Merge mozilla-central to tracemonkey.

This commit is contained in:
Robert Sayre 2009-03-13 02:40:28 -04:00
Родитель 86c7d1ec3a 4e175dbec9
Коммит 63cf3003f6
230 изменённых файлов: 2542 добавлений и 1555 удалений

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

@ -162,16 +162,16 @@ endif
ifeq ($(OS_ARCH),Darwin)
# need to pass arch flags for universal builds
ifdef UNIVERSAL_BINARY
MAKE_SYM_STORE_ARGS := -a "ppc i386" --vcs-info
MAKE_SYM_STORE_ARGS := -c -a "ppc i386" --vcs-info
MAKE_SYM_STORE_PATH := $(DIST)/universal
else
MAKE_SYM_STORE_ARGS := -a $(OS_TEST) --vcs-info
MAKE_SYM_STORE_ARGS := -c -a $(OS_TEST) --vcs-info
MAKE_SYM_STORE_PATH := $(DIST)/bin
endif
DUMP_SYMS_BIN ?= $(DIST)/host/bin/dump_syms
endif
ifeq (,$(filter-out Linux SunOS,$(OS_ARCH)))
MAKE_SYM_STORE_ARGS := --vcs-info
MAKE_SYM_STORE_ARGS := -c --vcs-info
DUMP_SYMS_BIN ?= $(DIST)/host/bin/dump_syms
MAKE_SYM_STORE_PATH := $(DIST)/bin
endif

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

@ -62,6 +62,7 @@ _TEST_FILES =\
nsIAccessibleEditableText.js \
relations.js \
role.js \
test_accessnode_invalidation.html \
test_actions_aria.html \
test_actions_inputs.html \
test_actions.xul \
@ -89,9 +90,9 @@ _TEST_FILES =\
test_nsIAccessible_focus.html \
test_nsIAccessibleDocument.html \
test_nsIAccessibleEditableText.html \
test_nsIAccessibleHyperLink.html \
$(warning test_nsIAccessibleHyperLink.html temporarily disabled) \
test_nsIAccessibleHyperLink.xul \
test_nsIAccessibleHyperText.html \
$(warning test_nsIAccessibleHyperText.html temporarily disabled) \
test_nsIAccessibleImage.html \
$(warning test_nsIAccessibleTable_listboxes.xul temporarily disabled) \
test_nsIAccessNode_utils.html \
@ -115,7 +116,6 @@ _TEST_FILES =\
test_textboxes.xul \
testTextboxes.js \
treeview.js \
test_bug434464.html \
z_states_frame.html \
z_states_framearticle.html \
z_states_framecheckbox.html \

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

@ -7,37 +7,34 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=434464
<title>Test NSIAccessNode cache invalidation</title>
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
<script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/common.js"></script>
<script type="application/javascript">
function doTest()
{
var accRetrieval = Components.classes["@mozilla.org/accessibleRetrieval;1"].
getService(Components.interfaces.nsIAccessibleRetrieval);
var parentElm = document.getElementById("parent");
var parentElm = getNode("parent");
if (!parentElm) {
ok(false, "no parent element for paragraph!");
SimpleTest.finish();
return;
}
var elm = document.getElementById("para");
var elm = getNode("para");
if (!elm) {
ok(false, "no element for paragraph!");
SimpleTest.finish();
return;
}
// It's currently hidden. Ask for its parent's nsIAccessNode.
var parentElmAccNode = null;
try {
parentElmAccNode = accRetrieval.getAccessibleFor(parentElm).
QueryInterface(Components.interfaces.nsIAccessNode);
} catch(e) {}
var parentElmAccNode = getAccessible(parentElm, [nsIAccessNode]);
if (!parentElmAccNode) {
ok(false, "No accessNode for parent of hidden paragraph!");
SimpleTest.finish();
return;
}
// Get the paragraph's accessNode.
@ -49,6 +46,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=434464
if (!elmAccNode) {
ok(false, "No accessNode for hidden paragraph!");
SimpleTest.finish();
return;
}
// Now make the paragraph visible. This invalidates the just-retrieved
@ -60,11 +58,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=434464
window.setTimeout(
function()
{
var elmAcc = null;
try {
elmAcc = accRetrieval.getAccessibleFor(elm);
} catch(e) {}
var elmAcc = getAccessible(elm);
ok(elmAcc, "No accessible for paragraph after it became visible!");
SimpleTest.finish();

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

@ -50,8 +50,6 @@
%tabBrowserDTD;
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
%globalDTD;
<!ENTITY % placesDTD SYSTEM "chrome://browser/locale/places/places.dtd">
%placesDTD;
]>
<bindings id="tabBrowserBindings"
@ -98,7 +96,8 @@
oncommand="var tabbrowser = this.parentNode.parentNode.parentNode.parentNode;
tabbrowser.removeAllTabsBut(tabbrowser.mContextTab);"/>
<xul:menuseparator/>
<xul:menuitem id="context_openTabInWindow" label="&cmd.open_window.label;"
<xul:menuitem id="context_openTabInWindow" label="&openTabInNewWindow.label;"
accesskey="&openTabInNewWindow.accesskey;"
tbattr="tabbrowser-multiple"
oncommand="var tabbrowser = this.parentNode.parentNode.parentNode.parentNode;
tabbrowser.replaceTabWithWindow(tabbrowser.mContextTab);"/>

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

@ -36,7 +36,7 @@
* ***** END LICENSE BLOCK ***** */
#ifndef macieprofilemigrator___h___
#define maciebprofilemigrator___h___
#define macieprofilemigrator___h___
#include "nsIBrowserProfileMigrator.h"
#include "nsIObserverService.h"

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

@ -821,10 +821,7 @@
PlacesUIUtils.ensureLivemarkStatusMenuItem(menuitem.firstChild);
}
else if (PlacesUtils.nodeIsURI(aNode)) {
if (aNode.uri.lastIndexOf("javascript:", 0) == 0)
menuitem.setAttribute("bookmarklet", "true");
else
menuitem.removeAttribute("bookmarklet");
menuitem.setAttribute("scheme", PlacesUIUtils.guessUrlSchemeForUI(aNode.uri));
}
},

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

@ -220,10 +220,7 @@
domNode: popup });
}
else if (PlacesUtils.nodeIsURI(aChild)) {
if (aChild.uri.lastIndexOf("javascript:", 0) == 0)
button.setAttribute("bookmarklet", "true");
else
button.removeAttribute("bookmarklet");
button.setAttribute("scheme", PlacesUIUtils.guessUrlSchemeForUI(aChild.uri));
}
}
@ -645,10 +642,7 @@
PlacesUIUtils.ensureLivemarkStatusMenuItem(element.firstChild);
}
else if (PlacesUtils.nodeIsURI(aNode)) {
if (aNode.uri.lastIndexOf("javascript:", 0) == 0)
element.setAttribute("bookmarklet", "true");
else
element.removeAttribute("bookmarklet");
element.setAttribute("scheme", PlacesUIUtils.guessUrlSchemeForUI(aNode.uri));
}
},

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

@ -925,12 +925,11 @@ PlacesTreeView.prototype = {
}
else if (nodeType == Ci.nsINavHistoryResultNode.RESULT_TYPE_SEPARATOR)
properties.push(this._getAtomFor("separator"));
else if (itemId != -1) { // bookmark nodes
if (PlacesUtils.nodeIsLivemarkContainer(node.parent))
properties.push(this._getAtomFor("livemarkItem"));
else if (PlacesUtils.nodeIsURI(node)) {
if (node.uri.lastIndexOf("javascript:", 0) == 0)
properties.push(this._getAtomFor("bookmarklet"));
else if (PlacesUtils.nodeIsURI(node)) {
properties.push(this._getAtomFor(PlacesUIUtils.guessUrlSchemeForUI(node.uri)));
if (itemId != -1) {
if (PlacesUtils.nodeIsLivemarkContainer(node.parent))
properties.push(this._getAtomFor("livemarkItem"));
}
}

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

@ -981,6 +981,20 @@ var PlacesUIUtils = {
}
},
/**
* Helper for guessing scheme from an url string.
* Used to avoid nsIURI overhead in frequently called UI functions.
*
* @param aUrlString the url to guess the scheme from.
*
* @return guessed scheme for this url string.
*
* @note this is not supposed be perfect, so use it only for UI purposes.
*/
guessUrlSchemeForUI: function PUU_guessUrlSchemeForUI(aUrlString) {
return aUrlString.substr(0, aUrlString.indexOf(":"));
},
/**
* Helper for the toolbar and menu views
*/
@ -999,9 +1013,7 @@ var PlacesUIUtils = {
if (PlacesUtils.uriTypes.indexOf(type) != -1) {
element = document.createElement("menuitem");
element.className = "menuitem-iconic bookmark-item";
if (aNode.uri.lastIndexOf("javascript:", 0) == 0)
element.setAttribute("bookmarklet", "true");
element.setAttribute("scheme", this.guessUrlSchemeForUI(aNode.uri));
}
else if (PlacesUtils.containerTypes.indexOf(type) != -1) {
element = document.createElement("menu");

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

@ -369,7 +369,12 @@ PrivateBrowsingService.prototype = {
getService(Ci.nsICacheService)) {
// NOTE: there is no way to clear just that domain, so we clear out
// everything)
cs.evictEntries(Ci.nsICache.STORE_ANYWHERE);
try {
cs.evictEntries(Ci.nsICache.STORE_ANYWHERE);
} catch (ex) {
Cu.reportError("Exception thrown while clearing the cache: " +
ex.toString());
}
}
// Cookies

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

@ -1671,20 +1671,21 @@ SessionStoreService.prototype = {
if (aOverwriteTabs) {
this.restoreWindowFeatures(aWindow, winData);
delete this._windows[aWindow.__SSi].extData;
}
if (winData.cookies) {
this.restoreCookies(winData.cookies);
}
if (winData.extData) {
if (aOverwriteTabs || !this._windows[aWindow.__SSi].extData) {
if (!this._windows[aWindow.__SSi].extData) {
this._windows[aWindow.__SSi].extData = {};
}
for (var key in winData.extData) {
this._windows[aWindow.__SSi].extData[key] = winData.extData[key];
}
}
if (winData._closedTabs && (root._firstTabs || aOverwriteTabs)) {
this._windows[aWindow.__SSi]._closedTabs = winData._closedTabs;
if (aOverwriteTabs || root._firstTabs) {
this._windows[aWindow.__SSi]._closedTabs = winData._closedTabs || [];
}
this.restoreHistoryPrecursor(aWindow, tabs, winData.tabs,

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

@ -44,6 +44,8 @@ relativesrcdir = browser/components/sessionstore/test/browser
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk
# browser_477657.js is disabled, because it's unreliable (bug 482975).
_BROWSER_TEST_FILES = \
browser_248970_a.js \
browser_248970_b.js \

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

@ -0,0 +1,95 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is sessionstore test code.
*
* The Initial Developer of the Original Code is
* Simon Bünzli <zeniko@gmail.com>.
* Portions created by the Initial Developer are Copyright (C) 2009
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
function test() {
/** Test for Bug 477657 **/
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
waitForExplicitFinish();
let newWin = openDialog(location, "_blank", "chrome,all,dialog=no");
newWin.addEventListener("load", function(aEvent) {
let newState = { windows: [{
tabs: [{ entries: [] }],
_closedTabs: [{
state: { entries: [{ url: "about:" }]},
title: "About:"
}],
sizemode: "maximized"
}] };
let uniqueKey = "bug 477657";
let uniqueValue = "unik" + Date.now();
ss.setWindowValue(newWin, uniqueKey, uniqueValue);
is(ss.getWindowValue(newWin, uniqueKey), uniqueValue,
"window value was set before the window was overwritten");
ss.setWindowState(newWin, JSON.stringify(newState), true);
// use setTimeout(..., 0) to mirror sss_restoreWindowFeatures
setTimeout(function() {
is(ss.getWindowValue(newWin, uniqueKey), "",
"window value was implicitly cleared");
is(newWin.windowState, newWin.STATE_MAXIMIZED,
"the window was maximized");
is(JSON.parse(ss.getClosedTabData(newWin)).length, 1,
"the closed tab was added before the window was overwritten");
delete newState.windows[0]._closedTabs;
delete newState.windows[0].sizemode;
ss.setWindowState(newWin, JSON.stringify(newState), true);
setTimeout(function() {
is(JSON.parse(ss.getClosedTabData(newWin)).length, 0,
"closed tabs were implicitly cleared");
is(newWin.windowState, newWin.STATE_MAXIMIZED,
"the window remains maximized");
newState.windows[0].sizemode = "normal";
ss.setWindowState(newWin, JSON.stringify(newState), true);
setTimeout(function() {
isnot(newWin.windowState, newWin.STATE_MAXIMIZED,
"the window was explicitly unmaximized");
newWin.close();
finish();
}, 0);
}, 0);
}, 0);
}, false);
}

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

@ -144,8 +144,10 @@ $(CONFIG_DIR)/setup.exe::
for i in $(PP_LOCALIZED_FILES); do \
$(PERL) $(topsrcdir)/config/preprocessor.pl $(DEFINES) $(ACDEFINES) $(srcdir)/$$i > $(CONFIG_DIR)/$$i; \
done
ifeq ($(CONFIG_DIR),instgen)
$(PERL) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/make-installremoves.pl \
../removed-files > $(CONFIG_DIR)/removed-files.log
endif
$(PERL) $(topsrcdir)/config/preprocessor.pl -Fsubstitution $(DEFINES) $(ACDEFINES) \
$(srcdir)/nsis/defines.nsi.in | iconv -f UTF-8 -t UTF-16LE | \
cat $(MOZILLA_DIR)/toolkit/mozapps/installer/windows/nsis/utf16-le-bom.bin - > \

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

@ -9,6 +9,8 @@
<!ENTITY reloadAllTabs.accesskey "A">
<!ENTITY reloadTab.label "Reload Tab">
<!ENTITY reloadTab.accesskey "r">
<!ENTITY openTabInNewWindow.label "Open in a New Window">
<!ENTITY openTabInNewWindow.accesskey "W">
<!ENTITY listAllTabs.label "List all tabs">
<!ENTITY bookmarkAllTabs.label "Bookmark All Tabs…">
<!ENTITY bookmarkAllTabs.accesskey "T">

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

@ -38,7 +38,7 @@ dnl ***** END LICENSE BLOCK *****
AC_DEFUN(MOZ_PROG_CHECKMSYS,
[AC_REQUIRE([AC_INIT_BINSH])dnl
if test `uname -o` = Msys; then
if test `uname -s | grep -c MINGW 2>/dev/null` != "0"; then
msyshost=1
fi
])

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

@ -154,11 +154,11 @@ clean clobber realclean clobber_all::
cd $(MKDEPEND_DIR); $(MAKE) $@
endif
PYUNITS := unit-Expression.py unit-Preprocessor.py
PYUNITS := unit-Expression.py unit-Preprocessor.py unit-nsinstall.py
check:: check-preprocessor check-jar-mn
check:: check-python-modules check-jar-mn
check-preprocessor::
check-python-modules::
@$(EXIT_ON_ERROR) \
for test in $(PYUNITS); do \
$(PYTHON) $(srcdir)/tests/$$test ; \

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

@ -49,91 +49,106 @@ import os.path
import sys
import shutil
usage = "usage: %prog [options] arg1 [arg2 ...] target-directory"
p = OptionParser(usage=usage)
def nsinstall(argv):
usage = "usage: %prog [options] arg1 [arg2 ...] target-directory"
p = OptionParser(usage=usage)
p.add_option('-D', action="store_true",
help="Create a single directory only")
p.add_option('-t', action="store_true",
help="Preserve time stamp")
p.add_option('-m', action="store",
help="Set mode", metavar="mode")
p.add_option('-d', action="store_true",
help="Create directories in target")
p.add_option('-R', action="store_true",
help="Use relative symbolic links (ignored)")
p.add_option('-l', action="store_true",
help="Create link (ignored)")
p.add_option('-L', action="store", metavar="linkprefix",
help="Link prefix (ignored)")
p.add_option('-D', action="store_true",
help="Create a single directory only")
p.add_option('-t', action="store_true",
help="Preserve time stamp")
p.add_option('-m', action="store",
help="Set mode", metavar="mode")
p.add_option('-d', action="store_true",
help="Create directories in target")
p.add_option('-R', action="store_true",
help="Use relative symbolic links (ignored)")
p.add_option('-l', action="store_true",
help="Create link (ignored)")
p.add_option('-L', action="store", metavar="linkprefix",
help="Link prefix (ignored)")
# The remaining arguments are not used in our tree, thus they're not
# implented.
def BadArg(option, opt, value, parser):
parser.error('option not supported: %s' % opt)
# The remaining arguments are not used in our tree, thus they're not
# implented.
def BadArg(option, opt, value, parser):
parser.error('option not supported: %s' % opt)
p.add_option('-C', action="callback", metavar="CWD",
callback=BadArg,
help="NOT SUPPORTED")
p.add_option('-o', action="callback", callback=BadArg,
help="Set owner (NOT SUPPORTED)", metavar="owner")
p.add_option('-g', action="callback", callback=BadArg,
help="Set group (NOT SUPPORTED)", metavar="group")
p.add_option('-C', action="callback", metavar="CWD",
callback=BadArg,
help="NOT SUPPORTED")
p.add_option('-o', action="callback", callback=BadArg,
help="Set owner (NOT SUPPORTED)", metavar="owner")
p.add_option('-g', action="callback", callback=BadArg,
help="Set group (NOT SUPPORTED)", metavar="group")
(options, args) = p.parse_args(argv)
(options, args) = p.parse_args()
if options.m:
# mode is specified
try:
options.m = int(options.m, 8)
except:
sys.stderr.write('nsinstall: ' + options.m + ' is not a valid mode\n')
return 1
if options.m:
# mode is specified
try:
options.m = int(options.m, 8)
except:
sys.stderr.write('nsinstall: ' + options.m + ' is not a valid mode\n')
sys.exit(1)
# just create one directory?
if options.D:
if len(args) != 1:
sys.exit(1)
if os.path.exists(args[0]):
if not os.path.isdir(args[0]):
sys.stderr.write('nsinstall: ' + args[0] + ' is not a directory\n')
sys.exit(1)
# just create one directory?
if options.D:
if len(args) != 1:
return 1
if os.path.exists(args[0]):
if not os.path.isdir(args[0]):
sys.stderr.write('nsinstall: ' + args[0] + ' is not a directory\n')
sys.exit(1)
if options.m:
os.chmod(args[0], options.m)
sys.exit()
if options.m:
os.chmod(args[0], options.m)
sys.exit()
if options.m:
os.makedirs(args[0], options.m)
else:
os.makedirs(args[0])
sys.exit()
# nsinstall arg1 [...] directory
if len(args) < 2:
p.error('not enough arguments')
# set up handler
if options.d:
# we're supposed to create directories
def handleTarget(srcpath, targetpath):
# target directory was already created, just use mkdir
os.mkdir(dest)
else:
# we're supposed to copy files
def handleTarget(srcpath, targetpath):
if options.t:
shutil.copy2(srcpath, targetpath)
os.makedirs(args[0], options.m)
else:
shutil.copy(srcpath, targetpath)
os.makedirs(args[0])
return 0
# the last argument is the target directory
target = args.pop()
# ensure target directory
if not os.path.isdir(target):
os.makedirs(target)
# nsinstall arg1 [...] directory
if len(args) < 2:
p.error('not enough arguments')
for f in args:
dest = os.path.join(target,
os.path.basename(os.path.normpath(f)))
handleTarget(f, dest)
if options.m:
os.chmod(dest, options.m)
def copy_all_entries(entries, target):
for e in entries:
dest = os.path.join(target,
os.path.basename(os.path.normpath(e)))
handleTarget(e, dest)
if options.m:
os.chmod(dest, options.m)
# set up handler
if options.d:
# we're supposed to create directories
def handleTarget(srcpath, targetpath):
# target directory was already created, just use mkdir
os.mkdir(targetpath)
else:
# we're supposed to copy files
def handleTarget(srcpath, targetpath):
if os.path.isdir(srcpath):
os.mkdir(targetpath)
entries = [os.path.join(srcpath, e) for e in os.listdir(srcpath)]
copy_all_entries(entries, targetpath)
# options.t is not relevant for directories
if options.m:
os.chmod(targetpath, options.m)
elif options.t:
shutil.copy2(srcpath, targetpath)
else:
shutil.copy(srcpath, targetpath)
# the last argument is the target directory
target = args.pop()
# ensure target directory
if not os.path.isdir(target):
os.makedirs(target)
copy_all_entries(args, target)
return 0
if __name__ == '__main__':
sys.exit(nsinstall(sys.argv[1:]))

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

@ -131,73 +131,47 @@ endif
testxpcobjdir = $(DEPTH)/_tests/xpcshell
# Test file installation
libs::
@$(EXIT_ON_ERROR) \
for testdir in $(XPCSHELL_TESTS); do \
$(INSTALL) \
$(srcdir)/$$testdir/*.js \
$(testxpcobjdir)/$(MODULE)/$$testdir; \
done
# Path formats on Windows are hard. We require a topsrcdir formatted so that
# it may be passed to nsILocalFile.initWithPath (in other words, an absolute
# path of the form X:\path\to\topsrcdir), which we store in NATIVE_TOPSRCDIR.
# We require a forward-slashed path to topsrcdir so that it may be combined
# with a relative forward-slashed path for loading scripts, both dynamically
# and statically for head/test/tail JS files. Of course, on non-Windows none
# of this matters, and things will work correctly because everything's
# forward-slashed, everywhere, always.
ifdef CYGWIN_WRAPPER
NATIVE_TOPSRCDIR := `cygpath -wa $(topsrcdir)`
FWDSLASH_TOPSRCDIR := `cygpath -ma $(topsrcdir)`
else
FWDSLASH_TOPSRCDIR := $(topsrcdir)
ifeq ($(HOST_OS_ARCH),WINNT)
NATIVE_TOPSRCDIR := $(subst /,\\,$(WIN_TOP_SRC))
else
ifeq ($(HOST_OS_ARCH),os2-emx)
NATIVE_TOPSRCDIR := $(subst /,\\,$(topsrcdir))
else
NATIVE_TOPSRCDIR := $(topsrcdir)
endif
endif
endif # CYGWIN_WRAPPER
define _INSTALL_TESTS
$(INSTALL) $(wildcard $(srcdir)/$(dir)/*.js) $(testxpcobjdir)/$(MODULE)/$(dir)
endef # do not remove the blank line!
SOLO_FILE ?= $(error Specify a test filename in SOLO_FILE when using check-interactive or check-one)
libs::
$(foreach dir,$(XPCSHELL_TESTS),$(_INSTALL_TESTS))
testxpcsrcdir = $(topsrcdir)/testing/xpcshell
# Test execution
# Execute all tests in the $(XPCSHELL_TESTS) directories.
check::
@$(EXIT_ON_ERROR) \
for testdir in $(XPCSHELL_TESTS); do \
$(RUN_TEST_PROGRAM) \
$(testxpcsrcdir)/test_all.sh \
$(DIST)/bin/xpcshell \
$(FWDSLASH_TOPSRCDIR) \
$(NATIVE_TOPSRCDIR) \
$(testxpcobjdir)/$(MODULE)/$$testdir; \
done
$(PYTHON) \
$(testxpcsrcdir)/runxpcshelltests.py \
$(DIST)/bin/xpcshell \
$(topsrcdir) \
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(MODULE)/$(dir))
# Test execution
# Execute a single test, specified in $(SOLO_FILE), but don't automatically
# start the test. Instead, present the xpcshell prompt so the user can
# attach a debugger and then start the test.
check-interactive::
@$(EXIT_ON_ERROR) \
$(RUN_TEST_PROGRAM) \
$(testxpcsrcdir)/test_one.sh \
$(DIST)/bin/xpcshell \
$(FWDSLASH_TOPSRCDIR) \
$(NATIVE_TOPSRCDIR) \
$(testxpcobjdir)/$(MODULE)/$$testdir \
$(SOLO_FILE) 1;
$(PYTHON) \
$(testxpcsrcdir)/runxpcshelltests.py \
--test=$(SOLO_FILE) \
--interactive \
$(DIST)/bin/xpcshell \
$(topsrcdir) \
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(MODULE)/$(dir))
# Test execution
# Execute a single test, specified in $(SOLO_FILE)
check-one::
@$(EXIT_ON_ERROR) \
$(RUN_TEST_PROGRAM) \
$(testxpcsrcdir)/test_one.sh \
$(DIST)/bin/xpcshell \
$(FWDSLASH_TOPSRCDIR) \
$(NATIVE_TOPSRCDIR) \
$(testxpcobjdir)/$(MODULE)/$$testdir \
$(SOLO_FILE) 0;
$(PYTHON) \
$(testxpcsrcdir)/runxpcshelltests.py \
--test=$(SOLO_FILE) \
$(DIST)/bin/xpcshell \
$(topsrcdir) \
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(MODULE)/$(dir))
endif # XPCSHELL_TESTS

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

@ -0,0 +1,106 @@
import unittest
import os, sys, os.path, time
from tempfile import mkdtemp
from shutil import rmtree
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from nsinstall import nsinstall
class TestNsinstall(unittest.TestCase):
"""
Unit tests for nsinstall.py
"""
def setUp(self):
self.tmpdir = mkdtemp()
def tearDown(self):
rmtree(self.tmpdir)
# utility methods for tests
def touch(self, file, dir=None):
if dir is None:
dir = self.tmpdir
f = os.path.join(dir, file)
open(f, 'w').close()
return f
def mkdirs(self, dir):
d = os.path.join(self.tmpdir, dir)
os.makedirs(d)
return d
def test_nsinstall_D(self):
"Test nsinstall -D <dir>"
testdir = os.path.join(self.tmpdir, "test")
self.assertEqual(nsinstall(["-D", testdir]), 0)
self.assert_(os.path.isdir(testdir))
def test_nsinstall_basic(self):
"Test nsinstall <file> <dir>"
testfile = self.touch("testfile")
testdir = self.mkdirs("testdir")
self.assertEqual(nsinstall([testfile, testdir]), 0)
self.assert_(os.path.isfile(os.path.join(testdir, "testfile")))
def test_nsinstall_basic_recursive(self):
"Test nsinstall <dir> <dest dir>"
sourcedir = self.mkdirs("sourcedir")
self.touch("testfile", sourcedir)
destdir = self.mkdirs("destdir")
self.assertEqual(nsinstall([sourcedir, destdir]), 0)
testdir = os.path.join(destdir, "sourcedir")
self.assert_(os.path.isdir(testdir))
self.assert_(os.path.isfile(os.path.join(testdir, "testfile")))
def test_nsinstall_multiple(self):
"Test nsinstall <three files> <dest dir>"
testfiles = [self.touch("testfile1"),
self.touch("testfile2"),
self.touch("testfile3")]
testdir = self.mkdirs("testdir")
self.assertEqual(nsinstall(testfiles + [testdir]), 0)
for f in testfiles:
self.assert_(os.path.isfile(os.path.join(testdir,
os.path.basename(f))))
def test_nsinstall_t(self):
"Test that nsinstall -t works (preserve timestamp)"
testfile = self.touch("testfile")
testdir = self.mkdirs("testdir")
# set mtime to now - 30 seconds
t = int(time.time()) - 30
os.utime(testfile, (t, t))
self.assertEqual(nsinstall(["-t", testfile, testdir]), 0)
destfile = os.path.join(testdir, "testfile")
self.assert_(os.path.isfile(destfile))
self.assertEqual(os.stat(testfile).st_mtime,
os.stat(destfile).st_mtime)
if sys.platform != "win32":
# can't run this test on windows, don't have real file modes there
def test_nsinstall_m(self):
"Test that nsinstall -m works (set mode)"
testfile = self.touch("testfile")
mode = 0600
os.chmod(testfile, mode)
testdir = self.mkdirs("testdir")
self.assertEqual(nsinstall(["-m", "%04o" % mode, testfile, testdir]), 0)
destfile = os.path.join(testdir, "testfile")
self.assert_(os.path.isfile(destfile))
self.assertEqual(os.stat(testfile).st_mode,
os.stat(destfile).st_mode)
def test_nsinstall_d(self):
"Test that nsinstall -d works (create directories in target)"
# -d makes no sense to me, but ok!
testfile = self.touch("testfile")
testdir = self.mkdirs("testdir")
destdir = os.path.join(testdir, "subdir")
self.assertEqual(nsinstall(["-d", testfile, destdir]), 0)
self.assert_(os.path.isdir(os.path.join(destdir, "testfile")))
#TODO: implement -R, -l, -L and test them!
if __name__ == '__main__':
unittest.main()

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

@ -193,7 +193,7 @@ INCLUDES += \
-I$(srcdir)/../../xbl/src \
-I$(srcdir)/../../../layout/generic \
-I$(srcdir)/../../../layout/style \
-I$(srcdir)/../../../dom/src/base \
-I$(srcdir)/../../../dom/base \
-I$(srcdir)/../../xml/document/src \
-I$(topsrcdir)/xpcom/io \
$(NULL)

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

@ -3154,14 +3154,9 @@ nsCanvasRenderingContext2D::ThebesSurfaceFromElement(nsIDOMElement *imgElt,
if (!forceCopy && canvas->CountContexts() == 1) {
nsICanvasRenderingContextInternal *srcCanvas = canvas->GetContextAtIndex(0);
rv = srcCanvas->GetThebesSurface(getter_AddRefs(sourceSurface));
#ifndef WINCE
// force a copy if we couldn't get the surface, or if it's
// the same as what we have
if (sourceSurface == mSurface || NS_FAILED(rv))
#else
// force a copy if we couldn't get the surface
if (NS_FAILED(rv))
#endif
sourceSurface = nsnull;
}

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

@ -108,7 +108,7 @@ LOCAL_INCLUDES = \
-I$(srcdir)/../../html/base/src \
-I$(srcdir)/../../xul/content/src \
-I$(srcdir)/../../xml/content/src \
-I$(srcdir)/../../../dom/src/base \
-I$(srcdir)/../../../dom/base \
-I$(srcdir)/../../../layout/generic \
-I$(srcdir)/../../../layout/xul/base/src \
-I$(srcdir)/../../../layout/xul/base/src/tree/src \

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

@ -211,8 +211,10 @@ nsIMEStateManager::IsActive(nsPresContext* aPresContext)
// This root window is not active.
return PR_FALSE;
}
NS_ENSURE_TRUE(aPresContext->GetPresShell(), PR_FALSE);
nsIViewManager* vm = aPresContext->GetViewManager();
nsIPresShell* shell = aPresContext->GetPresShell();
NS_ENSURE_TRUE(shell, NS_ERROR_NOT_AVAILABLE);
nsIViewManager* vm = shell->GetViewManager();
NS_ENSURE_TRUE(vm, PR_FALSE);
nsCOMPtr<nsIViewObserver> observer;
vm->GetViewObserver(*getter_AddRefs(observer));
@ -274,7 +276,10 @@ nsIMEStateManager::SetIMEState(nsPresContext* aPresContext,
nsIWidget*
nsIMEStateManager::GetWidget(nsPresContext* aPresContext)
{
nsIViewManager* vm = aPresContext->GetViewManager();
nsIPresShell* shell = aPresContext->GetPresShell();
NS_ENSURE_TRUE(shell, nsnull);
nsIViewManager* vm = shell->GetViewManager();
if (!vm)
return nsnull;
nsCOMPtr<nsIWidget> widget = nsnull;
@ -540,7 +545,10 @@ nsIMEStateManager::OnTextStateFocus(nsPresContext* aPresContext,
nsINode *editableNode = GetRootEditableNode(aPresContext, aContent);
if (!editableNode) return NS_OK;
nsIViewManager* vm = aPresContext->GetViewManager();
nsIPresShell* shell = aPresContext->GetPresShell();
NS_ENSURE_TRUE(shell, NS_ERROR_NOT_AVAILABLE);
nsIViewManager* vm = shell->GetViewManager();
NS_ENSURE_TRUE(vm, NS_ERROR_NOT_AVAILABLE);
nsCOMPtr<nsIWidget> widget;

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

@ -107,7 +107,7 @@ INCLUDES += \
-I$(srcdir)/../../../events/src \
-I$(srcdir)/../../content/src \
-I$(srcdir)/../../../../layout/style \
-I$(srcdir)/../../../../dom/src/base \
-I$(srcdir)/../../../../dom/base \
$(NULL)
DEFINES += -D_IMPL_NS_LAYOUT

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

@ -479,12 +479,8 @@ nsImageDocument::ScrollImageTo(PRInt32 aX, PRInt32 aY, PRBool restoreImage)
nsIPresShell *shell = GetPrimaryShell();
if (!shell)
return NS_OK;
nsPresContext* context = shell->GetPresContext();
if (!context)
return NS_OK;
nsIViewManager* vm = context->GetViewManager();
nsIViewManager* vm = shell->GetViewManager();
if (!vm)
return NS_OK;

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

@ -110,7 +110,7 @@ LOCAL_INCLUDES = \
-I$(srcdir)/../../xul/document/src \
-I$(srcdir)/../../events/src \
-I$(srcdir)/../../../layout/style \
-I$(srcdir)/../../../dom/src/base \
-I$(srcdir)/../../../dom/base \
$(NULL)
DEFINES += -D_IMPL_NS_LAYOUT

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

@ -90,7 +90,7 @@ LOCAL_INCLUDES = \
-I$(srcdir)/../../../base/src \
-I$(srcdir)/../../../xul/content/src \
-I$(srcdir)/../../../events/src \
-I$(srcdir)/../../../../dom/src/base \
-I$(srcdir)/../../../../dom/base \
$(NULL)
DEFINES += -D_IMPL_NS_LAYOUT

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

@ -151,6 +151,7 @@ EXPORTS
sqlite3_snprintf
sqlite3_sql
sqlite3_step
sqlite3_stmt_status
sqlite3_thread_cleanup
sqlite3_total_changes
sqlite3_trace

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

@ -3950,11 +3950,11 @@ nsDocShell::DoGetPositionAndSize(PRInt32 * x, PRInt32 * y, PRInt32 * cx,
NS_IMETHODIMP
nsDocShell::Repaint(PRBool aForce)
{
nsCOMPtr<nsPresContext> context;
GetPresContext(getter_AddRefs(context));
NS_ENSURE_TRUE(context, NS_ERROR_FAILURE);
nsCOMPtr<nsIPresShell> presShell;
GetPresShell(getter_AddRefs(presShell));
NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
nsIViewManager* viewManager = context->GetViewManager();
nsIViewManager* viewManager = presShell->GetViewManager();
NS_ENSURE_TRUE(viewManager, NS_ERROR_FAILURE);
// what about aForce ?

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

@ -75,7 +75,8 @@ DIRS += interfaces/smil
endif
DIRS += \
public \
public/coreEvents \
base \
src \
locales \
tests \

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

@ -35,7 +35,7 @@
#
# ***** END LICENSE BLOCK *****
DEPTH = ../../..
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
@ -45,54 +45,39 @@ include $(DEPTH)/config/autoconf.mk
MODULE = dom
LIBRARY_NAME = jsdombase_s
LIBXUL_LIBRARY = 1
FORCE_STATIC_LIB = 1
REQUIRES = xpcom \
string \
webbrwsr \
commandhandler \
js \
widget \
gfx \
thebes \
layout \
content \
caps \
docshell \
xpconnect \
pref \
oji \
necko \
nkcache \
mimetype \
java \
locale \
prefetch \
xuldoc \
webshell \
view \
uconv \
shistory \
plugin \
windowwatcher \
chardet \
find \
appshell \
intl \
unicharutil \
rdf \
xultmpl \
jar \
storage \
htmlparser \
$(NULL)
XPIDLSRCS = \
nsIEntropyCollector.idl \
nsIScriptChannel.idl \
$(NULL)
ifdef NS_TRACE_MALLOC
REQUIRES += tracemalloc
endif
ifdef MOZ_JSDEBUGGER
REQUIRES += jsdebug
endif
EXPORTS = \
nsDOMCID.h \
nsDOMClassInfoID.h \
nsDOMError.h \
nsDOMJSUtils.h \
nsDOMScriptObjectHolder.h \
nsDOMString.h \
nsIBaseDOMException.h \
nsIDOMClassInfo.h \
nsIDOMScriptObjectFactory.h \
nsIFocusController.h \
nsIJSEventListener.h \
nsIJSNativeInitializer.h \
nsIScriptContext.h \
nsIScriptExternalNameSet.h \
nsIScriptGlobalObject.h \
nsIScriptGlobalObjectOwner.h \
nsIScriptNameSpaceManager.h \
nsIScriptObjectOwner.h \
nsIScriptObjectPrincipal.h \
nsIScriptRuntime.h \
nsIScriptTimeoutHandler.h \
nsPIDOMWindow.h \
nsPIWindowRoot.h \
nsWrapperCache.h \
$(NULL)
CPPSRCS = \
nsBarProps.cpp \
@ -116,26 +101,7 @@ CPPSRCS = \
nsDOMScriptObjectFactory.cpp \
$(NULL)
# we don't want the shared lib, but we want to force the creation of a
# static lib.
FORCE_STATIC_LIB = 1
LOCAL_INCLUDES = \
-I$(srcdir)/../events \
-I$(srcdir)/../storage \
-I$(srcdir)/../offline \
-I$(srcdir)/../geolocation \
-I$(srcdir)/../threads \
-I$(topsrcdir)/content/xbl/src \
-I$(topsrcdir)/content/xul/document/src \
-I$(topsrcdir)/content/events/src \
-I$(topsrcdir)/content/base/src \
-I$(topsrcdir)/content/html/document/src \
-I$(topsrcdir)/layout/style \
-I$(topsrcdir)/layout/xul/base/src/tree/src \
$(NULL)
DEFINES += -D_IMPL_NS_LAYOUT
include $(topsrcdir)/dom/dom-config.mk
ifdef MOZ_JSDEBUGGER
DEFINES += -DMOZ_JSDEBUGGER

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -490,7 +490,12 @@ nsDOMWindowUtils::ProcessUpdates()
nsPresContext* presContext = GetPresContext();
if (!presContext)
return NS_ERROR_UNEXPECTED;
nsIViewManager *viewManager = presContext->GetViewManager();
nsIPresShell* shell = presContext->GetPresShell();
if (!shell)
return NS_ERROR_UNEXPECTED;
nsIViewManager *viewManager = shell->GetViewManager();
if (!viewManager)
return NS_ERROR_UNEXPECTED;

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

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

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

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

@ -8164,10 +8164,10 @@ nsGlobalWindow::GetScrollInfo(nsIScrollableView **aScrollableView)
return NS_OK;
}
nsCOMPtr<nsPresContext> presContext;
mDocShell->GetPresContext(getter_AddRefs(presContext));
if (presContext) {
nsIViewManager* vm = presContext->GetViewManager();
nsCOMPtr<nsIPresShell> presShell;
mDocShell->GetPresShell(getter_AddRefs(presShell));
if (presShell) {
nsIViewManager* vm = presShell->GetViewManager();
if (vm)
return vm->GetRootScrollableView(aScrollableView);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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