Merge mozilla-central into services-central.

This commit is contained in:
Richard Newman 2011-04-06 17:32:40 -07:00
Родитель 05ce41ec03 b54ec5dbd6
Коммит 29299290e6
782 изменённых файлов: 50479 добавлений и 4328 удалений

Просмотреть файл

@ -57,3 +57,7 @@ dba2abb7db57078c5a4810884834d3056a5d56c2 last-mozilla-central
138f593553b66c9f815e8f57870c19d6347f7702 UPDATE_PACKAGING_R11_1_MU
e56ecd8b3a68c158025207c5fd081d043e28f5ce GECKO_2_0_BASE
e273946b74c8d631ed86bd74ba9afe0e67b12378 GECKO_2_1_BASE
b70744835d94e54eec97b8fd186c96da5708a506 PRE_MOBILE_MERGE
b70744835d94e54eec97b8fd186c96da5708a506 PRE_MOBILE_MERGE_20110406
a71bd564ebf5bf4f93d13e84114f759c263130b0 MOBILE_MERGE_DONE
a71bd564ebf5bf4f93d13e84114f759c263130b0 MOBILE_MERGE_DONE_20110406

Просмотреть файл

@ -948,10 +948,8 @@ pref("dom.ipc.plugins.enabled.i386.flash player.plugin", true);
pref("dom.ipc.plugins.enabled.i386.javaplugin2_npapi.plugin", true);
// x86_64 ipc preferences
pref("dom.ipc.plugins.enabled.x86_64", true);
#elifdef MOZ_IPC
pref("dom.ipc.plugins.enabled", true);
#else
pref("dom.ipc.plugins.enabled", false);
pref("dom.ipc.plugins.enabled", true);
#endif
#ifdef XP_WIN

Просмотреть файл

@ -249,9 +249,6 @@ function GroupItem(listOfEls, options) {
// ___ Superclass initialization
this._init($container[0]);
if (this.$debug)
this.$debug.css({zIndex: -1000});
// ___ Children
Array.prototype.forEach.call(listOfEls, function(el) {
self.add(el, options);
@ -600,7 +597,6 @@ GroupItem.prototype = Utils.extend(new Item(), new Subscribable(), {
UI.clearShouldResizeItems();
this._updateDebugBounds();
this.setTrenches(rect);
this.save();
@ -614,9 +610,6 @@ GroupItem.prototype = Utils.extend(new Item(), new Subscribable(), {
iQ(this.container).css({zIndex: value});
if (this.$debug)
this.$debug.css({zIndex: value + 1});
var count = this._children.length;
if (count) {
var topZIndex = value + count + 1;
@ -715,17 +708,10 @@ GroupItem.prototype = Utils.extend(new Item(), new Subscribable(), {
let closestTabItem = UI.getClosestTab(closeCenter);
UI.setActiveTab(closestTabItem);
// set the active group or orphan tabitem.
if (closestTabItem) {
if (closestTabItem.parent) {
GroupItems.setActiveGroupItem(closestTabItem.parent);
} else {
GroupItems.setActiveOrphanTab(closestTabItem);
}
} else {
if (closestTabItem && closestTabItem.parent)
GroupItems.setActiveGroupItem(closestTabItem.parent);
else
GroupItems.setActiveGroupItem(null);
GroupItems.setActiveOrphanTab(null);
}
},
// ----------
@ -916,8 +902,8 @@ GroupItem.prototype = Utils.extend(new Item(), new Subscribable(), {
// add click handlers
this.$undoContainer.click(function(e) {
// Only do this for clicks on this actual element.
if (e.target.nodeName != self.$undoContainer[0].nodeName)
// don't do anything if the close button is clicked.
if (e.target == undoClose[0])
return;
self.$undoContainer.fadeOut(function() { self._unhide(); });
@ -2263,7 +2249,7 @@ let GroupItems = {
return;
}
let orphanTabItem = this.getActiveOrphanTab();
let orphanTabItem = UI.getActiveOrphanTab();
if (!orphanTabItem) {
let targetGroupItem;
// find first visible non-app tab in the tabbar.
@ -2354,34 +2340,12 @@ let GroupItems = {
if (groupItem !== null) {
if (groupItem)
iQ(groupItem.container).addClass('activeGroupItem');
// if a groupItem is active, we surely are not in an orphaned tab.
this.setActiveOrphanTab(null);
}
this._activeGroupItem = groupItem;
this._save();
},
// ----------
// Function: getActiveOrphanTab
// Returns the active orphan tab, in cases when there is no active groupItem.
getActiveOrphanTab: function GroupItems_getActiveOrphanTab() {
return this._activeOrphanTab;
},
// ----------
// Function: setActiveOrphanTab
// In cases where an orphan tab (not in a groupItem) is active by itself,
// this function is called and the "active orphan tab" is set.
//
// Paramaters:
// groupItem - the active <TabItem> or <null>
setActiveOrphanTab: function GroupItems_setActiveOrphanTab(tabItem) {
if (tabItem !== null)
this.setActiveGroupItem(null);
this._activeOrphanTab = tabItem;
},
// ----------
// Function: _updateTabBar
// Hides and shows tabs in the tab bar based on the active groupItem or
@ -2389,14 +2353,18 @@ let GroupItems = {
_updateTabBar: function GroupItems__updateTabBar() {
if (!window.UI)
return; // called too soon
if (!this._activeGroupItem && !this._activeOrphanTab) {
Utils.assert(false, "There must be something to show in the tab bar!");
return;
let activeOrphanTab;
if (!this._activeGroupItem) {
activeOrphanTab = UI.getActiveOrphanTab();
if (!activeOrphanTab) {
Utils.assert(false, "There must be something to show in the tab bar!");
return;
}
}
let tabItems = this._activeGroupItem == null ?
[this._activeOrphanTab] : this._activeGroupItem._children;
[activeOrphanTab] : this._activeGroupItem._children;
gBrowser.showOnlyTheseTabs(tabItems.map(function(item) item.tab));
},
@ -2407,12 +2375,9 @@ let GroupItems = {
Utils.assertThrow(tabItem && tabItem.isATabItem, "tabItem must be a TabItem");
let groupItem = tabItem.parent;
if (groupItem) {
this.setActiveGroupItem(groupItem);
this.setActiveGroupItem(groupItem);
if (groupItem)
groupItem.setActiveTab(tabItem);
} else
this.setActiveOrphanTab(tabItem);
this._updateTabBar();
},
@ -2436,7 +2401,7 @@ let GroupItems = {
getNextGroupItemTab: function GroupItems_getNextGroupItemTab(reverse) {
var groupItems = Utils.copy(GroupItems.groupItems);
var activeGroupItem = GroupItems.getActiveGroupItem();
var activeOrphanTab = GroupItems.getActiveOrphanTab();
var activeOrphanTab = UI.getActiveOrphanTab();
var tabItem = null;
if (reverse)

Просмотреть файл

@ -72,15 +72,6 @@ function Item() {
// The z-index for this item.
this.zIndex = 0;
// Variable: debug
// When set to true, displays a rectangle on the screen that corresponds with bounds.
// May be used for additional debugging features in the future.
this.debug = false;
// Variable: $debug
// If <debug> is true, this will be the iQ object for the visible rectangle.
this.$debug = null;
// Variable: container
// The outermost DOM element that describes this item on screen.
this.container = null;
@ -154,16 +145,6 @@ Item.prototype = {
this.container = container;
this.$container = iQ(container);
if (this.debug) {
this.$debug = iQ('<div>')
.css({
border: '2px solid green',
zIndex: -10,
position: 'absolute'
})
.appendTo('body');
}
iQ(this.container).data('item', this);
// ___ drag
@ -510,16 +491,6 @@ Item.prototype = {
});
},
// ----------
// Function: _updateDebugBounds
// Called by a subclass when its bounds change, to update the debugging rectangles on screen.
// This functionality is enabled only by the debug property.
_updateDebugBounds: function Item__updateDebugBounds() {
if (this.$debug) {
this.$debug.css(this.bounds);
}
},
// ----------
// Function: setTrenches
// Sets up/moves the trenches for snapping to this item.

Просмотреть файл

@ -202,7 +202,6 @@ function TabItem(tab, options) {
this.setResizable(true, options.immediately);
this.droppable(true);
this._updateDebugBounds();
TabItems.register(this);
@ -524,7 +523,6 @@ TabItem.prototype = Utils.extend(new Item(), new Subscribable(), {
UI.clearShouldResizeItems();
this._updateDebugBounds();
rect = this.getBounds(); // ensure that it's a <Rect>
if (!Utils.isRect(this.bounds))
@ -645,11 +643,7 @@ TabItem.prototype = Utils.extend(new Item(), new Subscribable(), {
let $canvas = this.$canvas;
UI.setActiveTab(this);
if (this.parent) {
GroupItems.setActiveGroupItem(this.parent);
} else {
GroupItems.setActiveOrphanTab(this);
}
GroupItems.setActiveGroupItem(this.parent);
TabItems._update(this.tab, {force: true});
@ -715,8 +709,6 @@ TabItem.prototype = Utils.extend(new Item(), new Subscribable(), {
$tab.removeClass("front");
$canvas.css("-moz-transform", null);
GroupItems.setActiveOrphanTab(null);
if (typeof complete == "function")
complete();
};
@ -1095,8 +1087,8 @@ let TabItems = {
Utils.assertThrow(tab._tabViewTabItem, "should already be linked");
// note that it's ok to unlink an app tab; see .handleTabUnpin
if (tab._tabViewTabItem == GroupItems.getActiveOrphanTab())
GroupItems.setActiveOrphanTab(null);
if (tab._tabViewTabItem == UI.getActiveOrphanTab())
UI.setActiveTab(null);
this.unregister(tab._tabViewTabItem);
tab._tabViewTabItem._sendToSubscribers("close");

Просмотреть файл

@ -206,7 +206,7 @@ let UI = {
TabItems.tabWidth, TabItems.tabHeight);
newTab._tabViewTabItem.setBounds(box, true);
newTab._tabViewTabItem.pushAway(true);
GroupItems.setActiveOrphanTab(newTab._tabViewTabItem);
UI.setActiveTab(newTab._tabViewTabItem);
TabItems.creatingNewOrphanTab = false;
newTab._tabViewTabItem.zoomIn(true);
@ -356,9 +356,9 @@ let UI = {
GroupItems.setActiveGroupItem(groupItem);
},
// ----------
// Function: blurAll
// Blurs any currently focused element
//
blurAll: function UI_blurAll() {
iQ(":focus").each(function(element) {
element.blur();
@ -380,7 +380,6 @@ let UI = {
// ----------
// Function: getActiveTab
// Returns the currently active tab as a <TabItem>
//
getActiveTab: function UI_getActiveTab() {
return this._activeTab;
},
@ -415,6 +414,13 @@ let UI = {
}
},
// ----------
// Function: getActiveOrphanTab
// Returns the currently active orphan tab as a <TabItem>
getActiveOrphanTab: function UI_getActiveOrphanTab() {
return (this._activeTab && !this._activeTab.parent) ? this._activeTab : null;
},
// ----------
// Function: isTabViewVisible
// Returns true if the TabView UI is currently shown.
@ -476,7 +482,7 @@ let UI = {
// closed all other tabs. (If the user is looking at an orphan tab, then
// there is no active group for the purposes of this check.)
let activeGroupItem = null;
if (!GroupItems.getActiveOrphanTab()) {
if (!UI.getActiveOrphanTab()) {
activeGroupItem = GroupItems.getActiveGroupItem();
if (activeGroupItem && activeGroupItem.closeIfEmpty())
activeGroupItem = null;
@ -863,22 +869,18 @@ let UI = {
// No tabItem; must be an app tab. Base the tab bar on the current group.
// If no current group or orphan tab, figure it out based on what's
// already in the tab bar.
if (!GroupItems.getActiveGroupItem() && !GroupItems.getActiveOrphanTab()) {
if (!GroupItems.getActiveGroupItem() && !UI.getActiveOrphanTab()) {
for (let a = 0; a < gBrowser.tabs.length; a++) {
let theTab = gBrowser.tabs[a];
if (!theTab.pinned) {
let tabItem = theTab._tabViewTabItem;
if (tabItem.parent)
GroupItems.setActiveGroupItem(tabItem.parent);
else
GroupItems.setActiveOrphanTab(tabItem);
GroupItems.setActiveGroupItem(tabItem.parent);
break;
}
}
}
if (GroupItems.getActiveGroupItem() || GroupItems.getActiveOrphanTab())
if (GroupItems.getActiveGroupItem() || UI.getActiveOrphanTab())
GroupItems._updateTabBar();
}
},

Просмотреть файл

@ -62,7 +62,7 @@ function part1(win) {
let groupItems = contentWindow.GroupItems.groupItems;
is(groupItems.length, 1, "Only one group");
ok(!contentWindow.GroupItems.getActiveOrphanTab(), "There is no active orphan tab.");
ok(!contentWindow.UI.getActiveOrphanTab(), "There is no active orphan tab.");
ok(win.TabView.isVisible(), "Tab View is visible.");
win.gBrowser.tabContainer.addEventListener("TabSelect", function() {

Просмотреть файл

@ -567,7 +567,15 @@ nsBrowserContentHandler.prototype = {
#endif
},
helpInfo : " -browser Open a browser window.\n",
helpInfo : " -browser Open a browser window.\n" +
" -new-window <url> Open <url> in a new window.\n" +
" -new-tab <url> Open <url> in a new tab.\n" +
#ifdef XP_WIN
" -preferences Open Options dialog.\n" +
#else
" -preferences Open Preferences dialog.\n" +
#endif
" -search <term> Search <term> with your default search engine.\n",
/* nsIBrowserHandler */

Просмотреть файл

@ -1466,11 +1466,6 @@ ContentPermissionPrompt.prototype = {
},
};
// XXX Bug 573536
// browserBundle.GetStringFromName("geolocation.learnMore")
//var formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].getService(Ci.nsIURLFormatter);
//link.href = formatter.formatURLPref("browser.geolocation.warning.infoURL");
var message;
var secondaryActions = [];

Просмотреть файл

@ -474,8 +474,12 @@
// Save the current value in the form history
if (textValue) {
textBox._formHistSvc.addEntry(textBox.getAttribute("autocompletesearchparam"),
textValue);
try {
textBox._formHistSvc.addEntry(textBox.getAttribute("autocompletesearchparam"),
textValue);
} catch (ex) {
Components.utils.reportError("Saving search to form history failed: " + ex);
}
}
this.doSearch(textValue, where);

Просмотреть файл

@ -94,7 +94,6 @@ DEFINES += -DMOZ_D3DX9_DLL=$(MOZ_D3DX9_DLL)
DEFINES += -DMOZ_D3DCOMPILER_DLL=$(MOZ_D3DCOMPILER_DLL)
endif
# Don't ifdef MOZ_IPC this because mac ppc needs it too.
include $(topsrcdir)/ipc/app/defs.mk
DEFINES += -DMOZ_CHILD_PROCESS_NAME=$(MOZ_CHILD_PROCESS_NAME)

Просмотреть файл

@ -51,13 +51,11 @@
#else
@BINPATH@/@DLL_PREFIX@xul@DLL_SUFFIX@
#endif
#ifdef MOZ_IPC
#ifdef XP_MACOSX
@BINPATH@/@MOZ_CHILD_PROCESS_NAME@.app/
#else
@BINPATH@/@MOZ_CHILD_PROCESS_NAME@
#endif
#endif
#ifdef WINCE
@BINPATH@/mozce_shunt.dll
#elifdef XP_WIN32
@ -241,9 +239,6 @@
#endif
@BINPATH@/components/txtsvc.xpt
@BINPATH@/components/txmgr.xpt
#ifdef MOZ_USE_NATIVE_UCONV
@BINPATH@/components/ucnative.xpt
#endif
@BINPATH@/components/uconv.xpt
@BINPATH@/components/unicharutil.xpt
@BINPATH@/components/update.xpt

Просмотреть файл

@ -1,6 +1,4 @@
nv_done=Done
nv_timeout=Timed Out
nv_stopped=Stopped
openFile=Open File
droponhometitle=Set Home Page

Просмотреть файл

@ -63,3 +63,4 @@ externalProtocolLaunchBtn=Launch application
malwareBlocked=The site at %S has been reported as an attack site and has been blocked based on your security preferences.
phishingBlocked=The web site at %S has been reported as a web forgery designed to trick users into sharing personal or financial information.
cspFrameAncestorBlocked=This page has a content security policy that prevents it from being embedded in this way.
remoteXUL=This page uses an unsupported technology that is no longer available by default in Firefox.

Просмотреть файл

@ -186,3 +186,6 @@ functionality specific to firefox. -->
<button id='getMeOutOfHereButton'>&securityOverride.getMeOutOfHereButton;</button>
<button id='exceptionDialogButton'>&securityOverride.exceptionButtonLabel;</button>
">
<!ENTITY remoteXUL.title "Remote XUL">
<!ENTITY remoteXUL.longDesc "<p><ul><li>Please contact the website owners to inform them of this problem.</li></ul></p>">

Просмотреть файл

@ -58,12 +58,9 @@ CPPSRCS = \
nsChromeRegistry.cpp \
nsChromeRegistryChrome.cpp \
nsChromeProtocolHandler.cpp \
nsChromeRegistryContent.cpp \
$(NULL)
ifdef MOZ_IPC
CPPSRCS += nsChromeRegistryContent.cpp
endif
EXTRA_DSO_LDOPTS = \
$(MOZ_UNICHARUTIL_LIBS) \
$(MOZ_COMPONENT_LIBS) \

Просмотреть файл

@ -41,9 +41,7 @@
#include "nsChromeRegistry.h"
#include "nsChromeRegistryChrome.h"
#ifdef MOZ_IPC
#include "nsChromeRegistryContent.h"
#endif
#include <string.h>
@ -677,11 +675,9 @@ nsChromeRegistry::GetSingleton()
}
nsRefPtr<nsChromeRegistry> cr;
#ifdef MOZ_IPC
if (GeckoProcessType_Content == XRE_GetProcessType())
cr = new nsChromeRegistryContent();
else
#endif
cr = new nsChromeRegistryChrome();
if (NS_FAILED(cr->Init()))

Просмотреть файл

@ -36,11 +36,9 @@
*
* ***** END LICENSE BLOCK ***** */
#ifdef MOZ_IPC
#include "mozilla/dom/PContentParent.h"
#include "RegistryMessageUtils.h"
#include "nsResProtocolHandler.h"
#endif
#include "nsChromeRegistryChrome.h"
@ -443,7 +441,6 @@ void nsChromeRegistryChrome::UpdateSelectedLocale()
}
}
#ifdef MOZ_IPC
static void
SerializeURI(nsIURI* aURI,
SerializedURI& aSerializedURI)
@ -541,7 +538,6 @@ nsChromeRegistryChrome::CollectPackages(PLDHashTable *table,
args->packages.AppendElement(chromePackage);
return (PLDHashOperator)PL_DHASH_NEXT;
}
#endif
static PRBool
CanLoadResource(nsIURI* aResourceURI)

Просмотреть файл

@ -75,16 +75,12 @@ class nsChromeRegistryChrome : public nsChromeRegistry
nsISimpleEnumerator **_retval);
#endif
#ifdef MOZ_IPC
void SendRegisteredChrome(mozilla::dom::PContentParent* aChild);
#endif
private:
#ifdef MOZ_IPC
static PLDHashOperator CollectPackages(PLDHashTable *table,
PLDHashEntryHdr *entry,
PRUint32 number, void *arg);
#endif
nsresult SelectLocaleFromPref(nsIPrefBranch* prefs);
NS_OVERRIDE void UpdateSelectedLocale();

Просмотреть файл

@ -47,11 +47,9 @@ MODULE = test_chrome
XPCSHELL_TESTS = unit \
$(NULL)
ifdef MOZ_IPC
# FIXME/bug 575918: out-of-process xpcshell is broken on OS X
ifneq ($(OS_ARCH),Darwin)
XPCSHELL_TESTS += unit_ipc
endif
endif
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -102,7 +102,6 @@ MOZ_DEBUG_FLAGS = @MOZ_DEBUG_FLAGS@
MOZ_DEBUG_LDFLAGS=@MOZ_DEBUG_LDFLAGS@
MOZ_EXTENSIONS = @MOZ_EXTENSIONS@
MOZ_JSDEBUGGER = @MOZ_JSDEBUGGER@
MOZ_IPC = @MOZ_IPC@
MOZ_IPDL_TESTS = @MOZ_IPDL_TESTS@
MOZ_LEAKY = @MOZ_LEAKY@
MOZ_MEMORY = @MOZ_MEMORY@
@ -127,7 +126,6 @@ ENABLE_TESTS = @ENABLE_TESTS@
IBMBIDI = @IBMBIDI@
MOZ_UNIVERSALCHARDET = @MOZ_UNIVERSALCHARDET@
ACCESSIBILITY = @ACCESSIBILITY@
MOZ_USE_NATIVE_UCONV = @MOZ_USE_NATIVE_UCONV@
MOZ_BRANDING_DIRECTORY = @MOZ_BRANDING_DIRECTORY@
XPCOM_USE_LEA = @XPCOM_USE_LEA@
MOZ_INSTALLER = @MOZ_INSTALLER@

Просмотреть файл

@ -4950,7 +4950,6 @@ MOZ_BRANDING_DIRECTORY=
MOZ_OFFICIAL_BRANDING=
MOZ_FEEDS=1
MOZ_INSTALLER=1
MOZ_IPC=1
MOZ_JAVAXPCOM=
MOZ_JSDEBUGGER=1
MOZ_MATHML=1
@ -5000,7 +4999,6 @@ MOZ_TOOLKIT_SEARCH=1
MOZ_UI_LOCALE=en-US
MOZ_UNIVERSALCHARDET=1
MOZ_URL_CLASSIFIER=
MOZ_USE_NATIVE_UCONV=
MOZ_XSLT_STANDALONE=
MOZ_XTF=1
MOZ_XUL=1
@ -5646,6 +5644,11 @@ then
dnl ========================================================
dnl = GConf support module
dnl ========================================================
MOZ_ARG_DISABLE_BOOL(gconf,
[ --disable-gconf Disable Gconf support ],
MOZ_ENABLE_GCONF=,
MOZ_ENABLE_GCONF=force)
if test "$MOZ_ENABLE_GCONF"
then
PKG_CHECK_MODULES(MOZ_GCONF, gconf-2.0 >= $GCONF_VERSION gobject-2.0 ,[
@ -5821,21 +5824,6 @@ MOZ_ARG_DISABLE_BOOL(jsd,
MOZ_JSDEBUGGER=1)
dnl ========================================================
dnl = Disable IPC support for tabs and plugins
dnl ========================================================
MOZ_ARG_DISABLE_BOOL(ipc,
[ --disable-ipc Disable IPC for tabs and plugins (not supported)],
MOZ_IPC=,
MOZ_IPC=1)
if test -z "$MOZ_IPC"; then
AC_MSG_ERROR([--disable-ipc is no longer supported.])
fi
AC_DEFINE(MOZ_IPC)
AC_SUBST(MOZ_IPC)
dnl ========================================================
dnl = Enable IPDL's "expensive" unit tests
dnl ========================================================
@ -5901,20 +5889,6 @@ if test "$NS_PRINTING"; then
AC_DEFINE(NS_PRINTING)
AC_DEFINE(NS_PRINT_PREVIEW)
fi
dnl ========================================================
dnl use native unicode converters
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(native-uconv,
[ --enable-native-uconv Enable iconv support],
MOZ_USE_NATIVE_UCONV=1,
MOZ_USE_NATIVE_UCONV= )
if test "$MOZ_USE_NATIVE_UCONV"; then
AC_DEFINE(MOZ_USE_NATIVE_UCONV)
fi
if test "$OS_ARCH" != "WINCE" -a "$OS_ARCH" != "WINNT" -a "$MOZ_USE_NATIVE_UCONV" -a "$ac_cv_func_iconv" != "yes"; then
AC_MSG_ERROR([iconv() not found. Cannot enable native uconv support.])
fi
dnl ========================================================
dnl = Disable Fast Load
@ -6485,7 +6459,7 @@ if test -n "$MOZ_LIBJPEG_TURBO"; then
LIBJPEG_TURBO_X86_ASM=1
;;
WINNT:x86_64)
LIBJPEG_TURBO_ASFLAGS="-f win64 -rnasm -pnasm -D__x86_64__ -DPIC -DWIN64"
LIBJPEG_TURBO_ASFLAGS="-f win64 -rnasm -pnasm -D__x86_64__ -DPIC -DWIN64 -DMSVC"
LIBJPEG_TURBO_X64_ASM=1
;;
esac
@ -8931,7 +8905,7 @@ if test -z "$SKIP_LIBRARY_CHECKS" -a "$NECKO_WIFI" -a "$OS_ARCH" = "Linux"
then
MOZ_CHECK_HEADER([iwlib.h])
if test "$ac_cv_header_iwlib_h" != "yes"; then
AC_MSG_ERROR([Can't find header iwlib.h for Necko WiFi scanning (might be in package libiw-dev (Ubuntu) or wireless-tools-devel (Fedora)); use --disable-necko-wifi to disable])
AC_MSG_ERROR([Can't find header iwlib.h for Necko WiFi scanning (might be in package libiw-dev (Ubuntu) or wireless-tools-devel (Fedora) or libiw-devel (openSUSE)); use --disable-necko-wifi to disable])
fi
fi
@ -9056,7 +9030,6 @@ AC_SUBST(MOZ_SHARK)
AC_SUBST(MOZ_CALLGRIND)
AC_SUBST(MOZ_VTUNE)
AC_SUBST(MOZ_PROFILING)
AC_SUBST(MOZ_USE_NATIVE_UCONV)
AC_SUBST(MOZ_QUANTIFY)
AC_SUBST(LIBICONV)
AC_SUBST(MOZ_PLACES)
@ -9351,7 +9324,7 @@ dnl Check for headers, etc. needed by WebGL.
if test -n "$MOZ_WEBGL_GLX"; then
MOZ_CHECK_HEADER(GL/glx.h)
if test "$ac_cv_header_GL_glx_h" != "yes"; then
AC_MSG_ERROR([Can't find header GL/glx.h for WebGL (install mesa-common-dev (Ubuntu), mesa-libGL-devel (Fedora), or Mesa (SuSE))])
AC_MSG_ERROR([Can't find header GL/glx.h for WebGL (install mesa-common-dev (Ubuntu), mesa-libGL-devel (Fedora), or Mesa-devel (openSUSE))])
fi
fi # MOZ_WEBGL_GLX
fi # COMPILE_ENVIRONMENT

Просмотреть файл

@ -178,14 +178,9 @@ EXTRA_COMPONENTS = \
contentSecurityPolicy.manifest \
contentAreaDropListener.js \
contentAreaDropListener.manifest \
$(NULL)
ifdef MOZ_IPC
EXTRA_COMPONENTS += \
messageWakeupService.js \
messageWakeupService.manifest \
$(NULL)
endif
EXTRA_JS_MODULES = \
CSPUtils.jsm \

Просмотреть файл

@ -2138,11 +2138,17 @@ nsContentUtils::GenerateStateKey(nsIContent* aContent,
if (!generatedUniqueKey) {
// Either we didn't have a form control or we aren't in an HTML document so
// we can't figure out form info. First append a character that is not "d"
// or "f" to disambiguate from the case when we were a form control in an
// HTML document.
KeyAppendString(NS_LITERAL_CSTRING("o"), aKey);
// we can't figure out form info. Append the tag name if it's an element
// to avoid restoring state for one type of element on another type.
if (aContent->IsElement()) {
KeyAppendString(nsDependentAtomString(aContent->Tag()), aKey);
}
else {
// Append a character that is not "d" or "f" to disambiguate from
// the case when we were a form control in an HTML document.
KeyAppendString(NS_LITERAL_CSTRING("o"), aKey);
}
// Now start at aContent and append the indices of it and all its ancestors
// in their containers. That should at least pin down its position in the
// DOM...

Просмотреть файл

@ -8350,12 +8350,10 @@ PLDHashOperator UnlockEnumerator(imgIRequest* aKey,
nsresult
nsDocument::SetImageLockingState(PRBool aLocked)
{
#ifdef MOZ_IPC
if (XRE_GetProcessType() == GeckoProcessType_Content &&
!nsContentUtils::GetBoolPref("content.image.allow_locking", PR_TRUE)) {
return NS_OK;
}
#endif // MOZ_IPC
// If there's no change, there's nothing to do.
if (mLockingImages == aLocked)

Просмотреть файл

@ -44,9 +44,7 @@
* handling of loads in it, recursion-checking).
*/
#ifdef MOZ_IPC
# include "base/basictypes.h"
#endif
#include "base/basictypes.h"
#include "prenv.h"
@ -112,15 +110,12 @@
#include "Layers.h"
#ifdef MOZ_IPC
#include "ContentParent.h"
#include "TabParent.h"
#include "mozilla/layout/RenderFrameParent.h"
using namespace mozilla;
using namespace mozilla::dom;
#endif
using namespace mozilla::layers;
typedef FrameMetrics::ViewID ViewID;
@ -324,13 +319,11 @@ nsFrameLoader::nsFrameLoader(nsIContent *aOwner, PRBool aNetworkCreated)
, mInShow(PR_FALSE)
, mHideCalled(PR_FALSE)
, mNetworkCreated(aNetworkCreated)
#ifdef MOZ_IPC
, mDelayRemoteDialogs(PR_FALSE)
, mRemoteBrowserShown(PR_FALSE)
, mRemoteFrame(false)
, mCurrentRemoteFrame(nsnull)
, mRemoteBrowser(nsnull)
#endif
, mRenderMode(RENDER_MODE_DEFAULT)
{
}
@ -448,7 +441,6 @@ nsFrameLoader::ReallyStartLoadingInternal()
return rv;
}
#ifdef MOZ_IPC
if (mRemoteFrame) {
if (!mRemoteBrowser) {
TryRemoteBrowser();
@ -463,7 +455,6 @@ nsFrameLoader::ReallyStartLoadingInternal()
mRemoteBrowser->LoadURL(mURIToLoad);
return NS_OK;
}
#endif
NS_ASSERTION(mDocShell,
"MaybeCreateDocShell succeeded with a null mDocShell");
@ -534,11 +525,9 @@ nsFrameLoader::CheckURILoad(nsIURI* aURI)
if (NS_FAILED(rv)) {
return rv;
}
#ifdef MOZ_IPC
if (mRemoteFrame) {
return NS_OK;
}
#endif
return CheckForRecursiveLoad(aURI);
}
@ -554,12 +543,10 @@ nsFrameLoader::GetDocShell(nsIDocShell **aDocShell)
nsresult rv = MaybeCreateDocShell();
if (NS_FAILED(rv))
return rv;
#ifdef MOZ_IPC
if (mRemoteFrame) {
NS_WARNING("No docshells for remote frames!");
return NS_ERROR_NOT_AVAILABLE;
}
#endif
NS_ASSERTION(mDocShell,
"MaybeCreateDocShell succeeded, but null mDocShell");
}
@ -776,10 +763,7 @@ nsFrameLoader::Show(PRInt32 marginWidth, PRInt32 marginHeight,
return PR_FALSE;
}
#ifdef MOZ_IPC
if (!mRemoteFrame)
#endif
{
if (!mRemoteFrame) {
if (!mDocShell)
return PR_FALSE;
nsCOMPtr<nsIPresShell> presShell;
@ -803,11 +787,9 @@ nsFrameLoader::Show(PRInt32 marginWidth, PRInt32 marginHeight,
if (!view)
return PR_FALSE;
#ifdef MOZ_IPC
if (mRemoteFrame) {
return ShowRemoteFrame(GetSubDocumentSize(frame));
}
#endif
nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(mDocShell);
NS_ASSERTION(baseWindow, "Found a nsIDocShell that isn't a nsIBaseWindow.");
@ -880,7 +862,6 @@ nsFrameLoader::Show(PRInt32 marginWidth, PRInt32 marginHeight,
return PR_TRUE;
}
#ifdef MOZ_IPC
bool
nsFrameLoader::ShowRemoteFrame(const nsIntSize& size)
{
@ -909,7 +890,6 @@ nsFrameLoader::ShowRemoteFrame(const nsIntSize& size)
return true;
}
#endif
void
nsFrameLoader::Hide()
@ -1234,13 +1214,11 @@ nsFrameLoader::SwapWithOtherLoader(nsFrameLoader* aOther,
void
nsFrameLoader::DestroyChild()
{
#ifdef MOZ_IPC
if (mRemoteBrowser) {
mRemoteBrowser->SetOwnerElement(nsnull);
mRemoteBrowser->Destroy();
mRemoteBrowser = nsnull;
}
#endif
}
NS_IMETHODIMP
@ -1327,14 +1305,11 @@ void
nsFrameLoader::SetOwnerContent(nsIContent* aContent)
{
mOwnerContent = aContent;
#ifdef MOZ_IPC
if (RenderFrameParent* rfp = GetCurrentRemoteFrame()) {
rfp->OwnerContentChanged(aContent);
}
#endif
}
#ifdef MOZ_IPC
bool
nsFrameLoader::ShouldUseRemoteProcess()
{
@ -1370,7 +1345,6 @@ nsFrameLoader::ShouldUseRemoteProcess()
PR_FALSE);
return (bool) remoteEnabled;
}
#endif
nsresult
nsFrameLoader::MaybeCreateDocShell()
@ -1378,19 +1352,15 @@ nsFrameLoader::MaybeCreateDocShell()
if (mDocShell) {
return NS_OK;
}
#ifdef MOZ_IPC
if (mRemoteFrame) {
return NS_OK;
}
#endif
NS_ENSURE_STATE(!mDestroyCalled);
#ifdef MOZ_IPC
if (ShouldUseRemoteProcess()) {
mRemoteFrame = true;
return NS_OK;
}
#endif
// Get our parent docshell off the document of mOwnerContent
// XXXbz this is such a total hack.... We really need to have a
@ -1539,10 +1509,8 @@ nsFrameLoader::CheckForRecursiveLoad(nsIURI* aURI)
if (NS_FAILED(rv)) {
return rv;
}
#ifdef MOZ_IPC
NS_ASSERTION(!mRemoteFrame,
"Shouldn't call CheckForRecursiveLoad on remote frames.");
#endif
if (!mDocShell) {
return NS_ERROR_FAILURE;
}
@ -1642,7 +1610,6 @@ nsFrameLoader::CheckForRecursiveLoad(nsIURI* aURI)
NS_IMETHODIMP
nsFrameLoader::UpdatePositionAndSize(nsIFrame *aIFrame)
{
#ifdef MOZ_IPC
if (mRemoteFrame) {
if (mRemoteBrowser) {
nsIntSize size = GetSubDocumentSize(aIFrame);
@ -1650,7 +1617,6 @@ nsFrameLoader::UpdatePositionAndSize(nsIFrame *aIFrame)
}
return NS_OK;
}
#endif
return UpdateBaseWindowPositionAndSize(aIFrame);
}
@ -1718,7 +1684,6 @@ nsFrameLoader::GetSubDocumentSize(const nsIFrame *aIFrame)
presContext->AppUnitsToDevPixels(docSizeAppUnits.height));
}
#ifdef MOZ_IPC
bool
nsFrameLoader::TryRemoteBrowser()
{
@ -1798,24 +1763,19 @@ nsFrameLoader::TryRemoteBrowser()
}
return true;
}
#endif
#ifdef MOZ_IPC
mozilla::dom::PBrowserParent*
nsFrameLoader::GetRemoteBrowser()
{
return mRemoteBrowser;
}
#endif
NS_IMETHODIMP
nsFrameLoader::ActivateRemoteFrame() {
#ifdef MOZ_IPC
if (mRemoteBrowser) {
mRemoteBrowser->Activate();
return NS_OK;
}
#endif
return NS_ERROR_UNEXPECTED;
}
@ -1828,14 +1788,12 @@ nsFrameLoader::SendCrossProcessMouseEvent(const nsAString& aType,
PRInt32 aModifiers,
PRBool aIgnoreRootScrollFrame)
{
#ifdef MOZ_IPC
if (mRemoteBrowser) {
mRemoteBrowser->SendMouseEvent(aType, aX, aY, aButton,
aClickCount, aModifiers,
aIgnoreRootScrollFrame);
return NS_OK;
}
#endif
return NS_ERROR_FAILURE;
}
@ -1843,12 +1801,10 @@ NS_IMETHODIMP
nsFrameLoader::ActivateFrameEvent(const nsAString& aType,
PRBool aCapture)
{
#ifdef MOZ_IPC
if (mRemoteBrowser) {
return mRemoteBrowser->SendActivateFrameEvent(nsString(aType), aCapture) ?
NS_OK : NS_ERROR_NOT_AVAILABLE;
}
#endif
return NS_ERROR_FAILURE;
}
@ -1859,31 +1815,24 @@ nsFrameLoader::SendCrossProcessKeyEvent(const nsAString& aType,
PRInt32 aModifiers,
PRBool aPreventDefault)
{
#ifdef MOZ_IPC
if (mRemoteBrowser) {
mRemoteBrowser->SendKeyEvent(aType, aKeyCode, aCharCode, aModifiers,
aPreventDefault);
return NS_OK;
}
#endif
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
nsFrameLoader::GetDelayRemoteDialogs(PRBool* aRetVal)
{
#ifdef MOZ_IPC
*aRetVal = mDelayRemoteDialogs;
#else
*aRetVal = PR_FALSE;
#endif
return NS_OK;
}
NS_IMETHODIMP
nsFrameLoader::SetDelayRemoteDialogs(PRBool aDelay)
{
#ifdef MOZ_IPC
if (mRemoteBrowser && mDelayRemoteDialogs && !aDelay) {
nsRefPtr<nsIRunnable> ev =
NS_NewRunnableMethod(mRemoteBrowser,
@ -1891,7 +1840,6 @@ nsFrameLoader::SetDelayRemoteDialogs(PRBool aDelay)
NS_DispatchToCurrentThread(ev);
}
mDelayRemoteDialogs = aDelay;
#endif
return NS_OK;
}
@ -1922,13 +1870,11 @@ nsFrameLoader::CreateStaticClone(nsIFrameLoader* aDest)
bool LoadScript(void* aCallbackData, const nsAString& aURL)
{
#ifdef MOZ_IPC
mozilla::dom::PBrowserParent* tabParent =
static_cast<nsFrameLoader*>(aCallbackData)->GetRemoteBrowser();
if (tabParent) {
return tabParent->SendLoadRemoteScript(nsString(aURL));
}
#endif
nsFrameLoader* fl = static_cast<nsFrameLoader*>(aCallbackData);
nsRefPtr<nsInProcessTabChildGlobal> tabChild =
static_cast<nsInProcessTabChildGlobal*>(fl->GetTabChildGlobalAsEventTarget());
@ -1965,13 +1911,11 @@ bool SendAsyncMessageToChild(void* aCallbackData,
const nsAString& aMessage,
const nsAString& aJSON)
{
#ifdef MOZ_IPC
mozilla::dom::PBrowserParent* tabParent =
static_cast<nsFrameLoader*>(aCallbackData)->GetRemoteBrowser();
if (tabParent) {
return tabParent->SendAsyncMessage(nsString(aMessage), nsString(aJSON));
}
#endif
nsRefPtr<nsIRunnable> ev =
new nsAsyncMessageToChild(static_cast<nsFrameLoader*>(aCallbackData),
aMessage, aJSON);
@ -1996,7 +1940,6 @@ nsFrameLoader::GetContentViewsIn(float aXPx, float aYPx,
PRUint32* aLength,
nsIContentView*** aResult)
{
#ifdef MOZ_IPC
nscoord x = nsPresContext::CSSPixelsToAppUnits(aXPx - aLeftSize);
nscoord y = nsPresContext::CSSPixelsToAppUnits(aYPx - aTopSize);
nscoord w = nsPresContext::CSSPixelsToAppUnits(aLeftSize + aRightSize) + 1;
@ -2024,10 +1967,6 @@ nsFrameLoader::GetContentViewsIn(float aXPx, float aYPx,
*aResult = result;
*aLength = ids.Length();
#else
*aResult = nsnull;
*aLength = 0;
#endif
return NS_OK;
}
@ -2035,7 +1974,6 @@ nsFrameLoader::GetContentViewsIn(float aXPx, float aYPx,
NS_IMETHODIMP
nsFrameLoader::GetRootContentView(nsIContentView** aContentView)
{
#ifdef MOZ_IPC
RenderFrameParent* rfp = GetCurrentRemoteFrame();
if (!rfp) {
*aContentView = nsnull;
@ -2047,10 +1985,6 @@ nsFrameLoader::GetRootContentView(nsIContentView** aContentView)
nsRefPtr<nsIContentView>(view).forget(aContentView);
return NS_OK;
#else
return NS_ERROR_NOT_IMPLEMENTED;
#endif
}
nsresult
@ -2063,20 +1997,14 @@ nsFrameLoader::EnsureMessageManager()
return rv;
}
if (!mIsTopLevelContent
#ifdef MOZ_IPC
&& !mRemoteFrame
#endif
) {
if (!mIsTopLevelContent && !mRemoteFrame) {
return NS_OK;
}
if (mMessageManager) {
#ifdef MOZ_IPC
if (ShouldUseRemoteProcess()) {
mMessageManager->SetCallbackData(mRemoteBrowserShown ? this : nsnull);
}
#endif
return NS_OK;
}
@ -2092,7 +2020,6 @@ nsFrameLoader::EnsureMessageManager()
nsCOMPtr<nsIChromeFrameMessageManager> parentManager;
chromeWindow->GetMessageManager(getter_AddRefs(parentManager));
#ifdef MOZ_IPC
if (ShouldUseRemoteProcess()) {
mMessageManager = new nsFrameMessageManager(PR_TRUE,
nsnull,
@ -2103,7 +2030,6 @@ nsFrameLoader::EnsureMessageManager()
cx);
NS_ENSURE_TRUE(mMessageManager, NS_ERROR_OUT_OF_MEMORY);
} else
#endif
{
mMessageManager = new nsFrameMessageManager(PR_TRUE,

Просмотреть файл

@ -61,7 +61,6 @@ class nsIView;
class nsIInProcessContentFrameMessageManager;
class AutoResetInShow;
#ifdef MOZ_IPC
namespace mozilla {
namespace dom {
class PBrowserParent;
@ -79,7 +78,6 @@ typedef struct _GtkWidget GtkWidget;
#ifdef MOZ_WIDGET_QT
class QX11EmbedContainer;
#endif
#endif
/**
* Defines a target configuration for this <browser>'s content
@ -167,11 +165,9 @@ class nsFrameLoader : public nsIFrameLoader,
public nsIContentViewManager
{
friend class AutoResetInShow;
#ifdef MOZ_IPC
typedef mozilla::dom::PBrowserParent PBrowserParent;
typedef mozilla::dom::TabParent TabParent;
typedef mozilla::layout::RenderFrameParent RenderFrameParent;
#endif
protected:
nsFrameLoader(nsIContent *aOwner, PRBool aNetworkCreated);
@ -246,7 +242,6 @@ public:
nsIDocument* GetOwnerDoc() const
{ return mOwnerContent ? mOwnerContent->GetOwnerDoc() : nsnull; }
#ifdef MOZ_IPC
PBrowserParent* GetRemoteBrowser();
/**
@ -277,7 +272,6 @@ public:
{
mCurrentRemoteFrame = aFrame;
}
#endif
nsFrameMessageManager* GetFrameMessageManager() { return mMessageManager; }
nsIContent* GetOwnerContent() { return mOwnerContent; }
@ -285,9 +279,7 @@ public:
private:
#ifdef MOZ_IPC
bool ShouldUseRemoteProcess();
#endif
/**
* If we are an IPC frame, set mRemoteFrame. Otherwise, create and
@ -307,13 +299,11 @@ private:
void FireErrorEvent();
nsresult ReallyStartLoadingInternal();
#ifdef MOZ_IPC
// Return true if remote browser created; nothing else to do
bool TryRemoteBrowser();
// Tell the remote browser that it's now "virtually visible"
bool ShowRemoteFrame(const nsIntSize& size);
#endif
nsCOMPtr<nsIDocShell> mDocShell;
nsCOMPtr<nsIURI> mURIToLoad;
@ -335,7 +325,6 @@ private:
// it may lose the flag.
PRPackedBool mNetworkCreated : 1;
#ifdef MOZ_IPC
PRPackedBool mDelayRemoteDialogs : 1;
PRPackedBool mRemoteBrowserShown : 1;
bool mRemoteFrame;
@ -343,7 +332,6 @@ private:
nsCOMPtr<nsIObserver> mChildHost;
RenderFrameParent* mCurrentRemoteFrame;
TabParent* mRemoteBrowser;
#endif
// See nsIFrameLoader.idl. Short story, if !(mRenderMode &
// RENDER_MODE_ASYNC_SCROLL), all the fields below are ignored in

Просмотреть файл

@ -35,10 +35,8 @@
*
* ***** END LICENSE BLOCK ***** */
#ifdef MOZ_IPC
#include "ContentChild.h"
#include "ContentParent.h"
#endif
#include "jscntxt.h"
#include "nsFrameMessageManager.h"
#include "nsContentUtils.h"
@ -650,20 +648,13 @@ nsFrameScriptExecutor::LoadFrameScriptInternal(const nsAString& aURL)
nsCOMPtr<nsIInputStream> input;
channel->Open(getter_AddRefs(input));
nsString dataString;
if (input) {
const PRUint32 bufferSize = 8192;
char buffer[bufferSize];
nsCString data;
PRUint32 avail = 0;
input->Available(&avail);
PRUint32 read = 0;
if (avail) {
while (NS_SUCCEEDED(input->Read(buffer, bufferSize, &read)) && read) {
data.Append(buffer, read);
read = 0;
}
PRUint32 avail = 0;
if (input && NS_SUCCEEDED(input->Available(&avail)) && avail) {
nsCString buffer;
if (NS_FAILED(NS_ReadInputStreamToString(input, buffer, avail))) {
return;
}
nsScriptLoader::ConvertToUTF16(channel, (PRUint8*)data.get(), data.Length(),
nsScriptLoader::ConvertToUTF16(channel, (PRUint8*)buffer.get(), avail,
EmptyString(), nsnull, dataString);
}
@ -729,7 +720,6 @@ NS_IMPL_ISUPPORTS1(nsScriptCacheCleaner, nsIObserver)
nsFrameMessageManager* nsFrameMessageManager::sChildProcessManager = nsnull;
nsFrameMessageManager* nsFrameMessageManager::sParentProcessManager = nsnull;
#ifdef MOZ_IPC
bool SendAsyncMessageToChildProcess(void* aCallbackData,
const nsAString& aMessage,
const nsAString& aJSON)
@ -769,14 +759,11 @@ bool SendAsyncMessageToParentProcess(void* aCallbackData,
return true;
}
#endif
nsresult
NS_NewParentProcessMessageManager(nsIFrameMessageManager** aResult)
{
NS_ASSERTION(!nsFrameMessageManager::sParentProcessManager,
"Re-creating sParentProcessManager");
#ifdef MOZ_IPC
NS_ENSURE_TRUE(IsChromeProcess(), NS_ERROR_NOT_AVAILABLE);
nsFrameMessageManager* mm = new nsFrameMessageManager(PR_TRUE,
nsnull,
@ -790,9 +777,6 @@ NS_NewParentProcessMessageManager(nsIFrameMessageManager** aResult)
NS_ENSURE_TRUE(mm, NS_ERROR_OUT_OF_MEMORY);
nsFrameMessageManager::sParentProcessManager = mm;
return CallQueryInterface(mm, aResult);
#else
return NS_ERROR_NOT_AVAILABLE;
#endif
}
@ -801,7 +785,6 @@ NS_NewChildProcessMessageManager(nsISyncMessageSender** aResult)
{
NS_ASSERTION(!nsFrameMessageManager::sChildProcessManager,
"Re-creating sChildProcessManager");
#ifdef MOZ_IPC
NS_ENSURE_TRUE(!IsChromeProcess(), NS_ERROR_NOT_AVAILABLE);
nsFrameMessageManager* mm = new nsFrameMessageManager(PR_FALSE,
SendSyncMessageToParentProcess,
@ -815,7 +798,4 @@ NS_NewChildProcessMessageManager(nsISyncMessageSender** aResult)
NS_ENSURE_TRUE(mm, NS_ERROR_OUT_OF_MEMORY);
nsFrameMessageManager::sChildProcessManager = mm;
return CallQueryInterface(mm, aResult);
#else
return NS_ERROR_NOT_AVAILABLE;
#endif
}

Просмотреть файл

@ -2619,7 +2619,6 @@ nsGenericElement::RemoveAttributeNS(const nsAString& aNamespaceURI,
return NS_OK;
}
nsAutoString tmp;
UnsetAttr(nsid, name, PR_TRUE);
return NS_OK;

Просмотреть файл

@ -1382,20 +1382,48 @@ GK_ATOM(accent_, "accent")
GK_ATOM(accentunder_, "accentunder")
GK_ATOM(actiontype_, "actiontype")
GK_ATOM(alignmentscope_, "alignmentscope")
GK_ATOM(altimg_, "altimg")
GK_ATOM(altimg_height_, "altimg-height")
GK_ATOM(altimg_valign_, "altimg-valign")
GK_ATOM(altimg_width_, "altimg-width")
GK_ATOM(annotation_, "annotation")
GK_ATOM(annotation_xml_, "annotation-xml")
GK_ATOM(apply_, "apply")
GK_ATOM(approx_, "approx")
GK_ATOM(arccos_, "arccos")
GK_ATOM(arccosh_, "arccosh")
GK_ATOM(arccot_, "arccot")
GK_ATOM(arccoth_, "arccoth")
GK_ATOM(arccsc_, "arccsc")
GK_ATOM(arccsch_, "arccsch")
GK_ATOM(arcsec_, "arcsec")
GK_ATOM(arcsech_, "arcsech")
GK_ATOM(arcsin_, "arcsin")
GK_ATOM(arcsinh_, "arcsinh")
GK_ATOM(arctan_, "arctan")
GK_ATOM(arctanh_, "arctanh")
GK_ATOM(arg_, "arg")
GK_ATOM(bevelled_, "bevelled")
GK_ATOM(bind_, "bind")
GK_ATOM(bvar_, "bvar")
GK_ATOM(card_, "card")
GK_ATOM(cartesianproduct_, "cartesianproduct")
GK_ATOM(cbytes_, "cbytes")
GK_ATOM(cd_, "cd")
GK_ATOM(cdgroup_, "cdgroup")
GK_ATOM(cerror_, "cerror")
GK_ATOM(charalign_, "charalign")
GK_ATOM(ci_, "ci")
GK_ATOM(closure_, "closure")
GK_ATOM(cn_, "cn")
GK_ATOM(codomain_, "codomain")
GK_ATOM(columnalign_, "columnalign")
GK_ATOM(columnalignment_, "columnalignment")
GK_ATOM(columnlines_, "columnlines")
GK_ATOM(columnspacing_, "columnspacing")
GK_ATOM(columnspan_, "columnspan")
GK_ATOM(columnwidth_, "columnwidth")
GK_ATOM(complexes_, "complexes")
GK_ATOM(compose_, "compose")
GK_ATOM(condition_, "condition")
GK_ATOM(conjugate_, "conjugate")
@ -1403,22 +1431,37 @@ GK_ATOM(cos_, "cos")
GK_ATOM(cosh_, "cosh")
GK_ATOM(cot_, "cot")
GK_ATOM(coth_, "coth")
GK_ATOM(crossout_, "crossout")
GK_ATOM(csc_, "csc")
GK_ATOM(csch_, "csch")
GK_ATOM(cs_, "cs")
GK_ATOM(csymbol_, "csymbol")
GK_ATOM(curl_, "curl")
GK_ATOM(decimalpoint_, "decimalpoint")
GK_ATOM(definitionURL_, "definitionURL")
GK_ATOM(degree_, "degree")
GK_ATOM(denomalign_, "denomalign")
GK_ATOM(depth_, "depth")
GK_ATOM(determinant_, "determinant")
GK_ATOM(diff_, "diff")
GK_ATOM(displaystyle_, "displaystyle")
GK_ATOM(divergence_, "divergence")
GK_ATOM(divide_, "divide")
GK_ATOM(domain_, "domain")
GK_ATOM(domainofapplication_, "domainofapplication")
GK_ATOM(edge_, "edge")
GK_ATOM(el_, "el")
GK_ATOM(emptyset_, "emptyset")
GK_ATOM(eq_, "eq")
GK_ATOM(equalcolumns_, "equalcolumns")
GK_ATOM(equalrows_, "equalrows")
GK_ATOM(equivalent_, "equivalent")
GK_ATOM(eulergamma_, "eulergamma")
GK_ATOM(exists_, "exists")
GK_ATOM(exp_, "exp")
GK_ATOM(exponentiale_, "exponentiale")
GK_ATOM(factorial_, "factorial")
GK_ATOM(factorof_, "factorof")
GK_ATOM(fence_, "fence")
GK_ATOM(fn_, "fn")
GK_ATOM(fontfamily_, "fontfamily")
@ -1427,32 +1470,50 @@ GK_ATOM(fontstyle_, "fontstyle")
GK_ATOM(fontweight_, "fontweight")
GK_ATOM(forall_, "forall")
GK_ATOM(framespacing_, "framespacing")
GK_ATOM(gcd_, "gcd")
GK_ATOM(geq_, "geq")
GK_ATOM(groupalign_, "groupalign")
GK_ATOM(gt_, "gt")
GK_ATOM(ident_, "ident")
GK_ATOM(imaginaryi_, "imaginaryi")
GK_ATOM(imaginary_, "imaginary")
GK_ATOM(implies_, "implies")
GK_ATOM(int_, "int")
GK_ATOM(indentalignfirst_, "indentalignfirst")
GK_ATOM(indentalign_, "indentalign")
GK_ATOM(indentalignlast_, "indentalignlast")
GK_ATOM(indentshiftfirst_, "indentshiftfirst")
GK_ATOM(indentshift_, "indentshift")
GK_ATOM(indenttarget_, "indenttarget")
GK_ATOM(integers_, "integers")
GK_ATOM(intersect_, "intersect")
GK_ATOM(interval_, "interval")
GK_ATOM(int_, "int")
GK_ATOM(inverse_, "inverse")
GK_ATOM(lambda_, "lambda")
GK_ATOM(laplacian_, "laplacian")
GK_ATOM(largeop_, "largeop")
GK_ATOM(lcm_, "lcm")
GK_ATOM(leq_, "leq")
GK_ATOM(limit_, "limit")
GK_ATOM(linebreak_, "linebreak")
GK_ATOM(linebreakmultchar_, "linebreakmultchar")
GK_ATOM(linebreakstyle_, "linebreakstyle")
GK_ATOM(linethickness_, "linethickness")
GK_ATOM(list_, "list")
GK_ATOM(ln_, "ln")
GK_ATOM(log_, "log")
GK_ATOM(location_, "location")
GK_ATOM(logbase_, "logbase")
GK_ATOM(log_, "log")
GK_ATOM(longdivstyle_, "longdivstyle")
GK_ATOM(lowlimit_, "lowlimit")
GK_ATOM(lquote_, "lquote")
GK_ATOM(lspace_, "lspace")
GK_ATOM(lt_, "lt")
GK_ATOM(maction_, "maction")
GK_ATOM(maligngroup_, "maligngroup")
GK_ATOM(malign_, "malign")
GK_ATOM(malignmark_, "malignmark")
GK_ATOM(malignscope_, "malignscope")
GK_ATOM(mathbackground_, "mathbackground")
GK_ATOM(mathcolor_, "mathcolor")
GK_ATOM(mathsize_, "mathsize")
@ -1466,15 +1527,20 @@ GK_ATOM(menclose_, "menclose")
GK_ATOM(merror_, "merror")
GK_ATOM(mfenced_, "mfenced")
GK_ATOM(mfrac_, "mfrac")
GK_ATOM(mfraction_, "mfraction")
GK_ATOM(mglyph_, "mglyph")
GK_ATOM(mi_, "mi")
GK_ATOM(minlabelspacing_, "minlabelspacing")
GK_ATOM(minsize_, "minsize")
GK_ATOM(minus_, "minus")
GK_ATOM(mlabeledtr_, "mlabeledtr")
GK_ATOM(mlongdiv_, "mlongdiv")
GK_ATOM(mmultiscripts_, "mmultiscripts")
GK_ATOM(mn_, "mn")
GK_ATOM(mo_, "mo")
GK_ATOM(momentabout_, "momentabout")
GK_ATOM(moment_, "moment")
GK_ATOM(mo_, "mo")
GK_ATOM(monospaced_, "monospaced")
GK_ATOM(movablelimits_, "movablelimits")
GK_ATOM(mover_, "mover")
GK_ATOM(mpadded_, "mpadded")
@ -1482,9 +1548,15 @@ GK_ATOM(mphantom_, "mphantom")
GK_ATOM(mprescripts_, "mprescripts")
GK_ATOM(mroot_, "mroot")
GK_ATOM(mrow_, "mrow")
GK_ATOM(mscarries_, "mscarries")
GK_ATOM(mscarry_, "mscarry")
GK_ATOM(msgroup_, "msgroup")
GK_ATOM(msline_, "msline")
GK_ATOM(ms_, "ms")
GK_ATOM(mspace_, "mspace")
GK_ATOM(msqrt_, "msqrt")
GK_ATOM(msrow_, "msrow")
GK_ATOM(mstack_, "mstack")
GK_ATOM(mstyle_, "mstyle")
GK_ATOM(msub_, "msub")
GK_ATOM(msubsup_, "msubsup")
@ -1495,19 +1567,37 @@ GK_ATOM(mtext_, "mtext")
GK_ATOM(mtr_, "mtr")
GK_ATOM(munder_, "munder")
GK_ATOM(munderover_, "munderover")
GK_ATOM(naturalnumbers_, "naturalnumbers")
GK_ATOM(negativemediummathspace_, "negativemediummathspace")
GK_ATOM(negativethickmathspace_, "negativethickmathspace")
GK_ATOM(negativethinmathspace_, "negativethinmathspace")
GK_ATOM(negativeverythickmathspace_, "negativeverythickmathspace")
GK_ATOM(negativeverythinmathspace_, "negativeverythinmathspace")
GK_ATOM(negativeveryverythickmathspace_, "negativeveryverythickmathspace")
GK_ATOM(negativeveryverythinmathspace_, "negativeveryverythinmathspace")
GK_ATOM(neq_, "neq")
GK_ATOM(notanumber_, "notanumber")
GK_ATOM(notation_, "notation")
GK_ATOM(note_, "note")
GK_ATOM(notin_, "notin")
GK_ATOM(notprsubset_, "notprsubset")
GK_ATOM(notsubset_, "notsubset")
GK_ATOM(numalign_, "numalign")
GK_ATOM(other_, "other")
GK_ATOM(outerproduct_, "outerproduct")
GK_ATOM(partialdiff_, "partialdiff")
GK_ATOM(piece_, "piece")
GK_ATOM(piecewise_, "piecewise")
GK_ATOM(pi_, "pi")
GK_ATOM(plus_, "plus")
GK_ATOM(power_, "power")
GK_ATOM(primes_, "primes")
GK_ATOM(product_, "product")
GK_ATOM(prsubset_, "prsubset")
GK_ATOM(quotient_, "quotient")
GK_ATOM(rationals_, "rationals")
GK_ATOM(real_, "real")
GK_ATOM(reals_, "reals")
GK_ATOM(reln_, "reln")
GK_ATOM(root_, "root")
GK_ATOM(rowalign_, "rowalign")
@ -1515,29 +1605,36 @@ GK_ATOM(rowlines_, "rowlines")
GK_ATOM(rowspacing_, "rowspacing")
GK_ATOM(rquote_, "rquote")
GK_ATOM(rspace_, "rspace")
GK_ATOM(scalarproduct_, "scalarproduct")
GK_ATOM(schemaLocation_, "schemaLocation")
GK_ATOM(scriptlevel_, "scriptlevel")
GK_ATOM(scriptminsize_, "scriptminsize")
GK_ATOM(scriptsizemultiplier_, "scriptsizemultiplier")
GK_ATOM(scriptsize_, "scriptsize")
GK_ATOM(sdev_, "sdev")
GK_ATOM(sec_, "sec")
GK_ATOM(sech_, "sech")
GK_ATOM(sec_, "sec")
GK_ATOM(selection_, "selection")
GK_ATOM(selector_, "selector")
GK_ATOM(semantics_, "semantics")
GK_ATOM(sep_, "sep")
GK_ATOM(separator_, "separator")
GK_ATOM(separators_, "separators")
GK_ATOM(set_, "set")
GK_ATOM(sep_, "sep")
GK_ATOM(setdiff_, "setdiff")
GK_ATOM(set_, "set")
GK_ATOM(share_, "share")
GK_ATOM(shift_, "shift")
GK_ATOM(side_, "side")
GK_ATOM(sin_, "sin")
GK_ATOM(sinh_, "sinh")
GK_ATOM(sin_, "sin")
GK_ATOM(stackalign_, "stackalign")
GK_ATOM(stretchy_, "stretchy")
GK_ATOM(subscriptshift_, "subscriptshift")
GK_ATOM(subset_, "subset")
GK_ATOM(superscriptshift_, "superscriptshift")
GK_ATOM(symmetric_, "symmetric")
GK_ATOM(tan_, "tan")
GK_ATOM(tanh_, "tanh")
GK_ATOM(tan_, "tan")
GK_ATOM(tendsto_, "tendsto")
GK_ATOM(thickmathspace_, "thickmathspace")
GK_ATOM(thinmathspace_, "thinmathspace")
@ -1545,12 +1642,15 @@ GK_ATOM(times_, "times")
GK_ATOM(transpose_, "transpose")
GK_ATOM(union_, "union")
GK_ATOM(uplimit_, "uplimit")
GK_ATOM(var_, "var")
GK_ATOM(variance_, "variance")
GK_ATOM(vectorproduct_, "vectorproduct")
GK_ATOM(vector_, "vector")
GK_ATOM(verythickmathspace_, "verythickmathspace")
GK_ATOM(verythinmathspace_, "verythinmathspace")
GK_ATOM(veryverythickmathspace_, "veryverythickmathspace")
GK_ATOM(veryverythinmathspace_, "veryverythinmathspace")
GK_ATOM(voffset_, "voffset")
GK_ATOM(xref_, "xref")
GK_ATOM(math, "math") // the only one without an underscore
#endif

Просмотреть файл

@ -16,12 +16,14 @@
* The Original Code is Gecko code.
*
* The Initial Developer of the Original Code is
* Mozilla Corporation
* the Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Vladimir Vukicevic <vladimir@pobox.com> (original author)
* Ms2ger <ms2ger@gmail.com>
* Yury <async.processingjs@yahoo.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
@ -39,6 +41,8 @@
#include "nsDOMError.h"
#include "nsIDOMCanvasRenderingContext2D.h"
#include "CheckedInt.h"
#include "nsMathUtils.h"
typedef nsresult (NS_STDCALL nsIDOMCanvasRenderingContext2D::*CanvasStyleSetterType)(const nsAString &, nsISupports *);
typedef nsresult (NS_STDCALL nsIDOMCanvasRenderingContext2D::*CanvasStyleGetterType)(nsAString &, nsISupports **, PRInt32 *);
@ -153,6 +157,95 @@ nsIDOMCanvasRenderingContext2D_GetFillStyle(JSContext *cx, JSObject *obj, jsid i
return Canvas2D_GetStyleHelper(cx, obj, id, vp, &nsIDOMCanvasRenderingContext2D::GetFillStyle_multi);
}
static bool
CreateImageData(JSContext* cx,
uint32 w,
uint32 h,
nsIDOMCanvasRenderingContext2D* self,
int32 x,
int32 y,
jsval* vp)
{
using mozilla::CheckedInt;
if (w == 0)
w = 1;
if (h == 0)
h = 1;
CheckedInt<uint32> len = CheckedInt<uint32>(w) * h * 4;
if (!len.valid()) {
return xpc_qsThrow(cx, NS_ERROR_DOM_INDEX_SIZE_ERR);
}
// Create the fast typed array; it's initialized to 0 by default.
JSObject* darray =
js_CreateTypedArray(cx, js::TypedArray::TYPE_UINT8_CLAMPED, len.value());
js::AutoObjectRooter rd(cx, darray);
if (!darray) {
return false;
}
if (self) {
js::TypedArray* tdest = js::TypedArray::fromJSObject(darray);
// make the call
nsresult rv =
self->GetImageData_explicit(x, y, w, h,
static_cast<PRUint8*>(tdest->data),
tdest->byteLength);
if (NS_FAILED(rv)) {
return xpc_qsThrowMethodFailed(cx, rv, vp);
}
}
// Do JS_NewObject after CreateTypedArray, so that gc will get
// triggered here if necessary
JSObject* result = JS_NewObject(cx, NULL, NULL, NULL);
js::AutoObjectRooter rr(cx, result);
if (!result) {
return false;
}
if (!JS_DefineProperty(cx, result, "width", INT_TO_JSVAL(w), NULL, NULL,
JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT) ||
!JS_DefineProperty(cx, result, "height", INT_TO_JSVAL(h), NULL, NULL,
JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT) ||
!JS_DefineProperty(cx, result, "data", OBJECT_TO_JSVAL(darray), NULL, NULL,
JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT)) {
return false;
}
*vp = OBJECT_TO_JSVAL(result);
return true;
}
static bool
GetImageDataDimensions(JSContext *cx, JSObject *dataObject, uint32 *width, uint32 *height)
{
jsval temp;
int32 wi, hi;
// Need to check that dataObject is ImageData object. That's hard for the moment
// because they're just vanilla objects in our implementation.
// Let's guess, if the object has valid width and height then it's suitable
// for this operation.
if (!JS_GetProperty(cx, dataObject, "width", &temp) ||
!JS_ValueToECMAInt32(cx, temp, &wi))
return false;
if (!JS_GetProperty(cx, dataObject, "height", &temp) ||
!JS_ValueToECMAInt32(cx, temp, &hi))
return false;
if (wi <= 0 || hi <= 0)
return xpc_qsThrow(cx, NS_ERROR_DOM_INDEX_SIZE_ERR);
*width = (uint32)wi;
*height = (uint32)hi;
return true;
}
static JSBool
nsIDOMCanvasRenderingContext2D_CreateImageData(JSContext *cx, uintN argc, jsval *vp)
{
@ -160,51 +253,43 @@ nsIDOMCanvasRenderingContext2D_CreateImageData(JSContext *cx, uintN argc, jsval
/* Note: this doesn't need JS_THIS_OBJECT */
if (argc < 2)
if (argc < 1)
return xpc_qsThrow(cx, NS_ERROR_XPC_NOT_ENOUGH_ARGS);
jsval *argv = JS_ARGV(cx, vp);
int32 wi, hi;
if (!JS_ValueToECMAInt32(cx, argv[0], &wi) ||
!JS_ValueToECMAInt32(cx, argv[1], &hi))
return JS_FALSE;
if (argc == 1) {
// The specification asks to throw NOT_SUPPORTED if first argument is NULL,
// An object is expected, so throw an exception for all primitives.
if (JSVAL_IS_PRIMITIVE(argv[0]))
return xpc_qsThrow(cx, NS_ERROR_DOM_NOT_SUPPORTED_ERR);
if (wi <= 0 || hi <= 0)
JSObject *dataObject = JSVAL_TO_OBJECT(argv[0]);
uint32 data_width, data_height;
if (!GetImageDataDimensions(cx, dataObject, &data_width, &data_height))
return false;
return CreateImageData(cx, data_width, data_height, NULL, 0, 0, vp);
}
jsdouble width, height;
if (!JS_ValueToNumber(cx, argv[0], &width) ||
!JS_ValueToNumber(cx, argv[1], &height))
return false;
if (!NS_finite(width) || !NS_finite(height))
return xpc_qsThrow(cx, NS_ERROR_DOM_NOT_SUPPORTED_ERR);
if (!width || !height)
return xpc_qsThrow(cx, NS_ERROR_DOM_INDEX_SIZE_ERR);
uint32 w = (uint32) wi;
uint32 h = (uint32) hi;
int32 wi = JS_DoubleToInt32(width);
int32 hi = JS_DoubleToInt32(height);
/* Sanity check w * h here */
uint32 len0 = w * h;
if (len0 / w != (uint32) h)
return xpc_qsThrow(cx, NS_ERROR_DOM_INDEX_SIZE_ERR);
uint32 len = len0 * 4;
if (len / 4 != len0)
return xpc_qsThrow(cx, NS_ERROR_DOM_INDEX_SIZE_ERR);
// create the fast typed array; it's initialized to 0 by default
JSObject *darray = js_CreateTypedArray(cx, js::TypedArray::TYPE_UINT8_CLAMPED, len);
js::AutoObjectRooter rd(cx, darray);
if (!darray)
return JS_FALSE;
// Do JS_NewObject after CreateTypedArray, so that gc will get
// triggered here if necessary
JSObject *result = JS_NewObject(cx, NULL, NULL, NULL);
js::AutoObjectRooter rr(cx, result);
if (!result)
return JS_FALSE;
if (!JS_DefineProperty(cx, result, "width", INT_TO_JSVAL(w), NULL, NULL, JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT) ||
!JS_DefineProperty(cx, result, "height", INT_TO_JSVAL(h), NULL, NULL, JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT) ||
!JS_DefineProperty(cx, result, "data", OBJECT_TO_JSVAL(darray), NULL, NULL, JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT))
return JS_FALSE;
*vp = OBJECT_TO_JSVAL(result);
return JS_TRUE;
uint32 w = PR_ABS(wi);
uint32 h = PR_ABS(hi);
return CreateImageData(cx, w, h, NULL, 0, 0, vp);
}
static JSBool
@ -216,8 +301,6 @@ nsIDOMCanvasRenderingContext2D_GetImageData(JSContext *cx, uintN argc, jsval *vp
if (!obj)
return JS_FALSE;
nsresult rv;
nsIDOMCanvasRenderingContext2D *self;
xpc_qsSelfRef selfref;
js::AutoValueRooter tvr(cx);
@ -229,56 +312,41 @@ nsIDOMCanvasRenderingContext2D_GetImageData(JSContext *cx, uintN argc, jsval *vp
jsval *argv = JS_ARGV(cx, vp);
int32 x, y;
int32 wi, hi;
if (!JS_ValueToECMAInt32(cx, argv[0], &x) ||
!JS_ValueToECMAInt32(cx, argv[1], &y) ||
!JS_ValueToECMAInt32(cx, argv[2], &wi) ||
!JS_ValueToECMAInt32(cx, argv[3], &hi))
return JS_FALSE;
jsdouble xd, yd, width, height;
if (!JS_ValueToNumber(cx, argv[0], &xd) ||
!JS_ValueToNumber(cx, argv[1], &yd) ||
!JS_ValueToNumber(cx, argv[2], &width) ||
!JS_ValueToNumber(cx, argv[3], &height))
return false;
if (wi <= 0 || hi <= 0)
if (!NS_finite(xd) || !NS_finite(yd) ||
!NS_finite(width) || !NS_finite(height))
return xpc_qsThrow(cx, NS_ERROR_DOM_NOT_SUPPORTED_ERR);
if (!width || !height)
return xpc_qsThrow(cx, NS_ERROR_DOM_INDEX_SIZE_ERR);
uint32 w = (uint32) wi;
uint32 h = (uint32) hi;
int32 x = JS_DoubleToInt32(xd);
int32 y = JS_DoubleToInt32(yd);
int32 wi = JS_DoubleToInt32(width);
int32 hi = JS_DoubleToInt32(height);
// Sanity check w * h here
uint32 len0 = w * h;
if (len0 / w != (uint32) h)
return xpc_qsThrow(cx, NS_ERROR_DOM_INDEX_SIZE_ERR);
uint32 len = len0 * 4;
if (len / 4 != len0)
return xpc_qsThrow(cx, NS_ERROR_DOM_INDEX_SIZE_ERR);
// create the fast typed array
JSObject *darray = js_CreateTypedArray(cx, js::TypedArray::TYPE_UINT8_CLAMPED, len);
js::AutoObjectRooter rd(cx, darray);
if (!darray)
return JS_FALSE;
js::TypedArray *tdest = js::TypedArray::fromJSObject(darray);
// make the call
rv = self->GetImageData_explicit(x, y, w, h, (PRUint8*) tdest->data, tdest->byteLength);
if (NS_FAILED(rv))
return xpc_qsThrowMethodFailed(cx, rv, vp);
// Do JS_NewObject after CreateTypedArray, so that gc will get
// triggered here if necessary
JSObject *result = JS_NewObject(cx, NULL, NULL, NULL);
js::AutoObjectRooter rr(cx, result);
if (!result)
return JS_FALSE;
if (!JS_DefineProperty(cx, result, "width", INT_TO_JSVAL(w), NULL, NULL, JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT) ||
!JS_DefineProperty(cx, result, "height", INT_TO_JSVAL(h), NULL, NULL, JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT) ||
!JS_DefineProperty(cx, result, "data", OBJECT_TO_JSVAL(darray), NULL, NULL, JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT))
return JS_FALSE;
*vp = OBJECT_TO_JSVAL(result);
return JS_TRUE;
// Handle negative width and height by flipping the rectangle over in the
// relevant direction.
uint32 w, h;
if (width < 0) {
w = -wi;
x -= w;
} else {
w = wi;
}
if (height < 0) {
h = -hi;
y -= h;
} else {
h = hi;
}
return CreateImageData(cx, w, h, self, x, y, vp);
}
static JSBool
@ -312,26 +380,15 @@ nsIDOMCanvasRenderingContext2D_PutImageData(JSContext *cx, uintN argc, jsval *vp
!JS_ValueToECMAInt32(cx, argv[2], &y))
return JS_FALSE;
int32 wi, hi;
uint32 w, h;
JSObject *darray;
// grab width, height, and the dense array from the dataObject
js::AutoValueRooter tv(cx);
if (!JS_GetProperty(cx, dataObject, "width", tv.jsval_addr()) ||
!JS_ValueToECMAInt32(cx, tv.jsval_value(), &wi))
if (!GetImageDataDimensions(cx, dataObject, &w, &h))
return JS_FALSE;
if (!JS_GetProperty(cx, dataObject, "height", tv.jsval_addr()) ||
!JS_ValueToECMAInt32(cx, tv.jsval_value(), &hi))
return JS_FALSE;
if (wi <= 0 || hi <= 0)
return xpc_qsThrow(cx, NS_ERROR_DOM_INDEX_SIZE_ERR);
uint32 w = (uint32) wi;
uint32 h = (uint32) hi;
// the optional dirty rect
PRBool hasDirtyRect = PR_FALSE;
int32 dirtyX = 0,

Просмотреть файл

@ -55,14 +55,9 @@ CPPSRCS = \
CanvasImageCache.cpp \
CanvasUtils.cpp \
nsCanvasRenderingContext2D.cpp \
$(NULL)
ifdef MOZ_IPC
CPPSRCS += \
DocumentRendererParent.cpp \
DocumentRendererChild.cpp \
$(NULL)
endif
# Canvas 3D Pieces

Просмотреть файл

@ -38,24 +38,15 @@
*
* ***** END LICENSE BLOCK ***** */
#ifdef MOZ_IPC
# include "base/basictypes.h"
#endif
#include "base/basictypes.h"
#include "nsIDOMXULElement.h"
#ifdef _MSC_VER
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#if defined(XP_WIN) || defined(XP_OS2)
#include <float.h>
#endif
#include "prmem.h"
#include "prenv.h"
#include "nsIServiceManager.h"
#include "nsMathUtils.h"
#include "nsContentUtils.h"
@ -64,6 +55,7 @@
#include "nsIDOMCanvasRenderingContext2D.h"
#include "nsICanvasRenderingContextInternal.h"
#include "nsHTMLCanvasElement.h"
#include "nsSVGEffects.h"
#include "nsPresContext.h"
#include "nsIPresShell.h"
#include "nsIVariant.h"
@ -120,51 +112,23 @@
#include "nsStyleUtil.h"
#include "CanvasImageCache.h"
#ifdef MOZ_IPC
# include <algorithm>
# include "mozilla/dom/ContentParent.h"
# include "mozilla/ipc/PDocumentRendererParent.h"
# include "mozilla/dom/PBrowserParent.h"
# include "mozilla/ipc/DocumentRendererParent.h"
#include <algorithm>
#include "mozilla/dom/ContentParent.h"
#include "mozilla/ipc/PDocumentRendererParent.h"
#include "mozilla/dom/PBrowserParent.h"
#include "mozilla/ipc/DocumentRendererParent.h"
// windows.h (included by chromium code) defines this, in its infinite wisdom
# undef DrawText
#undef DrawText
using namespace mozilla::ipc;
#endif
#ifdef MOZ_SVG
#include "nsSVGEffects.h"
#endif
using namespace mozilla;
using namespace mozilla::layers;
using namespace mozilla::dom;
#ifndef M_PI
#define M_PI 3.14159265358979323846
#define M_PI_2 1.57079632679489661923
#endif
/* Float validation stuff */
static inline bool
DoubleIsFinite(double d)
{
#ifdef WIN32
// NOTE: '!!' casts an int to bool without spamming MSVC warning C4800.
return !!_finite(d);
#else
return finite(d);
#endif
}
#define VALIDATE(_f) if (!DoubleIsFinite(_f)) return PR_FALSE
/* These must take doubles as args, because JSDOUBLE_IS_FINITE expects
* to take the address of its argument; we can't cast/convert in the
* macro.
*/
#define VALIDATE(_f) if (!NS_finite(_f)) return PR_FALSE
static PRBool FloatValidate (double f1) {
VALIDATE(f1);
@ -1237,7 +1201,6 @@ nsCanvasRenderingContext2D::SetIsOpaque(PRBool isOpaque)
NS_IMETHODIMP
nsCanvasRenderingContext2D::SetIsIPC(PRBool isIPC)
{
#ifdef MOZ_IPC
if (isIPC == mIPC)
return NS_OK;
@ -1251,9 +1214,6 @@ nsCanvasRenderingContext2D::SetIsIPC(PRBool isIPC)
}
return NS_OK;
#else
return NS_ERROR_NOT_IMPLEMENTED;
#endif
}
NS_IMETHODIMP
@ -1430,7 +1390,7 @@ NS_IMETHODIMP
nsCanvasRenderingContext2D::Translate(float x, float y)
{
if (!FloatValidate(x,y))
return NS_ERROR_DOM_SYNTAX_ERR;
return NS_OK;
mThebes->Translate(gfxPoint(x, y));
return NS_OK;
@ -1440,7 +1400,7 @@ NS_IMETHODIMP
nsCanvasRenderingContext2D::Transform(float m11, float m12, float m21, float m22, float dx, float dy)
{
if (!FloatValidate(m11,m12,m21,m22,dx,dy))
return NS_ERROR_DOM_SYNTAX_ERR;
return NS_OK;
gfxMatrix matrix(m11, m12, m21, m22, dx, dy);
mThebes->Multiply(matrix);
@ -1657,6 +1617,9 @@ nsCanvasRenderingContext2D::CreateRadialGradient(float x0, float y0, float r0, f
if (!FloatValidate(x0,y0,r0,x1,y1,r1))
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
if (r0 < 0.0 || r1 < 0.0)
return NS_ERROR_DOM_INDEX_SIZE_ERR;
nsRefPtr<gfxPattern> gradpat = new gfxPattern(x0, y0, r0, x1, y1, r1);
if (!gradpat)
return NS_ERROR_OUT_OF_MEMORY;
@ -1674,6 +1637,9 @@ nsCanvasRenderingContext2D::CreatePattern(nsIDOMHTMLElement *image,
const nsAString& repeat,
nsIDOMCanvasPattern **_retval)
{
if (!image) {
return NS_ERROR_DOM_TYPE_MISMATCH_ERR;
}
gfxPattern::GraphicsExtend extend;
if (repeat.IsEmpty() || repeat.EqualsLiteral("repeat")) {
@ -2072,7 +2038,7 @@ NS_IMETHODIMP
nsCanvasRenderingContext2D::MoveTo(float x, float y)
{
if (!FloatValidate(x,y))
return NS_ERROR_DOM_SYNTAX_ERR;
return NS_OK;
mHasPath = PR_TRUE;
mThebes->MoveTo(gfxPoint(x, y));
@ -2083,7 +2049,7 @@ NS_IMETHODIMP
nsCanvasRenderingContext2D::LineTo(float x, float y)
{
if (!FloatValidate(x,y))
return NS_ERROR_DOM_SYNTAX_ERR;
return NS_OK;
mHasPath = PR_TRUE;
mThebes->LineTo(gfxPoint(x, y));
@ -2094,7 +2060,7 @@ NS_IMETHODIMP
nsCanvasRenderingContext2D::QuadraticCurveTo(float cpx, float cpy, float x, float y)
{
if (!FloatValidate(cpx,cpy,x,y))
return NS_ERROR_DOM_SYNTAX_ERR;
return NS_OK;
// we will always have a current point, since beginPath forces
// a moveto(0,0)
@ -2206,7 +2172,7 @@ NS_IMETHODIMP
nsCanvasRenderingContext2D::Rect(float x, float y, float w, float h)
{
if (!FloatValidate(x,y,w,h))
return NS_ERROR_DOM_SYNTAX_ERR;
return NS_OK;
mHasPath = PR_TRUE;
mThebes->Rectangle(gfxRect(x, y, w, h));
@ -3365,7 +3331,9 @@ nsCanvasRenderingContext2D::DrawImage(nsIDOMElement *imgElt, float a1,
float a6, float a7, float a8,
PRUint8 optional_argc)
{
NS_ENSURE_ARG(imgElt);
if (!imgElt) {
return NS_ERROR_DOM_TYPE_MISMATCH_ERR;
}
double sx,sy,sw,sh;
double dx,dy,dw,dh;
@ -3767,7 +3735,6 @@ nsCanvasRenderingContext2D::AsyncDrawXULElement(nsIDOMXULElement* aElem, float a
if (!frameloader)
return NS_ERROR_FAILURE;
#ifdef MOZ_IPC
PBrowserParent *child = frameloader->GetRemoteBrowser();
if (!child) {
nsCOMPtr<nsIDOMWindow> window =
@ -3815,14 +3782,6 @@ nsCanvasRenderingContext2D::AsyncDrawXULElement(nsIDOMXULElement* aElem, float a
}
return NS_OK;
#else
nsCOMPtr<nsIDOMWindow> window =
do_GetInterface(frameloader->GetExistingDocShell());
if (!window)
return NS_ERROR_FAILURE;
return DrawWindow(window, aX, aY, aW, aH, aBGColor, flags);
#endif
}
//

Просмотреть файл

@ -3497,7 +3497,7 @@ var ctx = canvas.getContext('2d');
var _thrown = undefined; try {
ctx.drawImage(null, 0, 0);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.TYPE_MISMATCH_ERR, "should throw TYPE_MISMATCH_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.TYPE_MISMATCH_ERR, "should throw TYPE_MISMATCH_ERR");
}
@ -3669,7 +3669,7 @@ var ctx = canvas.getContext('2d');
var _thrown = undefined; try {
ctx.drawImage(undefined, 0, 0);
} catch (e) { _thrown = e }; ok(_thrown && _thrown.result == Components.results.NS_ERROR_INVALID_ARG, "should throw NS_ERROR_INVALID_ARG");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.TYPE_MISMATCH_ERR, "should throw TYPE_MISMATCH_ERR");
var _thrown = undefined; try {
ctx.drawImage(0, 0, 0);
} catch (e) { _thrown = e }; ok(_thrown && _thrown.result == Components.results.NS_ERROR_XPC_BAD_CONVERT_JS_ZERO_ISNOT_NULL, "should throw NS_ERROR_XPC_BAD_CONVERT_JS_ZERO_ISNOT_NULL");
@ -6647,13 +6647,13 @@ var ctx = canvas.getContext('2d');
var _thrown = undefined; try {
ctx.createRadialGradient(0, 0, -0.1, 0, 0, 1);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw INDEX_SIZE_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw INDEX_SIZE_ERR");
var _thrown = undefined; try {
ctx.createRadialGradient(0, 0, 1, 0, 0, -0.1);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw INDEX_SIZE_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw INDEX_SIZE_ERR");
var _thrown = undefined; try {
ctx.createRadialGradient(0, 0, -0.1, 0, 0, -0.1);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw INDEX_SIZE_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw INDEX_SIZE_ERR");
}
@ -7227,6 +7227,24 @@ var ctx = canvas.getContext('2d');
ok(ctx.createImageData(1, 1) !== null, "ctx.createImageData(1, 1) !== null");
}
</script>
<!-- [[[ test_2d.imageData.create1.basic.html ]]] -->
<p>Canvas test: 2d.imageData.create1.basic - bug 630040</p>
<!-- Testing: createImageData(imgdata) exists and returns something -->
<canvas id="c254a" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function test_2d_imageData_create1_basic() {
var canvas = document.getElementById('c254a');
var ctx = canvas.getContext('2d');
ok(ctx.createImageData(ctx.createImageData(1, 1)) != null, "ctx.createImageData(ctx.createImageData(1, 1)) != null");
}
</script>
@ -7253,6 +7271,35 @@ for (var i = 0; i < imgdata.data.length; ++i)
ok(isTransparentBlack, "isTransparentBlack");
}
</script>
<!-- [[[ test_2d.imageData.create1.initial.html ]]] -->
<p>Canvas test: 2d.imageData.create1.initial - bug 630040</p>
<!-- Testing: createImageData(imgdata) returns transparent black data of the right size -->
<canvas id="c255a" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function test_2d_imageData_create1_initial() {
var canvas = document.getElementById('c255a');
var ctx = canvas.getContext('2d');
ctx.fillStyle = '#0f0';
ctx.fillRect(0, 0, 100, 50);
var imgdata1 = ctx.getImageData(0, 0, 10, 20);
var imgdata2 = ctx.createImageData(imgdata1);
ok(imgdata2.data.length == imgdata1.data.length, "imgdata2.data.length == imgdata1.data.length");
ok(imgdata2.width == imgdata1.width, "imgdata2.width == imgdata1.width");
ok(imgdata2.height == imgdata1.height, "imgdata2.height == imgdata1.height");
var isTransparentBlack = true;
for (var i = 0; i < imgdata2.data.length; ++i)
if (imgdata2.data[i] !== 0)
isTransparentBlack = false;
ok(isTransparentBlack, "isTransparentBlack");
}
</script>
@ -7310,7 +7357,7 @@ ok(imgdata3.data.length == imgdata4.data.length, "imgdata3.data.length == imgdat
} catch (e) {
_thrown_outer = true;
}
todo(!_thrown_outer, 'should not throw exception');
ok(!_thrown_outer, 'should not throw exception');
}
@ -7330,25 +7377,46 @@ var ctx = canvas.getContext('2d');
var _thrown = undefined; try {
ctx.createImageData(Infinity, 10);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.createImageData(-Infinity, 10);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.createImageData(NaN, 10);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.createImageData(10, Infinity);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.createImageData(10, -Infinity);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.createImageData(10, NaN);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.createImageData(Infinity, Infinity);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.createImageData({valueOf:function() Infinity}, 10);
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.createImageData({valueOf:function() -Infinity}, 10);
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.createImageData({valueOf:function() NaN}, 10);
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.createImageData(10, {valueOf:function() Infinity});
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.createImageData(10, {valueOf:function() -Infinity});
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.createImageData(10, {valueOf:function() NaN});
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.createImageData({valueOf:function() Infinity}, {valueOf:function() Infinity});
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
}
@ -7405,7 +7473,7 @@ ok(isTransparentBlack, "isTransparentBlack");
} catch (e) {
_thrown_outer = true;
}
todo(!_thrown_outer, 'should not throw exception');
ok(!_thrown_outer, 'should not throw exception');
}
@ -7440,6 +7508,38 @@ ok(imgdata.data.thisImplementsCanvasPixelArray, "imgdata.data.thisImplementsCanv
todo(!_thrown_outer, 'should not throw exception');
}
</script>
<!-- [[[ test_2d.imageData.create1.type.html ]]] -->
<p>Canvas test: 2d.imageData.create1.type - bug 630040</p>
<!-- Testing: createImageData(imgdata) returns an ImageData object containing a CanvasPixelArray object -->
<canvas id="c261a" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function test_2d_imageData_create1_type() {
var canvas = document.getElementById('c261a');
var ctx = canvas.getContext('2d');
var _thrown_outer = false;
try {
todo(window.ImageData !== undefined, "window.ImageData !== undefined");
todo(window.CanvasPixelArray !== undefined, "window.CanvasPixelArray !== undefined");
window.ImageData.prototype.thisImplementsImageData = true;
window.CanvasPixelArray.prototype.thisImplementsCanvasPixelArray = true;
var imgdata = ctx.createImageData(ctx.createImageData(1, 1));
todo(imgdata.thisImplementsImageData, "imgdata.thisImplementsImageData");
todo(imgdata.data.thisImplementsCanvasPixelArray, "imgdata.data.thisImplementsCanvasPixelArray");
} catch (e) {
_thrown_outer = true;
}
todo(!_thrown_outer, 'should not throw exception');
}
</script>
@ -7466,6 +7566,26 @@ var _thrown = undefined; try {
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw INDEX_SIZE_ERR");
}
</script>
<!-- [[[ test_2d.imageData.create1.zero.html ]]] -->
<p>Canvas test: 2d.imageData.create1.zero - bug 630040</p>
<!-- Testing: createImageData(null) throws NOT_SUPPORTED_ERR -->
<canvas id="c262a" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
function test_2d_imageData_create1_zero() {
var canvas = document.getElementById('c262a');
var ctx = canvas.getContext('2d');
var _thrown = undefined; try {
ctx.createImageData(null);
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
}
</script>
@ -7530,73 +7650,142 @@ var ctx = canvas.getContext('2d');
var _thrown = undefined; try {
ctx.getImageData(Infinity, 10, 10, 10);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(-Infinity, 10, 10, 10);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(NaN, 10, 10, 10);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(10, Infinity, 10, 10);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(10, -Infinity, 10, 10);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(10, NaN, 10, 10);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(10, 10, Infinity, 10);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(10, 10, -Infinity, 10);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(10, 10, NaN, 10);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(10, 10, 10, Infinity);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(10, 10, 10, -Infinity);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(10, 10, 10, NaN);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(Infinity, Infinity, 10, 10);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(Infinity, Infinity, Infinity, 10);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(Infinity, Infinity, Infinity, Infinity);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(Infinity, Infinity, 10, Infinity);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(Infinity, 10, Infinity, 10);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(Infinity, 10, Infinity, Infinity);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(Infinity, 10, 10, Infinity);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(10, Infinity, Infinity, 10);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(10, Infinity, Infinity, Infinity);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(10, Infinity, 10, Infinity);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(10, 10, Infinity, Infinity);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData({valueOf:function() Infinity}, 10, 10, 10);
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData({valueOf:function() -Infinity}, 10, 10, 10);
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData({valueOf:function() NaN}, 10, 10, 10);
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(10, {valueOf:function() Infinity}, 10, 10);
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(10, {valueOf:function() -Infinity}, 10, 10);
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(10, {valueOf:function() NaN}, 10, 10);
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(10, 10, {valueOf:function() Infinity}, 10);
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(10, 10, {valueOf:function() -Infinity}, 10);
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(10, 10, {valueOf:function() NaN}, 10);
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(10, 10, 10, {valueOf:function() Infinity});
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(10, 10, 10, {valueOf:function() -Infinity});
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(10, 10, 10, {valueOf:function() NaN});
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData({valueOf:function() Infinity}, {valueOf:function() Infinity}, 10, 10);
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData({valueOf:function() Infinity}, {valueOf:function() Infinity}, {valueOf:function() Infinity}, 10);
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData({valueOf:function() Infinity}, {valueOf:function() Infinity}, {valueOf:function() Infinity}, {valueOf:function() Infinity});
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData({valueOf:function() Infinity}, {valueOf:function() Infinity}, 10, {valueOf:function() Infinity});
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData({valueOf:function() Infinity}, 10, {valueOf:function() Infinity}, 10);
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData({valueOf:function() Infinity}, 10, {valueOf:function() Infinity}, {valueOf:function() Infinity});
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData({valueOf:function() Infinity}, 10, 10, {valueOf:function() Infinity});
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(10, {valueOf:function() Infinity}, {valueOf:function() Infinity}, 10);
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(10, {valueOf:function() Infinity}, {valueOf:function() Infinity}, {valueOf:function() Infinity});
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(10, {valueOf:function() Infinity}, 10, {valueOf:function() Infinity});
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.getImageData(10, 10, {valueOf:function() Infinity}, {valueOf:function() Infinity});
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
}
@ -7768,15 +7957,19 @@ ctx.fillRect(0, 0, 100, 50);
ctx.fillStyle = '#fff';
ctx.fillRect(20, 10, 60, 10);
var imgdata1 = ctx.getImageData(85, 25, -10, -10);
ok(imgdata1.data[0] === 255, "imgdata1.data[\""+(0)+"\"] === 255");
ok(imgdata1.data[1] === 255, "imgdata1.data[\""+(1)+"\"] === 255");
ok(imgdata1.data[2] === 255, "imgdata1.data[\""+(2)+"\"] === 255");
ok(imgdata1.data[3] === 255, "imgdata1.data[\""+(3)+"\"] === 255");
ok(imgdata1.data[imgdata1.data.length-4+0] === 0, "imgdata1.data[imgdata1.data.length-4+0] === 0");
ok(imgdata1.data[imgdata1.data.length-4+1] === 0, "imgdata1.data[imgdata1.data.length-4+1] === 0");
ok(imgdata1.data[imgdata1.data.length-4+2] === 0, "imgdata1.data[imgdata1.data.length-4+2] === 0");
ok(imgdata1.data[imgdata1.data.length-4+3] === 255, "imgdata1.data[imgdata1.data.length-4+3] === 255");
try {
var imgdata1 = ctx.getImageData(85, 25, -10, -10);
ok(imgdata1.data[0] === 255, "imgdata1.data[\""+(0)+"\"] === 255");
ok(imgdata1.data[1] === 255, "imgdata1.data[\""+(1)+"\"] === 255");
ok(imgdata1.data[2] === 255, "imgdata1.data[\""+(2)+"\"] === 255");
ok(imgdata1.data[3] === 255, "imgdata1.data[\""+(3)+"\"] === 255");
ok(imgdata1.data[imgdata1.data.length-4+0] === 0, "imgdata1.data[imgdata1.data.length-4+0] === 0");
ok(imgdata1.data[imgdata1.data.length-4+1] === 0, "imgdata1.data[imgdata1.data.length-4+1] === 0");
ok(imgdata1.data[imgdata1.data.length-4+2] === 0, "imgdata1.data[imgdata1.data.length-4+2] === 0");
ok(imgdata1.data[imgdata1.data.length-4+3] === 255, "imgdata1.data[imgdata1.data.length-4+3] === 255");
} catch (e) {
ok(false, "Unexpected exception in first part of test_2d_imageData_get_source_negative()", e);
}
var imgdata2 = ctx.getImageData(0, 0, -1, -1);
ok(imgdata2.data[0] === 0, "imgdata2.data[\""+(0)+"\"] === 0");
@ -7888,7 +8081,7 @@ ok(imgdata.height == 1, "imgdata.height == 1");
} catch (e) {
_thrown_outer = true;
}
todo(!_thrown_outer, 'should not throw exception');
ok(!_thrown_outer, 'should not throw exception');
}
@ -10458,7 +10651,7 @@ if (ctx.createImageData) {
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
var _thrown = undefined; try {
ctx.createImageData(1);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NOT_SUPPORTED_ERR");
}
if (ctx.getImageData) {
var _thrown = undefined; try {
@ -13220,7 +13413,7 @@ isPixel(ctx, 90,45, 0,255,0,255, 0);
} catch (e) {
_thrown_outer = true;
}
todo(!_thrown_outer, 'should not throw exception');
ok(!_thrown_outer, 'should not throw exception');
}
@ -13335,7 +13528,7 @@ isPixel(ctx, 50,25, 0,255,0,255, 0);
} catch (e) {
_thrown_outer = true;
}
todo(!_thrown_outer, 'should not throw exception');
ok(!_thrown_outer, 'should not throw exception');
}
@ -13441,7 +13634,7 @@ isPixel(ctx, 90,45, 0,255,0,255, 0);
} catch (e) {
_thrown_outer = true;
}
todo(!_thrown_outer, 'should not throw exception');
ok(!_thrown_outer, 'should not throw exception');
}
@ -13705,7 +13898,7 @@ isPixel(ctx, 90,45, 0,255,0,255, 0);
} catch (e) {
_thrown_outer = true;
}
todo(!_thrown_outer, 'should not throw exception');
ok(!_thrown_outer, 'should not throw exception');
}
@ -14768,7 +14961,7 @@ var ctx = canvas.getContext('2d');
var _thrown = undefined; try {
ctx.createPattern(null, 'repeat');
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.TYPE_MISMATCH_ERR, "should throw TYPE_MISMATCH_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.TYPE_MISMATCH_ERR, "should throw TYPE_MISMATCH_ERR");
}
@ -14806,7 +14999,7 @@ var ctx = canvas.getContext('2d');
var _thrown = undefined; try {
ctx.createPattern(undefined, 'repeat');
} catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.TYPE_MISMATCH_ERR, "should throw TYPE_MISMATCH_ERR");
} catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.TYPE_MISMATCH_ERR, "should throw TYPE_MISMATCH_ERR");
}
@ -18916,7 +19109,7 @@ isPixel(ctx, 50,25, 0,255,0,255, 0);
} catch (e) {
_thrown_outer = true;
}
todo(!_thrown_outer, 'should not throw exception');
ok(!_thrown_outer, 'should not throw exception');
}
@ -19030,7 +19223,7 @@ isPixel(ctx, 50,25, 0,255,0,255, 0);
} catch (e) {
_thrown_outer = true;
}
todo(!_thrown_outer, 'should not throw exception');
ok(!_thrown_outer, 'should not throw exception');
}
@ -22142,11 +22335,21 @@ function runTests() {
} catch (e) {
ok(false, "unexpected exception thrown in: test_2d_imageData_create_basic");
}
try {
test_2d_imageData_create1_basic();
} catch (e) {
ok(false, "unexpected exception thrown in: test_2d_imageData_create1_basic");
}
try {
test_2d_imageData_create_initial();
} catch (e) {
ok(false, "unexpected exception thrown in: test_2d_imageData_create_initial");
}
try {
test_2d_imageData_create1_initial();
} catch (e) {
ok(false, "unexpected exception thrown in: test_2d_imageData_create1_initial");
}
try {
test_2d_imageData_create_large();
} catch (e) {
@ -22177,11 +22380,21 @@ function runTests() {
} catch (e) {
ok(false, "unexpected exception thrown in: test_2d_imageData_create_type");
}
try {
test_2d_imageData_create1_type();
} catch (e) {
ok(false, "unexpected exception thrown in: test_2d_imageData_create1_type");
}
try {
test_2d_imageData_create_zero();
} catch (e) {
ok(false, "unexpected exception thrown in: test_2d_imageData_create_zero");
}
try {
test_2d_imageData_create1_zero();
} catch (e) {
ok(false, "unexpected exception thrown in: test_2d_imageData_create1_zero");
}
try {
test_2d_imageData_get_basic();
} catch (e) {

Просмотреть файл

@ -37,10 +37,8 @@
*
* ***** END LICENSE BLOCK ***** */
#ifdef MOZ_IPC
#include "base/basictypes.h"
#include "IPC/IPCMessageUtils.h"
#endif
#include "nsCOMPtr.h"
#include "nsDOMEvent.h"
#include "nsEventStateManager.h"
@ -1370,7 +1368,6 @@ nsDOMEvent::GetPreventDefault(PRBool* aReturn)
void
nsDOMEvent::Serialize(IPC::Message* aMsg, PRBool aSerializeInterfaceType)
{
#ifdef MOZ_IPC
if (aSerializeInterfaceType) {
IPC::WriteParam(aMsg, NS_LITERAL_STRING("event"));
}
@ -1392,13 +1389,11 @@ nsDOMEvent::Serialize(IPC::Message* aMsg, PRBool aSerializeInterfaceType)
IPC::WriteParam(aMsg, trusted);
// No timestamp serialization for now!
#endif
}
PRBool
nsDOMEvent::Deserialize(const IPC::Message* aMsg, void** aIter)
{
#ifdef MOZ_IPC
nsString type;
NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &type), PR_FALSE);
@ -1416,9 +1411,6 @@ nsDOMEvent::Deserialize(const IPC::Message* aMsg, void** aIter)
SetTrusted(trusted);
return PR_TRUE;
#else
return PR_FALSE;
#endif
}

Просмотреть файл

@ -36,10 +36,8 @@
*
* ***** END LICENSE BLOCK ***** */
#ifdef MOZ_IPC
#include "base/basictypes.h"
#include "IPC/IPCMessageUtils.h"
#endif
#include "nsDOMNotifyPaintEvent.h"
#include "nsContentUtils.h"
#include "nsClientRect.h"
@ -148,7 +146,6 @@ nsDOMNotifyPaintEvent::GetPaintRequests(nsIDOMPaintRequestList** aResult)
return NS_OK;
}
#ifdef MOZ_IPC
void
nsDOMNotifyPaintEvent::Serialize(IPC::Message* aMsg,
PRBool aSerializeInterfaceType)
@ -190,7 +187,6 @@ nsDOMNotifyPaintEvent::Deserialize(const IPC::Message* aMsg, void** aIter)
return PR_TRUE;
}
#endif
nsresult NS_NewDOMNotifyPaintEvent(nsIDOMEvent** aInstancePtrResult,
nsPresContext* aPresContext,

Просмотреть файл

@ -61,10 +61,8 @@ public:
// Forward to base class
NS_FORWARD_TO_NSDOMEVENT
#ifdef MOZ_IPC
virtual void Serialize(IPC::Message* aMsg, PRBool aSerializeInterfaceType);
virtual PRBool Deserialize(const IPC::Message* aMsg, void** aIter);
#endif
private:
nsRegion GetRegion();

Просмотреть файл

@ -35,10 +35,8 @@
*
* ***** END LICENSE BLOCK ***** */
#ifdef MOZ_IPC
#include "base/basictypes.h"
#include "IPC/IPCMessageUtils.h"
#endif
#include "nsDOMScrollAreaEvent.h"
#include "nsGUIEvent.h"
@ -116,7 +114,6 @@ nsDOMScrollAreaEvent::InitScrollAreaEvent(const nsAString &aEventType,
return NS_OK;
}
#ifdef MOZ_IPC
void
nsDOMScrollAreaEvent::Serialize(IPC::Message* aMsg,
PRBool aSerializeInterfaceType)
@ -152,7 +149,6 @@ nsDOMScrollAreaEvent::Deserialize(const IPC::Message* aMsg, void** aIter)
return PR_TRUE;
}
#endif
nsresult
NS_NewDOMScrollAreaEvent(nsIDOMEvent **aInstancePtrResult,

Просмотреть файл

@ -58,10 +58,8 @@ public:
NS_FORWARD_TO_NSDOMUIEVENT
#ifdef MOZ_IPC
virtual void Serialize(IPC::Message* aMsg, PRBool aSerializeInterfaceType);
virtual PRBool Deserialize(const IPC::Message* aMsg, void** aIter);
#endif
protected:
nsClientRect mClientArea;

Просмотреть файл

@ -37,10 +37,8 @@
*
* ***** END LICENSE BLOCK ***** */
#ifdef MOZ_IPC
#include "base/basictypes.h"
#include "IPC/IPCMessageUtils.h"
#endif
#include "nsCOMPtr.h"
#include "nsDOMUIEvent.h"
#include "nsIPresShell.h"
@ -394,7 +392,6 @@ nsDOMUIEvent::DuplicatePrivateData()
return rv;
}
#ifdef MOZ_IPC
void
nsDOMUIEvent::Serialize(IPC::Message* aMsg, PRBool aSerializeInterfaceType)
{
@ -416,7 +413,6 @@ nsDOMUIEvent::Deserialize(const IPC::Message* aMsg, void** aIter)
NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &mDetail), PR_FALSE);
return PR_TRUE;
}
#endif
nsresult NS_NewDOMUIEvent(nsIDOMEvent** aInstancePtrResult,
nsPresContext* aPresContext,

Просмотреть файл

@ -62,10 +62,8 @@ public:
// nsIPrivateDOMEvent interface
NS_IMETHOD DuplicatePrivateData();
#ifdef MOZ_IPC
virtual void Serialize(IPC::Message* aMsg, PRBool aSerializeInterfaceType);
virtual PRBool Deserialize(const IPC::Message* aMsg, void** aIter);
#endif
// Forward to nsDOMEvent
NS_FORWARD_TO_NSDOMEVENT

Просмотреть файл

@ -44,9 +44,7 @@
*
* ***** END LICENSE BLOCK ***** */
#ifdef MOZ_IPC
#include "mozilla/dom/TabParent.h"
#endif
#include "nsCOMPtr.h"
#include "nsEventStateManager.h"
@ -164,9 +162,7 @@
#import <ApplicationServices/ApplicationServices.h>
#endif
#ifdef MOZ_IPC
using namespace mozilla::dom;
#endif
//#define DEBUG_DOCSHELL_FOCUS
@ -1338,20 +1334,16 @@ nsEventStateManager::PreHandleEvent(nsPresContext* aPresContext,
break;
case NS_QUERY_SELECTED_TEXT:
{
#ifdef MOZ_IPC
if (RemoteQueryContentEvent(aEvent))
break;
#endif
nsContentEventHandler handler(mPresContext);
handler.OnQuerySelectedText((nsQueryContentEvent*)aEvent);
}
break;
case NS_QUERY_TEXT_CONTENT:
{
#ifdef MOZ_IPC
if (RemoteQueryContentEvent(aEvent))
break;
#endif
nsContentEventHandler handler(mPresContext);
handler.OnQueryTextContent((nsQueryContentEvent*)aEvent);
}
@ -1407,7 +1399,6 @@ nsEventStateManager::PreHandleEvent(nsPresContext* aPresContext,
break;
case NS_SELECTION_SET:
{
#ifdef MOZ_IPC
nsSelectionEvent *selectionEvent =
static_cast<nsSelectionEvent*>(aEvent);
if (IsTargetCrossProcess(selectionEvent)) {
@ -1416,7 +1407,6 @@ nsEventStateManager::PreHandleEvent(nsPresContext* aPresContext,
selectionEvent->mSucceeded = PR_TRUE;
break;
}
#endif
nsContentEventHandler handler(mPresContext);
handler.OnSelectionEvent((nsSelectionEvent*)aEvent);
}
@ -1437,7 +1427,6 @@ nsEventStateManager::PreHandleEvent(nsPresContext* aPresContext,
DoContentCommandScrollEvent(static_cast<nsContentCommandEvent*>(aEvent));
}
break;
#ifdef MOZ_IPC
case NS_TEXT_TEXT:
{
nsTextEvent *textEvent = static_cast<nsTextEvent*>(aEvent);
@ -1464,7 +1453,6 @@ nsEventStateManager::PreHandleEvent(nsPresContext* aPresContext,
}
}
break;
#endif // MOZ_IPC
}
return NS_OK;
}
@ -3337,7 +3325,6 @@ nsEventStateManager::PostHandleEvent(nsPresContext* aPresContext,
return ret;
}
#ifdef MOZ_IPC
PRBool
nsEventStateManager::RemoteQueryContentEvent(nsEvent *aEvent)
{
@ -3367,7 +3354,6 @@ nsEventStateManager::IsTargetCrossProcess(nsGUIEvent *aEvent)
return PR_FALSE;
return TabParent::GetIMETabParent() != nsnull;
}
#endif
NS_IMETHODIMP
nsEventStateManager::NotifyDestroyPresContext(nsPresContext* aPresContext)

Просмотреть файл

@ -349,11 +349,9 @@ protected:
nsresult DoContentCommandEvent(nsContentCommandEvent* aEvent);
nsresult DoContentCommandScrollEvent(nsContentCommandEvent* aEvent);
#ifdef MOZ_IPC
PRBool RemoteQueryContentEvent(nsEvent *aEvent);
mozilla::dom::TabParent *GetCrossProcessTarget();
PRBool IsTargetCrossProcess(nsGUIEvent *aEvent);
#endif
PRInt32 mLockCursor;

Просмотреть файл

@ -50,14 +50,9 @@ LIBXUL_LIBRARY = 1
EXPORTS = \
nsImageMapUtils.h \
nsClientRect.h \
nsHTMLDNSPrefetch.h \
$(NULL)
ifdef MOZ_IPC
EXPORTS += \
nsHTMLDNSPrefetch.h \
$(NULL)
endif
CPPSRCS = \
nsClientRect.cpp \
nsHTMLDNSPrefetch.cpp \

Просмотреть файл

@ -553,7 +553,6 @@ NS_IMETHODIMP
nsHTMLCanvasElement::MozGetIPCContext(const nsAString& aContextId,
nsISupports **aContext)
{
#ifdef MOZ_IPC
if(!nsContentUtils::IsCallerTrustedForRead()) {
// XXX ERRMSG we need to report an error to developers here! (bug 329026)
return NS_ERROR_DOM_SECURITY_ERR;
@ -588,9 +587,6 @@ nsHTMLCanvasElement::MozGetIPCContext(const nsAString& aContextId,
NS_ADDREF (*aContext = mCurrentContext);
return NS_OK;
#else
return NS_ERROR_NOT_IMPLEMENTED;
#endif
}
nsresult

Просмотреть файл

@ -36,12 +36,10 @@
*
* ***** END LICENSE BLOCK ***** */
#ifdef MOZ_IPC
#include "base/basictypes.h"
#include "mozilla/net/NeckoCommon.h"
#include "mozilla/net/NeckoChild.h"
#include "nsURLHelper.h"
#endif
#include "nsHTMLDNSPrefetch.h"
#include "nsCOMPtr.h"
@ -108,10 +106,8 @@ nsHTMLDNSPrefetch::Initialize()
rv = CallGetService(kDNSServiceCID, &sDNSService);
if (NS_FAILED(rv)) return rv;
#ifdef MOZ_IPC
if (IsNeckoChild())
NeckoChild::InitNeckoChild();
#endif
sInitialized = PR_TRUE;
return NS_OK;
@ -142,7 +138,6 @@ nsHTMLDNSPrefetch::IsAllowed (nsIDocument *aDocument)
nsresult
nsHTMLDNSPrefetch::Prefetch(Link *aElement, PRUint16 flags)
{
#ifdef MOZ_IPC
if (IsNeckoChild()) {
// Instead of transporting the Link object to the other process
// we are using the hostname based function here, too. Compared to the
@ -153,7 +148,6 @@ nsHTMLDNSPrefetch::Prefetch(Link *aElement, PRUint16 flags)
return Prefetch(hostname, flags);
}
#endif
if (!(sInitialized && sPrefetches && sDNSService && sDNSListener))
return NS_ERROR_NOT_AVAILABLE;
@ -182,7 +176,6 @@ nsHTMLDNSPrefetch::PrefetchHigh(Link *aElement)
nsresult
nsHTMLDNSPrefetch::Prefetch(nsAString &hostname, PRUint16 flags)
{
#ifdef MOZ_IPC
if (IsNeckoChild()) {
// We need to check IsEmpty() because net_IsValidHostName()
// considers empty strings to be valid hostnames
@ -192,7 +185,6 @@ nsHTMLDNSPrefetch::Prefetch(nsAString &hostname, PRUint16 flags)
}
return NS_OK;
}
#endif
if (!(sInitialized && sDNSService && sPrefetches && sDNSListener))
return NS_ERROR_NOT_AVAILABLE;

Просмотреть файл

@ -143,9 +143,7 @@ public:
} mEntries[sMaxDeferred];
};
#ifdef MOZ_IPC
friend class mozilla::net::NeckoParent;
#endif
};
#endif

Просмотреть файл

@ -92,6 +92,9 @@ public:
NS_IMETHOD Run() {
if (mWeakFrame.IsAlive()) {
// SetSelectionRange leads to Selection::AddRange which flushes Layout -
// need to block script to avoid nested PrepareEditor calls (bug 642800).
nsAutoScriptBlocker scriptBlocker;
mFrame->SetSelectionRange(mStart, mEnd);
}
return NS_OK;

Просмотреть файл

@ -60,7 +60,6 @@
#include "nsCRT.h"
#include "prtime.h"
#include "prlog.h"
#include "nsInt64.h"
#include "nsNodeUtils.h"
#include "nsIContent.h"
#include "mozilla/dom/Element.h"

Просмотреть файл

@ -37,14 +37,12 @@
*
* ***** END LICENSE BLOCK ***** */
#ifdef MOZ_IPC
#include "mozilla/dom/ContentChild.h"
#include "mozilla/dom/PAudioChild.h"
#include "mozilla/dom/AudioChild.h"
#include "mozilla/Monitor.h"
#include "nsXULAppAPI.h"
using namespace mozilla::dom;
#endif
#include <stdio.h>
#include <math.h>
@ -65,7 +63,7 @@ extern "C" {
// Android's audio backend is not available in content processes, so audio must
// be remoted to the parent chrome process.
#if defined(ANDROID) && defined(MOZ_IPC)
#if defined(ANDROID)
#define REMOTE_AUDIO 1
#endif
@ -122,7 +120,6 @@ class nsAudioStreamLocal : public nsAudioStream
};
#ifdef MOZ_IPC
class nsAudioStreamRemote : public nsAudioStream
{
public:
@ -294,7 +291,6 @@ class AudioShutdownEvent : public nsRunnable
nsRefPtr<AudioChild> mAudioChild;
};
#endif // MOZ_IPC
void nsAudioStream::InitLibrary()
@ -597,8 +593,6 @@ PRInt32 nsAudioStreamLocal::GetMinWriteSamples()
return static_cast<PRInt32>(samples);
}
#ifdef MOZ_IPC
nsAudioStreamRemote::nsAudioStreamRemote()
: mAudioChild(NULL),
mFormat(FORMAT_S16_LE),
@ -750,5 +744,3 @@ nsAudioStreamRemote::IsPaused()
{
return mPaused;
}
#endif // MOZ_IPC

Просмотреть файл

@ -64,14 +64,13 @@ public:
// library after using it.
static void ShutdownLibrary();
// Thread, usually for MOZ_IPC handling, that is shared between audio streams.
// Thread that is shared between audio streams.
// This may return null in the child process
nsIThread *GetThread();
// AllocateStream will return either a local stream or a remoted stream
// depending on where you call it from. If MOZ_IPC is enabled, and you
// call this from a child process, you may recieve an implementation which
// forwards to a compositing process.
// depending on where you call it from. If you call this from a child process,
// you may receive an implementation which forwards to a compositing process.
static nsAudioStream* AllocateStream();
// Initialize the audio stream. aNumChannels is the number of audio channels

Просмотреть файл

@ -187,7 +187,7 @@ PRBool nsRawReader::DecodeVideoFrame(PRBool &aKeyframeSkip,
PRInt64 currentFrameTime = 1000 * mCurrentFrame / mFrameRate;
PRUint32 length = mFrameSize - sizeof(nsRawPacketHeader);
nsAutoPtr<PRUint8> buffer(new PRUint8[length]);
nsAutoArrayPtr<PRUint8> buffer(new PRUint8[length]);
nsMediaStream* stream = mDecoder->GetCurrentStream();
NS_ASSERTION(stream, "Decoder has no media stream");

Просмотреть файл

@ -151,11 +151,7 @@ nsSMILAnimationController::Resume(PRUint32 aType)
if (wasPaused && !mPauseState && mChildContainerTable.Count()) {
Sample(); // Run the first sample manually
if (mAnimationElementTable.Count()) {
StartSampling(GetRefreshDriverForDoc(mDocument));
} else {
mDeferredStartSampling = PR_TRUE;
}
MaybeStartSampling(GetRefreshDriverForDoc(mDocument));
}
}
@ -299,8 +295,8 @@ void
nsSMILAnimationController::NotifyRefreshDriverCreated(
nsRefreshDriver* aRefreshDriver)
{
if (!mPauseState && !mDeferredStartSampling) {
StartSampling(aRefreshDriver);
if (!mPauseState) {
MaybeStartSampling(aRefreshDriver);
}
}
@ -346,6 +342,22 @@ nsSMILAnimationController::StopSampling(nsRefreshDriver* aRefreshDriver)
}
}
void
nsSMILAnimationController::MaybeStartSampling(nsRefreshDriver* aRefreshDriver)
{
if (mDeferredStartSampling) {
// We've received earlier 'MaybeStartSampling' calls, and we're
// deferring until we get a registered animation.
return;
}
if (mAnimationElementTable.Count()) {
StartSampling(aRefreshDriver);
} else {
mDeferredStartSampling = PR_TRUE;
}
}
//----------------------------------------------------------------------
// Sample-related methods and callbacks
@ -820,15 +832,11 @@ nsresult
nsSMILAnimationController::AddChild(nsSMILTimeContainer& aChild)
{
TimeContainerPtrKey* key = mChildContainerTable.PutEntry(&aChild);
NS_ENSURE_TRUE(key,NS_ERROR_OUT_OF_MEMORY);
NS_ENSURE_TRUE(key, NS_ERROR_OUT_OF_MEMORY);
if (!mPauseState && mChildContainerTable.Count() == 1) {
Sample(); // Run the first sample manually
if (mAnimationElementTable.Count()) {
StartSampling(GetRefreshDriverForDoc(mDocument));
} else {
mDeferredStartSampling = PR_TRUE;
}
MaybeStartSampling(GetRefreshDriverForDoc(mDocument));
}
return NS_OK;

Просмотреть файл

@ -162,6 +162,9 @@ protected:
void StartSampling(nsRefreshDriver* aRefreshDriver);
void StopSampling(nsRefreshDriver* aRefreshDriver);
// Wrapper for StartSampling that defers if no animations are registered.
void MaybeStartSampling(nsRefreshDriver* aRefreshDriver);
// Sample-related callbacks and implementation helpers
virtual void DoSample();
void DoSample(PRBool aSkipUnchangedContainers);

Просмотреть файл

@ -1214,7 +1214,7 @@ MappedAttrParser::CreateStyleRule()
return nsnull; // No mapped attributes were parsed
}
nsRefPtr<css::StyleRule> rule = NS_NewCSSStyleRule(nsnull, mDecl);
nsRefPtr<css::StyleRule> rule = new css::StyleRule(nsnull, mDecl);
mDecl = nsnull; // We no longer own the declaration -- drop our pointer to it
return rule.forget();
}

Просмотреть файл

@ -323,19 +323,6 @@ protected:
PRUint32 mPendingSheets;
/*
* XXX dr
* ------
* We used to have two pointers into the content model: mPopupNode and
* mTooltipNode, which were used to retrieve the objects triggering a
* popup or tooltip. You need that access because your reference has
* disappeared by the time you click on a popup item or do whatever
* with a tooltip. These were owning references (no cycles, as pinkerton
* pointed out, since we're still parent-child).
*/
nsCOMPtr<nsIDOMNode> mTooltipNode; // [OWNER] element triggering the tooltip
/**
* document lightweight theme for use with :-moz-lwtheme, :-moz-lwtheme-brighttext
* and :-moz-lwtheme-darktext

Просмотреть файл

@ -71,7 +71,7 @@ public:
* UnregisterVisitedCallback.
*
* @pre aURI must not be null.
* @pre aLink may be null only in the MOZ_IPC parent process.
* @pre aLink may be null only in the parent (chrome) process.
*
* @param aURI
* The URI to check.

Просмотреть файл

@ -229,9 +229,7 @@ static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
#include "nsIChannelPolicy.h"
#include "nsIContentSecurityPolicy.h"
#ifdef MOZ_IPC
#include "nsXULAppAPI.h"
#endif
using namespace mozilla;
@ -3935,31 +3933,6 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI *aURI,
case NS_ERROR_REMOTE_XUL:
{
error.AssignLiteral("remoteXUL");
/**
* We want to set an hardcoded messageStr which uses the
* brandShortName.
*/
nsCOMPtr<nsIStringBundleService> stringBundleService =
mozilla::services::GetStringBundleService();
if (!stringBundleService) {
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsIStringBundle> brandBundle;
rv = stringBundleService->CreateBundle(kBrandBundleURL,
getter_AddRefs(brandBundle));
NS_ENSURE_SUCCESS(rv, rv);
nsXPIDLString brandName;
rv = brandBundle->GetStringFromName(NS_LITERAL_STRING("brandShortName").get(),
getter_Copies(brandName));
// We could use something like nsTextFormatter::smprintf.
messageStr.AssignLiteral("This page uses an unsupported technology "
"that is no longer available by default in ");
messageStr.Append(brandName);
messageStr.AppendLiteral(".");
break;
}
case NS_ERROR_UNSAFE_CONTENT_TYPE:
@ -6016,12 +5989,10 @@ nsDocShell::OnRedirectStateChange(nsIChannel* aOldChannel,
nsCOMPtr<nsIApplicationCacheChannel> appCacheChannel =
do_QueryInterface(aNewChannel);
if (appCacheChannel) {
#ifdef MOZ_IPC
// Permission will be checked in the parent process.
if (GeckoProcessType_Default != XRE_GetProcessType())
appCacheChannel->SetChooseApplicationCache(PR_TRUE);
else
#endif
appCacheChannel->SetChooseApplicationCache(ShouldCheckAppCache(newURI));
}
@ -8736,12 +8707,10 @@ nsDocShell::DoURILoad(nsIURI * aURI,
// Loads with the correct permissions should check for a matching
// application cache.
#ifdef MOZ_IPC
// Permission will be checked in the parent process
if (GeckoProcessType_Default != XRE_GetProcessType())
appCacheChannel->SetChooseApplicationCache(PR_TRUE);
else
#endif
appCacheChannel->SetChooseApplicationCache(
ShouldCheckAppCache(aURI));
}

Просмотреть файл

@ -328,7 +328,7 @@
<h1 id="et_nssBadCert">&nssBadCert.title;</h1>
<h1 id="et_malwareBlocked">&malwareBlocked.title;</h1>
<h1 id="et_cspFrameAncestorBlocked">&cspFrameAncestorBlocked.title;</h1>
<h1 id="et_remoteXUL">Remote XUL</h1>
<h1 id="et_remoteXUL">&remoteXUL.title;</h1>
</div>
<div id="errorDescriptionsContainer">
<div id="ed_generic">&generic.longDesc;</div>
@ -352,7 +352,7 @@
<div id="ed_nssBadCert">&nssBadCert.longDesc2;</div>
<div id="ed_malwareBlocked">&malwareBlocked.longDesc;</div>
<div id="ed_cspFrameAncestorBlocked">&cspFrameAncestorBlocked.longDesc;</div>
<div id="ed_remoteXUL"><ul><li>Please contact the website owners to inform them of this problem.</li></ul></div>
<div id="ed_remoteXUL">&remoteXUL.longDesc;</div>
</div>
</div>

Просмотреть файл

@ -83,13 +83,8 @@ DIRS += \
plugins \
indexedDB \
system \
$(NULL)
ifdef MOZ_IPC
DIRS += \
ipc \
$(NULL)
endif
ifdef ENABLE_TESTS
DIRS += tests

Просмотреть файл

@ -83,6 +83,7 @@ EXPORTS = \
nsPIWindowRoot.h \
nsFocusManager.h \
nsWrapperCache.h \
nsContentPermissionHelper.h \
$(NULL)
CPPSRCS = \
@ -106,27 +107,17 @@ CPPSRCS = \
nsScriptNameSpaceManager.cpp \
nsDOMScriptObjectFactory.cpp \
nsQueryContentEventResult.cpp \
nsContentPermissionHelper.cpp \
$(NULL)
ifdef MOZ_IPC
EXPORTS += \
nsContentPermissionHelper.h \
$(NULL)
CPPSRCS += \
nsContentPermissionHelper.cpp \
$(NULL)
endif
include $(topsrcdir)/dom/dom-config.mk
ifdef MOZ_JSDEBUGGER
DEFINES += -DMOZ_JSDEBUGGER
endif
ifdef MOZ_IPC
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/ipc/chromium/chromium-config.mk
endif
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -46,9 +46,7 @@
*
* ***** END LICENSE BLOCK ***** */
#ifdef MOZ_IPC
#include "base/basictypes.h"
#endif
// Local Includes
#include "nsGlobalWindow.h"
@ -8734,24 +8732,14 @@ nsGlobalWindow::SetTimeoutOrInterval(nsIScriptTimeoutHandler *aHandler,
return NS_OK;
}
PRUint32 nestingLevel = sNestingLevel + 1;
if (aIsInterval || nestingLevel >= DOM_CLAMP_TIMEOUT_NESTING_LEVEL) {
// Don't allow timeouts less than DOMMinTimeoutValue() from
// now...
interval = NS_MAX(interval, DOMMinTimeoutValue());
}
else if (interval < 0) {
// Clamp negative intervals to 0.
interval = 0;
}
// Disallow negative intervals. If aIsInterval also disallow 0,
// because we use that as a "don't repeat" flag.
interval = NS_MAX(aIsInterval ? 1 : 0, interval);
NS_ASSERTION(interval >= 0, "DOMMinTimeoutValue() lies");
PRUint32 realInterval = interval;
// Make sure we don't proceed with a interval larger than our timer
// Make sure we don't proceed with an interval larger than our timer
// code can handle.
if (realInterval > PR_IntervalToMilliseconds(DOM_MAX_TIMEOUT_VALUE)) {
realInterval = PR_IntervalToMilliseconds(DOM_MAX_TIMEOUT_VALUE);
if (interval > PR_IntervalToMilliseconds(DOM_MAX_TIMEOUT_VALUE)) {
interval = PR_IntervalToMilliseconds(DOM_MAX_TIMEOUT_VALUE);
}
nsTimeout *timeout = new nsTimeout();
@ -8763,10 +8751,19 @@ nsGlobalWindow::SetTimeoutOrInterval(nsIScriptTimeoutHandler *aHandler,
timeout->AddRef();
if (aIsInterval) {
timeout->mInterval = realInterval;
timeout->mInterval = interval;
}
timeout->mScriptHandler = aHandler;
// Now clamp the actual interval we will use for the timer based on
PRUint32 nestingLevel = sNestingLevel + 1;
PRInt32 realInterval = interval;
if (aIsInterval || nestingLevel >= DOM_CLAMP_TIMEOUT_NESTING_LEVEL) {
// Don't allow timeouts less than DOMMinTimeoutValue() from
// now...
realInterval = NS_MAX(realInterval, DOMMinTimeoutValue());
}
// Get principal of currently executing code, save for execution of timeout.
// If our principals subsume the subject principal then use the subject
// principal. Otherwise, use our principal to avoid running script in
@ -8857,6 +8854,9 @@ nsGlobalWindow::SetTimeoutOrInterval(nsIScriptTimeoutHandler *aHandler,
PRInt32 delay =
nsContentUtils::GetIntPref("dom.disable_open_click_delay");
// This is checking |interval|, not realInterval, on purpose,
// because our lower bound for |realInterval| could be pretty high
// in some cases.
if (interval <= delay) {
timeout->mPopupState = gPopupControlState;
}

Просмотреть файл

@ -38,6 +38,7 @@
* ***** END LICENSE BLOCK ***** */
#include "mozilla/dom/AudioParent.h"
#include "mozilla/unused.h"
#include "nsThreadUtils.h"
// C++ file contents
@ -159,7 +160,7 @@ AudioParent::Notify(nsITimer* timer)
NS_ASSERTION(mStream, "AudioStream not initialized.");
PRInt64 offset = mStream->GetSampleOffset();
SendSampleOffsetUpdate(offset, PR_IntervalNow());
unused << SendSampleOffsetUpdate(offset, PR_IntervalNow());
return NS_OK;
}
@ -222,7 +223,7 @@ bool
AudioParent::RecvShutdown()
{
Shutdown();
PAudioParent::Send__delete__(this);
unused << PAudioParent::Send__delete__(this);
return true;
}

Просмотреть файл

@ -62,3 +62,4 @@ externalProtocolLaunchBtn=Launch application
malwareBlocked=The site at %S has been reported as an attack site and has been blocked based on your security preferences.
phishingBlocked=The web site at %S has been reported as a web forgery designed to trick users into sharing personal or financial information.
cspFrameAncestorBlocked=This page has a content security policy that prevents it from being embedded in this way.
remoteXUL=This page uses an unsupported technology that is no longer available by default.

Просмотреть файл

@ -89,3 +89,6 @@
this inclusion needs to be intact for that approach to work correctly. -->
<!ENTITY % netErrorAppDTD SYSTEM "chrome://global/locale/netErrorApp.dtd">
%netErrorAppDTD;
<!ENTITY remoteXUL.title "Remote XUL">
<!ENTITY remoteXUL.longDesc "<p><ul><li>Please contact the website owners to inform them of this problem.</li></ul></p>">

Просмотреть файл

@ -50,8 +50,6 @@ EXPORTS_mozilla = \
PluginLibrary.h \
$(NULL)
ifdef MOZ_IPC
EXPORTS_NAMESPACES = mozilla mozilla/plugins
EXPORTS_mozilla/plugins = \
@ -151,7 +149,6 @@ LOCAL_INCLUDES = \
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/ipc/chromium/chromium-config.mk
endif
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -83,9 +83,7 @@ LOCAL_INCLUDES += -I$(topsrcdir)/dom/system/android \
$(NULL)
endif
ifdef MOZ_IPC
EXPORTS += nsGeoPositionIPCSerialiser.h
endif
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/ipc/chromium/chromium-config.mk

Просмотреть файл

@ -34,7 +34,6 @@
*
* ***** END LICENSE BLOCK ***** */
#ifdef MOZ_IPC
#include "nsContentPermissionHelper.h"
#include "nsXULAppAPI.h"
@ -53,7 +52,6 @@
#include "nsDOMEventTargetHelper.h"
#include "TabChild.h"
#endif
#include "nsGeolocation.h"
#include "nsAutoPtr.h"
@ -478,7 +476,6 @@ nsGeolocationRequest::Shutdown()
mErrorCallback = nsnull;
}
#ifdef MOZ_IPC
bool nsGeolocationRequest::Recv__delete__(const bool& allow)
{
if (allow)
@ -487,7 +484,6 @@ bool nsGeolocationRequest::Recv__delete__(const bool& allow)
(void) Cancel();
return true;
}
#endif
////////////////////////////////////////////////////
// nsGeolocationService
////////////////////////////////////////////////////
@ -677,13 +673,11 @@ nsGeolocationService::StartDevice()
// inactivivity
SetDisconnectTimer();
#ifdef MOZ_IPC
if (XRE_GetProcessType() == GeckoProcessType_Content) {
ContentChild* cpc = ContentChild::GetSingleton();
cpc->SendAddGeolocationListener();
return NS_OK;
}
#endif
// Start them up!
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
@ -722,13 +716,11 @@ nsGeolocationService::StopDevice()
mDisconnectTimer = nsnull;
}
#ifdef MOZ_IPC
if (XRE_GetProcessType() == GeckoProcessType_Content) {
ContentChild* cpc = ContentChild::GetSingleton();
cpc->SendRemoveGeolocationListener();
return; // bail early
}
#endif
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
if (!obs)
@ -1049,7 +1041,6 @@ nsGeolocation::WindowOwnerStillExists()
bool
nsGeolocation::RegisterRequestWithPrompt(nsGeolocationRequest* request)
{
#ifdef MOZ_IPC
if (XRE_GetProcessType() == GeckoProcessType_Content) {
nsCOMPtr<nsPIDOMWindow> window = do_QueryReferent(mOwner);
if (!window)
@ -1071,7 +1062,6 @@ nsGeolocation::RegisterRequestWithPrompt(nsGeolocationRequest* request)
request->Sendprompt();
return true;
}
#endif
if (nsContentUtils::GetBoolPref("geo.prompt.testing", PR_FALSE))
{

Просмотреть файл

@ -37,11 +37,9 @@
#ifndef nsGeoLocation_h
#define nsGeoLocation_h
#ifdef MOZ_IPC
#include "mozilla/dom/PContentPermissionRequestChild.h"
// Microsoft's API Name hackery sucks
#undef CreateEvent
#endif
#include "nsCOMPtr.h"
#include "nsAutoPtr.h"
@ -67,9 +65,7 @@
#include "nsIGeolocationProvider.h"
#include "nsIContentPermissionPrompt.h"
#ifdef MOZ_IPC
#include "PCOMContentPermissionRequestChild.h"
#endif
class nsGeolocationService;
class nsGeolocation;
@ -77,9 +73,7 @@ class nsGeolocation;
class nsGeolocationRequest
: public nsIContentPermissionRequest
, public nsITimerCallback
#ifdef MOZ_IPC
, public PCOMContentPermissionRequestChild
#endif
{
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
@ -107,10 +101,8 @@ class nsGeolocationRequest
~nsGeolocationRequest();
#ifdef MOZ_IPC
bool Recv__delete__(const bool& allow);
void IPDLRelease() { Release(); }
#endif
private:

Просмотреть файл

@ -297,7 +297,7 @@ nsJSONWriter::nsJSONWriter() : mStream(nsnull),
{
}
nsJSONWriter::nsJSONWriter(nsIOutputStream *aStream) : mStream(nsnull),
nsJSONWriter::nsJSONWriter(nsIOutputStream *aStream) : mStream(aStream),
mBuffer(nsnull),
mBufferCount(0),
mDidWrite(PR_FALSE),

Просмотреть файл

@ -138,11 +138,12 @@ function testOutputStreams() {
}
// check BOMs
var f = writeToFile({},"UTF-8", true);
// the clone() calls are there to work around -- bug 410005
var f = writeToFile({},"UTF-8", true).clone();
do_check_eq(f.fileSize, 5);
var f = writeToFile({},"UTF-16LE", true);
var f = writeToFile({},"UTF-16LE", true).clone();
do_check_eq(f.fileSize, 6);
var f = writeToFile({},"UTF-16BE", true);
var f = writeToFile({},"UTF-16BE", true).clone();
do_check_eq(f.fileSize, 6);
outputDir.remove(true);
@ -163,7 +164,6 @@ function run_test() {
testStringEncode();
throwingToJSON();
// failing on windows -- bug 410005
// testOutputStreams();
testOutputStreams();
}

Просмотреть файл

@ -36,7 +36,6 @@
#include "nsDesktopNotification.h"
#ifdef MOZ_IPC
#include "nsContentPermissionHelper.h"
#include "nsXULAppAPI.h"
@ -44,7 +43,6 @@
#include "TabChild.h"
using namespace mozilla::dom;
#endif
/* ------------------------------------------------------------------------ */
/* AlertServiceObserver */
@ -129,7 +127,6 @@ nsDOMDesktopNotification::nsDOMDesktopNotification(const nsAString & title,
nsRefPtr<nsDesktopNotificationRequest> request = new nsDesktopNotificationRequest(this);
// if we are in the content process, then remote it to the parent.
#ifdef MOZ_IPC
if (XRE_GetProcessType() == GeckoProcessType_Content) {
// if for some reason mOwner is null, just silently
@ -152,7 +149,6 @@ nsDOMDesktopNotification::nsDOMDesktopNotification(const nsAString & title,
request->Sendprompt();
return;
}
#endif
// otherwise, dispatch it
NS_DispatchToMainThread(request);

Просмотреть файл

@ -37,10 +37,7 @@
#ifndef nsDesktopNotification_h
#define nsDesktopNotification_h
#ifdef MOZ_IPC
#include "PCOMContentPermissionRequestChild.h"
#endif
#include "nsDOMClassInfo.h"
#include "nsIJSContextStack.h"
@ -155,10 +152,8 @@ protected:
* Simple Request
*/
class nsDesktopNotificationRequest : public nsIContentPermissionRequest,
public nsRunnable
#ifdef MOZ_IPC
, public PCOMContentPermissionRequestChild
#endif
public nsRunnable,
public PCOMContentPermissionRequestChild
{
public:
@ -182,8 +177,6 @@ class nsDesktopNotificationRequest : public nsIContentPermissionRequest,
{
}
#ifdef MOZ_IPC
bool Recv__delete__(const bool& allow)
{
if (allow)
@ -193,7 +186,6 @@ class nsDesktopNotificationRequest : public nsIContentPermissionRequest,
return true;
}
void IPDLRelease() { Release(); }
#endif
nsRefPtr<nsDOMDesktopNotification> mDesktopNotification;
};

Просмотреть файл

@ -57,14 +57,9 @@
#include "nsIScriptGlobalObject.h"
#include "nsIWebNavigation.h"
#ifdef MOZ_IPC
#include "nsXULAppAPI.h"
#define IS_CHILD_PROCESS() \
(GeckoProcessType_Default != XRE_GetProcessType())
#else
#define IS_CHILD_PROCESS() \
(false)
#endif
// Event names

Просмотреть файл

@ -55,13 +55,11 @@ CPPSRCS = \
ifdef MOZ_STORAGE
CPPSRCS += nsDOMStorageDBWrapper.cpp nsDOMStoragePersistentDB.cpp nsDOMStorageMemoryDB.cpp
ifdef MOZ_IPC
CPPSRCS += StorageChild.cpp StorageParent.cpp
EXPORTS_NAMESPACES = mozilla/dom
EXPORTS_mozilla/dom = StorageChild.h StorageParent.h
endif
endif
# we don't want the shared lib, but we want to force the creation of a static lib.
FORCE_STATIC_LIB = 1

Просмотреть файл

@ -40,12 +40,10 @@
*
* ***** END LICENSE BLOCK ***** */
#ifdef MOZ_IPC
#include "StorageChild.h"
#include "StorageParent.h"
#include "nsXULAppAPI.h"
using mozilla::dom::StorageChild;
#endif
#include "prnetdb.h"
#include "nsCOMPtr.h"
@ -271,11 +269,9 @@ nsDOMStorageManager::Initialize()
NS_ADDREF(gStorageManager);
#ifdef MOZ_IPC
// No observers needed in non-chrome
if (XRE_GetProcessType() != GeckoProcessType_Default)
return NS_OK;
#endif
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
if (!os)
@ -1355,12 +1351,10 @@ nsDOMStorage::nsDOMStorage()
{
mSecurityChecker = this;
#ifdef MOZ_IPC
if (XRE_GetProcessType() != GeckoProcessType_Default)
mStorageImpl = new StorageChild(this);
else
#endif
mStorageImpl = new DOMStorageImpl(this);
mStorageImpl = new DOMStorageImpl(this);
}
nsDOMStorage::nsDOMStorage(nsDOMStorage& aThat)
@ -1369,13 +1363,10 @@ nsDOMStorage::nsDOMStorage(nsDOMStorage& aThat)
{
mSecurityChecker = this;
#ifdef MOZ_IPC
if (XRE_GetProcessType() != GeckoProcessType_Default) {
StorageChild* other = static_cast<StorageChild*>(aThat.mStorageImpl.get());
mStorageImpl = new StorageChild(this, *other);
} else
#endif
{
} else {
DOMStorageImpl* other = static_cast<DOMStorageImpl*>(aThat.mStorageImpl.get());
mStorageImpl = new DOMStorageImpl(this, *other);
}

Просмотреть файл

@ -52,5 +52,6 @@ const WorkerTest = {
worker.onmessage = messageCallback;
worker.onerror = errorCallback;
worker.postMessage(message);
return worker;
}
};

Просмотреть файл

@ -54,19 +54,28 @@
{
SimpleTest.waitForExplicitFinish();
var worker;
function done()
{
worker = null;
SimpleTest.finish();
}
function messageCallback(event) {
is(event.data, "Done", "Correct message");
SimpleTest.finish();
done();
}
function errorCallback(event) {
ok(false, "Worker had an error: " + event.message);
SimpleTest.finish();
done();
}
Components.utils.import("resource://gre/modules/WorkerTest.jsm");
WorkerTest.go(window.location.href, messageCallback, errorCallback);
worker = WorkerTest.go(window.location.href, messageCallback,
errorCallback);
}
]]>

Просмотреть файл

@ -4759,23 +4759,24 @@ nsEditor::CreateTxnForDeleteCharacter(nsIDOMCharacterData *aData,
"invalid direction");
nsAutoString data;
aData->GetData(data);
PRUint32 segOffset, segLength = 1;
PRUint32 segOffset = aOffset, segLength = 1;
if (aDirection == eNext) {
segOffset = aOffset;
if (segOffset + 1 < data.Length() &&
NS_IS_HIGH_SURROGATE(data[segOffset]) &&
NS_IS_LOW_SURROGATE(data[segOffset+1])) {
// delete both halves of the surrogate pair
++segLength;
}
} else {
segOffset = aOffset - 1;
} else if (aOffset > 0) {
--segOffset;
if (segOffset > 0 &&
NS_IS_LOW_SURROGATE(data[segOffset]) &&
NS_IS_HIGH_SURROGATE(data[segOffset-1])) {
NS_IS_LOW_SURROGATE(data[segOffset]) &&
NS_IS_HIGH_SURROGATE(data[segOffset-1])) {
++segLength;
--segOffset;
}
} else {
return NS_ERROR_FAILURE;
}
return CreateTxnForDeleteText(aData, segOffset, segLength, aTxn);
}
@ -4789,7 +4790,7 @@ nsEditor::CreateTxnForDeleteInsertionPoint(nsIDOMRange *aRange,
PRInt32 *aOffset,
PRInt32 *aLength)
{
NS_ASSERTION(aAction == eNext || aAction == ePrevious, "invalid action");
NS_ASSERTION(aAction != eNone, "invalid action");
// get the node and offset of the insertion point
nsCOMPtr<nsIDOMNode> node;

Просмотреть файл

@ -53,6 +53,13 @@ _TEST_FILES = \
test_bug586662.html \
$(NULL)
_CHROME_TEST_FILES = \
test_bug646194.xul \
$(NULL)
libs:: $(_TEST_FILES)
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
libs:: $(_CHROME_TEST_FILES)
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)

Просмотреть файл

@ -0,0 +1,62 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin"
type="text/css"?>
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
type="text/css"?>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=646194
-->
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="Mozilla Bug 646194" onload="runTest();">
<script type="application/javascript"
src="chrome://mochikit/content/MochiKit/packed.js"/>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
<body xmlns="http://www.w3.org/1999/xhtml">
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=646194"
target="_blank">Mozilla Bug 646194</a>
<p/>
<iframe id="i" src="data:text/html,&lt;div contenteditable=true id=t&gt;test me now&lt;/div&gt;"/>
<p/>
<pre id="test">
</pre>
</body>
<script class="testbody" type="application/javascript">
<![CDATA[
function runTest() {
function doCommand(aCmd) {
var controller = top.document.commandDispatcher
.getControllerForCommand(aCmd);
ok((controller && controller.isCommandEnabled(aCmd)), "command available");
controller.doCommand(aCmd);
}
var i = document.getElementById("i");
i.focus();
var doc = i.contentDocument;
var t = doc.getElementById("t");
t.focus();
// put the caret at the end
getSelection().collapse(t.firstChild, 11);
// Simulate pression Option+Delete on Mac
// We do things this way because not every platform can invoke this
// command using the available key bindings.
doCommand("cmd_wordPrevious");
doCommand("cmd_wordPrevious");
doCommand("cmd_deleteWordBackward");
doCommand("cmd_deleteWordBackward");
// If we reach here, we haven't crashed. Phew!
// But let's check the value too, now that we're here.
is(t.textContent, "me now", "The command has worked correctly");
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
]]>
</script>
</window>

Просмотреть файл

@ -1229,10 +1229,7 @@ NS_IMETHODIMP nsWebBrowser::Create()
}
mDocShellAsNav->SetSessionHistory(mInitInfo->sessionHistory);
#ifdef MOZ_IPC
if (XRE_GetProcessType() == GeckoProcessType_Default)
#endif
{
if (XRE_GetProcessType() == GeckoProcessType_Default) {
// Hook up global history. Do not fail if we can't - just warn.
rv = EnableGlobalHistory(mShouldEnableHistory);
NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "EnableGlobalHistory() failed");

Просмотреть файл

@ -62,7 +62,6 @@
#include "nsIStringEnumerator.h"
#include "nsCRT.h"
#include "nsSupportsArray.h"
#include "nsInt64.h"
#include "nsContentCID.h"
#include "nsStreamUtils.h"
@ -168,8 +167,8 @@ struct OutputData
nsCOMPtr<nsIURI> mFile;
nsCOMPtr<nsIURI> mOriginalLocation;
nsCOMPtr<nsIOutputStream> mStream;
nsInt64 mSelfProgress;
nsInt64 mSelfProgressMax;
PRInt64 mSelfProgress;
PRInt64 mSelfProgressMax;
PRPackedBool mCalcFileExt;
OutputData(nsIURI *aFile, nsIURI *aOriginalLocation, PRBool aCalcFileExt) :
@ -192,8 +191,8 @@ struct OutputData
struct UploadData
{
nsCOMPtr<nsIURI> mFile;
nsInt64 mSelfProgress;
nsInt64 mSelfProgressMax;
PRInt64 mSelfProgress;
PRInt64 mSelfProgressMax;
UploadData(nsIURI *aFile) :
mFile(aFile),
@ -244,6 +243,8 @@ nsWebBrowserPersist::nsWebBrowserPersist() :
mPersistFlags(kDefaultPersistFlags),
mPersistResult(NS_OK),
mWrapColumn(72),
mTotalCurrentProgress(0),
mTotalMaxProgress(0),
mEncodingFlags(0)
{
}

Просмотреть файл

@ -58,7 +58,6 @@
#include "nsHashtable.h"
#include "nsTArray.h"
#include "nsInt64.h"
#include "nsCWebBrowserPersist.h"
@ -240,8 +239,8 @@ private:
PRPackedBool mSerializingOutput;
PRUint32 mPersistFlags;
PRUint32 mPersistResult;
nsInt64 mTotalCurrentProgress;
nsInt64 mTotalMaxProgress;
PRInt64 mTotalCurrentProgress;
PRInt64 mTotalMaxProgress;
PRInt16 mWrapColumn;
PRUint32 mEncodingFlags;
nsString mContentType;

Просмотреть файл

@ -37,11 +37,9 @@
*
* ***** END LICENSE BLOCK ***** */
#ifdef MOZ_IPC
#include "mozilla/dom/ContentParent.h"
#include "mozilla/dom/ContentChild.h"
#include "mozilla/unused.h"
#endif
#include "nsPermissionManager.h"
#include "nsPermission.h"
#include "nsCRT.h"
@ -63,7 +61,6 @@
static nsPermissionManager *gPermissionManager = nsnull;
#ifdef MOZ_IPC
using mozilla::dom::ContentParent;
using mozilla::dom::ContentChild;
using mozilla::unused; // ha!
@ -108,7 +105,6 @@ ParentProcess()
return nsnull;
}
#endif
#define ENSURE_NOT_CHILD_PROCESS_(onError) \
PR_BEGIN_MACRO \
@ -174,9 +170,7 @@ NS_IMPL_ISUPPORTS3(nsPermissionManager, nsIPermissionManager, nsIObserver, nsISu
nsPermissionManager::nsPermissionManager()
: mLargestID(0)
#ifdef MOZ_IPC
, mUpdateChildProcess(PR_FALSE)
#endif
{
}
@ -233,7 +227,6 @@ nsPermissionManager::Init()
mObserverService->AddObserver(this, "profile-do-change", PR_TRUE);
}
#ifdef MOZ_IPC
if (IsChildProcess()) {
// Get the permissions from the parent process
InfallibleTArray<IPC::Permission> perms;
@ -248,7 +241,6 @@ nsPermissionManager::Init()
// Stop here; we don't need the DB in the child process
return NS_OK;
}
#endif
// ignore failure here, since it's non-fatal (we can run fine without
// persistent storage - e.g. if there's no profile).
@ -440,9 +432,7 @@ nsPermissionManager::Add(nsIURI *aURI,
PRUint32 aExpireType,
PRInt64 aExpireTime)
{
#ifdef MOZ_IPC
ENSURE_NOT_CHILD_PROCESS;
#endif
NS_ENSURE_ARG_POINTER(aURI);
NS_ENSURE_ARG_POINTER(aType);
@ -476,7 +466,6 @@ nsPermissionManager::AddInternal(const nsAFlatCString &aHost,
NotifyOperationType aNotifyOperation,
DBOperationType aDBOperation)
{
#ifdef MOZ_IPC
if (!IsChildProcess()) {
// In the parent, send the update now, if the child is ready
if (mUpdateChildProcess) {
@ -486,7 +475,6 @@ nsPermissionManager::AddInternal(const nsAFlatCString &aHost,
unused << ParentProcess()->SendAddPermission(permission);
}
}
#endif
if (!gHostArena) {
gHostArena = new PLArenaPool;
@ -627,9 +615,7 @@ NS_IMETHODIMP
nsPermissionManager::Remove(const nsACString &aHost,
const char *aType)
{
#ifdef MOZ_IPC
ENSURE_NOT_CHILD_PROCESS;
#endif
NS_ENSURE_ARG_POINTER(aType);
@ -647,9 +633,7 @@ nsPermissionManager::Remove(const nsACString &aHost,
NS_IMETHODIMP
nsPermissionManager::RemoveAll()
{
#ifdef MOZ_IPC
ENSURE_NOT_CHILD_PROCESS;
#endif
nsresult rv = RemoveAllInternal();
NotifyObservers(nsnull, NS_LITERAL_STRING("cleared").get());
@ -806,9 +790,7 @@ AddPermissionsToList(nsHostEntry *entry, void *arg)
NS_IMETHODIMP nsPermissionManager::GetEnumerator(nsISimpleEnumerator **aEnum)
{
#ifdef MOZ_IPC
ENSURE_NOT_CHILD_PROCESS;
#endif
// roll an nsCOMArray of all our permissions, then hand out an enumerator
nsCOMArray<nsIPermission> array;
@ -821,9 +803,7 @@ NS_IMETHODIMP nsPermissionManager::GetEnumerator(nsISimpleEnumerator **aEnum)
NS_IMETHODIMP nsPermissionManager::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *someData)
{
#ifdef MOZ_IPC
ENSURE_NOT_CHILD_PROCESS;
#endif
if (!nsCRT::strcmp(aTopic, "profile-before-change")) {
// The profile is about to change,
@ -920,9 +900,7 @@ nsPermissionManager::NotifyObservers(nsIPermission *aPermission,
nsresult
nsPermissionManager::Read()
{
#ifdef MOZ_IPC
ENSURE_NOT_CHILD_PROCESS;
#endif
nsresult rv;
@ -990,9 +968,7 @@ static const char kMatchTypeHost[] = "host";
nsresult
nsPermissionManager::Import()
{
#ifdef MOZ_IPC
ENSURE_NOT_CHILD_PROCESS;
#endif
nsresult rv;
@ -1098,9 +1074,7 @@ nsPermissionManager::UpdateDB(OperationType aOp,
PRUint32 aExpireType,
PRInt64 aExpireTime)
{
#ifdef MOZ_IPC
ENSURE_NOT_CHILD_PROCESS_NORET;
#endif
nsresult rv;

Просмотреть файл

@ -251,7 +251,6 @@ private:
// An array to store the strings identifying the different types.
nsTArray<nsCString> mTypeArray;
#ifdef MOZ_IPC
// Whether we should update the child process with every change to a
// permission. This is set to true once the child is ready to receive
// such updates.
@ -262,7 +261,6 @@ public:
{
mUpdateChildProcess = PR_TRUE;
}
#endif
};
// {4F6B5E00-0C36-11d5-A535-0010A401EB10}

Просмотреть файл

@ -96,12 +96,10 @@ libs:: $(_BROWSER_TEST_FILES)
XPCSHELL_TESTS = unit
ifdef MOZ_IPC
# FIXME/bug 575918: out-of-process xpcshell is broken on OS X
ifneq ($(OS_ARCH),Darwin)
XPCSHELL_TESTS += unit_ipc
endif
endif
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -59,16 +59,12 @@ endif
DIRS += angle
DIRS += src qcms layers harfbuzz/src ots/src thebes
DIRS += src qcms layers harfbuzz/src ots/src thebes ipc
ifdef BUILD_STATIC_LIBS
DIRS += ycbcr
endif
ifdef MOZ_IPC
DIRS += ipc
endif
ifdef ENABLE_TESTS
TOOL_DIRS += tests
endif

Просмотреть файл

@ -42,8 +42,6 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
ifdef MOZ_IPC
MODULE = gfxipc
LIBRARY_NAME = gfxipc_s
FORCE_STATIC_LIB = 1
@ -73,8 +71,6 @@ endif
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/ipc/chromium/chromium-config.mk
endif
include $(topsrcdir)/config/rules.mk
CXXFLAGS += $(MOZ_CAIRO_CFLAGS) $(TK_CFLAGS)

Просмотреть файл

@ -38,9 +38,7 @@
*
* ***** END LICENSE BLOCK ***** */
#ifdef MOZ_IPC
# include "mozilla/layers/ShadowLayers.h"
#endif // MOZ_IPC
#include "mozilla/layers/ShadowLayers.h"
#include "ImageLayers.h"
#include "Layers.h"
@ -241,7 +239,6 @@ Layer::CanUseOpaqueSurface()
parent->CanUseOpaqueSurface();
}
#ifdef MOZ_IPC
// NB: eventually these methods will be defined unconditionally, and
// can be moved into Layers.h
const nsIntRect*
@ -262,13 +259,6 @@ Layer::GetEffectiveVisibleRegion()
return GetVisibleRegion();
}
#else
const nsIntRect* Layer::GetEffectiveClipRect() { return GetClipRect(); }
const nsIntRegion& Layer::GetEffectiveVisibleRegion() { return GetVisibleRegion(); }
#endif // MOZ_IPC
gfx3DMatrix
Layer::SnapTransform(const gfx3DMatrix& aTransform,
const gfxRect& aSnapRect,
@ -361,10 +351,8 @@ Layer::CalculateScissorRect(bool aIntermediate,
const gfx3DMatrix&
Layer::GetLocalTransform()
{
#ifdef MOZ_IPC
if (ShadowLayer* shadow = AsShadowLayer())
return shadow->GetShadowTransform();
#endif
return mTransform;
}
@ -702,7 +690,6 @@ LayerManager::IsLogEnabled()
return PR_LOG_TEST(sLog, PR_LOG_DEBUG);
}
# ifdef MOZ_IPC
static nsACString&
PrintInfo(nsACString& aTo, ShadowLayer* aShadowLayer)
{
@ -720,12 +707,6 @@ PrintInfo(nsACString& aTo, ShadowLayer* aShadowLayer)
}
return aTo;
}
# else
static nsACString& PrintInfo(nsACString& aTo, ShadowLayer* aShadowLayer)
{
return aTo;
}
# endif // MOZ_IPC
#else // !MOZ_LAYERS_HAVE_LOG

Просмотреть файл

@ -44,14 +44,11 @@ VPATH = \
$(srcdir)/opengl \
$(srcdir)/d3d9 \
$(srcdir)/d3d10 \
$(srcdir)/ipc \
$(NULL)
include $(DEPTH)/config/autoconf.mk
ifdef MOZ_IPC
VPATH += $(srcdir)/ipc
endif
MODULE = thebes
LIBRARY_NAME = layers
LIBXUL_LIBRARY = 1
@ -127,7 +124,6 @@ CPPSRCS += \
endif
endif
ifdef MOZ_IPC #{
EXPORTS_NAMESPACES = IPC mozilla/layers
EXPORTS_IPC = ShadowLayerUtils.h
EXPORTS_mozilla/layers =\
@ -149,8 +145,6 @@ EXPORTS_mozilla/layers += ShadowLayerUtilsX11.h
CPPSRCS += ShadowLayerUtilsX11.cpp
endif #}
endif #}
# Enable GLES2.0 under maemo
ifdef MOZ_X11
ifdef MOZ_PLATFORM_MAEMO
@ -160,9 +154,7 @@ endif
include $(topsrcdir)/config/rules.mk
ifdef MOZ_IPC
include $(topsrcdir)/ipc/chromium/chromium-config.mk
endif
CXXFLAGS += $(MOZ_CAIRO_CFLAGS) $(TK_CFLAGS)

Просмотреть файл

@ -345,6 +345,7 @@ ThebesLayerBuffer::BeginPaint(ThebesLayer* aLayer, ContentType aContentType,
} else {
// We can't do a real self-copy because the buffer is rotated.
// So allocate a new buffer for the destination.
destBufferRect = neededRegion.GetBounds();
bufferDimsChanged = PR_TRUE;
destBuffer = CreateBuffer(contentType, destBufferDims, bufferFlags);
if (!destBuffer)

Просмотреть файл

@ -36,14 +36,12 @@
*
* ***** END LICENSE BLOCK ***** */
#ifdef MOZ_IPC
# include "gfxSharedImageSurface.h"
#include "gfxSharedImageSurface.h"
# include "mozilla/layers/PLayerChild.h"
# include "mozilla/layers/PLayersChild.h"
# include "mozilla/layers/PLayersParent.h"
# include "ipc/ShadowLayerChild.h"
#endif
#include "mozilla/layers/PLayerChild.h"
#include "mozilla/layers/PLayersChild.h"
#include "mozilla/layers/PLayersParent.h"
#include "ipc/ShadowLayerChild.h"
#include "BasicLayers.h"
#include "ImageLayers.h"
@ -1604,8 +1602,6 @@ BasicLayerManager::CreateReadbackLayer()
return layer.forget();
}
#ifdef MOZ_IPC
class BasicShadowableThebesLayer;
class BasicShadowableLayer : public ShadowableLayer
{
@ -2886,7 +2882,6 @@ BasicShadowLayerManager::IsCompositingCheap()
return mShadowManager &&
LayerManager::IsCompositingCheap(GetParentBackendType());
}
#endif // MOZ_IPC
}
}

Просмотреть файл

@ -45,9 +45,7 @@
#include "nsAutoRef.h"
#include "nsThreadUtils.h"
#ifdef MOZ_IPC
#include "mozilla/layers/ShadowLayers.h"
#endif
class nsIWidget;
@ -71,11 +69,7 @@ class ReadbackProcessor;
* between layers).
*/
class THEBES_API BasicLayerManager :
#ifdef MOZ_IPC
public ShadowLayerManager
#else
public LayerManager
#endif
{
public:
/**
@ -235,7 +229,6 @@ protected:
};
#ifdef MOZ_IPC
class BasicShadowLayerManager : public BasicLayerManager,
public ShadowLayerForwarder
{
@ -284,7 +277,6 @@ private:
LayerRefArray mKeepAlive;
};
#endif // MOZ_IPC
}
}

Просмотреть файл

@ -35,9 +35,7 @@
*
* ***** END LICENSE BLOCK ***** */
#ifdef MOZ_IPC
# include "gfxSharedImageSurface.h"
#endif
#include "gfxSharedImageSurface.h"
#include "CanvasLayerOGL.h"
@ -245,8 +243,6 @@ CanvasLayerOGL::RenderLayer(int aPreviousDestination,
}
#ifdef MOZ_IPC
ShadowCanvasLayerOGL::ShadowCanvasLayerOGL(LayerManagerOGL* aManager)
: ShadowCanvasLayer(aManager, nsnull)
, LayerOGL(aManager)
@ -334,5 +330,3 @@ ShadowCanvasLayerOGL::RenderLayer(int aPreviousFrameBuffer,
mOGLManager->BindAndDrawQuad(program);
}
#endif // MOZ_IPC

Просмотреть файл

@ -38,10 +38,8 @@
#ifndef GFX_CANVASLAYEROGL_H
#define GFX_CANVASLAYEROGL_H
#ifdef MOZ_IPC
# include "mozilla/layers/PLayers.h"
# include "mozilla/layers/ShadowLayers.h"
#endif // MOZ_IPC
#include "mozilla/layers/PLayers.h"
#include "mozilla/layers/ShadowLayers.h"
#include "LayerManagerOGL.h"
#include "gfxASurface.h"
@ -88,7 +86,6 @@ protected:
PRPackedBool mNeedsYFlip;
};
#ifdef MOZ_IPC
// NB: eventually we'll have separate shadow canvas2d and shadow
// canvas3d layers, but currently they look the same from the
// perspective of the compositor process
@ -129,7 +126,6 @@ private:
};
#endif // MOZ_IPC
} /* layers */
} /* mozilla */

Просмотреть файл

@ -80,14 +80,12 @@ ColorLayerOGL::RenderLayer(int,
return RenderColorLayer(this, mOGLManager, aOffset);
}
#ifdef MOZ_IPC
void
ShadowColorLayerOGL::RenderLayer(int,
const nsIntPoint& aOffset)
{
return RenderColorLayer(this, mOGLManager, aOffset);
}
#endif // MOZ_IPC
} /* layers */

Просмотреть файл

@ -38,10 +38,8 @@
#ifndef GFX_COLORLAYEROGL_H
#define GFX_COLORLAYEROGL_H
#ifdef MOZ_IPC
# include "mozilla/layers/PLayers.h"
# include "mozilla/layers/ShadowLayers.h"
#endif // MOZ_IPC
#include "mozilla/layers/PLayers.h"
#include "mozilla/layers/ShadowLayers.h"
#include "LayerManagerOGL.h"
@ -69,7 +67,6 @@ public:
const nsIntPoint& aOffset);
};
#ifdef MOZ_IPC
class ShadowColorLayerOGL : public ShadowColorLayer,
public LayerOGL
{
@ -90,7 +87,6 @@ public:
virtual void RenderLayer(int aPreviousFrameBuffer,
const nsIntPoint& aOffset);
};
#endif // MOZ_IPC
} /* layers */
} /* mozilla */

Просмотреть файл

@ -343,8 +343,6 @@ ContainerLayerOGL::RenderLayer(int aPreviousFrameBuffer,
}
#ifdef MOZ_IPC
ShadowContainerLayerOGL::ShadowContainerLayerOGL(LayerManagerOGL *aManager)
: ShadowContainerLayer(aManager, NULL)
, LayerOGL(aManager)
@ -391,8 +389,6 @@ ShadowContainerLayerOGL::RenderLayer(int aPreviousFrameBuffer,
ContainerRender(this, aPreviousFrameBuffer, aOffset, mOGLManager);
}
#endif // MOZ_IPC
} /* layers */
} /* mozilla */

Просмотреть файл

@ -38,10 +38,8 @@
#ifndef GFX_CONTAINERLAYEROGL_H
#define GFX_CONTAINERLAYEROGL_H
#ifdef MOZ_IPC
# include "mozilla/layers/PLayers.h"
# include "mozilla/layers/ShadowLayers.h"
#endif
#include "mozilla/layers/PLayers.h"
#include "mozilla/layers/ShadowLayers.h"
#include "Layers.h"
#include "LayerManagerOGL.h"
@ -100,7 +98,6 @@ public:
}
};
#ifdef MOZ_IPC
class ShadowContainerLayerOGL : public ShadowContainerLayer,
public LayerOGL
{
@ -139,7 +136,6 @@ public:
DefaultComputeEffectiveTransforms(aTransformToSurface);
}
};
#endif // MOZ_IPC
} /* layers */
} /* mozilla */

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше