Merge m-c to m-i.

This commit is contained in:
Kyle Huey 2011-07-09 20:26:01 -07:00
commit 0dc1e3045c
108 changed files with 1196 additions and 1234 deletions

View File

@ -1,193 +1,201 @@
<?xml version="1.0"?>
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist">
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1306529826000">
<emItems>
<emItem id="fdm_ffext@freedownloadmanager.org">
<versionRange minVersion="1.0" maxVersion="1.3.1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="3.0a1" maxVersion="*"/>
</targetApplication>
</versionRange>
</emItem>
<emItem id="firefox@bandoo.com">
<versionRange minVersion="5.0" maxVersion="5.0" severity="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="3.7a1pre" maxVersion="*"/>
</targetApplication>
</versionRange>
</emItem>
<emItem id="langpack-vi-VN@firefox.mozilla.org">
<versionRange minVersion="2.0" maxVersion="2.0"/>
</emItem>
<emItem id="masterfiler@gmail.com">
<versionRange severity="3"/>
</emItem>
<emItem id="mozilla_cc@internetdownloadmanager.com">
<versionRange minVersion=" " maxVersion="6.9.8">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="3.7a1pre" maxVersion="*"/>
</targetApplication>
</versionRange>
<versionRange minVersion="2.1" maxVersion="3.3">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="3.0a1" maxVersion="*"/>
</targetApplication>
</versionRange>
</emItem>
<emItem id="msntoolbar@msn.com">
<versionRange minVersion=" " maxVersion="6.*"/>
</emItem>
<emItem id="personas@christopher.beard">
<versionRange minVersion="1.6" maxVersion="1.6">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="3.6" maxVersion="3.6.*"/>
</targetApplication>
</versionRange>
</emItem>
<emItem id="ShopperReports@ShopperReports.com">
<versionRange minVersion="3.1.22.0" maxVersion="3.1.22.0"/>
</emItem>
<emItem id="support@daemon-tools.cc">
<versionRange minVersion=" " maxVersion="1.0.0.5"/>
</emItem>
<emItem id="support@update-firefox.com"/>
<emItem id="yslow@yahoo-inc.com">
<versionRange minVersion="2.0.5" maxVersion="2.0.5">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="3.5.7" maxVersion="*"/>
</targetApplication>
</versionRange>
</emItem>
<emItem id="{2224e955-00e9-4613-a844-ce69fccaae91}"/>
<emItem id="{27182e60-b5f3-411c-b545-b44205977502}">
<versionRange minVersion="1.0" maxVersion="1.0"/>
</emItem>
<emItem id="{3252b9ae-c69a-4eaf-9502-dc9c1f6c009e}">
<versionRange minVersion="2.2" maxVersion="2.2"/>
</emItem>
<emItem id="{3f963a5b-e555-4543-90e2-c3908898db71}">
<versionRange minVersion=" " maxVersion="8.5"/>
</emItem>
<emItem id="{46551EC9-40F0-4e47-8E18-8E5CF550CFB8}">
<versionRange minVersion="1.1b1" maxVersion="1.1b1"/>
</emItem>
<emItem id="{4B3803EA-5230-4DC3-A7FC-33638F3D3542}">
<versionRange minVersion="1.2" maxVersion="1.2">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="3.0a1" maxVersion="*"/>
</targetApplication>
</versionRange>
</emItem>
<emItem id="{6E19037A-12E3-4295-8915-ED48BC341614}">
<versionRange minVersion="0.1" maxVersion="1.3.328.4" severity="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="3.7a1pre" maxVersion="*"/>
</targetApplication>
</versionRange>
</emItem>
<emItem id="{8CE11043-9A15-4207-A565-0C94C42D590D}"/>
<emItem id="{AB2CE124-6272-4b12-94A9-7303C7397BD1}">
<versionRange minVersion="0.1" maxVersion="5.2.0.7164" severity="1"/>
</emItem>
<emItem id="{B13721C7-F507-4982-B2E5-502A71474FED}">
<versionRange severity="1"/>
</emItem>
<emItem id="{B7082FAA-CB62-4872-9106-E42DD88EDE45}">
<versionRange minVersion="0.1" maxVersion="3.3.0.*">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="3.7a1" maxVersion="*"/>
</targetApplication>
</versionRange>
<versionRange minVersion="3.3.1" maxVersion="*">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="5.0a1" maxVersion="*"/>
</targetApplication>
</versionRange>
</emItem>
<emItem id="{E8E88AB0-7182-11DF-904E-6045E0D72085}"/>
</emItems>
<pluginItems>
<pluginItem>
<match name="name" exp="^Yahoo Application State Plugin$"/>
<match name="description" exp="^Yahoo Application State Plugin$"/>
<match name="filename" exp="npYState.dll"/>
<versionRange>
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="3.0a1" maxVersion="3.*"/>
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem>
<match name="name" exp="QuickTime Plug-in 7[.]1[.]"/>
<match name="filename" exp="npqtplugin.?[.]dll"/>
<versionRange>
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="3.0a1" maxVersion="3.*"/>
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem>
<match name="filename" exp="NPFFAddOn.dll"/>
<versionRange>
</versionRange>
</pluginItem>
<pluginItem>
<match name="filename" exp="NPMySrch.dll"/>
<versionRange>
</versionRange>
</pluginItem>
<pluginItem>
<match name="filename" exp="npViewpoint.dll"/>
<versionRange>
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="3.0" maxVersion="*"/>
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem>
<match name="name" exp="[0-6]\.0\.[01]\d{2}\.\d+"/>
<match name="filename" exp="npdeploytk.dll"/>
<versionRange severity="1">
</versionRange>
</pluginItem>
<pluginItem>
<match name="filename" exp="[Nn][Pp][Jj][Pp][Ii]1[56]0_[0-9]+\.[Dd][Ll][Ll]"/>
<versionRange>
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="3.6a1pre" maxVersion="*"/>
</targetApplication>
</versionRange>
</pluginItem>
</pluginItems>
<gfxItems>
<gfxBlacklistEntry>
<os>WINNT 6.1</os>
<vendor>0x10de</vendor>
<devices>
<device>0x0a6c</device>
</devices>
<feature>DIRECT2D</feature>
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus>
<driverVersion>8.17.12.5896</driverVersion>
<driverVersionComparator>LESS_THAN_OR_EQUAL</driverVersionComparator>
</gfxBlacklistEntry>
<gfxBlacklistEntry>
<os>WINNT 6.1</os>
<vendor>0x10de</vendor>
<devices>
<device>0x0a6c</device>
</devices>
<feature>DIRECT3D_9_LAYERS</feature>
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus>
<driverVersion>8.17.12.5896</driverVersion>
<driverVersionComparator>LESS_THAN_OR_EQUAL</driverVersionComparator>
</gfxBlacklistEntry>
<gfxBlacklistEntry>
<os>WINNT 5.1</os>
<vendor>0x10de</vendor>
<feature>DIRECT3D_9_LAYERS</feature>
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus>
<driverVersion>7.0.0.0</driverVersion>
<driverVersionComparator>GREATER_THAN_OR_EQUAL</driverVersionComparator>
</gfxBlacklistEntry>
</gfxItems>
<emItem blockID="i8" id="{B13721C7-F507-4982-B2E5-502A71474FED}">
<versionRange minVersion=" " severity="1">
</versionRange>
</emItem>
<emItem blockID="i38" id="{B7082FAA-CB62-4872-9106-E42DD88EDE45}">
<versionRange minVersion="0.1" maxVersion="3.3.0.*">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="3.7a1" maxVersion="*" />
</targetApplication>
</versionRange>
<versionRange minVersion="3.3.1" maxVersion="*">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="5.0a1" maxVersion="*" />
</targetApplication>
</versionRange>
</emItem>
<emItem blockID="i19" id="{46551EC9-40F0-4e47-8E18-8E5CF550CFB8}">
<versionRange minVersion="1.1b1" maxVersion="1.1b1">
</versionRange>
</emItem>
<emItem blockID="i16" id="{27182e60-b5f3-411c-b545-b44205977502}">
<versionRange minVersion="1.0" maxVersion="1.0">
</versionRange>
</emItem>
<emItem blockID="i10" id="{8CE11043-9A15-4207-A565-0C94C42D590D}">
</emItem>
<emItem blockID="i1" id="mozilla_cc@internetdownloadmanager.com">
<versionRange minVersion="2.1" maxVersion="3.3">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="3.0a1" maxVersion="*" />
</targetApplication>
</versionRange>
<versionRange minVersion=" " maxVersion="6.9.8">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="3.7a1pre" maxVersion="*" />
</targetApplication>
</versionRange>
</emItem>
<emItem blockID="i18" id="msntoolbar@msn.com">
<versionRange minVersion=" " maxVersion="6.*">
</versionRange>
</emItem>
<emItem blockID="i13" id="{E8E88AB0-7182-11DF-904E-6045E0D72085}">
</emItem>
<emItem blockID="i4" id="{4B3803EA-5230-4DC3-A7FC-33638F3D3542}">
<versionRange minVersion="1.2" maxVersion="1.2">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="3.0a1" maxVersion="*" />
</targetApplication>
</versionRange>
</emItem>
<emItem blockID="i23" id="firefox@bandoo.com">
<versionRange minVersion="5.0" maxVersion="5.0" severity="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="3.7a1pre" maxVersion="*" />
</targetApplication>
</versionRange>
</emItem>
<emItem blockID="i22" id="ShopperReports@ShopperReports.com">
<versionRange minVersion="3.1.22.0" maxVersion="3.1.22.0">
</versionRange>
</emItem>
<emItem blockID="i2" id="fdm_ffext@freedownloadmanager.org">
<versionRange minVersion="1.0" maxVersion="1.3.1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="3.0a1" maxVersion="*" />
</targetApplication>
</versionRange>
</emItem>
<emItem blockID="i5" id="support@daemon-tools.cc">
<versionRange minVersion=" " maxVersion="1.0.0.5">
</versionRange>
</emItem>
<emItem blockID="i6" id="{3f963a5b-e555-4543-90e2-c3908898db71}">
<versionRange minVersion=" " maxVersion="8.5">
</versionRange>
</emItem>
<emItem blockID="i12" id="masterfiler@gmail.com">
<versionRange severity="3">
</versionRange>
</emItem>
<emItem blockID="i20" id="{AB2CE124-6272-4b12-94A9-7303C7397BD1}">
<versionRange minVersion="0.1" maxVersion="5.2.0.7164" severity="1">
</versionRange>
</emItem>
<emItem blockID="i11" id="yslow@yahoo-inc.com">
<versionRange minVersion="2.0.5" maxVersion="2.0.5">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="3.5.7" maxVersion="*" />
</targetApplication>
</versionRange>
</emItem>
<emItem blockID="i17" id="{3252b9ae-c69a-4eaf-9502-dc9c1f6c009e}">
<versionRange minVersion="2.2" maxVersion="2.2">
</versionRange>
</emItem>
<emItem blockID="i3" id="langpack-vi-VN@firefox.mozilla.org">
<versionRange minVersion="2.0" maxVersion="2.0">
</versionRange>
</emItem>
<emItem blockID="i7" id="{2224e955-00e9-4613-a844-ce69fccaae91}">
</emItem>
<emItem blockID="i24" id="{6E19037A-12E3-4295-8915-ED48BC341614}">
<versionRange minVersion="0.1" maxVersion="1.3.328.4" severity="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="3.7a1pre" maxVersion="*" />
</targetApplication>
</versionRange>
</emItem>
<emItem blockID="i15" id="personas@christopher.beard">
<versionRange minVersion="1.6" maxVersion="1.6">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="3.6" maxVersion="3.6.*" />
</targetApplication>
</versionRange>
</emItem>
<emItem blockID="i21" id="support@update-firefox.com">
</emItem>
</emItems>
<pluginItems>
<pluginItem blockID="p26">
<match name="name" exp="^Yahoo Application State Plugin$" /> <match name="description" exp="^Yahoo Application State Plugin$" /> <match name="filename" exp="npYState.dll" /> <versionRange >
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="3.0a1" maxVersion="3.*" />
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem blockID="p27">
<match name="name" exp="QuickTime Plug-in 7[.]1[.]" /> <match name="filename" exp="npqtplugin.?[.]dll" /> <versionRange >
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="3.0a1" maxVersion="3.*" />
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem blockID="p28">
<match name="filename" exp="NPFFAddOn.dll" /> <versionRange >
</versionRange>
</pluginItem>
<pluginItem blockID="p31">
<match name="filename" exp="NPMySrch.dll" /> <versionRange >
</versionRange>
</pluginItem>
<pluginItem blockID="p32">
<match name="filename" exp="npViewpoint.dll" /> <versionRange >
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="3.0" maxVersion="*" />
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem blockID="p33">
<match name="name" exp="[0-6]\.0\.[01]\d{2}\.\d+" /> <match name="filename" exp="npdeploytk.dll" /> <versionRange severity="1">
</versionRange>
</pluginItem>
<pluginItem blockID="p34">
<match name="filename" exp="[Nn][Pp][Jj][Pp][Ii]1[56]0_[0-9]+\.[Dd][Ll][Ll]" /> <versionRange >
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="3.6a1pre" maxVersion="*" />
</targetApplication>
</versionRange>
</pluginItem>
</pluginItems>
<gfxItems>
<gfxBlacklistEntry blockID="g35">
<os>WINNT 6.1</os>
<vendor>0x10de</vendor>
<devices>
<device>0x0a6c</device>
</devices>
<feature>DIRECT2D</feature>
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus>
<driverVersion>8.17.12.5896</driverVersion>
<driverVersionComparator>LESS_THAN_OR_EQUAL</driverVersionComparator>
</gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g36">
<os>WINNT 6.1</os>
<vendor>0x10de</vendor>
<devices>
<device>0x0a6c</device>
</devices>
<feature>DIRECT3D_9_LAYERS</feature>
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus>
<driverVersion>8.17.12.5896</driverVersion>
<driverVersionComparator>LESS_THAN_OR_EQUAL</driverVersionComparator>
</gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g37">
<os>WINNT 5.1</os>
<vendor>0x10de</vendor>
<feature>DIRECT3D_9_LAYERS</feature>
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus>
<driverVersion>7.0.0.0</driverVersion>
<driverVersionComparator>GREATER_THAN_OR_EQUAL</driverVersionComparator>
</gfxBlacklistEntry>
</gfxItems>
</blocklist>

View File

@ -900,6 +900,10 @@ 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

View File

@ -1459,9 +1459,13 @@ 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);
@ -1583,9 +1587,13 @@ 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 {
@ -1636,8 +1644,12 @@ 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
@ -4157,11 +4169,15 @@ 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 () {

View File

@ -777,12 +777,10 @@
<body>
<![CDATA[
var newTitle = "";
var docTitle;
var docElement = this.ownerDocument.documentElement;
var sep = docElement.getAttribute("titlemenuseparator");
if (aBrowser.docShell.contentViewer)
docTitle = aBrowser.contentTitle;
var docTitle = aBrowser.contentTitle;
if (!docTitle)
docTitle = docElement.getAttribute("titledefault");
@ -859,7 +857,7 @@
var oldBrowser = this.mCurrentBrowser;
if (oldBrowser) {
oldBrowser.setAttribute("type", "content-targetable");
oldBrowser.docShell.isActive = false;
oldBrowser.docShellIsActive = false;
}
var updatePageReport = false;
@ -869,7 +867,7 @@
updatePageReport = true;
newBrowser.setAttribute("type", "content-primary");
newBrowser.docShell.isActive = true;
newBrowser.docShellIsActive = true;
this.mCurrentBrowser = newBrowser;
this.mCurrentTab = this.selectedTab;
this.showTab(this.mCurrentTab);
@ -880,6 +878,10 @@
// 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;
@ -890,6 +892,7 @@
this._callProgressListeners(null, "onSecurityChange",
[webProgress, null, securityUI.state], true, false);
}
#endif
var listener = this.mTabListeners[this.tabContainer.selectedIndex] || null;
if (listener && listener.mStateFlags) {
@ -901,7 +904,11 @@
// 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,6 +1270,11 @@
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");
@ -1310,7 +1322,11 @@
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;
@ -1348,7 +1364,7 @@
// We start our browsers out as inactive, and then maintain
// activeness in the tab switcher.
b.docShell.isActive = false;
b.docShellIsActive = false;
// Check if we're opening a tab related to the current tab and
// move it to after the current tab.
@ -1567,7 +1583,11 @@
// 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();

View File

@ -265,8 +265,11 @@ TabItem.prototype = Utils.extend(new Item(), new Subscribable(), {
let tabData = null;
let self = this;
let imageDataCb = function(imageData) {
Utils.assertThrow(tabData, "tabData");
// we could have been unlinked while waiting for the thumbnail to load
if (!self.tab)
return;
Utils.assertThrow(tabData, "tabData");
tabData.imageData = imageData;
let currentUrl = self.tab.linkedBrowser.currentURI.spec;

View File

@ -24,12 +24,10 @@ let PlacesOrganizer;
function test() {
waitForExplicitFinish();
openLibrary(onLibraryReady);
gLibrary = openLibrary(onLibraryReady);
}
function onLibraryReady(library) {
gLibrary = library;
function onLibraryReady() {
ok(PlacesUtils, "PlacesUtils in scope");
ok(PlacesUIUtils, "PlacesUIUtils in scope");

View File

@ -6,13 +6,14 @@ const TEST_URL = "http://example.com/";
let gLibrary;
let gItemId;
let PlacesOrganizer;
function test() {
waitForExplicitFinish();
gLibrary = openLibrary(onLibraryReady);
}
function onLibraryReady(library) {
function onLibraryReady() {
PlacesOrganizer = gLibrary.PlacesOrganizer;
// Sanity checks.

View File

@ -96,10 +96,7 @@ function test() {
.removeFolderChildren(PlacesUtils.unfiledBookmarksFolderId);
});
openLibrary(function (library) {
gLibrary = library;
executeSoon(nextTest);
});
gLibrary = openLibrary(nextTest);
}
function nextTest() {
@ -111,6 +108,6 @@ function nextTest() {
else {
// Close Library window.
gLibrary.close();
executeSoon(finish);
finish();
}
}

View File

@ -180,8 +180,5 @@ function test() {
ok(PlacesUIUtils, "PlacesUIUtils is running in chrome context");
// Open Library.
openLibrary(function (library) {
gLibrary = library;
nextTest();
});
gLibrary = openLibrary(nextTest);
}

View File

@ -602,8 +602,8 @@ menuitem.bookmark-item {
}
#navigator-toolbox[iconsize=large][mode=icons] > #nav-bar {
padding-left: 2px;
padding-right: 2px;
-moz-padding-start: 0;
-moz-padding-end: 2px;
}
#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-button,
@ -665,17 +665,18 @@ menuitem.bookmark-item {
}
#nav-bar .toolbarbutton-1[disabled="true"] {
opacity: .8;
opacity: .4;
}
#nav-bar .toolbarbutton-1[disabled="true"] > .toolbarbutton-menubutton-button > .toolbarbutton-icon,
#nav-bar .toolbarbutton-1[disabled="true"] > .toolbarbutton-icon {
opacity: .5;
opacity: 1;
}
#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-button:not([disabled="true"]):not(:active):hover,
#nav-bar .toolbarbutton-1:not([open="true"]):not(:active):hover > .toolbarbutton-menubutton-dropmarker:not([disabled="true"]),
#nav-bar .toolbarbutton-1:not([type="menu-button"]):not([disabled="true"]):not([checked="true"]):not([open="true"]):not(:active):hover {
#nav-bar .toolbarbutton-1:not([type="menu-button"]):not([disabled="true"]):not([checked="true"]):not([open="true"]):not(:active):hover,
#navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button:not([disabled="true"]):not([open]):not(:active):hover > .toolbarbutton-icon {
background-color: hsla(190,60%,70%,.5);
border-color: hsla(190,50%,65%,.8) hsla(190,50%,50%,.8) hsla(190,50%,40%,.8);
box-shadow: 0 0 0 1px rgba(255,255,255,.3) inset,
@ -794,14 +795,26 @@ toolbar[mode="full"] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
}
#navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button {
border-radius: 10000px;
padding: 0;
width: 30px;
height: 30px;
margin: -5px 0;
padding-top: 0;
padding-bottom: 0;
-moz-padding-start: 5px;
-moz-padding-end: 0;
position: relative;
z-index: 1;
margin-top: -2px;
margin-bottom: -2px;
border-radius: 0 10000px 10000px 0;
background: transparent;
border: none;
box-shadow: none;
}
#navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button:-moz-locale-dir(rtl) {
border-radius: 10000px 0 0 10000px;
}
#navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button > .toolbarbutton-icon {
border-radius: 10000px;
padding: 5px;
border: none;
background-image: -moz-linear-gradient(rgba(251,252,253,.97), rgba(246,247,248,.5) 49%,
rgba(231,232,233,.45) 51%, rgba(225,226,229,.2));
@ -812,7 +825,7 @@ toolbar[mode="full"] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
0 1px 1px rgba(0,0,0,.3);
}
#navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button:not([disabled="true"]):not([open="true"]):not(:active):hover {
#navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button:not([disabled="true"]):not([open="true"]):not(:active):hover > .toolbarbutton-icon {
box-shadow: 0 0 0 1px rgba(255,255,255,.3) inset,
0 0 0 2px rgba(255,255,255,.1) inset,
0 0 0 1px hsla(190,50%,40%,.3),
@ -821,8 +834,8 @@ toolbar[mode="full"] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
0 0 5px 1px hsl(190,90%,80%);
}
#navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button:not([disabled="true"]):hover:active,
#navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button[open="true"] {
#navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button:not([disabled="true"]):hover:active > .toolbarbutton-icon,
#navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button[open="true"] > .toolbarbutton-icon {
box-shadow: 0 0 6.5px rgba(0,0,0,.4) inset,
0 0 2px rgba(0,0,0,.4) inset,
0 0 0 1px rgba(0,0,0,.65),

View File

@ -5681,6 +5681,23 @@ 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 ========================================================

View File

@ -141,7 +141,7 @@ interface nsIContentViewManager : nsISupports
readonly attribute nsIContentView rootContentView;
};
[scriptable, uuid(13c512d6-fba0-402a-9244-fe7941c43965)]
[scriptable, uuid(12905a29-4246-475a-81d4-fc389197df02)]
interface nsIFrameLoader : nsISupports
{
/**
@ -187,6 +187,12 @@ interface nsIFrameLoader : nsISupports
*/
void activateRemoteFrame();
/**
* Deactivate remote frame.
* Throws an exception with non-remote frames.
*/
void deactivateRemoteFrame();
/**
* @see nsIDOMWindowUtils sendMouseEvent.
*/
@ -234,6 +240,24 @@ 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>);

View File

@ -327,6 +327,7 @@ nsFrameLoader::nsFrameLoader(nsIContent *aOwner, PRBool aNetworkCreated)
, mCurrentRemoteFrame(nsnull)
, mRemoteBrowser(nsnull)
, mRenderMode(RENDER_MODE_DEFAULT)
, mEventMode(EVENT_MODE_NORMAL_DISPATCH)
{
}
@ -537,6 +538,7 @@ 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,
@ -547,7 +549,7 @@ nsFrameLoader::GetDocShell(nsIDocShell **aDocShell)
return rv;
if (mRemoteFrame) {
NS_WARNING("No docshells for remote frames!");
return NS_ERROR_NOT_AVAILABLE;
return rv;
}
NS_ASSERTION(mDocShell,
"MaybeCreateDocShell succeeded, but null mDocShell");
@ -556,7 +558,7 @@ nsFrameLoader::GetDocShell(nsIDocShell **aDocShell)
*aDocShell = mDocShell;
NS_IF_ADDREF(*aDocShell);
return NS_OK;
return rv;
}
void
@ -1340,36 +1342,19 @@ nsFrameLoader::SetOwnerContent(nsIContent* aContent)
bool
nsFrameLoader::ShouldUseRemoteProcess()
{
// Check for *disabled* multi-process first: environment, prefs, attribute
// Then check for *enabled* multi-process pref: attribute, prefs
// Check for *disabled* multi-process first: environment, pref
// Then check for *enabled* multi-process attribute
// Default is not-remote.
if (PR_GetEnv("MOZ_DISABLE_OOP_TABS")) {
if (PR_GetEnv("MOZ_DISABLE_OOP_TABS") ||
Preferences::GetBool("dom.ipc.tabs.disabled", PR_FALSE)) {
return false;
}
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;
return (bool) mOwnerContent->AttrValueIs(kNameSpaceID_None,
nsGkAtoms::Remote,
nsGkAtoms::_true,
eCaseMatters);
}
nsresult
@ -1676,6 +1661,20 @@ 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)
{
@ -1787,6 +1786,15 @@ 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,

View File

@ -342,6 +342,10 @@ 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

View File

@ -1657,6 +1657,93 @@ 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
@ -2905,6 +2992,8 @@ nsEventStateManager::PostHandleEvent(nsPresContext* aPresContext,
NS_ENSURE_ARG(aPresContext);
NS_ENSURE_ARG_POINTER(aStatus);
HandleCrossProcessEvent(aEvent, aTargetFrame, aStatus);
mCurrentTarget = aTargetFrame;
mCurrentTargetContent = nsnull;
@ -3420,6 +3509,10 @@ 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;

View File

@ -49,6 +49,7 @@
#include "nsCOMPtr.h"
#include "nsIDocument.h"
#include "nsCOMArray.h"
#include "nsIFrameLoader.h"
#include "nsIFrame.h"
#include "nsCycleCollectionParticipant.h"
#include "nsIMarkupDocumentViewer.h"
@ -427,6 +428,12 @@ 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);

View File

@ -4,7 +4,7 @@
<script>
function focusHandler()
{
setTimeout(document.documentElement.removeAttribute('class'), 0);
document.documentElement.removeAttribute('class');
}
</script>
<body>

View File

@ -4,7 +4,7 @@ load 226744-1.xhtml
load 232095-1.xul
load 277523-1.xhtml
load 277950-1.xhtml
load 336744-1.html
skip-if(browserIsRemote) load 336744-1.html # no remote support for xul popups, bug 617653
asserts(0-1) load 336960-1.html # maybe bug 429586
load 342954-1.xhtml
load 342954-2.xhtml

View File

@ -34,6 +34,8 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/dom/TabParent.h"
#include "nsFocusManager.h"
#include "nsIInterfaceRequestor.h"
@ -1531,14 +1533,14 @@ nsFocusManager::Blur(nsPIDOMWindow* aWindowToClear,
NotifyFocusStateChange(content, shouldShowFocusRing, PR_FALSE);
}
// 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.
// 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.
// 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 && aAdjustWidgets) {
if (mActiveWindow) {
nsIFrame* contentFrame = content->GetPrimaryFrame();
nsIObjectFrame* objectFrame = do_QueryFrame(contentFrame);
if (objectFrame) {
if (aAdjustWidgets && objectFrame) {
// note that the presshell's widget is being retrieved here, not the one
// for the object frame.
nsIViewManager* vm = presShell->GetViewManager();
@ -1549,6 +1551,15 @@ 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
}
}
}
@ -1746,12 +1757,21 @@ nsFocusManager::Focus(nsPIDOMWindow* aWindow,
NotifyFocusStateChange(aContent, aWindow->ShouldShowFocusRing(), PR_TRUE);
// if this is an object/plug-in, focus the plugin's widget. Note that we might
// if this is an object/plug-in/remote browser, focus its widget. Note that we might
// no longer be in the same document, due to the events we fired above when
// aIsNewDocument.
if (aAdjustWidgets && presShell->GetDocument() == aContent->GetDocument()) {
if (objectFrameWidget)
if (presShell->GetDocument() == aContent->GetDocument()) {
if (aAdjustWidgets && 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);
@ -2948,6 +2968,28 @@ 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)

View File

@ -49,6 +49,13 @@
class nsIDocShellTreeItem;
class nsPIDOMWindow;
namespace mozilla {
namespace dom {
class TabParent;
}
}
struct nsDelayedBlurOrFocusEvent;
/**
@ -424,6 +431,12 @@ 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.
*/

View File

@ -58,6 +58,9 @@ using nsQueryContentEvent;
using nsRect;
using nsSelectionEvent;
using nsTextEvent;
using nsMouseEvent;
using nsMouseScrollEvent;
using nsKeyEvent;
using RemoteDOMEvent;
namespace mozilla {
@ -180,6 +183,8 @@ parent:
*/
sync GetDPI() returns (float value);
SetCursor(PRUint32 value);
PContentPermissionRequest(nsCString aType, URI uri);
PContentDialog(PRUint32 aType, nsCString aName, nsCString aFeatures,
@ -241,6 +246,8 @@ child:
*/
Activate();
Deactivate();
/**
* @see nsIDOMWindowUtils sendMouseEvent.
*/
@ -252,6 +259,10 @@ child:
PRInt32 aModifiers,
bool aIgnoreRootScrollFrame);
RealMouseEvent(nsMouseEvent event);
RealKeyEvent(nsKeyEvent event);
MouseScrollEvent(nsMouseScrollEvent event);
/**
* @see nsIDOMWindowUtils sendKeyEvent.
*/

View File

@ -284,9 +284,8 @@ TabChild::GetVisibility(PRBool* aVisibility)
NS_IMETHODIMP
TabChild::SetVisibility(PRBool aVisibility)
{
NS_NOTREACHED("TabChild::SetVisibility not supported in TabChild");
return NS_ERROR_NOT_IMPLEMENTED;
// should the platform support this? Bug 666365
return NS_OK;
}
NS_IMETHODIMP
@ -556,6 +555,13 @@ 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,
@ -573,6 +579,31 @@ 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,

View File

@ -180,6 +180,7 @@ 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,
@ -187,6 +188,9 @@ 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,

View File

@ -67,6 +67,7 @@
#include "nsSerializationHelper.h"
#include "nsIPromptFactory.h"
#include "nsIContent.h"
#include "nsIWidget.h"
#include "mozilla/unused.h"
#include "nsDebug.h"
@ -219,6 +220,12 @@ TabParent::Activate()
unused << SendActivate();
}
void
TabParent::Deactivate()
{
unused << SendDeactivate();
}
NS_IMETHODIMP
TabParent::Init(nsIDOMWindow *window)
{
@ -293,6 +300,21 @@ 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,
@ -308,6 +330,16 @@ 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,

View File

@ -107,6 +107,7 @@ 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,
@ -127,12 +128,16 @@ 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,

View File

@ -61,8 +61,7 @@
function randomClick() {
// First focus the remote frame, then dispatch click. This way remote frame gets focus before
// mouse event.
document.getElementById('page').QueryInterface(Components.interfaces.nsIFrameLoaderOwner)
.frameLoader.activateRemoteFrame();
document.getElementById('page').focus();
var frameLoader = document.getElementById('page').QueryInterface(Components.interfaces.nsIFrameLoaderOwner).frameLoader;
var x = parseInt(Math.random() * 100);
var y = parseInt(Math.random() * 100);
@ -73,8 +72,7 @@
function keyPress() {
// First focus the remote frame, then dispatch click. This way remote frame gets focus before
// mouse event.
document.getElementById('page').QueryInterface(Components.interfaces.nsIFrameLoaderOwner)
.frameLoader.activateRemoteFrame();
document.getElementById('page').focus();
var frameLoader = document.getElementById('page').QueryInterface(Components.interfaces.nsIFrameLoaderOwner).frameLoader;
var keyCode = Components.interfaces.nsIDOMKeyEvent.DOM_VK_A;
@ -280,7 +278,6 @@
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"
onfocus="this.QueryInterface(Components.interfaces.nsIFrameLoaderOwner).frameLoader.activateRemoteFrame();"/>
<browser type="content" src="http://www.google.com/" flex="1" id="page" remote="true"/>
<label id="messageLog" value="" crop="center"/>
</window>

View File

@ -2300,8 +2300,9 @@ _setvalue(NPP npp, NPPVariable variable, void *result)
}
case NPPVpluginKeepLibraryInMemory: {
NPBool bCached = (result != nsnull);
return inst->SetCached(bCached);
// This variable is not supported any more but we'll pretend it is
// so that plugins don't fail on an error return.
return NS_OK;
}
case NPPVpluginUsesDOMForCursorBool: {

View File

@ -81,7 +81,6 @@ nsNPAPIPluginInstance::nsNPAPIPluginInstance(nsNPAPIPlugin* plugin)
mWindowless(PR_FALSE),
mWindowlessLocal(PR_FALSE),
mTransparent(PR_FALSE),
mCached(PR_FALSE),
mUsesDOMForCursor(PR_FALSE),
mInPluginInitCall(PR_FALSE),
mPlugin(plugin),
@ -129,12 +128,6 @@ nsNPAPIPluginInstance::Destroy()
mPlugin = nsnull;
}
TimeStamp
nsNPAPIPluginInstance::LastStopTime()
{
return mStopTime;
}
nsresult nsNPAPIPluginInstance::Initialize(nsIPluginInstanceOwner* aOwner, const char* aMIMEType)
{
PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("nsNPAPIPluginInstance::Initialize this=%p\n",this));
@ -193,7 +186,6 @@ nsresult nsNPAPIPluginInstance::Stop()
{
AsyncCallbackAutoLock lock;
mRunning = DESTROYING;
mStopTime = TimeStamp::Now();
}
OnPluginDestroy(&mNPP);
@ -810,20 +802,6 @@ nsNPAPIPluginInstance::DefineJavaProperties()
return NS_OK;
}
nsresult
nsNPAPIPluginInstance::SetCached(PRBool aCache)
{
mCached = aCache;
return NS_OK;
}
nsresult
nsNPAPIPluginInstance::ShouldCache(PRBool* shouldCache)
{
*shouldCache = mCached;
return NS_OK;
}
nsresult
nsNPAPIPluginInstance::IsWindowless(PRBool* isWindowless)
{

View File

@ -91,7 +91,6 @@ public:
nsresult IsRemoteDrawingCoreAnimation(PRBool* aDrawing);
nsresult GetJSObject(JSContext *cx, JSObject** outObject);
nsresult DefineJavaProperties();
nsresult ShouldCache(PRBool* shouldCache);
nsresult IsWindowless(PRBool* isWindowless);
nsresult AsyncSetWindow(NPWindow* window);
nsresult GetImage(ImageContainer* aContainer, Image** aImage);
@ -162,12 +161,6 @@ public:
return mRunning == RUNNING || mRunning == DESTROYING;
}
// return is only valid when the plugin is not running
mozilla::TimeStamp LastStopTime();
// cache this NPAPI plugin
nsresult SetCached(PRBool aCache);
already_AddRefed<nsPIDOMWindow> GetDOMWindow();
nsresult PrivateModeStateChanged();
@ -223,7 +216,6 @@ protected:
PRPackedBool mWindowless;
PRPackedBool mWindowlessLocal;
PRPackedBool mTransparent;
PRPackedBool mCached;
PRPackedBool mUsesDOMForCursor;
public:
@ -252,10 +244,6 @@ private:
// non-null during a HandleEvent call
void* mCurrentPluginEvent;
// Timestamp for the last time this plugin was stopped.
// This is only valid when the plugin is actually stopped!
mozilla::TimeStamp mStopTime;
nsCOMPtr<nsIURI> mURI;
PRPackedBool mUsePluginLayersPref;

View File

@ -226,10 +226,6 @@ PRLogModuleInfo* nsPluginLogging::gPluginLog = nsnull;
#define BRAND_PROPERTIES_URL "chrome://branding/locale/brand.properties"
#define PLUGIN_PROPERTIES_URL "chrome://global/locale/downloadProgress.properties"
// #defines for plugin cache and prefs
#define NS_PREF_MAX_NUM_CACHED_PLUGINS "browser.plugins.max_num_cached_plugins"
#define DEFAULT_NUMBER_OF_STOPPED_PLUGINS 10
#ifdef CALL_SAFETY_ON
// By default we run OOPP, so we don't want to cover up crashes.
PRBool gSkipPluginSafeCalls = PR_TRUE;
@ -484,7 +480,7 @@ nsresult nsPluginHost::ReloadPlugins(PRBool reloadPages)
// we are re-scanning plugins. New plugins may have been added, also some
// plugins may have been removed, so we should probably shut everything down
// but don't touch running (active and not stopped) plugins
// but don't touch running (active and not stopped) plugins
// check if plugins changed, no need to do anything else
// if no changes to plugins have been made
@ -959,8 +955,7 @@ nsresult nsPluginHost::InstantiatePluginForChannel(nsIChannel* aChannel,
#endif
// Note that we're not setting up a plugin instance here; the stream
// listener's OnStartRequest will handle doing that, looking for
// stopped plugins, etc, etc.
// listener's OnStartRequest will handle doing that.
return NewEmbeddedPluginStreamListener(uri, aOwner, nsnull, aListener);
}
@ -1055,20 +1050,6 @@ nsPluginHost::InstantiateEmbeddedPlugin(const char *aMimeType, nsIURI* aURL,
bCanHandleInternally = PR_TRUE;
}
if (FindStoppedPluginForURL(aURL, aOwner) == NS_OK) {
PLUGIN_LOG(PLUGIN_LOG_NOISY,
("nsPluginHost::InstantiateEmbeddedPlugin FoundStopped mime=%s\n", aMimeType));
if (!isJava && bCanHandleInternally) {
nsNPAPIPluginInstance* instance;
aOwner->GetInstance(&instance);
NewEmbeddedPluginStream(aURL, aOwner, instance);
NS_IF_RELEASE(instance);
}
return NS_OK;
}
// if we don't have a MIME type at this point, we still have one more chance by
// opening the stream and seeing if the server hands one back
if (!aMimeType)
@ -1136,20 +1117,6 @@ nsresult nsPluginHost::InstantiateFullPagePlugin(const char *aMimeType,
aMimeType, aOwner, urlSpec.get()));
#endif
if (FindStoppedPluginForURL(aURI, aOwner) == NS_OK) {
PLUGIN_LOG(PLUGIN_LOG_NOISY,
("nsPluginHost::InstantiateFullPagePlugin FoundStopped mime=%s\n",aMimeType));
nsPluginTag* pluginTag = FindPluginForType(aMimeType, PR_TRUE);
if (!pluginTag || !pluginTag->mIsJavaPlugin) {
nsRefPtr<nsNPAPIPluginInstance> instance;
aOwner->GetInstance(getter_AddRefs(instance));
NewFullPagePluginStream(aURI, instance.get(), aStreamListener);
}
return NS_OK;
}
nsresult rv = SetUpPluginInstance(aMimeType, aURI, aOwner);
if (NS_OK == rv) {
@ -1206,31 +1173,6 @@ nsPluginHost::TagForPlugin(nsNPAPIPlugin* aPlugin)
return nsnull;
}
nsresult nsPluginHost::FindStoppedPluginForURL(nsIURI* aURL,
nsIPluginInstanceOwner *aOwner)
{
nsCAutoString url;
if (!aURL)
return NS_ERROR_FAILURE;
aURL->GetAsciiSpec(url);
nsNPAPIPluginInstance *instance = FindStoppedInstance(url.get());
if (instance && !instance->IsRunning()) {
aOwner->SetInstance(instance);
instance->SetOwner(aOwner);
instance->Start();
aOwner->CreateWidget();
// If we've got a native window, the let the plugin know about it.
aOwner->SetWindow();
return NS_OK;
}
return NS_ERROR_FAILURE;
}
nsresult nsPluginHost::SetUpPluginInstance(const char *aMimeType,
nsIURI *aURL,
nsIPluginInstanceOwner *aOwner)
@ -3255,39 +3197,17 @@ nsPluginHost::StopPluginInstance(nsNPAPIPluginInstance* aInstance)
PLUGIN_LOG(PLUGIN_LOG_NORMAL,
("nsPluginHost::StopPluginInstance called instance=%p\n",aInstance));
nsNPAPIPluginInstance* instance = aInstance;
if (instance->HasStartedDestroying())
if (aInstance->HasStartedDestroying()) {
return NS_OK;
}
nsPluginTag* pluginTag = TagForPlugin(aInstance->GetPlugin());
aInstance->Stop();
aInstance->Destroy();
mInstances.RemoveElement(aInstance);
// if the plugin does not want to be 'cached' just remove it
PRBool doCache = PR_TRUE;
aInstance->ShouldCache(&doCache);
if (doCache) {
// try to get the max cached plugins from a pref or use default
PRUint32 cachedPluginLimit;
nsresult rv = NS_ERROR_FAILURE;
if (mPrefService)
rv = mPrefService->GetIntPref(NS_PREF_MAX_NUM_CACHED_PLUGINS, (int*)&cachedPluginLimit);
if (NS_FAILED(rv))
cachedPluginLimit = DEFAULT_NUMBER_OF_STOPPED_PLUGINS;
if (StoppedInstanceCount() >= cachedPluginLimit) {
nsNPAPIPluginInstance *oldestInstance = FindOldestStoppedInstance();
if (oldestInstance) {
nsPluginTag* pluginTag = TagForPlugin(oldestInstance->GetPlugin());
oldestInstance->Destroy();
mInstances.RemoveElement(oldestInstance);
OnPluginInstanceDestroyed(pluginTag);
}
}
} else {
nsPluginTag* pluginTag = TagForPlugin(instance->GetPlugin());
instance->Destroy();
mInstances.RemoveElement(instance);
OnPluginInstanceDestroyed(pluginTag);
}
OnPluginInstanceDestroyed(pluginTag);
return NS_OK;
}
@ -4013,57 +3933,6 @@ nsPluginHost::FindInstance(const char *mimetype)
return nsnull;
}
nsNPAPIPluginInstance*
nsPluginHost::FindStoppedInstance(const char *url)
{
for (PRUint32 i = 0; i < mInstances.Length(); i++) {
nsNPAPIPluginInstance *instance = mInstances[i];
nsIURI *uri = instance->GetURI();
if (!uri)
continue;
nsCAutoString spec;
uri->GetSpec(spec);
if (!PL_strcmp(url, spec.get()) && !instance->IsRunning())
return instance;
}
return nsnull;
}
nsNPAPIPluginInstance*
nsPluginHost::FindOldestStoppedInstance()
{
nsNPAPIPluginInstance *oldestInstance = nsnull;
TimeStamp oldestTime = TimeStamp::Now();
for (PRUint32 i = 0; i < mInstances.Length(); i++) {
nsNPAPIPluginInstance *instance = mInstances[i];
if (instance->IsRunning())
continue;
TimeStamp time = instance->LastStopTime();
if (time < oldestTime) {
oldestTime = time;
oldestInstance = instance;
}
}
return oldestInstance;
}
PRUint32
nsPluginHost::StoppedInstanceCount()
{
PRUint32 stoppedCount = 0;
for (PRUint32 i = 0; i < mInstances.Length(); i++) {
nsNPAPIPluginInstance *instance = mInstances[i];
if (!instance->IsRunning())
stoppedCount++;
}
return stoppedCount;
}
nsTArray< nsRefPtr<nsNPAPIPluginInstance> >*
nsPluginHost::InstanceArray()
{

View File

@ -205,9 +205,6 @@ public:
const nsAString& browserDumpID);
nsNPAPIPluginInstance *FindInstance(const char *mimetype);
nsNPAPIPluginInstance *FindStoppedInstance(const char * url);
nsNPAPIPluginInstance *FindOldestStoppedInstance();
PRUint32 StoppedInstanceCount();
nsTArray< nsRefPtr<nsNPAPIPluginInstance> > *InstanceArray();
@ -256,9 +253,6 @@ private:
nsPluginTag*
FindPluginEnabledForExtension(const char* aExtension, const char* &aMimeType);
nsresult
FindStoppedPluginForURL(nsIURI* aURL, nsIPluginInstanceOwner *aOwner);
nsresult
FindPlugins(PRBool aCreatePluginList, PRBool * aPluginsChanged);

View File

@ -767,6 +767,9 @@ protected:
// root prescontext's root frame.
nsIntPoint mCachedMousePoint;
// cached modifiers
PRInt8 mCachedModifiers;
// set to the currently active menu bar, if any
nsMenuBarFrame* mActiveMenuBar;

View File

@ -73,6 +73,11 @@
#include "nsIObserverService.h"
#include "mozilla/Services.h"
#define FLAG_ALT 0x01
#define FLAG_CONTROL 0x02
#define FLAG_SHIFT 0x04
#define FLAG_META 0x08
const nsNavigationDirection DirectionFromKeyCodeTable[2][6] = {
{
eNavigationDirection_Last, // NS_VK_END
@ -140,6 +145,7 @@ NS_IMPL_ISUPPORTS4(nsXULPopupManager,
nsXULPopupManager::nsXULPopupManager() :
mRangeOffset(0),
mCachedMousePoint(0, 0),
mCachedModifiers(0),
mActiveMenuBar(nsnull),
mPopups(nsnull),
mNoHidePanels(nsnull),
@ -462,6 +468,8 @@ nsXULPopupManager::InitTriggerEvent(nsIDOMEvent* aEvent, nsIContent* aPopup,
}
}
mCachedModifiers = 0;
nsCOMPtr<nsIDOMNSUIEvent> uiEvent = do_QueryInterface(aEvent);
if (uiEvent) {
uiEvent->GetRangeParent(getter_AddRefs(mRangeParent));
@ -475,6 +483,22 @@ nsXULPopupManager::InitTriggerEvent(nsIDOMEvent* aEvent, nsIContent* aPopup,
nsEvent* event;
event = privateEvent->GetInternalNSEvent();
if (event) {
if (event->eventStructType == NS_MOUSE_EVENT ||
event->eventStructType == NS_KEY_EVENT) {
nsInputEvent* inputEvent = static_cast<nsInputEvent*>(event);
if (inputEvent->isAlt) {
mCachedModifiers |= FLAG_ALT;
}
if (inputEvent->isControl) {
mCachedModifiers |= FLAG_CONTROL;
}
if (inputEvent->isShift) {
mCachedModifiers |= FLAG_SHIFT;
}
if (inputEvent->isMeta) {
mCachedModifiers |= FLAG_META;
}
}
nsIDocument* doc = aPopup->GetCurrentDoc();
if (doc) {
nsIPresShell* presShell = doc->GetShell();
@ -1187,10 +1211,19 @@ nsXULPopupManager::FirePopupShowingEvent(nsIContent* aPopup,
}
event.refPoint = mCachedMousePoint;
event.isAlt = !!(mCachedModifiers & FLAG_ALT);
event.isControl = !!(mCachedModifiers & FLAG_CONTROL);
event.isShift = !!(mCachedModifiers & FLAG_SHIFT);
event.isMeta = !!(mCachedModifiers & FLAG_META);
nsEventDispatcher::Dispatch(popup, presContext, &event, nsnull, &status);
mCachedMousePoint = nsIntPoint(0, 0);
mOpeningPopup = nsnull;
mCachedModifiers = 0;
// if a panel, blur whatever has focus so that the panel can take the focus.
// This is done after the popupshowing event in case that event is cancelled.
// Using noautofocus="true" will disable this behaviour, which is needed for

View File

@ -211,9 +211,9 @@
case "Content:LocationChange":
try {
let locationURI = this._browser._ios.newURI(json.location, null, null);
this._browser._webNavigation._currentURI = locationURI;
this._browser._webNavigation.canGoBack = json.canGoBack;
this._browser._webNavigation.canGoForward = json.canGoForward;
this._browser.webNavigation._currentURI = locationURI;
this._browser.webNavigation.canGoBack = json.canGoBack;
this._browser.webNavigation.canGoForward = json.canGoForward;
this._browser._charset = json.charset;
} catch(e) {}
@ -284,7 +284,7 @@
.getService(Components.interfaces.nsICertOverrideService);
// Check whether this site is a security exception.
let currentURI = this._browser._webNavigation._currentURI;
let currentURI = this._browser.webNavigation._currentURI;
result.isException = !!this._overrideService.hasMatchingOverride(currentURI.asciiHost, currentURI.port, cert, {}, {});
}
@ -649,74 +649,8 @@
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._webNavigation;"
onget="return this._remoteWebNavigation;"
readonly="true"/>
<property name="contentWindow"

View File

@ -1862,13 +1862,8 @@ 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);
@ -2850,6 +2845,7 @@ 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;
},
@ -2998,12 +2994,7 @@ Tab.prototype = {
Elements.browsers.selectedPanel = notification;
browser.active = true;
document.getElementById("tabs").selectedTab = this._chromeTab;
// Ensure that the content process has gets an activate event
try {
let fl = browser.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
fl.activateRemoteFrame();
} catch (e) {}
browser.focus();
} else {
browser.messageManager.sendAsyncMessage("Browser:Blur", { });
browser.setAttribute("type", "content");

View File

@ -51,6 +51,7 @@ _BROWSER_FILES = \
remote_autocomplete.js \
remote_contentpopup.js \
remote_head.js \
remote_focus.js \
remote_forms.js \
remote_formsZoom.js \
remote_vkb.js \
@ -64,6 +65,8 @@ _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 \

View File

@ -0,0 +1,7 @@
<html>
<head>
<title>Focus/Activate test</title>
</head>
<body>
</body>
</html>

View File

@ -0,0 +1,52 @@
"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();
}

View File

@ -0,0 +1,16 @@
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);
});

View File

@ -3220,14 +3220,22 @@ 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);

View File

@ -1197,15 +1197,14 @@ NetworkPanel.prototype =
* Ensures that the number of message nodes of type aCategory don't exceed that
* category's line limit by removing old messages as needed.
*
* @param nsIDOMNode aConsoleNode
* The DOM node (richlistbox aka outputNode) that holds the output of the
* console.
* @param aHUDId aHUDId
* The HeadsUpDisplay ID.
* @param integer aCategory
* The category of message nodes to limit.
* @return number
* The current user-selected log limit.
*/
function pruneConsoleOutputIfNecessary(aConsoleNode, aCategory)
function pruneConsoleOutputIfNecessary(aHUDId, aCategory)
{
// Get the log limit, either from the pref or from the constant.
let logLimit;
@ -1216,13 +1215,15 @@ function pruneConsoleOutputIfNecessary(aConsoleNode, aCategory)
logLimit = DEFAULT_LOG_LIMIT;
}
let scrollBox = aConsoleNode.scrollBoxObject.element;
let hudRef = HUDService.getHudReferenceById(aHUDId);
let outputNode = hudRef.outputNode;
let scrollBox = outputNode.scrollBoxObject.element;
let oldScrollHeight = scrollBox.scrollHeight;
let scrolledToBottom = ConsoleUtils.isOutputScrolledToBottom(aConsoleNode);
let hudRef = HUDService.getHudReferenceForOutputNode(aConsoleNode);
let scrolledToBottom = ConsoleUtils.isOutputScrolledToBottom(outputNode);
// Prune the nodes.
let messageNodes = aConsoleNode.querySelectorAll(".webconsole-msg-" +
let messageNodes = outputNode.querySelectorAll(".webconsole-msg-" +
CATEGORY_CLASS_FRAGMENTS[aCategory]);
let removeNodes = messageNodes.length - logLimit;
for (let i = 0; i < removeNodes; i++) {
@ -1475,41 +1476,12 @@ HUD_SERVICE.prototype =
browser.webProgress.removeProgressListener(hud.progressListener);
delete hud.progressListener;
this.unregisterDisplay(displayNode);
this.unregisterDisplay(hudId);
window.focus();
}
},
/**
* Clear the specified HeadsUpDisplay
*
* @param string|nsIDOMNode aHUD
* Either the ID of a HUD or the DOM node corresponding to an outer
* HUD box.
* @returns void
*/
clearDisplay: function HS_clearDisplay(aHUD)
{
if (typeof(aHUD) === "string") {
aHUD = this.getOutputNodeById(aHUD);
}
let hudRef = HUDService.getHudReferenceForOutputNode(aHUD);
if (hudRef) {
hudRef.cssNodes = {};
}
var outputNode = aHUD.querySelector(".hud-output-node");
while (outputNode.firstChild) {
outputNode.removeChild(outputNode.firstChild);
}
aHUD.lastTimestamp = 0;
},
/**
* get a unique ID from the sequence generator
*
@ -1623,8 +1595,7 @@ HUD_SERVICE.prototype =
adjustVisibilityForMessageType:
function HS_adjustVisibilityForMessageType(aHUDId, aPrefKey, aState)
{
let displayNode = this.getOutputNodeById(aHUDId);
let outputNode = displayNode.querySelector(".hud-output-node");
let outputNode = this.getHudReferenceById(aHUDId).outputNode;
let doc = outputNode.ownerDocument;
// Look for message nodes ("hud-msg-node") with the given preference key
@ -1683,9 +1654,7 @@ HUD_SERVICE.prototype =
adjustVisibilityOnSearchStringChange:
function HS_adjustVisibilityOnSearchStringChange(aHUDId, aSearchString)
{
let displayNode = this.getOutputNodeById(aHUDId);
let outputNode = displayNode.querySelector(".hud-output-node");
let doc = outputNode.ownerDocument;
let outputNode = this.getHudReferenceById(aHUDId).outputNode;
let nodes = outputNode.querySelectorAll(".hud-msg-node");
@ -1743,74 +1712,60 @@ HUD_SERVICE.prototype =
/**
* When a display is being destroyed, unregister it first
*
* @param string|nsIDOMNode aHUD
* Either the ID of a HUD or the DOM node corresponding to an outer
* HUD box.
* @param string aHUDId
* The ID of a HUD.
* @returns void
*/
unregisterDisplay: function HS_unregisterDisplay(aHUD)
unregisterDisplay: function HS_unregisterDisplay(aHUDId)
{
let hud = this.getHudReferenceById(aHUDId);
// Remove children from the output. If the output is not cleared, there can
// be leaks as some nodes has node.onclick = function; set and GC can't
// remove the nodes then.
HUDService.clearDisplay(aHUD);
hud.jsterm.clearOutput();
var id, outputNode, ownerDoc;
if (typeof(aHUD) === "string") {
id = aHUD;
outputNode = this.getHeadsUpDisplay(aHUD);
}
else {
id = aHUD.getAttribute("id");
outputNode = aHUD;
// Make sure that the console panel does not try to call
// deactivateHUDForContext() again.
hud.consoleWindowUnregisterOnHide = false;
// Remove the HUDBox and the consolePanel if the Web Console is inside a
// floating xul:panel.
hud.HUDBox.parentNode.removeChild(hud.HUDBox);
if (hud.consolePanel) {
hud.consolePanel.parentNode.removeChild(hud.consolePanel);
}
// remove HUD DOM node and
// remove display references from local registries get the outputNode
var parent = outputNode.parentNode;
var splitters = parent.querySelectorAll("splitter");
var len = splitters.length;
for (var i = 0; i < len; i++) {
if (splitters[i].getAttribute("class") == "hud-splitter") {
splitters[i].parentNode.removeChild(splitters[i]);
break;
}
if (hud.splitter.parentNode) {
hud.splitter.parentNode.removeChild(hud.splitter);
}
ownerDoc = outputNode.ownerDocument;
ownerDoc.getElementById(id).parentNode.removeChild(outputNode);
hud.jsterm.autocompletePopup.destroy();
this.hudReferences[id].jsterm.autocompletePopup.destroy();
delete this.hudReferences[aHUDId];
this.hudReferences[id].consoleWindowUnregisterOnHide = false;
// remove the HeadsUpDisplay object from memory
if ("cssNodes" in this.hudReferences[id]) {
delete this.hudReferences[id].cssNodes;
}
delete this.hudReferences[id];
// remove the related storage object
this.storage.removeDisplay(id);
this.storage.removeDisplay(aHUDId);
for (let windowID in this.windowIds) {
if (this.windowIds[windowID] == id) {
if (this.windowIds[windowID] == aHUDId) {
delete this.windowIds[windowID];
}
}
this.unregisterActiveContext(id);
this.unregisterActiveContext(aHUDId);
let popupset = outputNode.ownerDocument.getElementById("mainPopupSet");
let panels = popupset.querySelectorAll("panel[hudId=" + id + "]");
let popupset = hud.chromeDocument.getElementById("mainPopupSet");
let panels = popupset.querySelectorAll("panel[hudId=" + aHUDId + "]");
for (let i = 0; i < panels.length; i++) {
panels[i].hidePopup();
}
let id = ConsoleUtils.supString(id);
let id = ConsoleUtils.supString(aHUDId);
Services.obs.notifyObservers(id, "web-console-destroyed", null);
if (Object.keys(this.hudReferences).length == 0) {
let autocompletePopup = outputNode.ownerDocument.
let autocompletePopup = hud.chromeDocument.
getElementById("webConsole_autocompletePopup");
if (autocompletePopup) {
autocompletePopup.parentNode.removeChild(autocompletePopup);
@ -1883,6 +1838,18 @@ HUD_SERVICE.prototype =
}
},
/**
* Returns the HeadsUpDisplay object associated to a content window.
*
* @param nsIDOMWindow aContentWindow
* @returns object
*/
getHudByWindow: function HS_getHudByWindow(aContentWindow)
{
let hudId = this.getHudIdByWindow(aContentWindow);
return hudId ? this.hudReferences[hudId] : null;
},
/**
* Returns the hudId that is corresponding to the hud activated for the
* passed aContentWindow. If there is no matching hudId null is returned.
@ -1896,27 +1863,6 @@ HUD_SERVICE.prototype =
return this.getHudIdByWindowId(windowId);
},
/**
* Returns the hudReference for a given output node.
*
* @param nsIDOMNode aNode (currently either a xul:vbox as returned by
* getOutputNodeById() or a richlistbox).
* @returns a HUD | null
*/
getHudReferenceForOutputNode: function HS_getHudReferenceForOutputNode(aNode)
{
let node = aNode;
// starting from richlistbox, need to find hudbox
while (!node.id && !node.classList.contains("hud-box")) {
if (node.parentNode) {
node = node.parentNode;
} else {
return null;
}
}
return this.getHudReferenceById(node.id);
},
/**
* Returns the hudReference for a given id.
*
@ -1928,38 +1874,6 @@ HUD_SERVICE.prototype =
return aId in this.hudReferences ? this.hudReferences[aId] : null;
},
/**
* Gets the Web Console DOM node, the .hud-box.
*
* @param string id
* The Heads Up Display DOM Id
* @returns nsIDOMNode
*/
getHeadsUpDisplay: function HS_getHeadsUpDisplay(aId)
{
return aId in this.hudReferences ? this.hudReferences[aId].HUDBox : null;
},
/**
* Gets the Web Console DOM node, the .hud-box.
*
* @param string aId
* @returns nsIDOMNode
*/
getOutputNodeById: function HS_getOutputNodeById(aId)
{
return this.getHeadsUpDisplay(aId);
},
/**
* Gets an array that contains all the HUD IDs.
* @returns array
*/
displaysIndex: function HS_displaysIndex()
{
return Object.keys(this.hudReferences);
},
/**
* Returns the hudId that is corresponding to the given outer window ID.
*
@ -1979,9 +1893,7 @@ HUD_SERVICE.prototype =
* @returns string
*/
getFilterStringByHUDId: function HS_getFilterStringbyHUDId(aHUDId) {
var hud = this.getHeadsUpDisplay(aHUDId);
var filterStr = hud.querySelectorAll(".hud-filter-box")[0].value;
return filterStr;
return this.getHudReferenceById(aHUDId).filterBox.value;
},
/**
@ -2104,18 +2016,6 @@ HUD_SERVICE.prototype =
ConsoleUtils.outputMessageNode(node, aHUDId);
},
/**
* Get OutputNode by Id
*
* @param string aId
* @returns nsIDOMNode (richlistbox)
*/
getConsoleOutputNode: function HS_getConsoleOutputNode(aId)
{
let displayNode = this.getHeadsUpDisplay(aId);
return displayNode.querySelector(".hud-output-node");
},
/**
* Inform user that the Web Console API has been replaced by a script
* in a content page.
@ -2203,23 +2103,6 @@ HUD_SERVICE.prototype =
*/
applicationHooks: null,
getChromeWindowFromContentWindow:
function HS_getChromeWindowFromContentWindow(aContentWindow)
{
if (!aContentWindow) {
throw new Error("Cannot get contentWindow via nsILoadContext");
}
var win = aContentWindow.QueryInterface(Ci.nsIDOMWindow)
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow)
.QueryInterface(Ci.nsIDOMChromeWindow);
return win;
},
/**
* Requests that haven't finished yet.
*/
@ -2689,29 +2572,6 @@ HUD_SERVICE.prototype =
// see bug 559748
},
/**
* Passed a HUDId, the corresponding window is returned
*
* @param string aHUDId
* @returns nsIDOMWindow
*/
getContentWindowFromHUDId: function HS_getContentWindowFromHUDId(aHUDId)
{
var hud = this.getHeadsUpDisplay(aHUDId);
var nodes = hud.parentNode.childNodes;
for (var i = 0; i < nodes.length; i++) {
var node = nodes[i];
if (node.localName == "stack" &&
node.firstChild &&
node.firstChild.contentWindow) {
return node.firstChild.contentWindow;
}
}
throw new Error("HS_getContentWindowFromHUD: Cannot get contentWindow");
},
/**
* Creates a generator that always returns a unique number for use in the
* indexes
@ -2912,7 +2772,7 @@ HUD_SERVICE.prototype =
*/
animate: function HS_animate(aHUDId, aDirection, aCallback)
{
let hudBox = this.getOutputNodeById(aHUDId);
let hudBox = this.getHudReferenceById(aHUDId).HUDBox;
if (!hudBox.classList.contains("animated")) {
if (aCallback) {
aCallback();
@ -3147,7 +3007,7 @@ function HeadsUpDisplay(aConfig)
// create textNode Factory:
this.textFactory = NodeFactory("text", "xul", this.chromeDocument);
this.chromeWindow = HUDService.getChromeWindowFromContentWindow(this.contentWindow);
this.chromeWindow = this.chromeDocument.defaultView;
// create a panel dynamically and attach to the parentNode
this.createHUD();
@ -3318,7 +3178,9 @@ HeadsUpDisplay.prototype = {
}
panel.removeEventListener("popuphidden", onPopupHidden, false);
this.mainPopupSet.removeChild(panel);
if (panel.parentNode) {
panel.parentNode.removeChild(panel);
}
}).bind(this);
panel.addEventListener("popuphidden", onPopupHidden, false);
@ -3912,7 +3774,7 @@ HeadsUpDisplay.prototype = {
{
let hudId = this.hudId;
function HUD_clearButton_onCommand() {
HUDService.clearDisplay(hudId);
HUDService.getHudReferenceById(hudId).jsterm.clearOutput();
}
let clearButton = this.makeXULNode("toolbarbutton");
@ -4175,8 +4037,6 @@ function findCompletionBeginning(aStr)
function JSPropertyProvider(aScope, aInputValue)
{
let obj = unwrap(aScope);
// Store the scope object, since obj will be modified later on.
let win = obj;
// Analyse the aInputValue and find the beginning of the last part that
// should be completed.
@ -4215,7 +4075,7 @@ function JSPropertyProvider(aScope, aInputValue)
// Check if prop is a getter function on obj. Functions can change other
// stuff so we can't execute them to get the next object. Stop here.
if (isNonNativeGetter(win, obj, prop)) {
if (isNonNativeGetter(obj, prop)) {
return null;
}
try {
@ -4911,22 +4771,14 @@ JSTerm.prototype = {
clearOutput: function JST_clearOutput()
{
let outputNode = this.outputNode;
let hudRef = HUDService.getHudReferenceForOutputNode(outputNode);
let hud = HUDService.getHudReferenceById(this.hudId);
hud.cssNodes = {};
if (hudRef) {
hudRef.cssNodes = {};
while (hud.outputNode.firstChild) {
hud.outputNode.removeChild(hud.outputNode.firstChild);
}
while (outputNode.firstChild) {
outputNode.removeChild(outputNode.firstChild);
}
let hudBox = outputNode;
while (!hudBox.classList.contains("hud-box")) {
hudBox = hudBox.parentNode;
}
hudBox.lastTimestamp = 0;
hud.HUDBox.lastTimestamp = 0;
},
/**
@ -5850,7 +5702,7 @@ ConsoleUtils = {
HUDService.regroupOutput(outputNode);
if (pruneConsoleOutputIfNecessary(outputNode, aNode.category) == 0) {
if (pruneConsoleOutputIfNecessary(aHUDId, aNode.category) == 0) {
// We can't very well scroll to make the message node visible if the log
// limit is zero and the node was destroyed in the first place.
return;

View File

@ -163,9 +163,6 @@ function isNativeFunction(aFunction)
* Tells if the given property of the provided object is a non-native getter or
* not.
*
* @param object aScope
* Scope to use for the check.
*
* @param object aObject
* The object that contains the property.
*
@ -175,14 +172,14 @@ function isNativeFunction(aFunction)
* @return boolean
* True if the given property is a getter, false otherwise.
*/
function isNonNativeGetter(aScope, aObject, aProp) {
function isNonNativeGetter(aObject, aProp) {
if (typeof aObject != "object") {
return false;
}
let desc;
while (aObject) {
try {
if (desc = aScope.Object.getOwnPropertyDescriptor(aObject, aProp)) {
if (desc = Object.getOwnPropertyDescriptor(aObject, aProp)) {
break;
}
}
@ -223,11 +220,8 @@ function namesAndValuesOf(aObject)
continue;
}
// Also skip non-native getters. Pass the content window so that
// getOwnPropertyDescriptor can work later on.
let chromeWindow = Services.wm.getMostRecentWindow("navigator:browser");
let contentWindow = chromeWindow.gBrowser.selectedBrowser.contentWindow;
if (isNonNativeGetter(contentWindow.wrappedJSObject, aObject, propName)) {
// Also skip non-native getters.
if (isNonNativeGetter(aObject, propName)) {
value = ""; // Value is never displayed.
presentable = {type: TYPE_OTHER, display: "Getter"};
}

View File

@ -61,10 +61,7 @@ _BROWSER_TEST_FILES = \
browser_webconsole_console_logging_api.js \
browser_webconsole_consoleonpage.js \
browser_webconsole_chrome.js \
browser_webconsole_display_accessors.js \
browser_webconsole_execution_scope.js \
browser_webconsole_get_content_window_from_hud_id.js \
browser_webconsole_get_heads_up_display.js \
browser_webconsole_history.js \
browser_webconsole_hud_getters.js \
browser_webconsole_js_input_and_output_styling.js \
@ -130,7 +127,6 @@ _BROWSER_TEST_FILES = \
browser_webconsole_bug_618311_private_browsing.js \
browser_webconsole_bug_626484_output_copy_order.js \
browser_webconsole_bug_632347_iterators_generators.js \
browser_webconsole_bug_642108_refForOutputNode.js \
browser_webconsole_bug_642108_pruneTest.js \
browser_webconsole_bug_585956_console_trace.js \
browser_webconsole_bug_595223_file_uri.js \

View File

@ -63,11 +63,10 @@ function testWarningPresent() {
function testOpenWebConsole(shouldWarn) {
openConsole();
is(HUDService.displaysIndex().length, 1, "WebConsole was opened");
hudId = HUDService.displaysIndex()[0];
hud = HUDService.getHeadsUpDisplay(hudId);
hud = HUDService.getHudByWindow(content);
ok(hud, "WebConsole was opened");
let msg = (shouldWarn ? "found" : "didn't find") + " API replacement warning";
testLogEntry(hud, "disabled", msg, false, !shouldWarn);
testLogEntry(hud.outputNode, "disabled", msg, false, !shouldWarn);
}

View File

@ -51,7 +51,6 @@ function test() {
function onLoad(aEvent) {
browser.removeEventListener(aEvent.type, arguments.callee, true);
openConsole();
hudId = HUDService.displaysIndex()[0];
browser.addEventListener("load", testBasicNetLogging, true);
content.location = TEST_NETWORK_URI;
@ -60,7 +59,7 @@ function onLoad(aEvent) {
function testBasicNetLogging(aEvent) {
browser.removeEventListener(aEvent.type, arguments.callee, true);
outputNode = HUDService.hudReferences[hudId].outputNode;
outputNode = HUDService.getHudByWindow(content).outputNode;
executeSoon(function() {
findLogEntry("test-network.html");

View File

@ -59,7 +59,6 @@ function testPageReload() {
browser.removeEventListener("DOMContentLoaded", testPageReload, false);
let hudId = HUDService.displaysIndex()[0];
let console = browser.contentWindow.wrappedJSObject.console;
is(typeof console, "object", "window.console is an object, after page reload");

View File

@ -51,10 +51,8 @@ function testInputFocus() {
browser.removeEventListener("DOMContentLoaded", testInputFocus, false);
openConsole();
let hudId = HUDService.displaysIndex()[0];
let hudBox = HUDService.getHeadsUpDisplay(hudId);
let inputNode = hudBox.querySelector(".jsterm-input-node");
let inputNode = HUDService.getHudByWindow(content).jsterm.inputNode;
ok(inputNode.getAttribute("focused"), "input node is focused");
finishTest();

View File

@ -55,9 +55,7 @@ function testClosingAfterCompletion() {
openConsole();
hudId = HUDService.displaysIndex()[0];
hudBox = HUDService.getHeadsUpDisplay(hudId);
let inputNode = hudBox.querySelector(".jsterm-input-node");
let inputNode = HUDService.getHudByWindow(content).jsterm.inputNode;
let errorWhileClosing = false;
function errorListener(evt) {

View File

@ -92,9 +92,7 @@ var consoleObserver = {
Services.console.unregisterListener(this);
hudId = HUDService.displaysIndex()[0];
hud = HUDService.hudReferences[hudId];
outputNode = hud.outputNode;
let outputNode = HUDService.getHudByWindow(content).outputNode;
executeSoon(function() {
let msg = "Found the error message after page reload";

View File

@ -52,9 +52,7 @@ function testGroups() {
openConsole();
let hudId = HUDService.displaysIndex()[0];
let HUD = HUDService.hudReferences[hudId];
let HUD = HUDService.getHudByWindow(content);
let jsterm = HUD.jsterm;
let outputNode = jsterm.outputNode;

View File

@ -22,12 +22,12 @@ function testCloseButton() {
openConsole();
hudId = HUDService.displaysIndex()[0];
hudBox = HUDService.getHeadsUpDisplay(hudId);
let hud = HUDService.getHudByWindow(content);
let hudId = hud.hudId;
HUDService.disableAnimation(hudId);
executeSoon(function() {
let closeButton = hudBox.querySelector(".webconsole-close-button");
let closeButton = hud.HUDBox.querySelector(".webconsole-close-button");
ok(closeButton != null, "we have the close button");
// XXX: ASSERTION: ###!!! ASSERTION: XPConnect is being called on a scope without a 'Components' property!: 'Error', file /home/ddahl/code/moz/mozilla-central/mozilla-central/js/src/xpconnect/src/xpcwrappednativescope.cpp, line 795

View File

@ -53,8 +53,7 @@ function testDuplicateErrors() {
false);
openConsole();
let hudId = HUDService.displaysIndex()[0];
HUDService.clearDisplay(hudId);
HUDService.getHudByWindow(content).jsterm.clearOutput();
Services.console.registerListener(consoleObserver);
@ -74,9 +73,7 @@ var consoleObserver = {
Services.console.unregisterListener(this);
hudId = HUDService.displaysIndex()[0];
hud = HUDService.hudReferences[hudId];
outputNode = hud.outputNode;
outputNode = HUDService.getHudByWindow(content).outputNode;
executeSoon(function () {
var text = outputNode.textContent;

View File

@ -10,7 +10,7 @@
const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
let inputNode;
let HUD, inputNode;
function tabLoad(aEvent) {
browser.removeEventListener(aEvent.type, arguments.callee, true);
@ -18,11 +18,9 @@ function tabLoad(aEvent) {
waitForFocus(function() {
openConsole();
let hudId = HUDService.getHudIdByWindow(content);
HUD = HUDService.hudReferences[hudId];
HUD = HUDService.getHudByWindow(content);
let display = HUDService.getOutputNodeById(hudId);
inputNode = display.querySelector(".jsterm-input-node");
inputNode = HUD.jsterm.inputNode;
inputNode.focus();
executeSoon(function() {

View File

@ -5,6 +5,7 @@
*
* Contributor(s):
* Patrick Walton <pcwalton@mozilla.com>
* Mihai Șucan <mihai.sucan@gmail.com>
*
* ***** END LICENSE BLOCK ***** */
@ -24,9 +25,8 @@ function testLineLimit() {
openConsole();
hudId = HUDService.displaysIndex()[0];
let console = browser.contentWindow.wrappedJSObject.console;
hudBox = HUDService.getHeadsUpDisplay(hudId);
outputNode = HUDService.getHudByWindow(content).outputNode;
let prefBranch = Services.prefs.getBranch("devtools.hud.loglimit.");
prefBranch.setIntPref("console", 20);
@ -56,13 +56,11 @@ function testLineLimit() {
"the log limit is set to zero");
prefBranch.clearUserPref("console");
prefBranch = console = null;
prefBranch = console = outputNode = null;
finishTest();
}
function countMessageNodes() {
let hudId = HUDService.displaysIndex()[0];
let hudBox = HUDService.getHeadsUpDisplay(hudId);
return hudBox.querySelectorAll(".hud-msg-node").length;
return outputNode.querySelectorAll(".hud-msg-node").length;
}

View File

@ -21,8 +21,7 @@ function testSelectionWhenMovingBetweenBoxes() {
testSelectionWhenMovingBetweenBoxes, false);
openConsole();
let hudId = HUDService.displaysIndex()[0];
let jsterm = HUDService.hudReferences[hudId].jsterm;
let jsterm = HUDService.getHudByWindow(content).jsterm;
// Fill the console with some output.
jsterm.clearOutput();

View File

@ -21,14 +21,12 @@ function tabLoaded() {
// See bugs 574036, 586386 and 587617.
hudId = HUDService.displaysIndex()[0];
let HUD = HUDService.hudReferences[hudId].HUDBox;
let filterBox = HUD.querySelector(".hud-filter-box");
outputNode = HUD.querySelector(".hud-output-node");
let HUD = HUDService.getHudByWindow(content);
outputNode = HUD.outputNode;
let selection = getSelection();
let jstermInput = HUD.querySelector(".jsterm-input-node");
let console = browser.contentWindow.wrappedJSObject.console;
let contentSelection = browser.contentWindow.wrappedJSObject.getSelection();
let jstermInput = HUD.jsterm.inputNode;
let console = content.wrappedJSObject.console;
let contentSelection = content.wrappedJSObject.getSelection();
let make_selection = function () {
let controller =

View File

@ -55,9 +55,7 @@ function testTextNodeInsertion() {
false);
openConsole();
hudId = HUDService.displaysIndex()[0];
hudBox = HUDService.getHeadsUpDisplay(hudId);
let outputNode = hudBox.querySelector(".hud-output-node");
let outputNode = HUDService.getHudByWindow(content).outputNode;
let label = document.createElementNS(
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "label");

View File

@ -48,9 +48,7 @@ function testInputExpansion() {
openConsole();
hudId = HUDService.displaysIndex()[0];
hudBox = HUDService.getHeadsUpDisplay(hudId);
let input = hudBox.querySelector(".jsterm-input-node");
let input = HUDService.getHudByWindow(content).jsterm.inputNode;
input.focus();

View File

@ -16,16 +16,14 @@ function onContentLoaded()
{
browser.removeEventListener("load", arguments.callee, true);
hudId = HUDService.displaysIndex()[0];
HUD = HUDService.hudReferences[hudId].HUDBox;
let filterBox = HUD.querySelector(".hud-filter-box");
let outputNode = HUD.querySelector(".hud-output-node");
let HUD = HUDService.getHudByWindow(content);
let hudId = HUD.hudId;
let outputNode = HUD.outputNode;
let msg = "the unknown CSS property warning is displayed";
testLogEntry(outputNode, "foobarCssParser", msg, true);
HUDService.setFilterState(hudId, "cssparser", false);
let nodes = HUD.querySelectorAll(".hud-msg-node");
executeSoon(
function (){

View File

@ -22,8 +22,8 @@ function testExtraneousClosingBrackets(aEvent) {
browser.removeEventListener(aEvent.type, arguments.callee, true);
openConsole();
let hudId = HUDService.displaysIndex()[0];
let jsterm = HUDService.hudReferences[hudId].jsterm;
let jsterm = HUDService.getHudByWindow(content).jsterm;
jsterm.setInputValue("document.getElementById)");

View File

@ -90,19 +90,15 @@ function tab2Loaded(aEvent) {
function tab1Reloaded(aEvent) {
tab1.linkedBrowser.removeEventListener(aEvent.type, arguments.callee, true);
let hudId1 = HUDService.getHudIdByWindow(tab1.linkedBrowser.contentWindow);
let display1 = HUDService.getOutputNodeById(hudId1);
let outputNode1 = display1.querySelector(".hud-output-node");
let hud1 = HUDService.getHudByWindow(tab1.linkedBrowser.contentWindow);
let outputNode1 = hud1.outputNode;
let msg = "Found the iframe network request in tab1";
testLogEntry(outputNode1, TEST_IFRAME_URI, msg, true);
let hudId2 = HUDService.getHudIdByWindow(tab2.linkedBrowser.contentWindow);
let display2 = HUDService.getOutputNodeById(hudId2);
let outputNode2 = display2.querySelector(".hud-output-node");
let hud2 = HUDService.getHudByWindow(tab2.linkedBrowser.contentWindow);
let outputNode2 = hud2.outputNode;
isnot(display1, display2, "the two HUD displays must be different");
isnot(outputNode1, outputNode2,
"the two HUD outputNodes must be different");

View File

@ -18,11 +18,9 @@ function tabLoad1(aEvent) {
openConsole();
let hudId = HUDService.getHudIdByWindow(browser.contentWindow);
HUD = HUDService.hudReferences[hudId];
HUD = HUDService.getHudByWindow(content);
let display = HUDService.getOutputNodeById(hudId);
outputNode = display.querySelector(".hud-output-node");
outputNode = HUD.outputNode;
browser.addEventListener("load", tabLoad2, true);

View File

@ -19,8 +19,7 @@ function tabLoad(aEvent) {
let hudId = HUDService.getHudIdByWindow(content);
HUD = HUDService.hudReferences[hudId];
let display = HUDService.getOutputNodeById(hudId);
inputNode = display.querySelector(".jsterm-input-node");
inputNode = HUD.jsterm.inputNode;
inputNode.focus();

View File

@ -62,7 +62,7 @@ function performTest() {
HUD.console.log("message for tab " + i);
}
let displays = HUDService.displaysIndex();
let displays = Object.keys(HUDService.hudReferences);
is(displays.length, 4, "four displays found");
win2.close();
@ -72,7 +72,7 @@ function performTest() {
win1.gBrowser.removeTab(openTabs[1]);
executeSoon(function() {
displays = HUDService.displaysIndex();
displays = Object.keys(HUDService.hudReferences);
is(displays.length, 0, "no displays found");
ok(!HUDService.storage, "no storage found");
ok(!HUDService.httpObserver, "no httpObserver found");

View File

@ -34,8 +34,7 @@ function contentLoaded(aEvent) {
}
function buttonClicked() {
let hudId = HUDService.getHudIdByWindow(content);
let outputNode = HUDService.getOutputNodeById(hudId);
let outputNode = HUDService.getHudByWindow(content).outputNode;
let msg = "the error from the external script was logged";
testLogEntry(outputNode, "bogus", msg);

View File

@ -14,8 +14,9 @@ function testFilterButtons() {
browser.removeEventListener("load", testFilterButtons, true);
openConsole();
hudId = HUDService.displaysIndex()[0];
hudBox = HUDService.hudReferences[hudId].HUDBox;
let hud = HUDService.getHudByWindow(content);
hudId = hud.hudId;
hudBox = hud.HUDBox;
testMenuFilterButton("net");
testMenuFilterButton("css");

View File

@ -9,11 +9,9 @@ function onContentLoaded()
{
browser.removeEventListener("load", arguments.callee, true);
hudId = HUDService.displaysIndex()[0];
HUD = HUDService.hudReferences[hudId].HUDBox;
jsterm = HUDService.hudReferences[hudId].jsterm;
let filterBox = HUD.querySelector(".hud-filter-box");
let outputNode = HUD.querySelector(".hud-output-node");
let HUD = HUDService.getHudByWindow(content);
let jsterm = HUD.jsterm;
let outputNode = HUD.outputNode;
let msg = "The unknown CSS property warning is displayed only once";
let node = outputNode.firstChild;

View File

@ -22,10 +22,9 @@ function test()
browser.removeEventListener("load", arguments.callee, true);
openConsole();
is(HUDService.displaysIndex().length, 1, "Web Console was opened");
hudId = HUDService.displaysIndex()[0];
hud = HUDService.getHeadsUpDisplay(hudId);
hud = HUDService.getHudByWindow(content);
ok(hud, "Web Console is now open");
HUDService.lastFinishedRequestCallback = function(aRequest) {
lastRequest = aRequest;
@ -151,11 +150,9 @@ function testLiveFilteringOnSearchStrings() {
}
function countMessageNodes() {
let outputNode = hud.querySelector(".hud-output-node");
let messageNodes = outputNode.querySelectorAll(".hud-msg-node");
let messageNodes = hud.outputNode.querySelectorAll(".hud-msg-node");
let displayedMessageNodes = 0;
let view = outputNode.ownerDocument.defaultView;
let view = hud.chromeWindow;
for (let i = 0; i < messageNodes.length; i++) {
let computedStyle = view.getComputedStyle(messageNodes[i], null);
if (computedStyle.display !== "none")
@ -167,6 +164,6 @@ function countMessageNodes() {
function setStringFilter(aValue)
{
hud.querySelector(".hud-filter-box").value = aValue;
HUDService.adjustVisibilityOnSearchStringChange(hudId, aValue);
hud.filterBox.value = aValue;
HUDService.adjustVisibilityOnSearchStringChange(hud.hudId, aValue);
}

View File

@ -50,8 +50,7 @@ function testCSSPruning() {
browser.removeEventListener("DOMContentLoaded",testCSSPruning, false);
openConsole();
let hudId = HUDService.getHudIdByWindow(content);
let hudRef = HUDService.getHudReferenceById(hudId);
let hudRef = HUDService.getHudByWindow(content);
populateConsoleRepeats(hudRef);
ok(hudRef.cssNodes["css log x"], "repeated nodes in cssNodes");
@ -68,7 +67,6 @@ function testCSSPruning() {
}
function countMessageNodes() {
let hudId = HUDService.getHudIdByWindow(content);
let hudBox = HUDService.getHeadsUpDisplay(hudId);
return hudBox.querySelectorAll(".hud-msg-node").length;
let outputNode = HUDService.getHudByWindow(content).outputNode;
return outputNode.querySelectorAll(".hud-msg-node").length;
}

View File

@ -1,36 +0,0 @@
/* vim:set ts=2 sw=2 sts=2 et: */
/* ***** BEGIN LICENSE BLOCK *****
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*
* ***** END LICENSE BLOCK ***** */
// Tests that the getHudReferenceForOutputNode returns a reference when passed
// a hudBox (xul:vbox) or an output box (richlistbox).
const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
function test() {
addTab(TEST_URI);
browser.addEventListener("DOMContentLoaded", testHudRef,
false);
}
function testHudRef() {
browser.removeEventListener("DOMContentLoaded",testHudRef, false);
openConsole();
let hudId = HUDService.displaysIndex()[0];
let hudBox = HUDService.getHeadsUpDisplay(hudId);
let hudRef = HUDService.getHudReferenceForOutputNode(hudBox);
ok(hudRef, "We have a hudRef");
let outBox = HUDService.getOutputNodeById(hudId);
let hudRef2 = HUDService.getHudReferenceForOutputNode(outBox);
ok(hudRef2, "We have the second hudRef");
is(hudRef, hudRef2, "The two hudRefs are identical");
finishTest();
}

View File

@ -55,11 +55,11 @@ function testWebDevLimits(aEvent) {
}
function testJsLimits(aEvent) {
HUDService.clearDisplay(gHudId);
gOldPref = Services.prefs.getIntPref("devtools.hud.loglimit.exception");
Services.prefs.setIntPref("devtools.hud.loglimit.exception", 10);
let hud = HUDService.hudReferences[gHudId];
hud.jsterm.clearOutput();
outputNode = hud.outputNode;
hud.console.log("testing JS limits");
@ -87,11 +87,11 @@ function testJsLimits(aEvent) {
var gCounter, gImage;
function testNetLimits(aEvent) {
HUDService.clearDisplay(gHudId);
gOldPref = Services.prefs.getIntPref("devtools.hud.loglimit.network");
Services.prefs.setIntPref("devtools.hud.loglimit.network", 10);
let hud = HUDService.hudReferences[gHudId];
hud.jsterm.clearOutput();
outputNode = hud.outputNode;
hud.console.log("testing Net limits");
@ -124,11 +124,11 @@ function loadImage() {
}
function testCssLimits(aEvent) {
HUDService.clearDisplay(gHudId);
gOldPref = Services.prefs.getIntPref("devtools.hud.loglimit.cssparser");
Services.prefs.setIntPref("devtools.hud.loglimit.cssparser", 10);
let hud = HUDService.hudReferences[gHudId];
hud.jsterm.clearOutput();
outputNode = hud.outputNode;
hud.console.log("testing CSS limits");

View File

@ -22,6 +22,7 @@
* Rob Campbell <rcampbell@mozilla.com>
* Patrick Walton <pwalton@mozilla.com>
* David Dahl <ddahl@mozilla.com>
* Mihai Șucan <mihai.sucan@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
@ -51,19 +52,16 @@ function testChrome() {
openConsole();
hudId = HUDService.displaysIndex()[0];
hud = HUDService.hudReferences[hudId];
let hud = HUDService.getHudByWindow(content);
ok(hud, "we have a console");
hudBox = HUDService.getHeadsUpDisplay(hudId);
ok(hudBox, "we have the console display");
ok(hud.HUDBox, "we have the console display");
let jsterm = hud.jsterm;
ok(jsterm, "we have a jsterm");
let input = jsterm.inputNode;
let outputNode = hudBox.querySelector(".jsterm-input-node");
ok(outputNode, "we have an output node");
ok(hud.outputNode, "we have an output node");
// Test typing 'docu'.
input.value = "docu";
@ -71,7 +69,6 @@ function testChrome() {
jsterm.complete(jsterm.COMPLETE_HINT_ONLY);
is(jsterm.completeNode.value, " ment", "'docu' completion");
HUD = jsterm = input = null;
finishTest();
}

View File

@ -52,10 +52,7 @@ function testCompletion() {
openConsole();
hudId = HUDService.displaysIndex()[0];
var HUD = HUDService.hudReferences[hudId];
var jsterm = HUD.jsterm;
var jsterm = HUDService.getHudByWindow(content).jsterm;
var input = jsterm.inputNode;
// Test typing 'docu'.
@ -105,7 +102,7 @@ function testCompletion() {
jsterm.complete(jsterm.COMPLETE_HINT_ONLY);
is(jsterm.completeNode.value, " \n e", "multi-line completion");
HUD = jsterm = input = null;
jsterm = input = null;
finishTest();
}

View File

@ -56,10 +56,7 @@ function onLoad() {
function testButtonClicked()
{
let hudId = HUDService.displaysIndex()[0];
let console = browser.contentWindow.wrappedJSObject.console;
let hudBox = HUDService.getHeadsUpDisplay(hudId);
let outputNode = hudBox.querySelector(".hud-output-node");
let outputNode = HUDService.getHudByWindow(content).outputNode;
let nodes = outputNode.querySelectorAll(".hud-msg-node");
is(nodes.length, 2, "two nodes");
ok(/start/.test(nodes[0].textContent), "start found");

View File

@ -52,6 +52,10 @@ function onLoad() {
openConsole();
hud = HUDService.getHudByWindow(content);
hudId = hud.hudId;
outputNode = hud.outputNode;
testConsoleLoggingAPI("log");
testConsoleLoggingAPI("info");
testConsoleLoggingAPI("warn");
@ -62,12 +66,9 @@ function onLoad() {
}
function testConsoleLoggingAPI(aMethod) {
let hudId = HUDService.displaysIndex()[0];
let console = browser.contentWindow.wrappedJSObject.console;
let hudBox = HUDService.getHeadsUpDisplay(hudId);
let outputNode = hudBox.querySelector(".hud-output-node");
let console = content.wrappedJSObject.console;
HUDService.clearDisplay(hudId);
hud.jsterm.clearOutput();
setStringFilter(hudId, "foo");
console[aMethod]("foo-bar-baz");
@ -77,7 +78,7 @@ function testConsoleLoggingAPI(aMethod) {
is(nodes.length, 1, "1 hidden " + aMethod + " node found (via classList)");
HUDService.clearDisplay(hudId);
hud.jsterm.clearOutput();
// now toggle the current method off - make sure no visible message
@ -89,14 +90,14 @@ function testConsoleLoggingAPI(aMethod) {
is(nodes.length, 1, aMethod + " logging turned off, 1 message hidden");
HUDService.clearDisplay(hudId);
hud.jsterm.clearOutput();
HUDService.setFilterState(hudId, aMethod, true);
console[aMethod]("foo-bar-baz");
nodes = outputNode.querySelectorAll("description");
is(nodes.length, 1, aMethod + " logging turned on, 1 message shown");
HUDService.clearDisplay(hudId);
hud.jsterm.clearOutput();
setStringFilter(hudId, "");
// test for multiple arguments.
@ -108,8 +109,7 @@ function testConsoleLoggingAPI(aMethod) {
}
function setStringFilter(aId, aValue) {
let hudBox = HUDService.getHeadsUpDisplay(aId);
hudBox.querySelector(".hud-filter-box").value = aValue;
hud.filterBox.value = aValue;
HUDService.adjustVisibilityOnSearchStringChange(aId, aValue);
}

View File

@ -23,10 +23,9 @@ function test()
function testOpenWebConsole()
{
openConsole();
is(HUDService.displaysIndex().length, 1, "WebConsole was opened");
hudId = HUDService.displaysIndex()[0];
hud = HUDService.hudReferences[hudId];
hud = HUDService.getHudByWindow(content);
ok(hud, "WebConsole was opened");
testOwnConsole();
}

View File

@ -10,7 +10,7 @@
// Tests that copying multiple messages inserts newlines in between.
const TEST_URI = "http://example.com/";
const TEST_URI = "data:text/html,Web Console test for bug 586142";
function test()
{
@ -26,22 +26,17 @@ function onLoad() {
function testNewlines() {
openConsole();
hudId = HUDService.displaysIndex()[0];
ok(hudId != null, "we have the HUD ID");
hud = HUDService.getHudByWindow(content);
hud.jsterm.clearOutput();
HUDService.clearDisplay(hudId);
let contentWindow = browser.contentWindow;
let console = contentWindow.wrappedJSObject.console;
let console = content.wrappedJSObject.console;
ok(console != null, "we have the console object");
for (let i = 0; i < 20; i++) {
console.log("Hello world!");
}
let hudNode = HUDService.getOutputNodeById(hudId);
let outputNode = hudNode.querySelector(".hud-output-node");
ok(outputNode != null, "we have the output node");
let outputNode = hud.outputNode;
outputNode.selectAll();
outputNode.focus();

View File

@ -1,67 +0,0 @@
/* vim:set ts=2 sw=2 sts=2 et: */
/* ***** 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 DevTools test code.
*
* The Initial Developer of the Original Code is Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* David Dahl <ddahl@mozilla.com>
* Patrick Walton <pcwalton@mozilla.com>
* Julian Viereck <jviereck@mozilla.com>
* Mihai Sucan <mihai.sucan@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 ***** */
// Tests that HUDService.displays() and HUDService.displaysIndex() work.
const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
function test() {
addTab(TEST_URI);
browser.addEventListener("DOMContentLoaded", testDisplayAccessors, false);
}
function testDisplayAccessors() {
browser.removeEventListener("DOMContentLoaded", testDisplayAccessors,
false);
openConsole();
var idx = HUDService.displaysIndex();
let hudId = idx[0];
ok(typeof idx == "object", "displays is an object");
ok(typeof idx.push == "function", "displaysIndex is an array");
var len = idx.length;
ok(idx.length > 0, "idx.length > 0: " + len);
finishTest();
}

View File

@ -53,10 +53,7 @@ function testExecutionScope() {
openConsole();
let hudId = HUDService.displaysIndex()[0];
let HUD = HUDService.hudReferences[hudId];
let jsterm = HUD.jsterm;
let jsterm = HUDService.getHudByWindow(content).jsterm;
jsterm.clearOutput();
jsterm.execute("location;");

View File

@ -1,64 +0,0 @@
/* vim:set ts=2 sw=2 sts=2 et: */
/* ***** 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 DevTools test code.
*
* The Initial Developer of the Original Code is Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* David Dahl <ddahl@mozilla.com>
* Patrick Walton <pcwalton@mozilla.com>
* Julian Viereck <jviereck@mozilla.com>
* Mihai Sucan <mihai.sucan@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 ***** */
// Tests the HUDService.getContentWindowFromHUDId() method.
const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
function test() {
addTab(TEST_URI);
browser.addEventListener("DOMContentLoaded",
testGetContentWindowFromHUDId, false);
}
function testGetContentWindowFromHUDId() {
browser.removeEventListener("DOMContentLoaded",
testGetContentWindowFromHUDId, false);
openConsole();
let hudId = HUDService.displaysIndex()[0];
let window = HUDService.getContentWindowFromHUDId(hudId);
ok(window.document, "we have a contentWindow");
finishTest();
}

View File

@ -1,60 +0,0 @@
/* vim:set ts=2 sw=2 sts=2 et: */
/* ***** 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 DevTools test code.
*
* The Initial Developer of the Original Code is Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* David Dahl <ddahl@mozilla.com>
* Patrick Walton <pcwalton@mozilla.com>
* Julian Viereck <jviereck@mozilla.com>
* Mihai Sucan <mihai.sucan@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 ***** */
// Tests the HUDService.getHeadsUpDisplay() method.
const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
function test() {
addTab(TEST_URI);
browser.addEventListener("DOMContentLoaded", testGetHeadsUpDisplay,
false);
}
function testGetHeadsUpDisplay() {
browser.removeEventListener("DOMContentLoaded", testGetHeadsUpDisplay,
false);
openConsole();
hudId = HUDService.displaysIndex()[0];
hud = HUDService.getHeadsUpDisplay(hudId);
ok(hud.getAttribute("id") == hudId, "found HUD node by Id.");
finishTest();
}

View File

@ -56,9 +56,7 @@ function testHistory() {
openConsole();
hudId = HUDService.displaysIndex()[0];
let HUD = HUDService.hudReferences[hudId];
let jsterm = HUD.jsterm;
let jsterm = HUDService.getHudByWindow(content).jsterm;
let input = jsterm.inputNode;
let executeList = ["document", "window", "window.location"];

View File

@ -53,9 +53,7 @@ function testHUDGetters() {
openConsole();
hudId = HUDService.displaysIndex()[0];
var HUD = HUDService.hudReferences[hudId];
var HUD = HUDService.getHudByWindow(content);
var jsterm = HUD.jsterm;
var klass = jsterm.inputNode.getAttribute("class");
ok(klass == "jsterm-input-node", "We have the input node.");

View File

@ -55,9 +55,7 @@ function testJSInputAndOutputStyling() {
openConsole();
hudId = HUDService.displaysIndex()[0];
let jsterm = HUDService.hudReferences[hudId].jsterm;
let jsterm = HUDService.getHudByWindow(content).jsterm;
jsterm.clearOutput();
jsterm.execute("2 + 2");

View File

@ -53,10 +53,7 @@ function testJSInputExpansion() {
openConsole();
hudId = HUDService.displaysIndex()[0];
let HUD = HUDService.hudReferences[hudId];
let jsterm = HUD.jsterm;
let jsterm = HUDService.getHudByWindow(content).jsterm;
let input = jsterm.inputNode;
input.focus();

View File

@ -61,11 +61,7 @@ function testJSTerm()
openConsole();
hudId = HUDService.displaysIndex()[0];
let hudBox = HUDService.getHeadsUpDisplay(hudId);
hud = HUDService.hudReferences[hudId];
jsterm = hud.jsterm;
let outputNode = hudBox.querySelector(".hud-output-node");
jsterm = HUDService.getHudByWindow(content).jsterm;
jsterm.clearOutput();
jsterm.execute("'id=' + $('header').getAttribute('id')");
@ -158,5 +154,6 @@ function testJSTerm()
jsterm.execute("null");
checkResult("null", "null is null", 1);
jsterm = null;
finishTest();
}

View File

@ -54,20 +54,18 @@ function testLiveFilteringOfMessageTypes() {
openConsole();
hudId = HUDService.displaysIndex()[0];
hud = HUDService.getHudByWindow(content);
let console = browser.contentWindow.wrappedJSObject.console;
let hudBox = HUDService.getHeadsUpDisplay(hudId);
let outputNode = hudBox.querySelector(".hud-output-node");
for (let i = 0; i < 50; i++) {
console.log("http://www.example.com/");
}
HUDService.setFilterState(hudId, "log", false);
HUDService.setFilterState(hud.hudId, "log", false);
is(countMessageNodes(), 0, "the log nodes are hidden when the " +
"corresponding filter is switched off");
HUDService.setFilterState(hudId, "log", true);
HUDService.setFilterState(hud.hudId, "log", true);
isnot(countMessageNodes(), 0, "the log nodes reappear when the " +
"corresponding filter is switched on");
@ -75,13 +73,9 @@ function testLiveFilteringOfMessageTypes() {
}
function countMessageNodes() {
let hudId = HUDService.displaysIndex()[0];
let hudBox = HUDService.getHeadsUpDisplay(hudId);
let outputNode = hudBox.querySelector(".hud-output-node");
let messageNodes = outputNode.querySelectorAll(".hud-log");
let messageNodes = hud.outputNode.querySelectorAll(".hud-log");
let displayedMessageNodes = 0;
let view = outputNode.ownerDocument.defaultView;
let view = hud.chromeWindow;
for (let i = 0; i < messageNodes.length; i++) {
let computedStyle = view.getComputedStyle(messageNodes[i], null);
if (computedStyle.display !== "none") {

View File

@ -54,10 +54,8 @@ function testLiveFilteringOnSearchStrings() {
openConsole();
hudId = HUDService.displaysIndex()[0];
hud = HUDService.getHudByWindow(content);
let console = browser.contentWindow.wrappedJSObject.console;
let hudBox = HUDService.getHeadsUpDisplay(hudId);
let outputNode = hudBox.querySelector(".hud-output-node");
for (let i = 0; i < 50; i++) {
console.log("http://www.example.com/");
@ -107,13 +105,11 @@ function testLiveFilteringOnSearchStrings() {
}
function countMessageNodes() {
let hudId = HUDService.displaysIndex()[0];
let hudBox = HUDService.getHeadsUpDisplay(hudId);
let outputNode = hudBox.querySelector(".hud-output-node");
let outputNode = hud.outputNode;
let messageNodes = outputNode.querySelectorAll(".hud-log");
let displayedMessageNodes = 0;
let view = outputNode.ownerDocument.defaultView;
let view = hud.chromeWindow;
for (let i = 0; i < messageNodes.length; i++) {
let computedStyle = view.getComputedStyle(messageNodes[i], null);
if (computedStyle.display !== "none") {
@ -126,10 +122,7 @@ function countMessageNodes() {
function setStringFilter(aValue)
{
let hudId = HUDService.displaysIndex()[0];
let hudBox = HUDService.getHeadsUpDisplay(hudId);
hudBox.querySelector(".hud-filter-box").value = aValue;
HUDService.adjustVisibilityOnSearchStringChange(hudId, aValue);
hud.filterBox.value = aValue;
HUDService.adjustVisibilityOnSearchStringChange(hud.hudId, aValue);
}

View File

@ -54,10 +54,8 @@ function testLogNodeClasses() {
openConsole();
hudId = HUDService.displaysIndex()[0];
let console = browser.contentWindow.wrappedJSObject.console;
hudBox = HUDService.getHeadsUpDisplay(hudId);
outputNode = hudBox.querySelector(".hud-output-node");
let outputNode = HUDService.getHudByWindow(content).outputNode;
ok(console, "console exists");
console.log("I am a log message");

View File

@ -46,10 +46,8 @@ function onLoad() {
browser.removeEventListener("DOMContentLoaded", onLoad, false);
openConsole();
let hudId = HUDService.displaysIndex()[0];
let console = browser.contentWindow.wrappedJSObject.console;
let hudBox = HUDService.getHeadsUpDisplay(hudId);
let outputNode = hudBox.querySelector(".hud-output-node");
let console = content.wrappedJSObject.console;
let outputNode = HUDService.getHudByWindow(content).outputNode;
console.log("a log message");

View File

@ -30,10 +30,9 @@ function test()
browser.removeEventListener("load", arguments.callee, true);
openConsole();
is(HUDService.displaysIndex().length, 1, "Web Console was opened");
hudId = HUDService.displaysIndex()[0];
hud = HUDService.getHeadsUpDisplay(hudId);
hud = HUDService.getHudByWindow(content);
ok(hud, "Web Console is now open");
HUDService.lastFinishedRequestCallback = function(aRequest) {
lastRequest = aRequest;
@ -153,8 +152,7 @@ function testNetworkPanel()
{
// Open the NetworkPanel. The functionality of the NetworkPanel is tested
// within separate test files.
let filterBox = hud.querySelector(".hud-filter-box");
let networkPanel = HUDService.openNetworkPanel(filterBox, lastRequest);
let networkPanel = HUDService.openNetworkPanel(hud.filterBox, lastRequest);
is(networkPanel, lastRequest.panels[0].get(),
"Network panel stored on lastRequest object");

View File

@ -98,9 +98,7 @@ function checkNodeKeyValue(aPanel, aId, aKey, aValue) {
}
function testGen() {
let hudId = HUDService.displaysIndex()[0];
let hudBox = HUDService.getHeadsUpDisplay(hudId);
let filterBox = hudBox.querySelector(".hud-filter-box");
let filterBox = HUDService.getHudByWindow(content).filterBox;
var httpActivity = {
url: "http://www.testpage.com",

View File

@ -55,11 +55,8 @@ function testNullAndUndefinedOutput() {
openConsole();
hudId = HUDService.displaysIndex()[0];
let HUD = HUDService.hudReferences[hudId];
let jsterm = HUD.jsterm;
outputNode = jsterm.outputNode;
let jsterm = HUDService.getHudByWindow(content).jsterm;
let outputNode = jsterm.outputNode;
jsterm.clearOutput();
jsterm.execute("null;");

View File

@ -53,11 +53,8 @@ function testOutputOrder() {
openConsole();
hudId = HUDService.displaysIndex()[0];
let HUD = HUDService.hudReferences[hudId];
let jsterm = HUD.jsterm;
outputNode = jsterm.outputNode;
let jsterm = HUDService.getHudByWindow(content).jsterm;
let outputNode = jsterm.outputNode;
jsterm.clearOutput();
jsterm.execute("console.log('foo', 'bar');");

View File

@ -53,10 +53,7 @@ function testPropertyPanel() {
openConsole();
hudId = HUDService.displaysIndex()[0];
var HUD = HUDService.hudReferences[hudId];
var jsterm = HUD.jsterm;
var jsterm = HUDService.getHudByWindow(content).jsterm;
let propPanel = jsterm.openPropertyPanel("Test", [
1,

View File

@ -54,9 +54,7 @@ function testPropertyProvider() {
openConsole();
hudId = HUDService.displaysIndex()[0];
var HUD = HUDService.hudReferences[hudId];
var HUD = HUDService.getHudByWindow(content);
var jsterm = HUD.jsterm;
var context = jsterm.sandbox.window;
var completion;

View File

@ -53,14 +53,12 @@ function testRegistries() {
openConsole();
var displaysIdx = HUDService.displaysIndex();
ok(displaysIdx.length == 1, "one display id found");
var display = displaysIdx[0];
ok(HUDService.hudReferences[display], "we have a HUD");
let hud = HUDService.getHudByWindow(content);
ok(hud, "we have a HUD");
ok(HUDService.hudReferences[hud.hudId], "we have a HUD in hudReferences");
let windowID = HUDService.getWindowId(content);
is(HUDService.windowIds[windowID], display, "windowIds is working");
is(HUDService.windowIds[windowID], hud.hudId, "windowIds are working");
finishTest();
}

View File

@ -49,8 +49,7 @@ let observer = {
};
function findLocationNode() {
hudId = HUDService.displaysIndex()[0];
outputNode = HUDService.hudReferences[hudId].outputNode;
outputNode = HUDService.getHudByWindow(content).outputNode;
let locationNode = outputNode.querySelector(".webconsole-location");
ok(locationNode, "we have the location node");

View File

@ -3,6 +3,22 @@ var gTrigger = null;
var gIsMenu = false;
var gScreenX = -1, gScreenY = -1;
var gCachedEvent = null;
var gCachedEvent2 = null;
function cacheEvent(modifiers)
{
var cachedEvent = null;
var mouseFn = function(event) {
cachedEvent = event;
}
window.addEventListener("mousedown", mouseFn, false);
synthesizeMouse(document.documentElement, 0, 0, modifiers);
window.removeEventListener("mousedown", mouseFn, false);
return cachedEvent;
}
function runTests()
{
@ -15,17 +31,13 @@ function runTests()
gIsMenu = gTrigger.boxObject instanceof Components.interfaces.nsIMenuBoxObject;
var mouseFn = function(event) {
gScreenX = event.screenX;
gScreenY = event.screenY;
// cache the event so that we can use it in calls to openPopup
gCachedEvent = event;
}
// a hacky way to get the screen position of the document. Cache the event
// so that we can use it in calls to openPopup.
gCachedEvent = cacheEvent({ shiftKey: true });
gScreenX = gCachedEvent.screenX;
gScreenY = gCachedEvent.screenY;
gCachedEvent2 = cacheEvent({ altKey: true, ctrlKey: true, shiftKey: true, metaKey: true });
// a hacky way to get the screen position of the document
window.addEventListener("mousedown", mouseFn, false);
synthesizeMouse(document.documentElement, 0, 0, { });
window.removeEventListener("mousedown", mouseFn, false);
startPopupTests(popupTests);
}
@ -254,7 +266,7 @@ var popupTests = [
// can be used to override the popup's position. This test also passes an
// event to openPopup to check the trigger node.
testname: "open popup anchored with override",
events: [ "popupshowing thepopup", "popupshown thepopup" ],
events: [ "popupshowing thepopup 0010", "popupshown thepopup" ],
test: function(testname, step) {
// attribute overrides the position passed in
gMenuPopup.setAttribute("position", "end_after");
@ -403,7 +415,7 @@ var popupTests = [
},
{
testname: "open context popup at screen",
events: [ "popupshowing thepopup", "popupshown thepopup" ],
events: [ "popupshowing thepopup 0010", "popupshown thepopup" ],
test: function(testname, step) {
gExpectedTriggerNode = gCachedEvent.target;
gMenuPopup.openPopupAtScreen(gScreenX + 8, gScreenY + 16, true, gCachedEvent);
@ -558,6 +570,14 @@ var popupTests = [
checkActive(gMenuPopup, "", testname);
}
},
{
testname: "open context popup at screen with all modifiers set",
events: [ "popupshowing thepopup 1111", "popupshown thepopup" ],
autohide: "thepopup",
test: function(testname, step) {
gMenuPopup.openPopupAtScreen(gScreenX + 8, gScreenY + 16, true, gCachedEvent2);
}
},
{
testname: "open popup with open property",
events: [ "popupshowing thepopup", "popupshown thepopup" ],

View File

@ -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" style="width: 1024px; height: 614px"/> -->
<iframe id="googlenews" src="http://news.google.com/" type="content" style="width: 1024px; height: 614px"/>
<!-- <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"/>
</html:div>
</html:div>
</box>

Some files were not shown because too many files have changed in this diff Show More