'
};}
];
function delayReply(data) {
- var p = new Promise();
+ var p = new imports.Promise();
executeSoon(function() {
p.resolve(data);
});
diff --git a/browser/locales/en-US/chrome/browser/devtools/debugger.dtd b/browser/locales/en-US/chrome/browser/devtools/debugger.dtd
index 5c4649e18e2..ae4297a7920 100644
--- a/browser/locales/en-US/chrome/browser/devtools/debugger.dtd
+++ b/browser/locales/en-US/chrome/browser/devtools/debugger.dtd
@@ -11,6 +11,14 @@
- application menu item that opens the debugger UI. -->
+
+
+
+
+
+
@@ -44,3 +52,7 @@
- widget that displays the variables in the various available scopes in the
- debugger. -->
+
+
+
diff --git a/browser/locales/en-US/chrome/browser/devtools/debugger.properties b/browser/locales/en-US/chrome/browser/devtools/debugger.properties
index 90642b1581c..77e7738c882 100644
--- a/browser/locales/en-US/chrome/browser/devtools/debugger.properties
+++ b/browser/locales/en-US/chrome/browser/devtools/debugger.properties
@@ -38,9 +38,9 @@ withScope=With block
# pane as a header on container for identifiers in a closure scope.
closureScope=Closure
-# LOCALIZATION NOTE (emptyText): The text that is displayed in the stack frames
-# list when there are no frames to display.
-emptyText=Empty
+# LOCALIZATION NOTE (emptyStackText): The text that is displayed in the stack
+# frames list when there are no frames to display.
+emptyStackText=No stacks to display.
# LOCALIZATION NOTE (loadingText): The text that is displayed in the script
# editor when the laoding process has started but there is no file to display
diff --git a/browser/locales/en-US/chrome/browser/devtools/inspector.properties b/browser/locales/en-US/chrome/browser/devtools/inspector.properties
index 6eb67470c5a..114448e4f8e 100644
--- a/browser/locales/en-US/chrome/browser/devtools/inspector.properties
+++ b/browser/locales/en-US/chrome/browser/devtools/inspector.properties
@@ -20,11 +20,16 @@ breadcrumbs.siblings=Siblings
# LOCALIZATION NOTE (htmlPanel): Used in the Inspector tool's openInspectorUI
# method when registering the HTML panel.
-# LOCALIZATION NOTE (inspectButton.tooltiptext):
+# LOCALIZATION NOTE (inspectButtonWithShortcutKey.tooltip):
# This button appears in the Inspector Toolbar. inspectButton is stateful,
# if it's pressed users can select an element with the mouse.
# %S is the keyboard shortcut.
-inspectButton.tooltiptext=Select element with mouse (%S)
+inspectButtonWithShortcutKey.tooltip=Select element with mouse (%S)
+
+# LOCALIZATION NOTE (inspectButton.tooltip):
+# Same as inspectButtonWithShortcutKey.tooltip but used when an add-on
+# overrides the shortcut key.
+inspectButton.tooltip=Select element with mouse
# LOCALIZATION NOTE (markupButton.*):
# This button is the button located at the beginning of the breadcrumbs
diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp
index a3098a24aa4..e5260e3e7ac 100644
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -2783,8 +2783,13 @@ nsDocument::GetActiveElement(nsIDOMElement **aElement)
getter_AddRefs(focusedWindow));
// be safe and make sure the element is from this document
if (focusedContent && focusedContent->OwnerDoc() == this) {
- CallQueryInterface(focusedContent, aElement);
- return NS_OK;
+ if (focusedContent->IsInNativeAnonymousSubtree()) {
+ focusedContent = focusedContent->FindFirstNonNativeAnonymous();
+ }
+ if (focusedContent) {
+ CallQueryInterface(focusedContent, aElement);
+ return NS_OK;
+ }
}
}
diff --git a/content/events/src/nsEventListenerManager.cpp b/content/events/src/nsEventListenerManager.cpp
index c2c6fc1d0e3..36176ab0802 100644
--- a/content/events/src/nsEventListenerManager.cpp
+++ b/content/events/src/nsEventListenerManager.cpp
@@ -563,7 +563,8 @@ nsEventListenerManager::AddScriptEventListener(nsIAtom *aName,
// Try to get context from doc
// XXX sXBL/XBL2 issue -- do we really want the owner here? What
// if that's the XBL document?
- global = node->OwnerDoc()->GetScriptGlobalObject();
+ doc = node->OwnerDoc();
+ global = doc->GetScriptGlobalObject();
} else {
nsCOMPtr win(do_QueryInterface(mTarget));
if (win) {
diff --git a/content/events/test/test_bug238987.html b/content/events/test/test_bug238987.html
index c9c58432de2..7068ac54c99 100644
--- a/content/events/test/test_bug238987.html
+++ b/content/events/test/test_bug238987.html
@@ -61,6 +61,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=238987
expected + "], got [" + e.target.id + "]");
} else {
var expected = forwardFocusArray.shift();
+ is(e.target, document.activeElement, "Wrong activeElement!");
ok(expected == e.target.id,
"(focus) Forward tabbing, expected [" +
expected + "], got [" + e.target.id + "]");
diff --git a/content/html/content/test/test_bug430351.html b/content/html/content/test/test_bug430351.html
index 04587c9710c..ad761d1b906 100644
--- a/content/html/content/test/test_bug430351.html
+++ b/content/html/content/test/test_bug430351.html
@@ -216,13 +216,8 @@ var nonFocusableElements = [
"",
"",
- "",
- "",
- "",
"",
- "",
"",
- "",
"",
"",
@@ -326,6 +321,12 @@ var focusableInContentEditable = [
"",
"",
+ "",
+ "",
+ "",
+ "",
+ "",
+
"",
"",
"",
@@ -456,6 +457,13 @@ function testElements(parent, tags, shouldBeFocusable)
var errorPrefix = serializer.serializeToString(element) + " in " +
serializer.serializeToString(parent);
+ try {
+ // Make sure activeElement doesn't point to a
+ // native anonymous element.
+ parent.ownerDocument.activeElement.localName;
+ } catch (ex) {
+ ok(false, ex + errorPrefix + errorSuffix);
+ }
if (focusable ? focusable.indexOf(tag) > -1 : shouldBeFocusable) {
is(parent.ownerDocument.activeElement, element,
errorPrefix + " should be focusable" + errorSuffix);
diff --git a/media/libopus/update.sh b/media/libopus/update.sh
old mode 100755
new mode 100644
diff --git a/toolkit/devtools/debugger/server/dbg-script-actors.js b/toolkit/devtools/debugger/server/dbg-script-actors.js
index a479825756c..d5aef886b41 100644
--- a/toolkit/devtools/debugger/server/dbg-script-actors.js
+++ b/toolkit/devtools/debugger/server/dbg-script-actors.js
@@ -714,29 +714,29 @@ ThreadActor.prototype = {
},
/**
- * Create and return an environment actor that corresponds to the
- * Debugger.Environment for the provided object.
- * @param Debugger.Object aObject
- * The object whose lexical environment we want to extract.
+ * Create and return an environment actor that corresponds to the provided
+ * Debugger.Environment.
+ * @param Debugger.Environment aEnvironment
+ * The lexical environment we want to extract.
* @param object aPool
* The pool where the newly-created actor will be placed.
- * @return The EnvironmentActor for aObject or undefined for host functions or
- * functions scoped to a non-debuggee global.
+ * @return The EnvironmentActor for aEnvironment or undefined for host
+ * functions or functions scoped to a non-debuggee global.
*/
- createEnvironmentActor: function TA_createEnvironmentActor(aObject, aPool) {
- let environment = aObject.environment;
- if (!environment) {
+ createEnvironmentActor:
+ function TA_createEnvironmentActor(aEnvironment, aPool) {
+ if (!aEnvironment) {
return undefined;
}
- if (environment.actor) {
- return environment.actor;
+ if (aEnvironment.actor) {
+ return aEnvironment.actor;
}
- let actor = new EnvironmentActor(aObject, this);
+ let actor = new EnvironmentActor(aEnvironment, this);
this._environmentActors.push(actor);
aPool.addActor(actor);
- environment.actor = actor;
+ aEnvironment.actor = actor;
return actor;
},
@@ -1054,7 +1054,7 @@ ObjectActor.prototype = {
let descriptor = {};
descriptor.configurable = aObject.configurable;
descriptor.enumerable = aObject.enumerable;
- if (aObject.value) {
+ if (aObject.value !== undefined) {
descriptor.writable = aObject.writable;
descriptor.value = this.threadActor.createValueGrip(aObject.value);
} else {
@@ -1102,7 +1102,7 @@ ObjectActor.prototype = {
" 'Function' class." };
}
- let envActor = this.threadActor.createEnvironmentActor(this.obj,
+ let envActor = this.threadActor.createEnvironmentActor(this.obj.environment,
this.registeredPool);
if (!envActor) {
return { error: "notDebuggee",
@@ -1110,7 +1110,7 @@ ObjectActor.prototype = {
}
return { name: this.obj.name || null,
- scope: envActor.form() };
+ scope: envActor.form(this.obj) };
},
/**
@@ -1239,9 +1239,9 @@ FrameActor.prototype = {
}
let envActor = this.threadActor
- .createEnvironmentActor(this.frame,
+ .createEnvironmentActor(this.frame.environment,
this.frameLifetimePool);
- form.environment = envActor ? envActor.form() : envActor;
+ form.environment = envActor ? envActor.form(this.frame) : envActor;
form.this = this.threadActor.createValueGrip(this.frame.this);
form.arguments = this._args();
if (this.frame.script) {
@@ -1350,14 +1350,14 @@ BreakpointActor.prototype.requestTypes = {
* the bindings introduced by a lexical environment and assigning new values to
* those identifier bindings.
*
- * @param Debugger.Object aObject
- * The object whose lexical environment will be used to create the actor.
+ * @param Debugger.Environment aEnvironment
+ * The lexical environment that will be used to create the actor.
* @param ThreadActor aThreadActor
* The parent thread actor that contains this environment.
*/
-function EnvironmentActor(aObject, aThreadActor)
+function EnvironmentActor(aEnvironment, aThreadActor)
{
- this.obj = aObject;
+ this.obj = aEnvironment;
this.threadActor = aThreadActor;
}
@@ -1365,41 +1365,47 @@ EnvironmentActor.prototype = {
actorPrefix: "environment",
/**
- * Returns an environment form for use in a protocol message.
+ * Returns an environment form for use in a protocol message. Note that the
+ * requirement of passing the frame or function as a parameter is only
+ * temporary, since when bug 747514 lands, the environment will have a callee
+ * property that will contain it.
+ *
+ * @param object aObject
+ * The stack frame or function object whose environment bindings are
+ * being generated.
*/
- form: function EA_form() {
+ form: function EA_form(aObject) {
// Debugger.Frame might be dead by the time we get here, which will cause
// accessing its properties to throw.
- if (!this.obj.live) {
+ if (!aObject.live) {
return undefined;
}
let parent;
- if (this.obj.environment.parent) {
- parent = this.threadActor
- .createEnvironmentActor(this.obj.environment.parent,
- this.registeredPool);
+ if (this.obj.parent) {
+ let thread = this.threadActor;
+ parent = thread.createEnvironmentActor(this.obj.parent.environment,
+ this.registeredPool);
}
let form = { actor: this.actorID,
- parent: parent ? parent.form() : parent };
+ parent: parent ? parent.form(this.obj.parent) : parent };
- if (this.obj.environment.type == "object") {
- if (this.obj.environment.parent) {
+ if (aObject.type == "object") {
+ if (this.obj.parent) {
form.type = "with";
} else {
form.type = "object";
}
- form.object = this.threadActor.createValueGrip(this.obj.environment.object);
+ form.object = this.threadActor.createValueGrip(aObject.object);
} else {
- if (this.obj.class == "Function") {
+ if (aObject.class == "Function") {
form.type = "function";
- form.function = this.threadActor.createValueGrip(this.obj);
- form.functionName = this.obj.name;
+ form.function = this.threadActor.createValueGrip(aObject);
+ form.functionName = aObject.name;
} else {
form.type = "block";
}
-
- form.bindings = this._bindings();
+ form.bindings = this._bindings(aObject);
}
return form;
@@ -1407,19 +1413,41 @@ EnvironmentActor.prototype = {
/**
* Return the identifier bindings object as required by the remote protocol
- * specification.
+ * specification. Note that the requirement of passing the frame or function
+ * as a parameter is only temporary, since when bug 747514 lands, the
+ * environment will have a callee property that will contain it.
+ *
+ * @param object aObject [optional]
+ * The stack frame or function object whose environment bindings are
+ * being generated. When left unspecified, the bindings do not contain
+ * an 'arguments' property.
*/
- _bindings: function EA_bindings() {
+ _bindings: function EA_bindings(aObject) {
let bindings = { arguments: [], variables: {} };
- // TODO: this will be redundant after bug 692984 is fixed.
- if (typeof this.obj.environment.getVariableDescriptor != "function") {
+ // TODO: this part should be removed in favor of the commented-out part
+ // below when getVariableDescriptor lands (bug 725815).
+ if (typeof this.obj.getVariable != "function") {
+ //if (typeof this.obj.getVariableDescriptor != "function") {
return bindings;
}
- for (let name in this.obj.parameterNames) {
+ let parameterNames;
+ if (aObject && aObject.callee) {
+ parameterNames = aObject.callee.parameterNames;
+ }
+ for each (let name in parameterNames) {
let arg = {};
- let desc = this.obj.environment.getVariableDescriptor(name);
+ // TODO: this part should be removed in favor of the commented-out part
+ // below when getVariableDescriptor lands (bug 725815).
+ let desc = {
+ value: this.obj.getVariable(name),
+ configurable: false,
+ writable: true,
+ enumerable: true
+ };
+
+ // let desc = this.obj.getVariableDescriptor(name);
let descForm = {
enumerable: true,
configurable: desc.configurable
@@ -1435,14 +1463,22 @@ EnvironmentActor.prototype = {
bindings.arguments.push(arg);
}
- for (let name in this.obj.environment.names()) {
+ for each (let name in this.obj.names()) {
if (bindings.arguments.some(function exists(element) {
return !!element[name];
})) {
continue;
}
- let desc = this.obj.environment.getVariableDescriptor(name);
+ // TODO: this part should be removed in favor of the commented-out part
+ // below when getVariableDescriptor lands.
+ let desc = {
+ value: this.obj.getVariable(name),
+ configurable: false,
+ writable: true,
+ enumerable: true
+ };
+ //let desc = this.obj.getVariableDescriptor(name);
let descForm = {
enumerable: true,
configurable: desc.configurable
@@ -1468,7 +1504,7 @@ EnvironmentActor.prototype = {
* The protocol request object.
*/
onAssign: function EA_onAssign(aRequest) {
- let desc = this.obj.environment.getVariableDescriptor(aRequest.name);
+ let desc = this.obj.getVariableDescriptor(aRequest.name);
if (!desc.writable) {
return { error: "immutableBinding",
@@ -1477,7 +1513,7 @@ EnvironmentActor.prototype = {
}
try {
- this.obj.environment.setVariable(aRequest.name, aRequest.value);
+ this.obj.setVariable(aRequest.name, aRequest.value);
} catch (e) {
if (e instanceof Debugger.DebuggeeWouldRun) {
return { error: "threadWouldRun",
diff --git a/toolkit/devtools/debugger/tests/unit/test_framebindings-01.js b/toolkit/devtools/debugger/tests/unit/test_framebindings-01.js
new file mode 100644
index 00000000000..15ab5febdd6
--- /dev/null
+++ b/toolkit/devtools/debugger/tests/unit/test_framebindings-01.js
@@ -0,0 +1,63 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+/**
+ * Check a frame actor's bindings property.
+ */
+
+var gDebuggee;
+var gClient;
+var gThreadClient;
+
+function run_test()
+{
+ initTestDebuggerServer();
+ gDebuggee = addTestGlobal("test-stack");
+ gClient = new DebuggerClient(DebuggerServer.connectPipe());
+ gClient.connect(function() {
+ attachTestGlobalClientAndResume(gClient, "test-stack", function(aResponse, aThreadClient) {
+ gThreadClient = aThreadClient;
+ test_pause_frame();
+ });
+ });
+ do_test_pending();
+}
+
+function test_pause_frame()
+{
+ gThreadClient.addOneTimeListener("paused", function(aEvent, aPacket) {
+ let bindings = aPacket.frame.environment.bindings;
+ let args = bindings.arguments;
+ let vars = bindings.variables;
+
+ do_check_eq(args.length, 6);
+ do_check_eq(args[0].aNumber.value, 42);
+ do_check_eq(args[1].aBool.value, true);
+ do_check_eq(args[2].aString.value, "nasu");
+ do_check_eq(args[3].aNull.value.type, "null");
+ do_check_eq(args[4].aUndefined.value.type, "undefined");
+ do_check_eq(args[5].aObject.value.type, "object");
+ do_check_eq(args[5].aObject.value.class, "Object");
+ do_check_true(!!args[5].aObject.value.actor);
+
+ do_check_eq(vars.a.value, 1);
+ do_check_eq(vars.b.value, true);
+ do_check_eq(vars.c.value.type, "object");
+ do_check_eq(vars.c.value.class, "Object");
+ do_check_true(!!vars.c.value.actor);
+
+ gThreadClient.resume(function() {
+ finishClient(gClient);
+ });
+ });
+
+ gDebuggee.eval("(" + function() {
+ function stopMe(aNumber, aBool, aString, aNull, aUndefined, aObject) {
+ var a = 1;
+ var b = true;
+ var c = { a: "a" };
+ debugger;
+ };
+ stopMe(42, true, "nasu", null, undefined, { foo: "bar" });
+ } + ")()");
+}
diff --git a/toolkit/devtools/debugger/tests/unit/xpcshell.ini b/toolkit/devtools/debugger/tests/unit/xpcshell.ini
index 43f6ce50b29..d5eda702346 100644
--- a/toolkit/devtools/debugger/tests/unit/xpcshell.ini
+++ b/toolkit/devtools/debugger/tests/unit/xpcshell.ini
@@ -53,3 +53,4 @@ tail =
[test_stepping-02.js]
[test_stepping-03.js]
[test_stepping-04.js]
+[test_framebindings-01.js]
diff --git a/toolkit/mozapps/update/test/unit/head_update.js.in b/toolkit/mozapps/update/test/unit/head_update.js.in
index 4be57247fcf..4ae1e734316 100644
--- a/toolkit/mozapps/update/test/unit/head_update.js.in
+++ b/toolkit/mozapps/update/test/unit/head_update.js.in
@@ -80,6 +80,13 @@ const IS_ANDROID = true;
const IS_ANDROID = false;
#endif
+
+#ifdef MOZ_VERIFY_MAR_SIGNATURE
+const IS_MAR_CHECKS_ENABLED = true;
+#else
+const IS_MAR_CHECKS_ENABLED = false;
+#endif
+
const URL_HOST = "http://localhost:4444/";
const URL_PATH = "data";
diff --git a/toolkit/mozapps/update/test/unit/test_0113_versionDowngradeCheck.js b/toolkit/mozapps/update/test/unit/test_0113_versionDowngradeCheck.js
index a27a51f7b6e..88c6f09a90e 100644
--- a/toolkit/mozapps/update/test/unit/test_0113_versionDowngradeCheck.js
+++ b/toolkit/mozapps/update/test/unit/test_0113_versionDowngradeCheck.js
@@ -47,6 +47,10 @@ const TEST_FILES = [];
const VERSION_DOWNGRADE_ERROR = "23";
function run_test() {
+ if (!IS_MAR_CHECKS_ENABLED) {
+ return;
+ }
+
// Setup an old version MAR file
do_register_cleanup(cleanupUpdaterTest);
setupUpdaterTest(MAR_OLD_VERSION_FILE);
diff --git a/toolkit/mozapps/update/test/unit/test_0114_productChannelCheck.js b/toolkit/mozapps/update/test/unit/test_0114_productChannelCheck.js
index 3d5f7174852..b8c052b385e 100644
--- a/toolkit/mozapps/update/test/unit/test_0114_productChannelCheck.js
+++ b/toolkit/mozapps/update/test/unit/test_0114_productChannelCheck.js
@@ -47,6 +47,10 @@ const TEST_FILES = [];
const MAR_CHANNEL_MISMATCH_ERROR = "22";
function run_test() {
+ if (!IS_MAR_CHECKS_ENABLED) {
+ return;
+ }
+
// Setup a wrong channel MAR file
do_register_cleanup(cleanupUpdaterTest);
setupUpdaterTest(MAR_WRONG_CHANNEL_FILE);