Merge m-c to inbound, a=merge

This commit is contained in:
Wes Kocher 2015-10-23 15:51:31 -07:00
commit f001e7eed9
56 changed files with 491 additions and 236 deletions

View File

@ -12,5 +12,4 @@ if CONFIG['MOZ_EXTENSIONS']:
DIRS += [
'/%s' % CONFIG['MOZ_BRANDING_DIRECTORY'],
'/b2g',
'/devtools',
]

View File

@ -105,9 +105,9 @@ function clearCache() {
function clearCacheAndReload() {
// Reload the main frame with a cleared cache.
debug('Reloading ' + getContentWindow().location);
debug('Reloading ' + shell.contentBrowser.contentWindow.location);
clearCache();
getContentWindow().location.reload(true);
shell.contentBrowser.contentWindow.location.reload(true);
once('mozbrowserlocationchange').then(
evt => {
shell.sendEvent(window, "ContentStart");

View File

@ -15,10 +15,10 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="410e91ddabc7ba82a9b43b3711a3fdf2cb8de309"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="1c6628ed1e40575e5ec3669ab6ef389d4ebeea65"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="c1bbb66f52f9e2d76ce97e7b3aa0cb29957cd7d8"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="3b9a47b517d345b8d98bc7f787b9a6c2f51ca75d"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>

View File

@ -15,10 +15,10 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="410e91ddabc7ba82a9b43b3711a3fdf2cb8de309"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="1c6628ed1e40575e5ec3669ab6ef389d4ebeea65"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="c1bbb66f52f9e2d76ce97e7b3aa0cb29957cd7d8"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="3b9a47b517d345b8d98bc7f787b9a6c2f51ca75d"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>

View File

@ -19,8 +19,8 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="410e91ddabc7ba82a9b43b3711a3fdf2cb8de309"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="c1bbb66f52f9e2d76ce97e7b3aa0cb29957cd7d8"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="1c6628ed1e40575e5ec3669ab6ef389d4ebeea65"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="4ace9aaee0e048dfda11bb787646c59982a3dc80"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="c72c9278ddc2f442d193474993d36e7f2cfb08c4"/>

View File

@ -17,8 +17,8 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="410e91ddabc7ba82a9b43b3711a3fdf2cb8de309"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="c1bbb66f52f9e2d76ce97e7b3aa0cb29957cd7d8"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="1c6628ed1e40575e5ec3669ab6ef389d4ebeea65"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="3b9a47b517d345b8d98bc7f787b9a6c2f51ca75d"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="0c28789b9957913be975eb002a22323f93585d4c"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>

View File

@ -15,9 +15,9 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="410e91ddabc7ba82a9b43b3711a3fdf2cb8de309"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="1c6628ed1e40575e5ec3669ab6ef389d4ebeea65"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="c1bbb66f52f9e2d76ce97e7b3aa0cb29957cd7d8"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="3b9a47b517d345b8d98bc7f787b9a6c2f51ca75d"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>

View File

@ -15,9 +15,9 @@
<project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="410e91ddabc7ba82a9b43b3711a3fdf2cb8de309"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="1c6628ed1e40575e5ec3669ab6ef389d4ebeea65"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="c1bbb66f52f9e2d76ce97e7b3aa0cb29957cd7d8"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="3b9a47b517d345b8d98bc7f787b9a6c2f51ca75d"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>

View File

@ -19,8 +19,8 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="410e91ddabc7ba82a9b43b3711a3fdf2cb8de309"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="c1bbb66f52f9e2d76ce97e7b3aa0cb29957cd7d8"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="1c6628ed1e40575e5ec3669ab6ef389d4ebeea65"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="4ace9aaee0e048dfda11bb787646c59982a3dc80"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="c72c9278ddc2f442d193474993d36e7f2cfb08c4"/>

View File

@ -15,10 +15,10 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="410e91ddabc7ba82a9b43b3711a3fdf2cb8de309"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="1c6628ed1e40575e5ec3669ab6ef389d4ebeea65"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="c1bbb66f52f9e2d76ce97e7b3aa0cb29957cd7d8"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="3b9a47b517d345b8d98bc7f787b9a6c2f51ca75d"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>

View File

@ -1,9 +1,9 @@
{
"git": {
"git_revision": "410e91ddabc7ba82a9b43b3711a3fdf2cb8de309",
"git_revision": "1c6628ed1e40575e5ec3669ab6ef389d4ebeea65",
"remote": "https://git.mozilla.org/releases/gaia.git",
"branch": ""
},
"revision": "1b985049f337d592c0de868cbe3e34e49ea560bd",
"revision": "3725ee93c078cfa416c0ad67e5356d16302cdb48",
"repo_path": "integration/gaia-central"
}

View File

@ -15,10 +15,10 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="410e91ddabc7ba82a9b43b3711a3fdf2cb8de309"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="1c6628ed1e40575e5ec3669ab6ef389d4ebeea65"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="c1bbb66f52f9e2d76ce97e7b3aa0cb29957cd7d8"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="3b9a47b517d345b8d98bc7f787b9a6c2f51ca75d"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>

View File

@ -18,8 +18,8 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="410e91ddabc7ba82a9b43b3711a3fdf2cb8de309"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="c1bbb66f52f9e2d76ce97e7b3aa0cb29957cd7d8"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="1c6628ed1e40575e5ec3669ab6ef389d4ebeea65"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="3b9a47b517d345b8d98bc7f787b9a6c2f51ca75d"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="0c28789b9957913be975eb002a22323f93585d4c"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>

View File

@ -15,10 +15,10 @@
<project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="410e91ddabc7ba82a9b43b3711a3fdf2cb8de309"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="1c6628ed1e40575e5ec3669ab6ef389d4ebeea65"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="c1bbb66f52f9e2d76ce97e7b3aa0cb29957cd7d8"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="3b9a47b517d345b8d98bc7f787b9a6c2f51ca75d"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>

View File

@ -11,7 +11,6 @@ if CONFIG['MOZ_EXTENSIONS']:
DIRS += [
'/%s' % CONFIG['MOZ_BRANDING_DIRECTORY'],
'/b2g',
'/devtools',
]
# Add the defaults settings.

View File

@ -93,7 +93,7 @@
<binding id="notification" extends="chrome://global/content/bindings/notification.xml#notification">
<content>
<xul:hbox class="notification-inner outset" flex="1" xbl:inherits="type">
<xul:hbox class="notification-inner" flex="1" xbl:inherits="type">
<xul:toolbarbutton ondblclick="event.stopPropagation();"
class="messageCloseButton close-icon tabbable"
xbl:inherits="hidden=hideclose"

View File

@ -19,7 +19,7 @@
<stylesheet src="chrome://global/skin/notification.css"/>
</resources>
<content>
<xul:hbox class="notification-inner outset" flex="1" xbl:inherits="type">
<xul:hbox class="notification-inner" flex="1" xbl:inherits="type">
<xul:hbox anonid="details" align="center" flex="1">
<xul:image class="translate-infobar-element messageImage"
anonid="messageImage"/>

View File

@ -93,6 +93,11 @@ reflow.messageLinkText=function %1$S, %2$S line %3$S
# anonymous. Test console.trace() in the webconsole.
stacktrace.anonymousFunction=<anonymous>
# LOCALIZATION NOTE (stacktrace.asyncStack): this string is used to
# indicate that a given stack frame has an async parent.
# %S is the "Async Cause" of the frame.
stacktrace.asyncStack=(Async: %S)
# LOCALIZATION NOTE (unknownLocation): this string is used to
# display messages with sources that have an unknown location, eg. from
# console.trace() calls.

View File

@ -17,7 +17,6 @@ DIRS += [
'modules',
'themes',
'extensions',
'/devtools',
]
DIRS += [

View File

@ -311,7 +311,10 @@ var DebuggerView = {
if (button == 2) {
this.clickedLine = line;
}
else {
// Bug 1201008: Only add the breakpoint to the editor if we're currently
// looking at a source. Even if no source is loaded, you can
// interact with line 1 of the editor.
else if (DebuggerView.Sources.selectedValue) {
if (this.editor.hasBreakpoint(line)) {
this.editor.removeBreakpoint(line);
} else {

View File

@ -289,6 +289,8 @@ skip-if = e10s # TODO
skip-if = e10s # TODO
[browser_dbg_navigation.js]
skip-if = e10s && debug
[browser_dbg_no-dangling-breakpoints.js]
skip-if = e10s && debug
[browser_dbg_no-page-sources.js]
skip-if = e10s && debug
[browser_dbg_on-pause-highlight.js]

View File

@ -0,0 +1,23 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Bug 1201008 - Make sure you can't set a breakpoint in a blank
* editor
*/
function test() {
initDebugger('data:text/html,hi').then(([aTab,, aPanel]) => {
const gPanel = aPanel;
const gDebugger = gPanel.panelWin;
Task.spawn(function*() {
const editor = gDebugger.DebuggerView.editor;
editor.emit("gutterClick", 0);
is(editor.getBreakpoints().length, 0,
"A breakpoint should not exist");
closeDebuggerAndFinish(gPanel);
});
});
}

View File

@ -577,10 +577,10 @@ MarkupView.prototype = {
}
break;
case Ci.nsIDOMKeyEvent.DOM_VK_DELETE:
this.deleteNode(this._selectedContainer.node);
this.deleteNodeOrAttribute();
break;
case Ci.nsIDOMKeyEvent.DOM_VK_BACK_SPACE:
this.deleteNode(this._selectedContainer.node, true);
this.deleteNodeOrAttribute(true);
break;
case Ci.nsIDOMKeyEvent.DOM_VK_HOME:
let rootContainer = this.getContainer(this._rootNode);
@ -677,13 +677,32 @@ MarkupView.prototype = {
return name === "input" || name === "textarea";
},
/**
* If there's an attribute on the current node that's currently focused, then
* delete this attribute, otherwise delete the node itself.
* @param {boolean} moveBackward If set to true and if we're deleting the
* node, focus the previous sibling after deletion, otherwise the next one.
*/
deleteNodeOrAttribute: function(moveBackward) {
let focusedAttribute = this.doc.activeElement
? this.doc.activeElement.closest(".attreditor")
: null;
if (focusedAttribute) {
// The focused attribute might not be in the current selected container.
let container = focusedAttribute.closest("li.child").container;
container.removeAttribute(focusedAttribute.dataset.attr);
} else {
this.deleteNode(this._selectedContainer.node, moveBackward);
}
},
/**
* Delete a node from the DOM.
* This is an undoable action.
*
* @param {NodeFront} aNode The node to remove.
* @param {boolean} moveBackward If set to true, focus the previous sibling,
* otherwise the next one.
* otherwise the next one.
*/
deleteNode: function(aNode, moveBackward) {
if (aNode.isDocumentElement ||

View File

@ -93,6 +93,7 @@ skip-if = e10s # Bug 1040751 - CodeMirror editor.destroy() isn't e10s compatible
[browser_markupview_keybindings_02.js]
[browser_markupview_keybindings_03.js]
[browser_markupview_keybindings_04.js]
[browser_markupview_keybindings_delete_attributes.js]
[browser_markupview_mutation_01.js]
[browser_markupview_mutation_02.js]
[browser_markupview_navigation.js]

View File

@ -0,0 +1,63 @@
/* vim: set ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Tests that attributes can be deleted from the markup-view with the delete key
// when they are focused.
const HTML = `<div id="id" class="class" data-id="id"></div>`;
const TEST_URL = "data:text/html;charset=utf-8," + encodeURIComponent(HTML);
// List of all the test cases. Each item is an object with the following props:
// - selector: the css selector of the node that should be selected
// - attribute: the name of the attribute that should be focused. Do not
// specify an attribute that would make it impossible to find the node using
// selector.
// Note that after each test case, undo is called.
const TEST_DATA = [{
selector: "#id",
attribute: "class"
}, {
selector: "#id",
attribute: "data-id"
}];
add_task(function*() {
let {inspector} = yield addTab(TEST_URL).then(openInspector);
let {walker} = inspector;
for (let {selector, attribute} of TEST_DATA) {
info("Get the container for node " + selector);
let {editor} = yield getContainerForSelector(selector, inspector);
info("Focus attribute " + attribute);
let attr = editor.attrElements.get(attribute).querySelector(".editable");
attr.focus();
info("Delete the attribute by pressing delete");
let mutated = inspector.once("markupmutation");
EventUtils.sendKey("delete", inspector.panelWin);
yield mutated;
info("Check that the node is still here");
let node = yield walker.querySelector(walker.rootNode, selector);
ok(node, "The node hasn't been deleted");
info("Check that the attribute has been deleted");
node = yield walker.querySelector(walker.rootNode,
selector + "[" + attribute + "]");
ok(!node, "The attribute does not exist anymore in the DOM");
ok(!editor.attrElements.get(attribute),
"The attribute has been removed from the container");
info("Undo the change");
yield undoChange(inspector);
node = yield walker.querySelector(walker.rootNode,
selector + "[" + attribute + "]");
ok(node, "The attribute is back in the DOM");
ok(editor.attrElements.get(attribute),
"The attribute is back on the container");
}
});

View File

@ -8,52 +8,98 @@
// Also checks that after deletion the correct element is highlighted.
// The next sibling is preferred, but the parent is a fallback.
const TEST_URL = "data:text/html,<div id='parent'><div id='first'></div><div id='second'></div><div id='third'></div></div>";
const HTML = `<div id="parent">
<div id="first"></div>
<div id="second"></div>
<div id="third"></div>
</div>`;
const TEST_URL = "data:text/html;charset=utf-8," + encodeURIComponent(HTML);
function* checkDeleteAndSelection(inspector, key, nodeSelector, focusedNodeSelector) {
yield selectNode(nodeSelector, inspector);
yield clickContainer(nodeSelector, inspector);
info(`Deleting the element "${nodeSelector}" using the ${key} key`);
let mutated = inspector.once("markupmutation");
EventUtils.sendKey(key, inspector.panelWin);
yield Promise.all([mutated, inspector.once("inspector-updated")]);
let nodeFront = yield getNodeFront(focusedNodeSelector, inspector);
is(inspector.selection.nodeFront, nodeFront,
focusedNodeSelector + " should be selected after " + nodeSelector + " node gets deleted.");
info("Checking that it's gone, baby gone!");
ok(!content.document.querySelector(nodeSelector), "The test node does not exist");
yield undoChange(inspector);
ok(content.document.querySelector(nodeSelector), "The test node is back!");
}
// List of all the test cases. Each item is an object with the following props:
// - selector: the css selector of the node that should be selected
// - key: the key to press to delete the node (delete or back_space)
// - focusedSelector: the css selector of the node we expect to be selected as
// a result of the deletion
// - setup: an optional function that will be run before selecting and deleting
// the node
// Note that after each test case, undo is called.
const TEST_DATA = [{
selector: "#first",
key: "delete",
focusedSelector: "#second"
}, {
selector: "#second",
key: "delete",
focusedSelector: "#third"
}, {
selector: "#third",
key: "delete",
focusedSelector: "#second"
}, {
selector: "#first",
key: "back_space",
focusedSelector: "#second"
}, {
selector: "#second",
key: "back_space",
focusedSelector: "#first"
}, {
selector: "#third",
key: "back_space",
focusedSelector: "#second"
}, {
setup: function*(inspector) {
// Removing the siblings of #first in order to test with an only child.
let mutated = inspector.once("markupmutation");
for (let node of content.document.querySelectorAll("#second, #third")) {
node.remove();
}
yield mutated;
},
selector: "#first",
key: "delete",
focusedSelector: "#parent"
}, {
selector: "#first",
key: "back_space",
focusedSelector: "#parent"
}];
add_task(function*() {
let {inspector} = yield addTab(TEST_URL).then(openInspector);
info("Selecting the test node by clicking on it to make sure it receives focus");
for (let {setup, selector, key, focusedSelector} of TEST_DATA) {
if (setup) {
yield setup(inspector);
}
yield checkDeleteAndSelection(inspector, "delete", "#first", "#second");
yield checkDeleteAndSelection(inspector, "delete", "#second", "#third");
yield checkDeleteAndSelection(inspector, "delete", "#third", "#second");
yield checkDeleteAndSelection(inspector, "back_space", "#first", "#second");
yield checkDeleteAndSelection(inspector, "back_space", "#second", "#first");
yield checkDeleteAndSelection(inspector, "back_space", "#third", "#second");
// Removing the siblings of #first.
let mutated = inspector.once("markupmutation");
for (let node of content.document.querySelectorAll("#second, #third")) {
node.remove();
yield checkDeleteAndSelection(inspector, key, selector, focusedSelector);
}
yield mutated;
// Testing with an only child.
info("testing with an only child");
yield checkDeleteAndSelection(inspector, "delete", "#first", "#parent");
yield checkDeleteAndSelection(inspector, "back_space", "#first", "#parent");
yield inspector.once("inspector-updated");
});
function* checkDeleteAndSelection(inspector, key, selector, focusedSelector) {
info("Test deleting node " + selector + " with " + key + ", " +
"expecting " + focusedSelector + " to be focused");
info("Select node " + selector + " and make sure it is focused");
yield selectNode(selector, inspector);
yield clickContainer(selector, inspector);
info("Delete the node with: " + key);
let mutated = inspector.once("markupmutation");
EventUtils.sendKey(key, inspector.panelWin);
yield Promise.all([mutated, inspector.once("inspector-updated")]);
let nodeFront = yield getNodeFront(focusedSelector, inspector);
is(inspector.selection.nodeFront, nodeFront,
focusedSelector + " is selected after deletion");
info("Check that the node was really removed");
let node = yield getNodeFront(selector, inspector);
ok(!node, "The node can't be found in the page anymore");
info("Undo the deletion to restore the original markup");
yield undoChange(inspector);
node = yield getNodeFront(selector, inspector);
ok(node, "The node is back");
}

View File

@ -3529,8 +3529,10 @@ Widgets.Stacktrace.prototype = Heritage.extend(Widgets.BaseWidget.prototype,
let result = this.element = this.document.createElementNS(XHTML_NS, "ul");
result.className = "stacktrace devtools-monospace";
for (let frame of this.stacktrace) {
result.appendChild(this._renderFrame(frame));
if (this.stacktrace) {
for (let frame of this.stacktrace) {
result.appendChild(this._renderFrame(frame));
}
}
return this;
@ -3549,15 +3551,22 @@ Widgets.Stacktrace.prototype = Heritage.extend(Widgets.BaseWidget.prototype,
{
let fn = this.document.createElementNS(XHTML_NS, "span");
fn.className = "function";
let asyncCause = "";
if (frame.asyncCause) {
asyncCause =
l10n.getFormatStr("stacktrace.asyncStack", [frame.asyncCause]) + " ";
}
if (frame.functionName) {
let span = this.document.createElementNS(XHTML_NS, "span");
span.className = "cm-variable";
span.textContent = frame.functionName;
span.textContent = asyncCause + frame.functionName;
fn.appendChild(span);
fn.appendChild(this.document.createTextNode("()"));
} else {
fn.classList.add("cm-comment");
fn.textContent = l10n.getStr("stacktrace.anonymousFunction");
fn.textContent = asyncCause + l10n.getStr("stacktrace.anonymousFunction");
}
let location = this.output.owner.createLocationNode({url: frame.filename,

View File

@ -85,6 +85,7 @@ support-files =
test-console-output-regexp.html
test-console-column.html
test-consoleiframes.html
test-console-trace-async.html
test-certificate-messages.html
test-data.json
test-data.json^headers^
@ -312,6 +313,7 @@ skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s
[browser_webconsole_console_extras.js]
[browser_webconsole_console_logging_api.js]
[browser_webconsole_console_logging_workers_api.js]
[browser_webconsole_console_trace_async.js]
[browser_webconsole_count.js]
[browser_webconsole_dont_navigate_on_doubleclick.js]
[browser_webconsole_execution_scope.js]

View File

@ -0,0 +1,75 @@
/* vim:set ts=2 sw=2 sts=2 et: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const TEST_URI = "http://example.com/browser/devtools/client/" +
"webconsole/test/test-console-trace-async.html";
add_task(function* runTest() {
// Async stacks aren't on by default in all builds
yield new Promise(resolve => {
SpecialPowers.pushPrefEnv({"set": [
["javascript.options.asyncstack", true]
]}, resolve);
});
let {tab} = yield loadTab("data:text/html;charset=utf8,<p>hello");
let hud = yield openConsole(tab);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, TEST_URI);
let [result] = yield waitForMessages({
webconsole: hud,
messages: [{
name: "console.trace output",
consoleTrace: {
file: "test-console-trace-async.html",
fn: "inner",
},
}],
});
let node = [...result.matched][0];
ok(node, "found trace log node");
ok(node.textContent.includes("console.trace()"),
"trace log node includes console.trace()");
ok(node.textContent.includes("promise callback"),
"trace log node includes promise callback");
ok(node.textContent.includes("setTimeout handler"),
"trace log node includes setTimeout handler");
// The expected stack trace object.
let stacktrace = [
{
columnNumber: 3,
filename: TEST_URI,
functionName: "inner",
language: 2,
lineNumber: 9
},
{
asyncCause: "promise callback",
columnNumber: 1,
filename: TEST_URI,
functionName: "time1",
language: 2,
lineNumber: 13,
},
{
asyncCause: "setTimeout handler",
columnNumber: 1,
filename: TEST_URI,
functionName: "",
language: 2,
lineNumber: 18,
}
];
let obj = node._messageObject;
ok(obj, "console.trace message object");
ok(obj._stacktrace, "found stacktrace object");
is(obj._stacktrace.toSource(), stacktrace.toSource(),
"stacktrace is correct");
});

View File

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="en">
<head><meta charset="utf-8">
<title>Web Console test for bug 1200832 - console.trace() async stacks</title>
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<script type="application/javascript">
function inner() {
console.trace();
}
function time1() {
new Promise(function(resolve, reject) {
setTimeout(resolve, 10);
}).then(inner);
}
setTimeout(time1, 10);
</script>
</head>
<body>
<p>Web Console test for bug 1200832 - console.trace() async stacks</p>
</body>
</html>

View File

@ -4,13 +4,22 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
if CONFIG['MOZ_DEVTOOLS'] and CONFIG['MOZ_DEVTOOLS'] not in ('all', 'server'):
error('Unsupported MOZ_DEVTOOLS value: %s' % (CONFIG['MOZ_DEVTOOLS']))
if CONFIG['MOZ_DEVTOOLS'] == 'all':
DIRS += [
'client',
]
if CONFIG['MOZ_DEVTOOLS'] in ('all', 'server'):
DIRS += [
'server',
'shared',
]
DIRS += [
'server',
'shared',
]
# /browser uses DIST_SUBDIR. We opt-in to this treatment when building
# DevTools for the browser to keep the root omni.ja slim for use by external XUL
# apps. Mulet also uses this since it includes /browser.
if CONFIG['MOZ_BUILD_APP'] in ('browser', 'b2g/dev'):
DIST_SUBDIR = 'browser'
export('DIST_SUBDIR')

View File

@ -1989,7 +1989,7 @@ ConsoleReflowListener.prototype =
{
let frame = components.stack.caller.caller;
let filename = frame.filename;
let filename = frame ? frame.filename : null;
if (filename) {
// Because filename could be of the form "xxx.js -> xxx.js -> xxx.js",
@ -2002,8 +2002,8 @@ ConsoleReflowListener.prototype =
start: aStart,
end: aEnd,
sourceURL: filename,
sourceLine: frame.lineNumber,
functionName: frame.name
sourceLine: frame ? frame.lineNumber : null,
functionName: frame ? frame.name : null
});
},

View File

@ -935,6 +935,13 @@ StackFrameToStackEntry(nsIStackFrame* aStackFrame,
rv = aStackFrame->GetName(aStackEntry.mFunctionName);
NS_ENSURE_SUCCESS(rv, rv);
nsString cause;
rv = aStackFrame->GetAsyncCause(cause);
NS_ENSURE_SUCCESS(rv, rv);
if (!cause.IsEmpty()) {
aStackEntry.mAsyncCause.Construct(cause);
}
aStackEntry.mLanguage = aLanguage;
return NS_OK;
}
@ -960,6 +967,10 @@ ReifyStack(nsIStackFrame* aStack, nsTArray<ConsoleStackEntry>& aRefiedStack)
rv = stack->GetCaller(getter_AddRefs(caller));
NS_ENSURE_SUCCESS(rv, rv);
if (!caller) {
rv = stack->GetAsyncCaller(getter_AddRefs(caller));
NS_ENSURE_SUCCESS(rv, rv);
}
stack.swap(caller);
}

View File

@ -677,15 +677,8 @@ NS_IMETHODIMP JSStackFrame::GetCaller(nsIStackFrame** aCaller)
return StackFrame::GetCaller(aCaller);
}
nsCOMPtr<nsIStackFrame> caller;
if (callerObj) {
caller = new JSStackFrame(callerObj);
} else {
// Do we really need this dummy frame? If so, we should document why... I
// guess for symmetry with the "nothing on the stack" case, which returns
// a single dummy frame?
caller = new StackFrame();
}
nsCOMPtr<nsIStackFrame> caller =
callerObj ? new JSStackFrame(callerObj) : nullptr;
caller.forget(aCaller);
if (canCache) {

View File

@ -76,7 +76,7 @@ BluetoothMapFolder::GetFolderListingObjectString(nsAString& aString,
const nsAString& key = iter.Key();
folderListingObejct.Append("<folder name=\"");
folderListingObejct.Append(NS_ConvertUTF16toUTF8(key).get());
folderListingObejct.Append("\">");
folderListingObejct.Append("\"/>");
count++;
}

View File

@ -178,15 +178,16 @@ BluetoothProfileController::SetupProfiles(bool aAssignServiceClass)
bool isRemoteControl = IS_REMOTE_CONTROL(mTarget.cod);
bool isKeyboard = IS_KEYBOARD(mTarget.cod);
bool isPointingDevice = IS_POINTING_DEVICE(mTarget.cod);
bool isInvalid = IS_INVALID_COD(mTarget.cod);
bool isInvalid = IS_INVALID(mTarget.cod);
// The value of CoD is invalid. Since the device didn't declare its class of
// device properly, we assume the device may support all of these profiles.
// Note the invalid CoD from bluedroid callback usually results from
// NFC-triggered direct pairing for no EIR query records.
if (isInvalid) {
AddProfile(BluetoothHfpManager::Get());
AddProfile(BluetoothA2dpManager::Get());
AddProfile(BluetoothAvrcpManager::Get()); // register after A2DP
AddProfile(BluetoothHidManager::Get());
return;
}

View File

@ -54,15 +54,17 @@ BEGIN_BLUETOOTH_NAMESPACE
#define IS_POINTING_DEVICE(cod) ((GET_MINOR_DEVICE_CLASS(cod) & 0x20) >> 5)
/**
* Check whether the value of CoD is invalid. (i.e. Bit 31 ~ Bit 24 != 0x0)
* Check whether the value of CoD is invalid:
* - Bit 31 ~ Bit 24 != 0x0, or
* - CoD value is 0x1f00 (unclassified).
*
* According to Bluetooth core spec v4.1. Vol 2, Sec. 7.3, the data length of
* CoD (class of device) is 3 bytes. The two least significant bits are used to
* indicate 'format type'. The following 22 bits are used to indicate category
* of service class and device type. The remaining 8 bits (Bit 31 ~ Bit 24)
* should be unassigned bits, since BlueDroid uses uint32_t to store CoD.
* CoD (class of device) is 3 bytes: the two least significant bits indicate
* 'format type', and the following 22 bits indicate category of service class
* and device type. As bluedroid stores CoD with uint32_t, the remaining 8 bits
* (Bit 31 ~ Bit 24) should be unassigned.
*/
#define IS_INVALID_COD(cod) (cod >> 24)
#define IS_INVALID(cod) ((cod) >> 24 || (cod) == 0x1f00)
class BluetoothProfileManagerBase;
class BluetoothReplyRunnable;

View File

@ -54,7 +54,7 @@ BluetoothClassOfDevice::~BluetoothClassOfDevice()
void
BluetoothClassOfDevice::Reset()
{
mMajorServiceClass = 0x1; // LIMITED_DISCOVERABILITY
mMajorServiceClass = 0;
mMajorDeviceClass = 0x1F; // UNCATEGORIZED
mMinorDeviceClass = 0;
}

View File

@ -67,7 +67,6 @@ XPCOMUtils.defineLazyServiceGetter(this, "cpmm",
"nsISyncMessageSender");
function NfcContentHelper() {
Services.obs.addObserver(this, NFC.TOPIC_MOZSETTINGS_CHANGED, false);
Services.obs.addObserver(this, "xpcom-shutdown", false);
this._requestMap = [];
@ -180,16 +179,6 @@ NfcContentHelper.prototype = {
addEventListener: function addEventListener(listener, tabId) {
let _window = listener.window;
// TODO Bug 1166210 - enable NFC debug for child process.
if (!NFC.DEBUG_CONTENT_HELPER && _window.navigator.mozSettings) {
let lock = _window.navigator.mozSettings.createLock();
var nfcDebug = lock.get(NFC.SETTING_NFC_DEBUG);
nfcDebug.onsuccess = function _nfcDebug() {
DEBUG = nfcDebug.result[NFC.SETTING_NFC_DEBUG];
updateDebug();
};
}
this.eventListeners[tabId] = listener;
cpmm.sendAsyncMessage("NFC:AddEventListener", { tabId: tabId });
},
@ -252,16 +241,8 @@ NfcContentHelper.prototype = {
observe: function observe(subject, topic, data) {
if (topic == "xpcom-shutdown") {
this.destroyDOMRequestHelper();
Services.obs.removeObserver(this, NFC.TOPIC_MOZSETTINGS_CHANGED);
Services.obs.removeObserver(this, "xpcom-shutdown");
cpmm = null;
} else if (topic == NFC.TOPIC_MOZSETTINGS_CHANGED) {
if ("wrappedJSObject" in subject) {
subject = subject.wrappedJSObject;
}
if (subject) {
this.handle(subject.key, subject.value);
}
}
},
@ -293,15 +274,6 @@ NfcContentHelper.prototype = {
}
},
handle: function handle(name, result) {
switch (name) {
case NFC.SETTING_NFC_DEBUG:
DEBUG = result;
updateDebug();
break;
}
},
handleGeneralResponse: function handleGeneralResponse(result) {
let requestId = result.requestId;
let callback = this._requestMap[requestId];

View File

@ -81,6 +81,7 @@ dictionary ConsoleStackEntry {
unsigned long columnNumber = 0;
DOMString functionName = "";
unsigned long language = 0;
DOMString? asyncCause;
};
dictionary ConsoleTimerStart {

View File

@ -8,7 +8,3 @@ include('/toolkit/toolkit.mozbuild')
if CONFIG['MOZ_EXTENSIONS']:
DIRS += ['/extensions']
DIRS += [
'/devtools',
]

View File

@ -17,7 +17,7 @@ function run_test() {
let stack = Components.stack;
do_check_eq(stack.name, "asyncCallback");
do_check_eq(stack.caller.name, null);
do_check_eq(stack.caller, null);
do_check_eq(stack.asyncCause, null);
do_check_eq(stack.asyncCaller.name, "getAsyncStack");

View File

@ -14,5 +14,4 @@ if CONFIG['MOZ_EXTENSIONS']:
DIRS += [
'/%s' % CONFIG['MOZ_BRANDING_DIRECTORY'],
'/mobile/android',
'/devtools',
]

View File

@ -14,5 +14,4 @@ if CONFIG['MOZ_EXTENSIONS']:
DIRS += [
'/%s' % CONFIG['MOZ_BRANDING_DIRECTORY'],
'/mobile/android/b2gdroid',
'/devtools',
]

View File

@ -4,6 +4,8 @@
package org.mozilla.b2gdroid;
import java.util.Date;
import android.app.Activity;
import android.app.ActivityManager;
import android.app.KeyguardManager;
@ -45,6 +47,12 @@ public class Launcher extends FragmentActivity
private Apps mApps;
private SettingsMapper mSettings;
private static final long kHomeRepeat = 2;
private static final long kHomeDelay = 500; // delay in ms to tap kHomeRepeat times.
private long mFirstHome;
private long mLastHome;
private long mHomeCount;
/** ContextGetter */
public Context getContext() {
return this;
@ -97,6 +105,10 @@ public class Launcher extends FragmentActivity
"Launcher:Ready");
setContentView(R.layout.launcher);
mHomeCount = 0;
mFirstHome = 0;
mLastHome = 0;
}
@Override
@ -139,10 +151,29 @@ public class Launcher extends FragmentActivity
GeckoEvent e = GeckoEvent.createBroadcastEvent("Android:Launcher", obj.toString());
GeckoAppShell.sendEventToGecko(e);
} else if (Intent.ACTION_MAIN.equals(action)) {
Log.d(LOGTAG, "Let's dispatch a 'home' key event");
String message = "home-key";
// Check if we did a multiple home tap to trigger the task switcher.
long now = (new Date()).getTime();
if (now - mLastHome > kHomeDelay) {
mHomeCount = 0;
}
if (mHomeCount == 0) {
mFirstHome = now;
}
mHomeCount++;
if (mHomeCount == kHomeRepeat) {
mHomeCount = 0;
if (now - mFirstHome < kHomeDelay) {
message = "task-switcher";
}
}
mLastHome = now;
Log.d(LOGTAG, "Let's dispatch a '" + message + "' key event");
JSONObject obj = new JSONObject();
try {
obj.put("action", "home-key");
obj.put("action", message);
} catch(JSONException ex) {
Log.wtf(LOGTAG, "Error building Android:Launcher message", ex);
}

View File

@ -69,6 +69,9 @@ this.MessagesBridge = {
window.dispatchEvent(new window.KeyboardEvent("keydown", { key: "Home" }));
window.dispatchEvent(new window.KeyboardEvent("keyup", { key: "Home" }));
break;
case "task-switcher":
window.dispatchEvent(new window.CustomEvent("taskmanagershow", {}));
break;
}
},

View File

@ -373,12 +373,23 @@ class GeckoInputConnection
if (v.hasFocus() && !imm.isActive(v)) {
// Workaround: The view has focus but it is not the active view for the input method. (Bug 1211848)
refocusAndShowSoftInput(imm, v);
} else {
imm.showSoftInput(v, 0);
}
}
}
private static void refocusAndShowSoftInput(final InputMethodManager imm, final View v) {
ThreadUtils.postToUiThread(new Runnable() {
@Override
public void run() {
v.clearFocus();
v.requestFocus();
}
imm.showSoftInput(v, 0);
}
imm.showSoftInput(v, 0);
}
});
}
private static void hideSoftInput() {

View File

@ -6,6 +6,7 @@
package org.mozilla.gecko.home;
import android.content.Context;
import android.content.Intent;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.support.v7.widget.LinearLayoutManager;
@ -17,6 +18,7 @@ import android.view.View;
import org.mozilla.gecko.annotation.RobocopTarget;
import org.mozilla.gecko.R;
import org.mozilla.gecko.preferences.GeckoPreferences;
import org.mozilla.gecko.util.ColorUtils;
import org.mozilla.gecko.widget.RecyclerViewClickSupport;
@ -126,6 +128,9 @@ public class SearchEngineBar extends RecyclerView
}
if (position == 0) {
final Intent settingsIntent = new Intent(getContext(), GeckoPreferences.class);
GeckoPreferences.setResourceToOpen(settingsIntent, "preferences_search");
getContext().startActivity(settingsIntent);
return;
}

View File

@ -1,67 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<org.mozilla.gecko.tabs.TabsLayoutItemView xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/TabsItem"
android:focusable="true"
android:id="@+id/info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="@dimen/tab_vertical_padding"
android:paddingBottom="@dimen/tab_vertical_padding"
android:paddingLeft="1dip"
android:paddingRight="1dip"
android:gravity="center">
<!-- We set state_private on this View dynamically in TabsListLayout. -->
<org.mozilla.gecko.widget.TabThumbnailWrapper
android:id="@+id/wrapper"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/tab_thumbnail_margin"
android:padding="@dimen/tab_thumbnail_padding"
android:background="@drawable/tab_thumbnail"
android:duplicateParentState="true">
<org.mozilla.gecko.tabs.TabsPanelThumbnailView android:id="@+id/thumbnail"
android:layout_width="@dimen/tab_thumbnail_width"
android:layout_height="@dimen/tab_thumbnail_height"
android:layout_above="@+id/title_bar"
android:layout_alignParentTop="true"/>
<LinearLayout android:id="@id/title_bar"
android:layout_alignParentBottom="true"
android:layout_width="@dimen/tab_thumbnail_width"
android:layout_height="@dimen/tab_title_height"
android:orientation="horizontal"
android:background="#EFFF"
android:duplicateParentState="true">
<TextView android:id="@+id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:padding="4dip"
style="@style/TabLayoutItemTextAppearance"
android:textSize="12sp"
android:textColor="@color/placeholder_active_grey"
android:singleLine="true"
android:duplicateParentState="true"/>
<ImageButton android:id="@+id/close"
style="@style/TabsItemClose"
android:layout_width="32dip"
android:layout_height="match_parent"
android:background="@drawable/action_bar_button_inverse"
android:scaleType="center"
android:contentDescription="@string/close_tab"
android:src="@drawable/tab_close"/>
</LinearLayout>
</org.mozilla.gecko.widget.TabThumbnailWrapper>
</org.mozilla.gecko.tabs.TabsLayoutItemView>

View File

@ -9,7 +9,9 @@
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="48dp"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:clickable="true"
android:background="@color/pressed_about_page_header_grey">
<ImageView
android:id="@+id/search_engine_label"

View File

@ -35,28 +35,31 @@
android:layout_weight="1.0"
android:paddingTop="4dip"
android:paddingLeft="8dip"
android:paddingRight="4dip">
android:paddingRight="4dip"
android:duplicateParentState="true">
<TextView android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1.0"
style="@style/TabLayoutItemTextAppearance"
android:textColor="#FFFFFFFF"
android:textColor="@color/tab_item_title"
android:textSize="14sp"
android:gravity="center_vertical"
android:singleLine="false"
android:maxLines="4"
android:drawablePadding="6dp"
android:duplicateParentState="true"/>
</LinearLayout>
<ImageButton android:id="@+id/close"
<ImageView android:id="@+id/close"
style="@style/TabsItemClose"
android:layout_width="34dip"
android:layout_height="match_parent"
android:background="@drawable/action_bar_button_inverse"
android:scaleType="center"
android:contentDescription="@string/close_tab"
android:src="@drawable/tab_close"/>
android:src="@drawable/tab_item_close_button"
android:duplicateParentState="true"/>
</org.mozilla.gecko.tabs.TabsLayoutItemView>

View File

@ -171,9 +171,15 @@ class TabsGridLayout extends GridView
Tabs.registerOnTabsChangedListener(this);
refreshTabsData();
Tab currentlySelectedTab = Tabs.getInstance().getSelectedTab();
if (lastSelectedTabId != currentlySelectedTab.getId()) {
smoothScrollToPosition(tabsAdapter.getPositionForTab(currentlySelectedTab));
final Tab currentlySelectedTab = Tabs.getInstance().getSelectedTab();
final int position = currentlySelectedTab != null ? tabsAdapter.getPositionForTab(currentlySelectedTab) : -1;
if (position != -1) {
final boolean selectionChanged = lastSelectedTabId != currentlySelectedTab.getId();
final boolean positionIsVisible = position >= getFirstVisiblePosition() && position <= getLastVisiblePosition();
if (selectionChanged || !positionIsVisible) {
smoothScrollToPosition(position);
}
}
}

View File

@ -266,30 +266,29 @@ class MachCommands(MachCommandBase):
if platform.system() != "Windows":
return []
return {
return list({
"%s\\nodejs" % os.environ.get("SystemDrive"),
os.path.join(os.environ.get("ProgramFiles"), "nodejs"),
os.path.join(os.environ.get("PROGRAMW6432"), "nodejs"),
os.path.join(os.environ.get("PROGRAMFILES"), "nodejs")
}
})
def getNodeOrNpmPath(self, filename):
"""
Return the nodejs or npm path.
"""
try:
appPath = which.which(filename)
return appPath
except which.WhichError:
pass
if platform.system() == "Windows":
try:
for ext in ["", ".cmd", ".exe"]:
for ext in [".cmd", ".exe", ""]:
try:
nodeOrNpmPath = which.which(filename + ext,
path=self.getPossibleNodePathsWin())
if self.is_valid(nodeOrNpmPath):
return nodeOrNpmPath
except which.WhichError:
pass
else:
try:
return which.which(filename)
except which.WhichError:
pass
@ -315,5 +314,5 @@ class MachCommands(MachCommandBase):
with open(os.devnull, "w") as fnull:
subprocess.check_call([path, "--version"], stdout=fnull)
return True
except subprocess.CalledProcessError:
except (subprocess.CalledProcessError, WindowsError):
return False

View File

@ -74,6 +74,14 @@
if (this.findbar._isIMEComposing) {
return;
}
if (this._hadValue && !this.value) {
this._willfullyDeleted = true;
this._hadValue = false;
} else if (this.value.trim()) {
this._hadValue = true;
this._willfullyDeleted = false;
}
this.findbar._find(this.value);
]]></handler>
@ -1101,8 +1109,10 @@
return;
let clipboardSearchString = this._browser.finder.clipboardSearchString;
if (clipboardSearchString && this._findField.value != clipboardSearchString) {
if (clipboardSearchString && this._findField.value != clipboardSearchString &&
!this._findField._willfullyDeleted) {
this._findField.value = clipboardSearchString;
this._findField._hadValue = true;
// Changing the search string makes the previous status invalid, so
// we better clear it here.
this._updateStatusUI();

View File

@ -140,6 +140,7 @@ if CONFIG['MOZ_PREF_EXTENSIONS']:
DIRS += ['/extensions/pref']
DIRS += [
'/devtools',
'/services',
'/startupcache',
'/js/ductwork/debugger',

View File

@ -10,5 +10,4 @@ if CONFIG['MOZ_EXTENSIONS']:
DIRS += [
'/xulrunner',
'/devtools',
]