Merge m-c to b-i

This commit is contained in:
Phil Ringnalda 2013-10-03 08:00:21 -07:00
commit 9592b8fd7e
1108 changed files with 16373 additions and 6881 deletions

View File

@ -18,4 +18,4 @@
# Modifying this file will now automatically clobber the buildbot machines \o/
#
Bug 921563 needs a clobber due to apparent ipdl regeneration bugs.
Bug 871445 needs a clobber.

View File

@ -33,9 +33,9 @@ DIST_GARBAGE = config.cache config.log config.status* config-defs.h \
ifndef MOZ_PROFILE_USE
# We need to explicitly put backend.RecursiveMakeBackend.built here
# otherwise the rule in rules.mk doesn't run early enough.
libs export tools:: CLOBBER $(topsrcdir)/configure config.status backend.RecursiveMakeBackend.built
libs binaries export tools:: CLOBBER $(topsrcdir)/configure config.status backend.RecursiveMakeBackend.built
ifndef LIBXUL_SDK
libs export tools:: js-config-status
libs binaries export tools:: js-config-status
endif
endif
@ -103,10 +103,14 @@ ifdef MOZ_PROFILE_USE
ifndef NO_PROFILE_GUIDED_OPTIMIZE
ifneq ($(OS_ARCH)_$(GNU_CC), WINNT_)
export:: install-manifests
binaries::
@$(MAKE) install-manifests NO_REMOVE=1
endif
endif
else # !MOZ_PROFILE_USE (normal build)
export:: install-manifests
binaries::
@$(MAKE) install-manifests NO_REMOVE=1
endif
# For historical reasons that are unknown, $(DIST)/sdk is always blown away

View File

@ -122,13 +122,13 @@ nsCoreUtils::DispatchMouseEvent(uint32_t aEventType, int32_t aX, int32_t aY,
nsIContent *aContent, nsIFrame *aFrame,
nsIPresShell *aPresShell, nsIWidget *aRootWidget)
{
nsMouseEvent event(true, aEventType, aRootWidget,
nsMouseEvent::eReal, nsMouseEvent::eNormal);
WidgetMouseEvent event(true, aEventType, aRootWidget,
WidgetMouseEvent::eReal, WidgetMouseEvent::eNormal);
event.refPoint = LayoutDeviceIntPoint(aX, aY);
event.clickCount = 1;
event.button = nsMouseEvent::eLeftButton;
event.button = WidgetMouseEvent::eLeftButton;
event.time = PR_IntervalNow();
event.inputSource = nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN;

View File

@ -7,6 +7,7 @@
#define nsCoreUtils_h_
#include "nsIContent.h"
#include "nsIDocument.h"
#include "nsIPresShell.h"
#include "nsIDOMDOMStringList.h"

View File

@ -838,8 +838,8 @@ Accessible::ChildAtPoint(int32_t aX, int32_t aY,
nsIntRect rootRect;
rootWidget->GetScreenBounds(rootRect);
nsMouseEvent dummyEvent(true, NS_MOUSE_MOVE, rootWidget,
nsMouseEvent::eSynthesized);
WidgetMouseEvent dummyEvent(true, NS_MOUSE_MOVE, rootWidget,
WidgetMouseEvent::eSynthesized);
dummyEvent.refPoint = LayoutDeviceIntPoint(aX - rootRect.x, aY - rootRect.y);
nsIFrame* popupFrame = nsLayoutUtils::

View File

@ -2,8 +2,6 @@
# 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/.
EXPORT_LIBRARY = 1
# The midl generated code include Windows headers which defines min and max
# macros which conflicts with std::min/max. Suppress the macros:
OS_CXXFLAGS += -DNOMINMAX

View File

@ -45,3 +45,5 @@ LOCAL_INCLUDES += [
LIBRARY_NAME = 'accessibility_toolkit_ia2_s'
EXPORT_LIBRARY = True

View File

@ -2,7 +2,6 @@
# 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/.
EXPORT_LIBRARY = 1
include $(topsrcdir)/config/rules.mk
include $(topsrcdir)/ipc/chromium/chromium-config.mk

View File

@ -59,3 +59,5 @@ LOCAL_INCLUDES += [
LIBRARY_NAME = 'accessibility_toolkit_msaa_s'
EXPORT_LIBRARY = True

View File

@ -2,8 +2,6 @@
# 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/.
EXPORT_LIBRARY = 1
# The midl generated code include Windows headers which defines min and max
# macros which conflicts with std::min/max. Suppress the macros:
OS_CXXFLAGS += -DNOMINMAX

View File

@ -25,3 +25,5 @@ LOCAL_INCLUDES += [
LIBRARY_NAME = 'accessibility_toolkit_sdn_s'
EXPORT_LIBRARY = True

View File

@ -9,6 +9,8 @@ xpcaccevents_FILES := xpcAccEvents.h
xpcaccevents_DEST = $(DIST)/include
xpcaccevents_TARGET := export
CPPSRCS += xpcAccEvents.cpp
include $(topsrcdir)/config/rules.mk
ifneq ($(A11Y_LOG),0)

View File

@ -8,7 +8,6 @@ MODULE = 'accessibility'
CPP_SOURCES += [
'nsAccessibleRelation.cpp',
'xpcAccEvents.cpp',
'xpcAccessibleTable.cpp',
'xpcAccessibleTableCell.cpp',
]

View File

@ -1,5 +0,0 @@
#
# 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/.

View File

@ -1,5 +0,0 @@
#
# 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/.

View File

@ -1,5 +0,0 @@
#
# 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/.

View File

@ -1,5 +0,0 @@
#
# 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/.

View File

@ -1,5 +0,0 @@
#
# 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/.

View File

@ -1,5 +0,0 @@
#
# 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/.

View File

@ -1,5 +0,0 @@
#
# 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/.

View File

@ -1,5 +0,0 @@
#
# 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/.

View File

@ -1,5 +0,0 @@
#
# 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/.

View File

@ -1,5 +0,0 @@
#
# 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/.

View File

@ -1,5 +0,0 @@
#
# 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/.

View File

@ -1,5 +0,0 @@
#
# 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/.

View File

@ -1,4 +0,0 @@
# 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/.

View File

@ -1,5 +0,0 @@
#
# 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/.

View File

@ -1,5 +0,0 @@
#
# 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/.

View File

@ -1,5 +0,0 @@
#
# 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/.

View File

@ -1,5 +0,0 @@
#
# 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/.

View File

@ -1,5 +0,0 @@
#
# 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/.

View File

@ -1,5 +0,0 @@
#
# 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/.

View File

@ -1,5 +0,0 @@
#
# 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/.

View File

@ -1,5 +0,0 @@
#
# 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/.

View File

@ -1,5 +0,0 @@
#
# 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/.

View File

@ -1,5 +0,0 @@
#
# 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/.

View File

@ -795,6 +795,9 @@ pref("network.sntp.timeout", 30); // In seconds.
// Enable promise
pref("dom.promise.enabled", false);
// Enable dataStore
pref("dom.datastore.enabled", false);
// DOM Inter-App Communication API.
#ifdef MOZ_WIDGET_GONK
// Enable this only for gonk-specific build but not for desktop build.

View File

@ -6,6 +6,7 @@
Cu.import('resource://gre/modules/ContactService.jsm');
Cu.import('resource://gre/modules/SettingsChangeNotifier.jsm');
Cu.import('resource://gre/modules/DataStoreChangeNotifier.jsm');
Cu.import('resource://gre/modules/AlarmService.jsm');
Cu.import('resource://gre/modules/ActivitiesService.jsm');
Cu.import('resource://gre/modules/PermissionPromptHelper.jsm');

View File

@ -766,6 +766,10 @@ bin/components/@DLL_PREFIX@nkgnomevfs@DLL_SUFFIX@
@BINPATH@/components/B2GAboutRedirector.js
@BINPATH@/components/FilePicker.js
@BINPATH@/components/DataStore.manifest
@BINPATH@/components/DataStoreService.js
@BINPATH@/components/dom_datastore.xpt
#ifdef MOZ_WEBSPEECH
@BINPATH@/components/dom_webspeechsynth.xpt
#endif

View File

@ -82,7 +82,9 @@ ifeq ($(OS_ARCH),WINNT)
RCINCLUDE = splash.rc
# Rebuild firefox.exe if the manifest changes - it's included by splash.rc.
# (this dependency should really be just for firefox.exe, not other targets)
EXTRA_DEPS += $(PROGRAM).manifest
# Note the manifest file exists in the tree, so we use the explicit filename
# here.
EXTRA_DEPS += firefox.exe.manifest
ifndef GNU_CC
RCFLAGS += -DMOZ_PHOENIX -I$(srcdir)
else

View File

@ -895,6 +895,12 @@
#endif
</toolbar>
<hbox id="downloads-animation-container" mousethrough="always">
<vbox id="downloads-notification-anchor">
<vbox id="downloads-indicator-notification"/>
</vbox>
</hbox>
<toolbarpalette id="BrowserToolbarPalette">
# Update primaryToolbarButtons in browser/themes/shared/browser.inc when adding
@ -912,16 +918,8 @@
ondrop="DownloadsIndicatorView.onDrop(event);"
ondragover="DownloadsIndicatorView.onDragOver(event);"
ondragenter="DownloadsIndicatorView.onDragOver(event);"
xmlns:xbl="http://www.mozilla.org/xbl"
label="&downloads.label;"
tooltiptext="&downloads.tooltip;">
<!-- We need a different binding for the notification and progress bar, which means
we don't get these for free. Adding them in our binding loses them when dragging
to the customize window, so we add them in here as 'real' children -->
<image class="toolbarbutton-icon" xbl:inherits="validate,src=image,label"/>
<label class="toolbarbutton-text" crop="right" flex="1"
xbl:inherits="value=label,accesskey,crop"/>
</toolbarbutton>
tooltiptext="&downloads.tooltip;"/>
<toolbarbutton id="history-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
observes="viewHistorySidebar" label="&historyButton.label;"

View File

@ -1,4 +0,0 @@
# 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/.

View File

@ -1,4 +0,0 @@
# 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/.

View File

@ -1,5 +0,0 @@
#
# 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/.

View File

@ -111,6 +111,9 @@
extends="chrome://global/content/bindings/toolbarbutton.xml#toolbarbutton">
<content>
<children />
<xul:image class="toolbarbutton-icon" xbl:inherits="validate,src=image,label"/>
<xul:label class="toolbarbutton-text" crop="right" flex="1"
xbl:inherits="value=label,accesskey,crop"/>
</content>
</binding>
</bindings>

View File

@ -326,18 +326,39 @@ const DownloadsIndicatorView = {
return;
}
function DIV_SEN_callback() {
if (this._notificationTimeout) {
clearTimeout(this._notificationTimeout);
}
let indicator = this.indicator;
indicator.setAttribute("notification", aType);
this._notificationTimeout = setTimeout(
function () indicator.removeAttribute("notification"), 1000);
// If the anchor is not there or its container is hidden, don't show
// a notification
let anchor = DownloadsButton._placeholder;
if (!anchor || !isElementVisible(anchor.parentNode)) {
return;
}
this._ensureOperational(DIV_SEN_callback.bind(this));
if (this._notificationTimeout) {
clearTimeout(this._notificationTimeout);
}
// The notification element is positioned to show in the same location as
// the downloads button. It's not in the downloads button itself in order to
// be able to anchor the notification elsewhere if required, and to ensure
// the notification isn't clipped by overflow properties of the anchor's
// container.
let notifier = this.notifier;
if (notifier.style.transform == '') {
let anchorRect = anchor.getBoundingClientRect();
let notifierRect = notifier.getBoundingClientRect();
let topDiff = anchorRect.top - notifierRect.top;
let leftDiff = anchorRect.left - notifierRect.left;
let heightDiff = anchorRect.height - notifierRect.height;
let widthDiff = anchorRect.width - notifierRect.width;
let translateX = (leftDiff + .5 * widthDiff) + "px";
let translateY = (topDiff + .5 * heightDiff) + "px";
notifier.style.transform = "translate(" + translateX + ", " + translateY + ")";
}
notifier.setAttribute("notification", aType);
this._notificationTimeout = setTimeout(function () {
notifier.removeAttribute("notification");
notifier.style.transform = '';
}, 1000);
},
//////////////////////////////////////////////////////////////////////////////
@ -547,6 +568,12 @@ const DownloadsIndicatorView = {
(this.__indicatorProgress = document.getElementById("downloads-indicator-progress"));
},
get notifier()
{
return this._notifier ||
(this._notifier = document.getElementById("downloads-notification-anchor"));
},
_onCustomizedAway: function() {
this._indicator = null;
this._indicatorAnchor = null;

View File

@ -30,7 +30,6 @@
min="0" max="100"/>
</vbox>
<vbox id="downloads-indicator-icon"/>
<vbox id="downloads-indicator-notification"/>
</stack>
</toolbarbutton>
</overlay>

View File

@ -1,3 +0,0 @@
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/

View File

@ -1,4 +0,0 @@
# 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/.

View File

@ -1,4 +0,0 @@
# 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/.

View File

@ -1,7 +0,0 @@
# 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/.
# Disabled for too many intermittent failures (bug 895390)
# browser_privatebrowsing_cache.js \

View File

@ -7,6 +7,8 @@ support-files =
[browser_privatebrowsing_DownloadLastDirWithCPS.js]
[browser_privatebrowsing_aboutHomeButtonAfterWindowClose.js]
[browser_privatebrowsing_aboutSessionRestore.js]
# [browser_privatebrowsing_cache.js]
# Disabled for too many intermittent failures (bug 895390)
[browser_privatebrowsing_certexceptionsui.js]
[browser_privatebrowsing_concurrent.js]
[browser_privatebrowsing_concurrent_page.html]

View File

@ -1,14 +0,0 @@
#
# 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/.
# browser_bug415846.js disabled for too many intermittent failures (bug 546169)
#
# # The browser chrome test for bug 415846 doesn't run on Mac because of its
# # bizarre special-and-unique snowflake of a help menu.
# ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))
# MOCHITEST_BROWSER_FILES += \
# browser_bug415846.js \
# $(NULL)
# endif

View File

@ -2,3 +2,7 @@
support-files = head.js
[browser_bug400731.js]
# [browser_bug415846.js]
# Disabled for too many intermittent failures (bug 546169)
# Previously disabled on Mac because of its bizarre special-and-unique
# snowflake of a help menu.

View File

@ -2730,7 +2730,6 @@ let SessionStoreInternal = {
}
catch (ex) {
// ignore page load errors
aTab.removeAttribute("busy");
didStartLoad = false;
}
}

View File

@ -1,4 +0,0 @@
# 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/.

View File

@ -1,12 +0,0 @@
# 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/.
# browser_tabview_bug597980.js is disabled for leaking, see bug 711907
# browser_tabview_bug678374.js disabled for intermittent failures (bug 795265)
# browser_tabview_bug602432.js disabled for intermittent failures (bug 704417)
# browser_tabview_bug610242.js disabled for intermittent failures (bug 736036)
# browser_tabview_bug648882.js disabled for intermittent failures (bug 752862)
# browser_tabview_bug654941.js disabled for intermittent failures (bug 754222)
# browser_tabview_bug673729.js disabled for intermittent failures (bug 749980)
# browser_tabview_bug696602.js disabled for intermittent failures (bug 736425)

View File

@ -146,3 +146,11 @@ support-files =
[browser_tabview_snapping.js]
[browser_tabview_startup_transitions.js]
[browser_tabview_undo_group.js]
# browser_tabview_bug597980.js is disabled for leaking, see bug 711907
# browser_tabview_bug678374.js disabled for intermittent failures (bug 795265)
# browser_tabview_bug602432.js disabled for intermittent failures (bug 704417)
# browser_tabview_bug610242.js disabled for intermittent failures (bug 736036)
# browser_tabview_bug648882.js disabled for intermittent failures (bug 752862)
# browser_tabview_bug654941.js disabled for intermittent failures (bug 754222)
# browser_tabview_bug673729.js disabled for intermittent failures (bug 749980)
# browser_tabview_bug696602.js disabled for intermittent failures (bug 736425)

View File

@ -1,4 +0,0 @@
# 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/.

View File

@ -120,6 +120,7 @@ let UI = {
},
startSimulator: function(version) {
this._portBeforeSimulatorStarted = this.connection.port;
let port = ConnectionManager.getFreeTCPPort();
let simulator = Simulator.getByVersion(version);
if (!simulator) {
@ -152,6 +153,12 @@ let UI = {
_onSimulatorConnected: function() {
this.connection.log("Connected to simulator.");
this.connection.keepConnecting = false;
// This doesn't change the current (successful) connection,
// but makes sure that when the simulator is disconnected, the
// connection doesn't end up with a random port number (from
// getFreeTCPPort).
this.connection.port = this._portBeforeSimulatorStarted;
},
_onSimulatorDisconnected: function() {

View File

@ -1,4 +0,0 @@
# 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/.

View File

@ -328,12 +328,6 @@ function performTest() {
is(gVariablesView.getFocusedItem().name, "prop1",
"The 'prop1' item should be focused.");
if (gVariablesView.getFocusedItem().name != "prop1") {
gDebugger.DebuggerView.toggleInstrumentsPane({ visible: true, animated: false })
yield promise.defer().promise;
yield closeDebuggerAndFinish(gPanel);
}
EventUtils.sendKey("RIGHT", gDebugger);
is(gVariablesView.getFocusedItem().name, "prop1",
"The 'prop1' item should still be focused.");

View File

@ -1,4 +0,0 @@
# 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/.

View File

@ -1,4 +0,0 @@
# 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/.

View File

@ -102,6 +102,7 @@ HTMLBreadcrumbs.prototype = {
this.selection.on("new-node-front", this.update);
this.selection.on("pseudoclass", this.updateSelectors);
this.selection.on("attribute-changed", this.updateSelectors);
this.inspector.on("markupmutation", this.update);
this.update();
},
@ -349,6 +350,7 @@ HTMLBreadcrumbs.prototype = {
this.selection.off("new-node-front", this.update);
this.selection.off("pseudoclass", this.updateSelectors);
this.selection.off("attribute-changed", this.updateSelectors);
this.inspector.off("markupmutation", this.update);
this.container.removeEventListener("underflow", this.onscrollboxreflow, false);
this.container.removeEventListener("overflow", this.onscrollboxreflow, false);
@ -611,7 +613,7 @@ HTMLBreadcrumbs.prototype = {
/**
* Update the breadcrumbs display when a new node is selected.
*/
update: function BC_update()
update: function BC_update(reason)
{
this.inspector.hideNodeMenu();
@ -632,7 +634,8 @@ HTMLBreadcrumbs.prototype = {
let idx = this.indexOf(this.selection.nodeFront);
// Is the node already displayed in the breadcrumbs?
if (idx > -1) {
// (and there are no mutations that need re-display of the crumbs)
if (idx > -1 && reason !== "markupmutation") {
// Yes. We select it.
this.setCursor(idx);
} else {
@ -666,7 +669,7 @@ HTMLBreadcrumbs.prototype = {
doneUpdating(this.selection.nodeFront);
this.selectionGuardEnd(err);
});
},
}
}
XPCOMUtils.defineLazyGetter(this, "DOMUtils", function () {

View File

@ -399,7 +399,7 @@ InspectorPanel.prototype = {
}
self._updateProgress = null;
self.emit("inspector-updated");
self.emit("inspector-updated", name);
},
};
}
@ -432,7 +432,9 @@ InspectorPanel.prototype = {
},
/**
* When a node is deleted, select its parent node.
* When a node is deleted, select its parent node or the defaultNode if no
* parent is found (may happen when deleting an iframe inside which the
* node was selected).
*/
onDetached: function InspectorPanel_onDetached(event, parentNode) {
this.cancelLayoutChange();

View File

@ -4,6 +4,8 @@
* 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 {Cu, Ci} = require("chrome");
let EventEmitter = require("devtools/shared/event-emitter");
@ -76,32 +78,38 @@ Selection.prototype = {
let pseudoChange = false;
let detached = false;
let parentNode = null;
for (let m of mutations) {
if (!attributeChange && m.type == "attributes") {
attributeChange = true;
}
if (m.type == "childList") {
if (!detached && this.isNode() && !this.isConnected()) {
parentNode = m.target;
if (!detached && !this.isConnected()) {
if (this.isNode()) {
parentNode = m.target;
}
detached = true;
}
}
if (m.type == "pseudoClassLock"){
if (m.type == "pseudoClassLock") {
pseudoChange = true;
}
}
if (attributeChange)
// Fire our events depending on what changed in the mutations array
if (attributeChange) {
this.emit("attribute-changed");
if (pseudoChange)
}
if (pseudoChange) {
this.emit("pseudoclass");
}
if (detached) {
this.emit("detached", parentNode ? parentNode.rawNode() : null);
this.emit("detached-front", parentNode);
}
},
destroy: function SN_destroy() {
destroy: function() {
this.setNode(null);
this.setWalker(null);
},
@ -117,7 +125,7 @@ Selection.prototype = {
},
// Not remote-safe
setNode: function SN_setNode(value, reason="unknown") {
setNode: function(value, reason="unknown") {
if (value) {
value = this._walker.frontForRawNode(value);
}
@ -168,13 +176,13 @@ Selection.prototype = {
return this._nodeFront;
},
isRoot: function SN_isRootNode() {
isRoot: function() {
return this.isNode() &&
this.isConnected() &&
this._nodeFront.isDocumentElement;
},
isNode: function SN_isNode() {
isNode: function() {
if (!this._nodeFront) {
return false;
}
@ -188,11 +196,11 @@ Selection.prototype = {
return true;
},
isLocal: function SN_nsLocal() {
isLocal: function() {
return !!this._node;
},
isConnected: function SN_isConnected() {
isConnected: function() {
let node = this._nodeFront;
if (!node || !node.actorID) {
return false;
@ -220,58 +228,58 @@ Selection.prototype = {
return false;
},
isHTMLNode: function SN_isHTMLNode() {
isHTMLNode: function() {
let xhtml_ns = "http://www.w3.org/1999/xhtml";
return this.isNode() && this.node.namespaceURI == xhtml_ns;
},
// Node type
isElementNode: function SN_isElementNode() {
isElementNode: function() {
return this.isNode() && this.nodeFront.nodeType == Ci.nsIDOMNode.ELEMENT_NODE;
},
isAttributeNode: function SN_isAttributeNode() {
isAttributeNode: function() {
return this.isNode() && this.nodeFront.nodeType == Ci.nsIDOMNode.ATTRIBUTE_NODE;
},
isTextNode: function SN_isTextNode() {
isTextNode: function() {
return this.isNode() && this.nodeFront.nodeType == Ci.nsIDOMNode.TEXT_NODE;
},
isCDATANode: function SN_isCDATANode() {
isCDATANode: function() {
return this.isNode() && this.nodeFront.nodeType == Ci.nsIDOMNode.CDATA_SECTION_NODE;
},
isEntityRefNode: function SN_isEntityRefNode() {
isEntityRefNode: function() {
return this.isNode() && this.nodeFront.nodeType == Ci.nsIDOMNode.ENTITY_REFERENCE_NODE;
},
isEntityNode: function SN_isEntityNode() {
isEntityNode: function() {
return this.isNode() && this.nodeFront.nodeType == Ci.nsIDOMNode.ENTITY_NODE;
},
isProcessingInstructionNode: function SN_isProcessingInstructionNode() {
isProcessingInstructionNode: function() {
return this.isNode() && this.nodeFront.nodeType == Ci.nsIDOMNode.PROCESSING_INSTRUCTION_NODE;
},
isCommentNode: function SN_isCommentNode() {
isCommentNode: function() {
return this.isNode() && this.nodeFront.nodeType == Ci.nsIDOMNode.PROCESSING_INSTRUCTION_NODE;
},
isDocumentNode: function SN_isDocumentNode() {
isDocumentNode: function() {
return this.isNode() && this.nodeFront.nodeType == Ci.nsIDOMNode.DOCUMENT_NODE;
},
isDocumentTypeNode: function SN_isDocumentTypeNode() {
isDocumentTypeNode: function() {
return this.isNode() && this.nodeFront.nodeType == Ci.nsIDOMNode.DOCUMENT_TYPE_NODE;
},
isDocumentFragmentNode: function SN_isDocumentFragmentNode() {
isDocumentFragmentNode: function() {
return this.isNode() && this.nodeFront.nodeType == Ci.nsIDOMNode.DOCUMENT_FRAGMENT_NODE;
},
isNotationNode: function SN_isNotationNode() {
isNotationNode: function() {
return this.isNode() && this.nodeFront.nodeType == Ci.nsIDOMNode.NOTATION_NODE;
},
}
};

View File

@ -1,7 +0,0 @@
# 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/.
# Disabled for too many intermittent failures (bug 851349)
# browser_inspector_bug_831693_searchbox_panel_navigation.js \

View File

@ -14,6 +14,8 @@ support-files = head.js
[browser_inspector_bug_831693_combinator_suggestions.js]
[browser_inspector_bug_831693_input_suggestion.js]
[browser_inspector_bug_831693_search_suggestions.html]
# [browser_inspector_bug_831693_searchbox_panel_navigation.js]
# Disabled for too many intermittent failures (bug 851349)
[browser_inspector_bug_835722_infobar_reappears.js]
[browser_inspector_bug_840156_destroy_after_navigation.js]
[browser_inspector_changes.js]
@ -40,3 +42,5 @@ support-files = head.js
[browser_inspector_select_last_selected.js]
[browser_inspector_select_last_selected2.html]
[browser_inspector_sidebarstate.js]
[browser_inspector_bug_848731_reset_selection_on_delete.js]
[browser_inspector_bug_848731_reset_selection_on_delete.html]

View File

@ -0,0 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>node delete - reset selection - test</title>
</head>
<body>
<ul id="deleteChildren">
<li id="deleteManually">Delete me via the inspector</li>
<li id="deleteAutomatically">Delete me via javascript</li>
</ul>
<iframe id="deleteIframe" src="data:text/html,%3C!DOCTYPE%20html%3E%3Chtml%20lang%3D%22en%22%3E%3Cbody%3E%3Cp%20id%3D%22deleteInIframe%22%3EDelete my container iframe%3C%2Fp%3E%3C%2Fbody%3E%3C%2Fhtml%3E"></iframe>
</body>
</html>

View File

@ -0,0 +1,146 @@
/* -*- Mode: Javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* 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/. */
// Test that when nodes are being deleted in the page, the current selection
// and therefore the markup view, css rule view, computed view, font view,
// box model view, and breadcrumbs, reset accordingly to show the right node
const TEST_PAGE = "http://mochi.test:8888/browser/browser/devtools/inspector/test/browser_inspector_bug_848731_reset_selection_on_delete.html";
function test() {
let inspector, toolbox;
waitForExplicitFinish();
// Create a tab, load test HTML, wait for load and start the tests
gBrowser.selectedTab = gBrowser.addTab();
gBrowser.selectedBrowser.addEventListener("load", function onload() {
gBrowser.selectedBrowser.removeEventListener("load", onload, true);
waitForFocus(function() {
openInspector((aInspector, aToolbox) => {
inspector = aInspector;
toolbox = aToolbox;
startTests();
});
}, content);
}, true);
content.location = TEST_PAGE;
function startTests() {
testManuallyDeleteSelectedNode();
}
function getContainerForRawNode(rawNode) {
let front = inspector.markup.walker.frontForRawNode(rawNode);
let container = inspector.markup.getContainer(front);
return container;
}
// 1 - select a node, right click, hit delete, verify that its parent is selected
// and that all other tools are fine
function testManuallyDeleteSelectedNode() {
info("Deleting a node via the devtools contextual menu");
// Select our div
let div = content.document.getElementById("deleteManually");
inspector.selection.setNode(div);
inspector.once("inspector-updated", () => {
is(inspector.selection.node, div, "Test node is selected");
// Get the node container in the markup view
let container = getContainerForRawNode(div);
// Simulate right-click
EventUtils.synthesizeMouse(container.tagLine, 2, 2,
{type: "contextmenu", button: 2}, inspector.panelWin);
// And react to the popup shown event
let contextMenu = inspector.panelDoc.getElementById("inspectorPopupSet");
contextMenu.addEventListener("popupshown", function contextShown() {
contextMenu.removeEventListener("popupshown", contextShown, false);
// Click on the delete sub-menu item
inspector.panelDoc.getElementById("node-menu-delete").click();
// Once updated, make sure eveything is in place, and move on
inspector.once("inspector-updated", () => {
let parent = content.document.getElementById("deleteChildren");
assertNodeSelectedAndPanelsUpdated(parent, "ul#deleteChildren");
testAutomaticallyDeleteSelectedNode();
});
}, false);
});
}
// 2 - select a node, delete it via javascript, verify the same things as 1
function testAutomaticallyDeleteSelectedNode() {
info("Deleting a node via javascript");
// Select our second div
let div = content.document.getElementById("deleteAutomatically");
inspector.selection.setNode(div);
inspector.once("inspector-updated", () => {
is(inspector.selection.node, div, "Test node is selected");
// Now remove that div via javascript
let parent = content.document.getElementById("deleteChildren");
parent.removeChild(div);
// Once updated, make sure eveything is in place, and move on
inspector.once("inspector-updated", () => {
assertNodeSelectedAndPanelsUpdated(parent, "ul#deleteChildren");
testDeleteSelectedNodeContainerFrame();
});
});
}
// 3 - select a node inside an iframe, delete the iframe via javascript, verify that the default node is selected
// and that all other tools are fine
function testDeleteSelectedNodeContainerFrame() {
info("Deleting an iframe via javascript");
// Select our third test element, inside the iframe
let iframe = content.document.getElementById("deleteIframe");
let div = iframe.contentDocument.getElementById("deleteInIframe");
inspector.selection.setNode(div);
inspector.once("inspector-updated", () => {
is(inspector.selection.node, div, "Test node is selected");
// Now remove that parent iframe via javascript
let parent = content.document.body;
parent.removeChild(iframe);
// Once updated, make sure eveything is in place, and move on
inspector.once("inspector-updated", () => {
assertNodeSelectedAndPanelsUpdated(parent, "body");
endTests();
});
});
}
function endTests() {
executeSoon(() => {
toolbox.destroy();
toolbox = inspector = null;
gBrowser.removeCurrentTab();
finish();
});
}
function assertNodeSelectedAndPanelsUpdated(node, crumbLabel) {
// Right node selected?
is(inspector.selection.nodeFront, getNodeFront(node),
"The right node is selected");
// breadcrumbs updated?
let breadcrumbs = inspector.panelDoc.getElementById("inspector-breadcrumbs");
is(breadcrumbs.querySelector("button[checked=true]").textContent, crumbLabel,
"The right breadcrumb is selected");
// Highlighter is shown?
ok(!inspector.highlighter.isHidden(), "The highlighter is shown");
}
}

View File

@ -1,4 +0,0 @@
# 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/.

View File

@ -28,7 +28,9 @@ Cu.import("resource://gre/modules/Services.jsm");
loader.lazyGetter(this, "DOMParser", function() {
return Cc["@mozilla.org/xmlextras/domparser;1"].createInstance(Ci.nsIDOMParser);
});
loader.lazyGetter(this, "AutocompletePopup", () => require("devtools/shared/autocomplete-popup").AutocompletePopup);
loader.lazyGetter(this, "AutocompletePopup", () => {
return require("devtools/shared/autocomplete-popup").AutocompletePopup
});
/**
* Vocabulary for the purposes of this file:
@ -48,8 +50,7 @@ loader.lazyGetter(this, "AutocompletePopup", () => require("devtools/shared/auto
* @param iframe aFrame
* An iframe in which the caller has kindly loaded markup-view.xhtml.
*/
function MarkupView(aInspector, aFrame, aControllerWindow)
{
function MarkupView(aInspector, aFrame, aControllerWindow) {
this._inspector = aInspector;
this.walker = this._inspector.walker;
this._frame = aFrame;
@ -101,8 +102,7 @@ exports.MarkupView = MarkupView;
MarkupView.prototype = {
_selectedContainer: null,
template: function MT_template(aName, aDest, aOptions={stack: "markup-view.xhtml"})
{
template: function(aName, aDest, aOptions={stack: "markup-view.xhtml"}) {
let node = this.doc.getElementById("template-" + aName).cloneNode(true);
node.removeAttribute("id");
template(node, aDest, aOptions);
@ -113,8 +113,7 @@ MarkupView.prototype = {
* Get the MarkupContainer object for a given node, or undefined if
* none exists.
*/
getContainer: function MT_getContainer(aNode)
{
getContainer: function(aNode) {
return this._containers.get(aNode);
},
@ -148,8 +147,7 @@ MarkupView.prototype = {
/**
* Highlight the inspector selected node.
*/
_onNewSelection: function MT__onNewSelection()
{
_onNewSelection: function() {
let done = this._inspector.updating("markup-view");
if (this._inspector.selection.isNode()) {
this.showNode(this._inspector.selection.nodeFront, true).then(() => {
@ -166,8 +164,7 @@ MarkupView.prototype = {
* Create a TreeWalker to find the next/previous
* node for selection.
*/
_selectionWalker: function MT__seletionWalker(aStart)
{
_selectionWalker: function(aStart) {
let walker = this.doc.createTreeWalker(
aStart || this._elt,
Ci.nsIDOMNodeFilter.SHOW_ELEMENT,
@ -187,8 +184,7 @@ MarkupView.prototype = {
/**
* Key handling.
*/
_onKeyDown: function MT__KeyDown(aEvent)
{
_onKeyDown: function(aEvent) {
let handled = true;
// Ignore keystrokes that originated in editors.
@ -286,8 +282,7 @@ MarkupView.prototype = {
* Delete a node from the DOM.
* This is an undoable action.
*/
deleteNode: function MC__deleteNode(aNode)
{
deleteNode: function(aNode) {
if (aNode.isDocumentElement ||
aNode.nodeType == Ci.nsIDOMNode.DOCUMENT_TYPE_NODE) {
return;
@ -315,7 +310,7 @@ MarkupView.prototype = {
/**
* If an editable item is focused, select its container.
*/
_onFocus: function MC__onFocus(aEvent) {
_onFocus: function(aEvent) {
let parent = aEvent.target;
while (!parent.container) {
parent = parent.parentNode;
@ -334,8 +329,7 @@ MarkupView.prototype = {
* @param aIgnoreFocus aIgnoreFocus
* If falsy, keyboard focus will be moved to the container too.
*/
navigate: function MT__navigate(aContainer, aIgnoreFocus)
{
navigate: function(aContainer, aIgnoreFocus) {
if (!aContainer) {
return;
}
@ -362,8 +356,7 @@ MarkupView.prototype = {
* Whether the newly imported node should be flashed
* @returns MarkupContainer The MarkupContainer object for this element.
*/
importNode: function MT_importNode(aNode, aFlashNode)
{
importNode: function(aNode, aFlashNode) {
if (!aNode) {
return null;
}
@ -395,8 +388,7 @@ MarkupView.prototype = {
/**
* Mutation observer used for included nodes.
*/
_mutationObserver: function MT__mutationObserver(aMutations)
{
_mutationObserver: function(aMutations) {
for (let mutation of aMutations) {
let type = mutation.type;
let target = mutation.target;
@ -437,8 +429,7 @@ MarkupView.prototype = {
* Given a list of mutations returned by the mutation observer, flash the
* corresponding containers to attract attention.
*/
_flashMutatedNodes: function MT_flashMutatedNodes(aMutations)
{
_flashMutatedNodes: function(aMutations) {
let addedOrEditedContainers = new Set();
let removedContainers = new Set();
@ -481,8 +472,7 @@ MarkupView.prototype = {
* Make sure the given node's parents are expanded and the
* node is scrolled on to screen.
*/
showNode: function MT_showNode(aNode, centered)
{
showNode: function(aNode, centered) {
let container = this.importNode(aNode);
let parent = aNode;
while ((parent = parent.parentNode())) {
@ -501,8 +491,7 @@ MarkupView.prototype = {
/**
* Expand the container's children.
*/
_expandContainer: function MT__expandContainer(aContainer)
{
_expandContainer: function(aContainer) {
return this._updateChildren(aContainer, {expand: true}).then(() => {
aContainer.expanded = true;
});
@ -511,8 +500,7 @@ MarkupView.prototype = {
/**
* Expand the node's children.
*/
expandNode: function MT_expandNode(aNode)
{
expandNode: function(aNode) {
let container = this._containers.get(aNode);
this._expandContainer(container);
},
@ -522,8 +510,7 @@ MarkupView.prototype = {
*
* @param aContainer The container to expand.
*/
_expandAll: function MT_expandAll(aContainer)
{
_expandAll: function(aContainer) {
return this._expandContainer(aContainer).then(() => {
let child = aContainer.children.firstChild;
let promises = [];
@ -541,8 +528,7 @@ MarkupView.prototype = {
* @param aContainer The node to expand, or null
* to start from the top.
*/
expandAll: function MT_expandAll(aNode)
{
expandAll: function(aNode) {
aNode = aNode || this._rootNode;
return this._expandAll(this._containers.get(aNode));
},
@ -550,14 +536,12 @@ MarkupView.prototype = {
/**
* Collapse the node's children.
*/
collapseNode: function MT_collapseNode(aNode)
{
collapseNode: function(aNode) {
let container = this._containers.get(aNode);
container.expanded = false;
},
setNodeExpanded: function(aNode, aExpanded)
{
setNodeExpanded: function(aNode, aExpanded) {
if (aExpanded) {
this.expandNode(aNode);
} else {
@ -568,8 +552,7 @@ MarkupView.prototype = {
/**
* Mark the given node selected.
*/
markNodeAsSelected: function MT_markNodeAsSelected(aNode)
{
markNodeAsSelected: function(aNode) {
let container = this._containers.get(aNode);
if (this._selectedContainer === container) {
return false;
@ -589,8 +572,7 @@ MarkupView.prototype = {
* Make sure that every ancestor of the selection are updated
* and included in the list of visible children.
*/
_ensureVisible: function(node)
{
_ensureVisible: function(node) {
while (node) {
let container = this._containers.get(node);
let parent = node.parentNode();
@ -608,8 +590,7 @@ MarkupView.prototype = {
/**
* Unmark selected node (no node selected).
*/
unmarkSelectedNode: function MT_unmarkSelectedNode()
{
unmarkSelectedNode: function() {
if (this._selectedContainer) {
this._selectedContainer.selected = false;
this._selectedContainer = null;
@ -619,8 +600,7 @@ MarkupView.prototype = {
/**
* Called when the markup panel initiates a change on a node.
*/
nodeChanged: function MT_nodeChanged(aNode)
{
nodeChanged: function(aNode) {
if (aNode === this._inspector.selection.nodeFront) {
this._inspector.change("markupview");
}
@ -667,8 +647,7 @@ MarkupView.prototype = {
* @return a promise that will be resolved when the children are ready
* (which may be immediately).
*/
_updateChildren: function(aContainer, options)
{
_updateChildren: function(aContainer, options) {
let expand = options && options.expand;
let flash = options && options.flash;
@ -772,8 +751,7 @@ MarkupView.prototype = {
/**
* Return a list of the children to display for this container.
*/
_getVisibleChildren: function MV__getVisibleChildren(aContainer, aCentered)
{
_getVisibleChildren: function(aContainer, aCentered) {
let maxChildren = aContainer.maxChildren || this.maxChildren;
if (maxChildren == -1) {
maxChildren = undefined;
@ -788,8 +766,7 @@ MarkupView.prototype = {
/**
* Tear down the markup panel.
*/
destroy: function MT_destroy()
{
destroy: function() {
gDevTools.off("pref-changed", this._handlePrefChange);
this.undo.destroy();
@ -802,18 +779,23 @@ MarkupView.prototype = {
delete this._boundFocus;
if (this._boundUpdatePreview) {
this._frame.contentWindow.removeEventListener("scroll", this._boundUpdatePreview, true);
this._frame.contentWindow.removeEventListener("scroll",
this._boundUpdatePreview, true);
delete this._boundUpdatePreview;
}
if (this._boundResizePreview) {
this._frame.contentWindow.removeEventListener("resize", this._boundResizePreview, true);
this._frame.contentWindow.removeEventListener("overflow", this._boundResizePreview, true);
this._frame.contentWindow.removeEventListener("underflow", this._boundResizePreview, true);
this._frame.contentWindow.removeEventListener("resize",
this._boundResizePreview, true);
this._frame.contentWindow.removeEventListener("overflow",
this._boundResizePreview, true);
this._frame.contentWindow.removeEventListener("underflow",
this._boundResizePreview, true);
delete this._boundResizePreview;
}
this._frame.contentWindow.removeEventListener("keydown", this._boundKeyDown, false);
this._frame.contentWindow.removeEventListener("keydown",
this._boundKeyDown, false);
delete this._boundKeyDown;
this._inspector.selection.off("new-node-front", this._boundOnNewSelection);
@ -830,8 +812,7 @@ MarkupView.prototype = {
/**
* Initialize the preview panel.
*/
_initPreview: function MT_initPreview()
{
_initPreview: function() {
if (!Services.prefs.getBoolPref("devtools.inspector.markupPreview")) {
return;
}
@ -845,21 +826,23 @@ MarkupView.prototype = {
this._previewWidth = this._preview.getBoundingClientRect().width;
this._boundResizePreview = this._resizePreview.bind(this);
this._frame.contentWindow.addEventListener("resize", this._boundResizePreview, true);
this._frame.contentWindow.addEventListener("overflow", this._boundResizePreview, true);
this._frame.contentWindow.addEventListener("underflow", this._boundResizePreview, true);
this._frame.contentWindow.addEventListener("resize",
this._boundResizePreview, true);
this._frame.contentWindow.addEventListener("overflow",
this._boundResizePreview, true);
this._frame.contentWindow.addEventListener("underflow",
this._boundResizePreview, true);
this._boundUpdatePreview = this._updatePreview.bind(this);
this._frame.contentWindow.addEventListener("scroll", this._boundUpdatePreview, true);
this._frame.contentWindow.addEventListener("scroll",
this._boundUpdatePreview, true);
this._updatePreview();
},
/**
* Move the preview viewbox.
*/
_updatePreview: function MT_updatePreview()
{
_updatePreview: function() {
let win = this._frame.contentWindow;
if (win.scrollMaxY == 0) {
@ -876,7 +859,8 @@ MarkupView.prototype = {
let scrollTo
if (height >= win.innerHeight) {
scrollTo = -(height - win.innerHeight) * (win.scrollY / win.scrollMaxY);
this._previewBar.setAttribute("style", "height:" + height + "px;transform:translateY(" + scrollTo + "px)");
this._previewBar.setAttribute("style", "height:" + height +
"px;transform:translateY(" + scrollTo + "px)");
} else {
this._previewBar.setAttribute("style", "height:100%");
}
@ -886,14 +870,14 @@ MarkupView.prototype = {
let height = ~~(win.innerHeight * ratio) + "px";
let top = ~~(win.scrollY * ratio) + "px";
this._viewbox.setAttribute("style", "height:" + height + ";transform: translateY(" + top + ")");
this._viewbox.setAttribute("style", "height:" + height +
";transform: translateY(" + top + ")");
},
/**
* Hide the preview while resizing, to avoid slowness.
*/
_resizePreview: function MT_resizePreview()
{
_resizePreview: function() {
let win = this._frame.contentWindow;
this._previewBar.classList.add("hide");
win.clearTimeout(this._resizePreviewTimeout);
@ -1122,12 +1106,14 @@ MarkupContainer.prototype = {
this.highlighter.classList.add("theme-bg-darker");
}
if (this.closeTagLine) {
this.closeTagLine.querySelector(".highlighter").classList.add("theme-bg-darker");
this.closeTagLine.querySelector(".highlighter").classList.add(
"theme-bg-darker");
}
} else {
this.highlighter.classList.remove("theme-bg-darker");
if (this.closeTagLine) {
this.closeTagLine.querySelector(".highlighter").classList.remove("theme-bg-darker");
this.closeTagLine.querySelector(".highlighter").classList.remove(
"theme-bg-darker");
}
}
},
@ -1204,8 +1190,7 @@ RootContainer.prototype = {
/**
* Creates an editor for simple nodes.
*/
function GenericEditor(aContainer, aNode)
{
function GenericEditor(aContainer, aNode) {
this.elt = aContainer.doc.createElement("span");
this.elt.className = "editor";
this.elt.textContent = aNode.nodeName;
@ -1217,8 +1202,7 @@ function GenericEditor(aContainer, aNode)
* @param MarkupContainer aContainer The container owning this editor.
* @param DOMNode aNode The node being edited.
*/
function DoctypeEditor(aContainer, aNode)
{
function DoctypeEditor(aContainer, aNode) {
this.elt = aContainer.doc.createElement("span");
this.elt.className = "editor comment";
this.elt.textContent = '<!DOCTYPE ' + aNode.name +
@ -1235,8 +1219,7 @@ function DoctypeEditor(aContainer, aNode)
* @param DOMNode aNode The node being edited.
* @param string aTemplate The template id to use to build the editor.
*/
function TextEditor(aContainer, aNode, aTemplate)
{
function TextEditor(aContainer, aNode, aTemplate) {
this.node = aNode;
this._selected = false;
@ -1282,8 +1265,7 @@ TextEditor.prototype = {
this.update();
},
update: function TE_update()
{
update: function() {
if (!this.selected || !this.node.incompleteValue) {
let text = this.node.shortValue;
// XXX: internationalize the elliding
@ -1312,8 +1294,7 @@ TextEditor.prototype = {
* @param MarkupContainer aContainer The container owning this editor.
* @param Element aNode The node being edited.
*/
function ElementEditor(aContainer, aNode)
{
function ElementEditor(aContainer, aNode) {
this.doc = aContainer.doc;
this.undo = aContainer.undo;
this.template = aContainer.markup.template.bind(aContainer.markup);
@ -1386,8 +1367,7 @@ ElementEditor.prototype = {
/**
* Update the state of the editor from the node.
*/
update: function EE_update(parseColors=true)
{
update: function(parseColors=true) {
let attrs = this.node.attributes;
if (!attrs) {
return;
@ -1420,8 +1400,7 @@ ElementEditor.prototype = {
return this.node.startModifyingAttributes();
},
_createAttribute: function EE_createAttribute(aAttr, aBefore = null)
{
_createAttribute: function(aAttr, aBefore = null) {
// Create the template editor, which will save some variables here.
let data = {
attrName: aAttr.name,
@ -1497,7 +1476,6 @@ ElementEditor.prototype = {
}
});
// Figure out where we should place the attribute.
let before = aBefore;
if (aAttr.name == "id") {
@ -1539,8 +1517,7 @@ ElementEditor.prototype = {
* set of attributes, used to place new attributes where the
* user put them.
*/
_applyAttributes: function EE__applyAttributes(aValue, aAttrNode, aDoMods, aUndoMods)
{
_applyAttributes: function(aValue, aAttrNode, aDoMods, aUndoMods) {
let attrs = parseAttributeValues(aValue, this.doc);
for (let attr of attrs) {
// Create an attribute editor next to the current attribute if needed.
@ -1554,8 +1531,7 @@ ElementEditor.prototype = {
* Saves the current state of the given attribute into an attribute
* modification list.
*/
_saveAttribute: function(aName, aUndoMods)
{
_saveAttribute: function(aName, aUndoMods) {
let node = this.node;
if (node.hasAttribute(aName)) {
let oldValue = node.getAttribute(aName);
@ -1568,7 +1544,7 @@ ElementEditor.prototype = {
/**
* Called when the tag name editor has is done editing.
*/
onTagEdit: function EE_onTagEdit(aVal, aCommit) {
onTagEdit: function(aVal, aCommit) {
if (!aCommit || aVal == this.rawNode.tagName) {
return;
}
@ -1623,7 +1599,8 @@ ElementEditor.prototype = {
};
function nodeDocument(node) {
return node.ownerDocument || (node.nodeType == Ci.nsIDOMNode.DOCUMENT_NODE ? node : null);
return node.ownerDocument ||
(node.nodeType == Ci.nsIDOMNode.DOCUMENT_NODE ? node : null);
}
function truncateString(str, maxLength) {

View File

@ -1,4 +0,0 @@
# 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/.

View File

@ -783,16 +783,18 @@ function test() {
function testAsyncSetup(test, callback) {
info("START " + test.desc);
inspector.once("inspector-updated", function BIMET_testAsyncSetupNewNode() {
test.before();
test.execute(function() {
test.after();
undoRedo(test, callback);
});
});
executeSoon(function BIMET_setNode2() {
test.setup();
inspector.on("inspector-updated", function BIMET_updated(event, name) {
if (name === "inspector-panel") {
inspector.off("inspector-updated", BIMET_updated);
test.before();
test.execute(function() {
test.after();
undoRedo(test, callback);
});
}
});
executeSoon(test.setup);
}
function undoRedo(test, callback) {

View File

@ -65,6 +65,7 @@ Cu.import("resource:///modules/devtools/sourceeditor/source-editor.jsm");
Cu.import("resource:///modules/devtools/shared/event-emitter.js");
Cu.import("resource:///modules/devtools/SideMenuWidget.jsm");
Cu.import("resource:///modules/devtools/VariablesView.jsm");
Cu.import("resource:///modules/devtools/VariablesViewController.jsm");
Cu.import("resource:///modules/devtools/ViewHelpers.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",

View File

@ -1539,6 +1539,7 @@ NetworkDetailsView.prototype = {
Heritage.extend(GENERIC_VARIABLES_VIEW_SETTINGS, {
searchPlaceholder: L10N.getStr("jsonFilterText")
}));
VariablesViewController.attach(this._json);
this._paramsQueryString = L10N.getStr("paramsQueryString");
this._paramsFormData = L10N.getStr("paramsFormData");
@ -1889,9 +1890,10 @@ NetworkDetailsView.prototype = {
? L10N.getFormatStr("jsonpScopeName", callbackPadding[0].slice(0, -1))
: L10N.getStr("jsonScopeName");
let jsonScope = this._json.addScope(jsonScopeName);
jsonScope.addItem().populate(jsonObject, { expanded: true });
jsonScope.expanded = true;
this._json.controller.setSingleVariable({
label: jsonScopeName,
rawObject: jsonObject,
});
}
// Malformed JSON.
else {

View File

@ -1,4 +0,0 @@
# 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/.

View File

@ -1,4 +0,0 @@
# 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/.

View File

@ -1,4 +0,0 @@
# 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/.

View File

@ -1831,15 +1831,10 @@ ScratchpadSidebar.prototype = {
*/
_update: function SS__update(aObject)
{
let options = { objectActor: aObject };
let view = this.variablesView;
view.empty();
let scope = view.addScope();
scope.expanded = true;
scope.locked = true;
let container = scope.addItem();
return view.controller.expand(container, aObject);
return view.controller.setSingleVariable(options).expanded;
}
};

View File

@ -1,6 +0,0 @@
# 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/.
# Disable test due to bug 807234 becoming basically permanent
# browser_scratchpad_bug_653427_confirm_close.js \

View File

@ -12,6 +12,8 @@ support-files = head.js
[browser_scratchpad_bug_646070_chrome_context_pref.js]
[browser_scratchpad_bug_650760_help_key.js]
[browser_scratchpad_bug_651942_recent_files.js]
# [browser_scratchpad_bug_653427_confirm_close.js]
# Disable test due to bug 807234 becoming basically permanent
[browser_scratchpad_bug_660560_tab.js]
[browser_scratchpad_bug_661762_wrong_window_focus.js]
[browser_scratchpad_bug_669612_unsaved.js]

View File

@ -1,5 +0,0 @@
#
# 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/.

View File

@ -44,7 +44,7 @@ this.EXPORTED_SYMBOLS = ["VariablesViewController", "StackFrameUtils"];
*
* @param VariablesView aView
* The view to attach to.
* @param object aOptions
* @param object aOptions [optional]
* Options for configuring the controller. Supported options:
* - getObjectClient: callback for creating an object grip client
* - getLongStringClient: callback for creating a long string grip client
@ -54,7 +54,7 @@ this.EXPORTED_SYMBOLS = ["VariablesViewController", "StackFrameUtils"];
* - getterOrSetterEvalMacro: callback for creating a getter/setter eval macro
* - simpleValueEvalMacro: callback for creating a simple value eval macro
*/
function VariablesViewController(aView, aOptions) {
function VariablesViewController(aView, aOptions = {}) {
this.addExpander = this.addExpander.bind(this);
this._getObjectClient = aOptions.getObjectClient;
@ -442,6 +442,37 @@ VariablesViewController.prototype = {
}
}
},
/**
* Helper function for setting up a single Scope with a single Variable
* contained within it.
*
* @param object aOptions
* Options for the contents of the view:
* - objectActor: the grip of the new ObjectActor to show.
* - rawObject: the new raw object to show.
* - label: the new label for the inspected object.
* @return Object
* - variable: the created Variable.
* - expanded: the Promise that resolves when the variable expands.
*/
setSingleVariable: function(aOptions) {
let scope = this.view.addScope(aOptions.label);
scope.expanded = true;
scope.locked = true;
let variable = scope.addItem();
let expanded;
if (aOptions.objectActor) {
expanded = this.expand(variable, aOptions.objectActor);
} else if (aOptions.rawObject) {
variable.populate(aOptions.rawObject, { expanded: true });
expanded = promise.resolve();
}
return { variable: variable, expanded: expanded };
},
};

View File

@ -1,4 +0,0 @@
# 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/.

View File

@ -1,4 +0,0 @@
# 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/.

View File

@ -1,4 +0,0 @@
# 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/.

View File

@ -3485,20 +3485,13 @@ JSTerm.prototype = {
view.delete = null;
}
let scope = view.addScope(aOptions.label);
scope.expanded = true;
scope.locked = true;
let container = scope.addItem();
container.evaluationMacro = simpleValueEvalMacro;
let { variable, expanded } = view.controller.setSingleVariable(aOptions);
variable.evaluationMacro = simpleValueEvalMacro;
if (aOptions.objectActor) {
view.controller.expand(container, aOptions.objectActor);
view._consoleLastObjectActor = aOptions.objectActor.actor;
}
else if (aOptions.rawObject) {
container.populate(aOptions.rawObject);
view.commitHierarchy();
view._consoleLastObjectActor = null;
}
else {
@ -3506,7 +3499,9 @@ JSTerm.prototype = {
"display.");
}
this.emit("variablesview-updated", view, aOptions);
expanded.then(() => {
this.emit("variablesview-updated", view, aOptions);
});
},
/**

View File

@ -1,4 +0,0 @@
# 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/.

View File

@ -1,4 +0,0 @@
# 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/.

View File

@ -816,6 +816,11 @@ bin/libfreebl_32int64_3.so
@BINPATH@/metro/modules
#endif
@BINPATH@/components/DataStore.manifest
@BINPATH@/components/DataStoreService.js
@BINPATH@/components/dom_datastore.xpt
#ifdef MOZ_ASAN
@BINPATH@/llvm-symbolizer
#endif

View File

@ -524,9 +524,6 @@
this._xslideHandler = new CrossSlide.Handler(this, {
REARRANGESTART: this.crossSlideBoundary
});
this.addEventListener("touchstart", this._xslideHandler, false);
this.addEventListener("touchmove", this._xslideHandler, false);
this.addEventListener("touchend", this._xslideHandler, false);
}
// XXX This event was never actually implemented (bug 223411).

View File

@ -28,9 +28,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
"resource://gre/modules/NetUtil.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PdfJs",
"resource://pdf.js/PdfJs.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "DownloadUtils",
"resource://gre/modules/DownloadUtils.jsm");

View File

@ -85,6 +85,8 @@ var BrowserUI = {
Services.prefs.addObserver(debugServerStateChanged, this, false);
Services.prefs.addObserver(debugServerPortChanged, this, false);
Services.obs.addObserver(this, "handle-xul-text-link", false);
// listen content messages
messageManager.addMessageListener("DOMTitleChanged", this);
messageManager.addMessageListener("DOMWillOpenModalDialog", this);
@ -146,7 +148,6 @@ var BrowserUI = {
DialogUI.init();
FormHelperUI.init();
FindHelperUI.init();
PdfJs.init();
} catch(ex) {
Util.dumpLn("Exception in delay load module:", ex.message);
}
@ -172,6 +173,7 @@ var BrowserUI = {
uninit: function() {
messageManager.removeMessageListener("Browser:MozApplicationManifest", OfflineApps);
Services.obs.removeObserver(this, "handle-xul-text-link");
PanelUI.uninit();
FlyoutPanelsUI.uninit();
@ -573,6 +575,13 @@ var BrowserUI = {
observe: function BrowserUI_observe(aSubject, aTopic, aData) {
switch (aTopic) {
case "handle-xul-text-link":
let handled = aSubject.QueryInterface(Ci.nsISupportsPRBool);
if (!handled.data) {
this.addAndShowTab(aData, Browser.selectedTab);
handled.data = true;
}
break;
case "nsPref:changed":
switch (aData) {
case "browser.cache.disk_cache_ssl":

View File

@ -680,17 +680,17 @@
<setting pref="toolkit.telemetry.enabled" type="bool" title="&optionsHeader.telemetry.label;"/>
</settings>
<settings id="prefs-dnt" label="&doNotTrack.title;">
<description>&doNotTrack.desc;</description>
<setting id="prefs-dnt-value" pref="privacy.donottrackheader.value" type="radio" >
<radiogroup id="prefs-dnt-options">
<radio id="prefs-dnt-notrack" class="flyoutpanel-hack"
label="&doNotTrack.options.trackingNotOkay;" value="1"/>
<radio id="prefs-dnt-nopref" class="flyoutpanel-hack"
label="&doNotTrack.options.noPreference;" value="-1"/>
label="&doNotTrack.options.doNotTrack;" value="1"/>
<radio id="prefs-dnt-oktrack" class="flyoutpanel-hack"
label="&doNotTrack.options.trackingOkay;" value="0"/>
label="&doNotTrack.options.doTrack;" value="0"/>
<radio id="prefs-dnt-nopref" class="flyoutpanel-hack"
label="&doNotTrack.options.default;" value="-1"/>
</radiogroup>
</setting>
<label class="text-link" href="https://www.mozilla.org/dnt">&doNotTrack.learnMoreLink;</label>
</settings>
</flyoutpanel>

View File

@ -51,7 +51,6 @@ let AboutFlyoutPanel = {
if (aEvent.button != 0) {
return;
}
FlyoutPanelsUI.hide();
let url = Services.urlFormatter.formatURLPref("app.privacyURL");
BrowserUI.addAndShowTab(url, Browser.selectedTab);
},

View File

@ -38,10 +38,12 @@ let FlyoutPanelsUI = {
});
Services.obs.addObserver(this, "metro_viewstate_changed", false);
window.addEventListener("TabOpen", this, false);
},
uninit: function () {
Services.obs.removeObserver(this, "metro_viewstate_changed");
window.removeEventListener("TabOpen", this, false);
},
show: function(aToShow) {
@ -79,6 +81,14 @@ let FlyoutPanelsUI = {
return this._currentFlyout ? true : false;
},
handleEvent: function (aEvent) {
switch (aEvent.type) {
case "TabOpen":
this.hide()
break;
}
},
observe: function (aSubject, aTopic, aData) {
switch (aTopic) {
case "metro_viewstate_changed":

View File

@ -432,9 +432,10 @@ MenuPopup.prototype = {
let deferred = Promise.defer();
window.addEventListener("keypress", this, true);
window.addEventListener("click", this, true);
window.addEventListener("mousedown", this, true);
window.addEventListener("touchstart", this, true);
window.addEventListener("scroll", this, true);
Elements.stack.addEventListener("PopupChanged", this, false);
Elements.browsers.addEventListener("PanBegin", this, false);
this._panel.hidden = false;
let popupFrom = !aPositionOptions.bottomAligned ? "above" : "below";
@ -461,9 +462,10 @@ MenuPopup.prototype = {
let deferred = Promise.defer();
window.removeEventListener("keypress", this, true);
window.removeEventListener("click", this, true);
window.removeEventListener("mousedown", this, true);
window.removeEventListener("touchstart", this, true);
window.removeEventListener("scroll", this, true);
Elements.stack.removeEventListener("PopupChanged", this, false);
Elements.browsers.removeEventListener("PanBegin", this, false);
let self = this;
this._panel.addEventListener("transitionend", function popuphidden() {
@ -499,7 +501,9 @@ MenuPopup.prototype = {
this.hide();
}
break;
case "click":
case "mousedown":
case "touchstart":
case "scroll":
if (!this._popup.contains(aEvent.target)) {
aEvent.stopPropagation();
this.hide();
@ -517,9 +521,6 @@ MenuPopup.prototype = {
this.hide();
}
break;
case "PanBegin":
this.hide();
break;
}
}
};

View File

@ -98,9 +98,11 @@ gTests.push({
"context-copy-link"]);
promise = waitForEvent(document, "popuphidden");
ContextMenuUI.hide();
yield promise;
win.scrollBy(0, 1);
let hidden = yield promise;
ok(hidden && !(hidden instanceof Error), "scrolling hides the context menu");
win.getSelection().removeAllRanges();
win.scrollBy(0, -1);
////////////////////////////////////////////////////////////
// Context menu in content on a link

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