mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 23:02:20 +00:00
merge fx-team to mozilla-central a=merge
This commit is contained in:
commit
d282a3c477
@ -13,11 +13,14 @@ var gTab, gPanel, gDebugger;
|
||||
var gPrefs, gOptions;
|
||||
|
||||
function test() {
|
||||
let options = {
|
||||
source: TAB_URL,
|
||||
line: 1
|
||||
};
|
||||
initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
|
||||
Task.spawn(function* () {
|
||||
let options = {
|
||||
source: TAB_URL,
|
||||
line: 1
|
||||
};
|
||||
|
||||
let [aTab,, aPanel] = yield initDebugger(TAB_URL, options);
|
||||
|
||||
gTab = aTab;
|
||||
gPanel = aPanel;
|
||||
gDebugger = gPanel.panelWin;
|
||||
@ -28,7 +31,7 @@ function test() {
|
||||
|
||||
gDebugger.DebuggerView.toggleInstrumentsPane({ visible: true, animated: false });
|
||||
|
||||
testInstrumentsPaneCollapse();
|
||||
yield testInstrumentsPaneCollapse();
|
||||
testPanesStartupPref();
|
||||
|
||||
closeDebuggerAndFinish(gPanel);
|
||||
@ -50,7 +53,7 @@ function testPanesState() {
|
||||
"The options menu item should not be checked.");
|
||||
}
|
||||
|
||||
function testInstrumentsPaneCollapse() {
|
||||
function* testInstrumentsPaneCollapse () {
|
||||
let instrumentsPane =
|
||||
gDebugger.document.getElementById("instruments-pane");
|
||||
let instrumentsPaneToggleButton =
|
||||
@ -69,8 +72,13 @@ function testInstrumentsPaneCollapse() {
|
||||
!instrumentsPaneToggleButton.classList.contains("pane-collapsed"),
|
||||
"The instruments pane should at this point be visible.");
|
||||
|
||||
// Trigger reflow to make sure the UI is in required state.
|
||||
gDebugger.document.documentElement.getBoundingClientRect();
|
||||
|
||||
gDebugger.DebuggerView.toggleInstrumentsPane({ visible: false, animated: true });
|
||||
|
||||
yield once(instrumentsPane, "transitionend");
|
||||
|
||||
is(gPrefs.panesVisibleOnStartup, false,
|
||||
"The debugger view panes should still initially be preffed as hidden.");
|
||||
isnot(gOptions._showPanesOnStartupItem.getAttribute("checked"), "true",
|
||||
@ -83,7 +91,8 @@ function testInstrumentsPaneCollapse() {
|
||||
"The instruments pane has an incorrect left margin after collapsing.");
|
||||
is(instrumentsPane.style.marginRight, margin,
|
||||
"The instruments pane has an incorrect right margin after collapsing.");
|
||||
ok(instrumentsPane.hasAttribute("animated"),
|
||||
|
||||
ok(!instrumentsPane.hasAttribute("animated"),
|
||||
"The instruments pane has an incorrect attribute after an animated collapsing.");
|
||||
ok(instrumentsPane.classList.contains("pane-collapsed") &&
|
||||
instrumentsPaneToggleButton.classList.contains("pane-collapsed"),
|
||||
|
@ -335,6 +335,7 @@ Toolbox.prototype = {
|
||||
get splitConsole() {
|
||||
return this._splitConsole;
|
||||
},
|
||||
|
||||
/**
|
||||
* Get the focused state of the split console
|
||||
*/
|
||||
@ -1267,6 +1268,16 @@ Toolbox.prototype = {
|
||||
// backward compatibility with existing extensions do a check
|
||||
// for a promise return value.
|
||||
let built = definition.build(iframe.contentWindow, this);
|
||||
|
||||
// Set the dir attribute on the documents of panels using HTML.
|
||||
let docEl = iframe.contentWindow && iframe.contentWindow.document.documentElement;
|
||||
if (docEl && docEl.namespaceURI === HTML_NS) {
|
||||
let top = this.win.top;
|
||||
let topDocEl = top.document.documentElement;
|
||||
let isRtl = top.getComputedStyle(topDocEl).direction === "rtl";
|
||||
docEl.setAttribute("dir", isRtl ? "rtl" : "ltr");
|
||||
}
|
||||
|
||||
if (!(typeof built.then == "function")) {
|
||||
let panel = built;
|
||||
iframe.panel = panel;
|
||||
|
@ -430,8 +430,6 @@ MarkupView.prototype = {
|
||||
/**
|
||||
* Hide the box model highlighter on a given node front
|
||||
*
|
||||
* @param {NodeFront} nodeFront
|
||||
* The node to hide the highlighter for
|
||||
* @param {Boolean} forceHide
|
||||
* See toolbox-highlighter-utils/unhighlight
|
||||
* @return {Promise} Resolves when the highlighter for this nodeFront is
|
||||
|
@ -199,6 +199,7 @@ subsuite = clipboard
|
||||
[browser_rules_selector-highlighter_01.js]
|
||||
[browser_rules_selector-highlighter_02.js]
|
||||
[browser_rules_selector-highlighter_03.js]
|
||||
[browser_rules_selector-highlighter_04.js]
|
||||
[browser_rules_selector_highlight.js]
|
||||
[browser_rules_strict-search-filter-computed-list_01.js]
|
||||
[browser_rules_strict-search-filter_01.js]
|
||||
|
@ -76,9 +76,3 @@ add_task(function* () {
|
||||
is(HighlighterFront.options.selector, "body",
|
||||
"The right selector option is passed to the highlighter (2)");
|
||||
});
|
||||
|
||||
function* clickSelectorIcon(icon, view) {
|
||||
let onToggled = view.once("ruleview-selectorhighlighter-toggled");
|
||||
EventUtils.synthesizeMouseAtCenter(icon, {}, view.styleWindow);
|
||||
yield onToggled;
|
||||
}
|
||||
|
@ -76,9 +76,3 @@ add_task(function* () {
|
||||
ok(!HighlighterFront.isShown,
|
||||
"The highlighter is hidden now that the same selector was clicked");
|
||||
});
|
||||
|
||||
function* clickSelectorIcon(icon, view) {
|
||||
let onToggled = view.once("ruleview-selectorhighlighter-toggled");
|
||||
EventUtils.synthesizeMouseAtCenter(icon, {}, view.styleWindow);
|
||||
yield onToggled;
|
||||
}
|
||||
|
@ -0,0 +1,53 @@
|
||||
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
// Test that the selector highlighter is shown when clicking on a selector icon
|
||||
// for the 'element {}' rule
|
||||
|
||||
// Note that in this test, we mock the highlighter front, merely testing the
|
||||
// behavior of the style-inspector UI for now
|
||||
|
||||
const TEST_URI = `
|
||||
<p>Testing the selector highlighter for the 'element {}' rule</p>
|
||||
`;
|
||||
|
||||
add_task(function* () {
|
||||
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
|
||||
let {inspector, view} = yield openRuleView();
|
||||
|
||||
// Mock the highlighter front to get the reference of the NodeFront
|
||||
let HighlighterFront = {
|
||||
isShown: false,
|
||||
nodeFront: null,
|
||||
options: null,
|
||||
show: function (nodeFront, options) {
|
||||
this.nodeFront = nodeFront;
|
||||
this.options = options;
|
||||
this.isShown = true;
|
||||
},
|
||||
hide: function () {
|
||||
this.nodeFront = null;
|
||||
this.options = null;
|
||||
this.isShown = false;
|
||||
}
|
||||
};
|
||||
// Inject the mock highlighter in the rule-view
|
||||
view.selectorHighlighter = HighlighterFront;
|
||||
|
||||
info("Checking that the right NodeFront reference and options are passed");
|
||||
yield selectNode("p", inspector);
|
||||
let icon = getRuleViewSelectorHighlighterIcon(view, "element");
|
||||
|
||||
yield clickSelectorIcon(icon, view);
|
||||
is(HighlighterFront.nodeFront.tagName, "P",
|
||||
"The right NodeFront is passed to the highlighter (1)");
|
||||
is(HighlighterFront.options.selector, "body > p:nth-child(1)",
|
||||
"The right selector option is passed to the highlighter (1)");
|
||||
ok(HighlighterFront.isShown, "The toggle event says the highlighter is visible");
|
||||
|
||||
yield clickSelectorIcon(icon, view);
|
||||
ok(!HighlighterFront.isShown, "The toggle event says the highlighter is not visible");
|
||||
});
|
@ -817,6 +817,17 @@ function waitForStyleModification(inspector) {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Click on the selector icon
|
||||
* @param {DOMNode} icon
|
||||
* @param {CSSRuleView} view
|
||||
*/
|
||||
function* clickSelectorIcon(icon, view) {
|
||||
let onToggled = view.once("ruleview-selectorhighlighter-toggled");
|
||||
EventUtils.synthesizeMouseAtCenter(icon, {}, view.styleWindow);
|
||||
yield onToggled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make sure window is properly focused before sending a key event.
|
||||
* @param {Window} win
|
||||
|
@ -149,9 +149,10 @@ RuleEditor.prototype = {
|
||||
});
|
||||
}
|
||||
|
||||
if (this.rule.domRule.type !== CSSRule.KEYFRAME_RULE &&
|
||||
this.rule.domRule.selectors) {
|
||||
let selector = this.rule.domRule.selectors.join(", ");
|
||||
if (this.rule.domRule.type !== CSSRule.KEYFRAME_RULE) {
|
||||
let selector = this.rule.domRule.selectors
|
||||
? this.rule.domRule.selectors.join(", ")
|
||||
: this.ruleView.inspector.selectionCssSelector;
|
||||
|
||||
let selectorHighlighter = createChild(header, "span", {
|
||||
class: "ruleview-selectorhighlighter" +
|
||||
|
@ -4,9 +4,6 @@
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"DTD/xhtml1-strict.dtd">
|
||||
%htmlDTD;
|
||||
<!ENTITY % globalDTD
|
||||
SYSTEM "chrome://global/locale/global.dtd">
|
||||
%globalDTD;
|
||||
]>
|
||||
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
@ -19,7 +16,7 @@
|
||||
<link rel="stylesheet" href="chrome://devtools/skin/components-frame.css" type="text/css"/>
|
||||
<link rel="stylesheet" href="chrome://devtools/skin/components-h-split-box.css" type="text/css"/>
|
||||
</head>
|
||||
<body class="theme-body" dir="&locale.dir;">
|
||||
<body class="theme-body">
|
||||
<div id="app"></div>
|
||||
|
||||
<script type="application/javascript;version=1.8"
|
||||
|
@ -34,8 +34,13 @@ add_task(function* () {
|
||||
!detailsPaneToggleButton.classList.contains("pane-collapsed"),
|
||||
"The details pane should at this point be visible.");
|
||||
|
||||
// Trigger reflow to make sure the UI is in required state.
|
||||
document.documentElement.getBoundingClientRect();
|
||||
|
||||
NetMonitorView.toggleDetailsPane({ visible: false, animated: true });
|
||||
|
||||
yield once(detailsPane, "transitionend");
|
||||
|
||||
let margin = -(width + 1) + "px";
|
||||
is(width, Prefs.networkDetailsWidth,
|
||||
"The details pane has an incorrect width after collapsing.");
|
||||
@ -43,7 +48,7 @@ add_task(function* () {
|
||||
"The details pane has an incorrect left margin after collapsing.");
|
||||
is(detailsPane.style.marginRight, margin,
|
||||
"The details pane has an incorrect right margin after collapsing.");
|
||||
ok(detailsPane.hasAttribute("animated"),
|
||||
ok(!detailsPane.hasAttribute("animated"),
|
||||
"The details pane has an incorrect attribute after an animated collapsing.");
|
||||
ok(detailsPane.classList.contains("pane-collapsed") &&
|
||||
detailsPaneToggleButton.classList.contains("pane-collapsed"),
|
||||
|
@ -7,26 +7,26 @@
|
||||
display: block;
|
||||
}
|
||||
|
||||
.sidebar-toggle:-moz-locale-dir(ltr)::before,
|
||||
.sidebar-toggle.pane-collapsed:-moz-locale-dir(rtl)::before {
|
||||
.sidebar-toggle::before,
|
||||
.sidebar-toggle.pane-collapsed:dir(rtl)::before {
|
||||
background-image: var(--theme-pane-collapse-image);
|
||||
}
|
||||
|
||||
.sidebar-toggle.pane-collapsed:-moz-locale-dir(ltr)::before,
|
||||
.sidebar-toggle:-moz-locale-dir(rtl)::before {
|
||||
.sidebar-toggle.pane-collapsed::before,
|
||||
.sidebar-toggle:dir(rtl)::before {
|
||||
background-image: var(--theme-pane-expand-image);
|
||||
}
|
||||
|
||||
/* Rotate button icon 90deg if the toolbox container is
|
||||
in vertical mode (sidebar displayed under the main panel) */
|
||||
@media (max-width: 700px) {
|
||||
.sidebar-toggle:-moz-locale-dir(ltr)::before {
|
||||
.sidebar-toggle::before {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
/* Since RTL swaps the used images, we need to flip them
|
||||
the other way round */
|
||||
.sidebar-toggle:-moz-locale-dir(rtl)::before {
|
||||
.sidebar-toggle:dir(rtl)::before {
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ loader.lazyRequireGetter(this, "util", "gcli/util/util");
|
||||
loader.lazyRequireGetter(this, "ConsoleServiceListener", "devtools/server/actors/utils/webconsole-utils", true);
|
||||
loader.lazyRequireGetter(this, "gDevTools", "devtools/client/framework/devtools", true);
|
||||
loader.lazyRequireGetter(this, "gDevToolsBrowser", "devtools/client/framework/devtools-browser", true);
|
||||
loader.lazyRequireGetter(this, "nodeConstants", "devtools/shared/dom-node-constants", true);
|
||||
loader.lazyRequireGetter(this, "nodeConstants", "devtools/shared/dom-node-constants");
|
||||
loader.lazyRequireGetter(this, "EventEmitter", "devtools/shared/event-emitter");
|
||||
|
||||
/**
|
||||
|
@ -252,6 +252,11 @@ const ViewHelpers = exports.ViewHelpers = {
|
||||
// Add a class to the pane to handle min-widths, margins and animations.
|
||||
pane.classList.add("generic-toggled-pane");
|
||||
|
||||
// Avoid toggles in the middle of animation.
|
||||
if (pane.hasAttribute("animated")) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Avoid useless toggles.
|
||||
if (flags.visible == !pane.classList.contains("pane-collapsed")) {
|
||||
if (flags.callback) {
|
||||
@ -283,23 +288,36 @@ const ViewHelpers = exports.ViewHelpers = {
|
||||
pane.style.marginLeft = -width + "px";
|
||||
pane.style.marginRight = -width + "px";
|
||||
pane.style.marginBottom = -height + "px";
|
||||
pane.classList.add("pane-collapsed");
|
||||
}
|
||||
|
||||
// Wait for the animation to end before calling afterToggle()
|
||||
if (flags.animated) {
|
||||
pane.addEventListener("transitionend", function onEvent() {
|
||||
pane.removeEventListener("transitionend", onEvent, false);
|
||||
let options = {
|
||||
useCapture: false,
|
||||
once: true
|
||||
};
|
||||
|
||||
pane.addEventListener("transitionend", () => {
|
||||
// Prevent unwanted transitions: if the panel is hidden and the layout
|
||||
// changes margins will be updated and the panel will pop out.
|
||||
pane.removeAttribute("animated");
|
||||
|
||||
if (!flags.visible) {
|
||||
pane.classList.add("pane-collapsed");
|
||||
}
|
||||
if (flags.callback) {
|
||||
flags.callback();
|
||||
}
|
||||
}, false);
|
||||
} else if (flags.callback) {
|
||||
}, options);
|
||||
} else {
|
||||
if (!flags.visible) {
|
||||
pane.classList.add("pane-collapsed");
|
||||
}
|
||||
|
||||
// Invoke the callback immediately since there's no transition.
|
||||
flags.callback();
|
||||
if (flags.callback) {
|
||||
flags.callback();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -325,7 +325,7 @@
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.ruleview-expander.theme-twisty:-moz-locale-dir(rtl) {
|
||||
.ruleview-expander.theme-twisty:dir(rtl) {
|
||||
/* for preventing .theme-twisty's wrong direction in rtl; Bug 1296648 */
|
||||
transform: none;
|
||||
}
|
||||
|
@ -282,23 +282,23 @@
|
||||
/* RTL support: move the images that were on the left to the right,
|
||||
* and move images that were on the right to the left.
|
||||
*/
|
||||
.breadcrumbs-widget-item:-moz-locale-dir(rtl) {
|
||||
.breadcrumbs-widget-item:dir(rtl) {
|
||||
padding: 0 20px 0 8px;
|
||||
}
|
||||
|
||||
.breadcrumbs-widget-item:-moz-locale-dir(rtl),
|
||||
.breadcrumbs-widget-item[checked] + .breadcrumbs-widget-item:-moz-locale-dir(rtl) {
|
||||
.breadcrumbs-widget-item:dir(rtl),
|
||||
.breadcrumbs-widget-item[checked] + .breadcrumbs-widget-item:dir(rtl) {
|
||||
background-position: center right;
|
||||
}
|
||||
|
||||
#breadcrumb-separator-before:-moz-locale-dir(rtl),
|
||||
#breadcrumb-separator-after:-moz-locale-dir(rtl),
|
||||
#breadcrumb-separator-normal:-moz-locale-dir(rtl) {
|
||||
#breadcrumb-separator-before:dir(rtl),
|
||||
#breadcrumb-separator-after:dir(rtl),
|
||||
#breadcrumb-separator-normal:dir(rtl) {
|
||||
transform: scaleX(-1);
|
||||
}
|
||||
|
||||
#breadcrumb-separator-before:-moz-locale-dir(rtl):after,
|
||||
#breadcrumb-separator-after:-moz-locale-dir(rtl):after {
|
||||
#breadcrumb-separator-before:dir(rtl):after,
|
||||
#breadcrumb-separator-after:dir(rtl):after {
|
||||
transform: translateX(-5px) rotate(45deg);
|
||||
}
|
||||
|
||||
|
@ -626,14 +626,20 @@ let SourceActor = ActorClassWithSpec(sourceSpec, {
|
||||
/**
|
||||
* Handle a request to set a breakpoint.
|
||||
*
|
||||
* @param JSON request
|
||||
* A JSON object representing the request.
|
||||
* @param Number line
|
||||
* Line to break on.
|
||||
* @param Number column
|
||||
* Column to break on.
|
||||
* @param String condition
|
||||
* A condition which must be true for breakpoint to be hit.
|
||||
* @param Boolean noSliding
|
||||
* If true, disables breakpoint sliding.
|
||||
*
|
||||
* @returns Promise
|
||||
* A promise that resolves to a JSON object representing the
|
||||
* response.
|
||||
*/
|
||||
setBreakpoint: function (line, column, condition) {
|
||||
setBreakpoint: function (line, column, condition, noSliding) {
|
||||
if (this.threadActor.state !== "paused") {
|
||||
throw {
|
||||
error: "wrongState",
|
||||
@ -644,7 +650,8 @@ let SourceActor = ActorClassWithSpec(sourceSpec, {
|
||||
let location = new OriginalLocation(this, line, column);
|
||||
return this._getOrCreateBreakpointActor(
|
||||
location,
|
||||
condition
|
||||
condition,
|
||||
noSliding
|
||||
).then((actor) => {
|
||||
let response = {
|
||||
actor: actor.actorID,
|
||||
@ -671,11 +678,13 @@ let SourceActor = ActorClassWithSpec(sourceSpec, {
|
||||
* @param String condition
|
||||
* A string that is evaluated whenever the breakpoint is hit. If the
|
||||
* string evaluates to false, the breakpoint is ignored.
|
||||
* @param Boolean noSliding
|
||||
* If true, disables breakpoint sliding.
|
||||
*
|
||||
* @returns BreakpointActor
|
||||
* A BreakpointActor representing the breakpoint.
|
||||
*/
|
||||
_getOrCreateBreakpointActor: function (originalLocation, condition) {
|
||||
_getOrCreateBreakpointActor: function (originalLocation, condition, noSliding) {
|
||||
let actor = this.breakpointActorMap.getActor(originalLocation);
|
||||
if (!actor) {
|
||||
actor = new BreakpointActor(this.threadActor, originalLocation);
|
||||
@ -685,7 +694,7 @@ let SourceActor = ActorClassWithSpec(sourceSpec, {
|
||||
|
||||
actor.condition = condition;
|
||||
|
||||
return this._setBreakpoint(actor);
|
||||
return this._setBreakpoint(actor, noSliding);
|
||||
},
|
||||
|
||||
/*
|
||||
@ -705,18 +714,19 @@ let SourceActor = ActorClassWithSpec(sourceSpec, {
|
||||
*
|
||||
* @param BreakpointActor actor
|
||||
* The BreakpointActor to be set as a breakpoint handler.
|
||||
* @param Boolean noSliding
|
||||
* If true, disables breakpoint sliding.
|
||||
*
|
||||
* @returns A Promise that resolves to the given BreakpointActor.
|
||||
*/
|
||||
_setBreakpoint: function (actor) {
|
||||
_setBreakpoint: function (actor, noSliding) {
|
||||
const { originalLocation } = actor;
|
||||
const { originalLine, originalSourceActor } = originalLocation;
|
||||
|
||||
if (!this.isSourceMapped) {
|
||||
if (!this._setBreakpointAtGeneratedLocation(
|
||||
actor,
|
||||
GeneratedLocation.fromOriginalLocation(originalLocation)
|
||||
)) {
|
||||
const generatedLocation = GeneratedLocation.fromOriginalLocation(originalLocation);
|
||||
if (!this._setBreakpointAtGeneratedLocation(actor, generatedLocation) &&
|
||||
!noSliding) {
|
||||
const query = { line: originalLine };
|
||||
// For most cases, we have a real source to query for. The
|
||||
// only time we don't is for HTML pages. In that case we want
|
||||
|
@ -36,40 +36,52 @@ function run_test_with_server(aServer, aCallback)
|
||||
});
|
||||
}
|
||||
|
||||
function test_skip_breakpoint()
|
||||
{
|
||||
gThreadClient.addOneTimeListener("paused", function (aEvent, aPacket) {
|
||||
var test_no_skip_breakpoint = Task.async(function*(source, location) {
|
||||
let [aResponse, bpClient] = yield source.setBreakpoint(
|
||||
Object.assign({}, location, { noSliding: true })
|
||||
);
|
||||
|
||||
do_check_true(!aResponse.actualLocation);
|
||||
do_check_eq(bpClient.location.line, gDebuggee.line0 + 3);
|
||||
yield bpClient.remove();
|
||||
});
|
||||
|
||||
var test_skip_breakpoint = function() {
|
||||
gThreadClient.addOneTimeListener("paused", Task.async(function *(aEvent, aPacket) {
|
||||
let location = { line: gDebuggee.line0 + 3 };
|
||||
let source = gThreadClient.source(aPacket.frame.where.source);
|
||||
|
||||
source.setBreakpoint(location, function (aResponse, bpClient) {
|
||||
// Check that the breakpoint has properly skipped forward one line.
|
||||
do_check_true(!!aResponse.actualLocation);
|
||||
do_check_eq(aResponse.actualLocation.source.actor, source.actor);
|
||||
do_check_eq(aResponse.actualLocation.line, location.line + 1);
|
||||
// First, make sure that we can disable sliding with the
|
||||
// `noSliding` option.
|
||||
yield test_no_skip_breakpoint(source, location);
|
||||
|
||||
gThreadClient.addOneTimeListener("paused", function (aEvent, aPacket) {
|
||||
// Check the return value.
|
||||
do_check_eq(aPacket.type, "paused");
|
||||
do_check_eq(aPacket.frame.where.source.actor, source.actor);
|
||||
do_check_eq(aPacket.frame.where.line, location.line + 1);
|
||||
do_check_eq(aPacket.why.type, "breakpoint");
|
||||
do_check_eq(aPacket.why.actors[0], bpClient.actor);
|
||||
// Check that the breakpoint worked.
|
||||
do_check_eq(gDebuggee.a, 1);
|
||||
do_check_eq(gDebuggee.b, undefined);
|
||||
// Now make sure that the breakpoint properly slides forward one line.
|
||||
const [aResponse, bpClient] = yield source.setBreakpoint(location);
|
||||
do_check_true(!!aResponse.actualLocation);
|
||||
do_check_eq(aResponse.actualLocation.source.actor, source.actor);
|
||||
do_check_eq(aResponse.actualLocation.line, location.line + 1);
|
||||
|
||||
// Remove the breakpoint.
|
||||
bpClient.remove(function (aResponse) {
|
||||
gThreadClient.resume(function () {
|
||||
gClient.close().then(gCallback);
|
||||
});
|
||||
gThreadClient.addOneTimeListener("paused", function (aEvent, aPacket) {
|
||||
// Check the return value.
|
||||
do_check_eq(aPacket.type, "paused");
|
||||
do_check_eq(aPacket.frame.where.source.actor, source.actor);
|
||||
do_check_eq(aPacket.frame.where.line, location.line + 1);
|
||||
do_check_eq(aPacket.why.type, "breakpoint");
|
||||
do_check_eq(aPacket.why.actors[0], bpClient.actor);
|
||||
// Check that the breakpoint worked.
|
||||
do_check_eq(gDebuggee.a, 1);
|
||||
do_check_eq(gDebuggee.b, undefined);
|
||||
|
||||
// Remove the breakpoint.
|
||||
bpClient.remove(function (aResponse) {
|
||||
gThreadClient.resume(function () {
|
||||
gClient.close().then(gCallback);
|
||||
});
|
||||
});
|
||||
|
||||
gThreadClient.resume();
|
||||
});
|
||||
});
|
||||
|
||||
gThreadClient.resume();
|
||||
}));
|
||||
|
||||
// Use `evalInSandbox` to make the debugger treat it as normal
|
||||
// globally-scoped code, where breakpoint sliding rules apply.
|
||||
|
@ -2893,7 +2893,7 @@ SourceClient.prototype = {
|
||||
* @param function aOnResponse
|
||||
* Called with the thread's response.
|
||||
*/
|
||||
setBreakpoint: function ({ line, column, condition }, aOnResponse = noop) {
|
||||
setBreakpoint: function ({ line, column, condition, noSliding }, aOnResponse = noop) {
|
||||
// A helper function that sets the breakpoint.
|
||||
let doSetBreakpoint = aCallback => {
|
||||
let root = this._client.mainRoot;
|
||||
@ -2906,7 +2906,8 @@ SourceClient.prototype = {
|
||||
to: this.actor,
|
||||
type: "setBreakpoint",
|
||||
location: location,
|
||||
condition: condition
|
||||
condition: condition,
|
||||
noSliding: noSliding
|
||||
};
|
||||
|
||||
// Backwards compatibility: send the breakpoint request to the
|
||||
|
@ -29,7 +29,8 @@ const sourceSpec = generateActorSpec({
|
||||
line: Arg(0, "number"),
|
||||
column: Arg(1, "nullable:number")
|
||||
},
|
||||
condition: Arg(2, "nullable:string")
|
||||
condition: Arg(2, "nullable:string"),
|
||||
noSliding: Arg(3, "nullable:boolean")
|
||||
},
|
||||
response: RetVal("json")
|
||||
},
|
||||
|
@ -402,21 +402,30 @@ all_resources = \
|
||||
|
||||
generated/org/mozilla/gecko/R.java: .aapt.deps ;
|
||||
|
||||
# Only add libraries that contain resources here. We (unecessarily) generate an identical R.java which
|
||||
# is copied into each of these locations, and each of these files contains thousands of fields.
|
||||
# Each unnecessary copy therefore wastes unnecessary fields in the output dex file.
|
||||
# Note: usually proguard will help clean this up after the fact, but having too many fields will cause
|
||||
# dexing to fail, regardless of any later optimisations proguard could later make to bring us back
|
||||
# under the limit.
|
||||
# Ideally we would fix our aapt invocations to correctly generate minimal copies of R.java for each
|
||||
# package, but that seems redundant since gradle builds are able to correctly generate these files.
|
||||
|
||||
# If native devices are enabled, add Google Play Services, build their resources
|
||||
generated/android/support/v4/R.java: .aapt.deps ;
|
||||
# (no resources) generated/android/support/v4/R.java: .aapt.deps ;
|
||||
generated/android/support/v7/appcompat/R.java: .aapt.deps ;
|
||||
generated/android/support/v7/cardview/R.java: .aapt.deps ;
|
||||
generated/android/support/design/R.java: .aapt.deps ;
|
||||
generated/android/support/v7/mediarouter/R.java: .aapt.deps ;
|
||||
generated/android/support/v7/recyclerview/R.java: .aapt.deps ;
|
||||
generated/android/support/customtabs/R.java: .aapt.deps ;
|
||||
generated/android/support/v7/palette/R.java: .aapt.deps ;
|
||||
# (no resources) generated/android/support/customtabs/R.java: .aapt.deps ;
|
||||
# (no resources) generated/android/support/v7/palette/R.java: .aapt.deps ;
|
||||
generated/com/google/android/gms/R.java: .aapt.deps ;
|
||||
generated/com/google/android/gms/ads/R.java: .aapt.deps ;
|
||||
generated/com/google/android/gms/base/R.java: .aapt.deps ;
|
||||
generated/com/google/android/gms/cast/R.java: .aapt.deps ;
|
||||
generated/com/google/android/gms/gcm/R.java: .aapt.deps ;
|
||||
generated/com/google/android/gms/measurement/R.java: .aapt.deps ;
|
||||
# (no resources) generated/com/google/android/gms/gcm/R.java: .aapt.deps ;
|
||||
# (no resources) generated/com/google/android/gms/measurement/R.java: .aapt.deps ;
|
||||
|
||||
gecko.ap_: .aapt.deps ;
|
||||
R.txt: .aapt.deps ;
|
||||
|
@ -270,7 +270,7 @@ public class CombinedHistoryPanel extends HomeFragment implements RemoteClientsD
|
||||
if (data != null && data.getBoolean("goToRecentTabs", false) && mPanelLevel != PanelLevel.CHILD_RECENT_TABS) {
|
||||
mPanelLevel = PanelLevel.CHILD_RECENT_TABS;
|
||||
mRecyclerView.swapAdapter(mRecentTabsAdapter, true);
|
||||
updateEmptyView();
|
||||
updateEmptyView(PanelLevel.CHILD_RECENT_TABS);
|
||||
updateButtonFromLevel();
|
||||
}
|
||||
}
|
||||
@ -344,16 +344,17 @@ public class CombinedHistoryPanel extends HomeFragment implements RemoteClientsD
|
||||
switch (loaderId) {
|
||||
case LOADER_ID_HISTORY:
|
||||
mHistoryAdapter.setHistory(c);
|
||||
updateEmptyView(PanelLevel.PARENT);
|
||||
break;
|
||||
|
||||
case LOADER_ID_REMOTE:
|
||||
final List<RemoteClient> clients = mDB.getTabsAccessor().getClientsFromCursor(c);
|
||||
mHistoryAdapter.getDeviceUpdateHandler().onDeviceCountUpdated(clients.size());
|
||||
mClientsAdapter.setClients(clients);
|
||||
updateEmptyView(PanelLevel.CHILD_SYNC);
|
||||
break;
|
||||
}
|
||||
|
||||
updateEmptyView();
|
||||
updateButtonFromLevel();
|
||||
}
|
||||
|
||||
@ -365,15 +366,15 @@ public class CombinedHistoryPanel extends HomeFragment implements RemoteClientsD
|
||||
}
|
||||
|
||||
public interface PanelStateUpdateHandler {
|
||||
void onPanelStateUpdated();
|
||||
void onPanelStateUpdated(PanelLevel level);
|
||||
}
|
||||
|
||||
public PanelStateUpdateHandler getPanelStateUpdateHandler() {
|
||||
if (mPanelStateUpdateHandler == null) {
|
||||
mPanelStateUpdateHandler = new PanelStateUpdateHandler() {
|
||||
@Override
|
||||
public void onPanelStateUpdated() {
|
||||
updateEmptyView();
|
||||
public void onPanelStateUpdated(PanelLevel level) {
|
||||
updateEmptyView(level);
|
||||
updateButtonFromLevel();
|
||||
}
|
||||
};
|
||||
@ -403,7 +404,7 @@ public class CombinedHistoryPanel extends HomeFragment implements RemoteClientsD
|
||||
break;
|
||||
}
|
||||
|
||||
updateEmptyView();
|
||||
updateEmptyView(level);
|
||||
updateButtonFromLevel();
|
||||
return true;
|
||||
}
|
||||
@ -478,30 +479,31 @@ public class CombinedHistoryPanel extends HomeFragment implements RemoteClientsD
|
||||
}
|
||||
}
|
||||
|
||||
private void updateEmptyView() {
|
||||
private void updateEmptyView(PanelLevel level) {
|
||||
boolean showEmptyHistoryView = false;
|
||||
boolean showEmptyClientsView = false;
|
||||
boolean showEmptyRecentTabsView = false;
|
||||
switch (mPanelLevel) {
|
||||
case PARENT:
|
||||
showEmptyHistoryView = mHistoryAdapter.getItemCount() == mHistoryAdapter.getNumVisibleSmartFolders();
|
||||
break;
|
||||
if (mPanelLevel == level) {
|
||||
switch (mPanelLevel) {
|
||||
case PARENT:
|
||||
showEmptyHistoryView = mHistoryAdapter.getItemCount() == mHistoryAdapter.getNumVisibleSmartFolders();
|
||||
mHistoryEmptyView.setVisibility(showEmptyHistoryView ? View.VISIBLE : View.GONE);
|
||||
break;
|
||||
|
||||
case CHILD_SYNC:
|
||||
showEmptyClientsView = mClientsAdapter.getItemCount() == 1;
|
||||
break;
|
||||
case CHILD_SYNC:
|
||||
showEmptyClientsView = mClientsAdapter.getItemCount() == 1;
|
||||
mClientsEmptyView.setVisibility(showEmptyClientsView ? View.VISIBLE : View.GONE);
|
||||
break;
|
||||
|
||||
case CHILD_RECENT_TABS:
|
||||
showEmptyRecentTabsView = mRecentTabsAdapter.getClosedTabsCount() == 0;
|
||||
break;
|
||||
case CHILD_RECENT_TABS:
|
||||
showEmptyRecentTabsView = mRecentTabsAdapter.getClosedTabsCount() == 0;
|
||||
mRecentTabsEmptyView.setVisibility(showEmptyRecentTabsView ? View.VISIBLE : View.GONE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
final boolean showEmptyView = showEmptyClientsView || showEmptyHistoryView || showEmptyRecentTabsView;
|
||||
mRecyclerView.setOverScrollMode(showEmptyView ? View.OVER_SCROLL_NEVER : View.OVER_SCROLL_IF_CONTENT_SCROLLS);
|
||||
|
||||
mClientsEmptyView.setVisibility(showEmptyClientsView ? View.VISIBLE : View.GONE);
|
||||
mHistoryEmptyView.setVisibility(showEmptyHistoryView ? View.VISIBLE : View.GONE);
|
||||
mRecentTabsEmptyView.setVisibility(showEmptyRecentTabsView ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -34,6 +34,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.mozilla.gecko.home.CombinedHistoryItem.ItemType;
|
||||
import static org.mozilla.gecko.home.CombinedHistoryPanel.OnPanelLevelChangeListener.PanelLevel.CHILD_RECENT_TABS;
|
||||
|
||||
public class RecentTabsAdapter extends RecyclerView.Adapter<CombinedHistoryItem>
|
||||
implements CombinedHistoryRecyclerView.AdapterContextMenuBuilder, NativeEventListener {
|
||||
@ -135,7 +136,7 @@ public class RecentTabsAdapter extends RecyclerView.Adapter<CombinedHistoryItem>
|
||||
recentlyClosedTabsReceived = true;
|
||||
recentTabsUpdateHandler.onRecentTabsCountUpdated(
|
||||
getClosedTabsCount(), recentlyClosedTabsReceived);
|
||||
panelStateUpdateHandler.onPanelStateUpdated();
|
||||
panelStateUpdateHandler.onPanelStateUpdated(CHILD_RECENT_TABS);
|
||||
|
||||
// Handle the section header hiding/unhiding.
|
||||
updateHeaderVisibility(prevSectionHeaderVisibility, prevSectionHeaderIndex);
|
||||
@ -192,7 +193,7 @@ public class RecentTabsAdapter extends RecyclerView.Adapter<CombinedHistoryItem>
|
||||
lastSessionTabs = closedTabs;
|
||||
recentTabsUpdateHandler.onRecentTabsCountUpdated(
|
||||
getClosedTabsCount(), recentlyClosedTabsReceived);
|
||||
panelStateUpdateHandler.onPanelStateUpdated();
|
||||
panelStateUpdateHandler.onPanelStateUpdated(CHILD_RECENT_TABS);
|
||||
|
||||
// Handle the section header hiding/unhiding.
|
||||
updateHeaderVisibility(prevSectionHeaderVisibility, prevSectionHeaderIndex);
|
||||
@ -223,7 +224,7 @@ public class RecentTabsAdapter extends RecyclerView.Adapter<CombinedHistoryItem>
|
||||
lastSessionTabs = emptyLastSessionTabs;
|
||||
recentTabsUpdateHandler.onRecentTabsCountUpdated(
|
||||
getClosedTabsCount(), recentlyClosedTabsReceived);
|
||||
panelStateUpdateHandler.onPanelStateUpdated();
|
||||
panelStateUpdateHandler.onPanelStateUpdated(CHILD_RECENT_TABS);
|
||||
|
||||
// Handle the section header hiding.
|
||||
updateHeaderVisibility(prevSectionHeaderVisibility, prevSectionHeaderIndex);
|
||||
|
@ -509,7 +509,7 @@ OnSharedPreferenceChangeListener
|
||||
super.onDestroy();
|
||||
|
||||
GeckoApp.getEventDispatcher().unregisterGeckoThreadListener(this,
|
||||
"Sanitize:Finished",
|
||||
"Sanitize:Finished",
|
||||
"Snackbar:Show");
|
||||
|
||||
if (mPrefsRequest != null) {
|
||||
|
@ -62,7 +62,7 @@ resjar.generated_sources += [
|
||||
if CONFIG['ANDROID_SUPPORT_V4_AAR']:
|
||||
ANDROID_EXTRA_PACKAGES += ['android.support.v4']
|
||||
ANDROID_EXTRA_RES_DIRS += ['%' + CONFIG['ANDROID_SUPPORT_V4_AAR_RES']]
|
||||
resjar.generated_sources += ['android/support/v4/R.java']
|
||||
# (no resources) resjar.generated_sources += ['android/support/v4/R.java']
|
||||
if CONFIG['ANDROID_APPCOMPAT_V7_AAR']:
|
||||
ANDROID_EXTRA_PACKAGES += ['android.support.v7.appcompat']
|
||||
ANDROID_EXTRA_RES_DIRS += ['%' + CONFIG['ANDROID_APPCOMPAT_V7_AAR_RES']]
|
||||
@ -82,12 +82,11 @@ if CONFIG['ANDROID_RECYCLERVIEW_V7_AAR']:
|
||||
if CONFIG['ANDROID_CUSTOMTABS_AAR']:
|
||||
ANDROID_EXTRA_PACKAGES += ['android.support.customtabs']
|
||||
ANDROID_EXTRA_RES_DIRS += ['%' + CONFIG['ANDROID_CUSTOMTABS_AAR_RES']]
|
||||
resjar.generated_sources += ['android/support/customtabs/R.java']
|
||||
# (no resources) resjar.generated_sources += ['android/support/customtabs/R.java']
|
||||
if CONFIG['ANDROID_PALETTE_V7_AAR']:
|
||||
ANDROID_EXTRA_PACKAGES += ['android.support.v7.palette']
|
||||
ANDROID_EXTRA_RES_DIRS += ['%' + CONFIG['ANDROID_PALETTE_V7_AAR_RES']]
|
||||
resjar.generated_sources += ['android/support/v7/palette/R.java']
|
||||
|
||||
# (no resources) resjar.generated_sources += ['android/support/v7/palette/R.java']
|
||||
|
||||
resjar.javac_flags += ['-Xlint:all']
|
||||
|
||||
@ -880,12 +879,12 @@ if CONFIG['MOZ_ANDROID_GCM']:
|
||||
if CONFIG['ANDROID_PLAY_SERVICES_GCM_AAR']:
|
||||
ANDROID_EXTRA_PACKAGES += ['com.google.android.gms.gcm']
|
||||
ANDROID_EXTRA_RES_DIRS += ['%' + CONFIG['ANDROID_PLAY_SERVICES_GCM_AAR_RES']]
|
||||
resjar.generated_sources += ['com/google/android/gms/gcm/R.java']
|
||||
# (no resources) resjar.generated_sources += ['com/google/android/gms/gcm/R.java']
|
||||
|
||||
if CONFIG['ANDROID_PLAY_SERVICES_MEASUREMENT_AAR']:
|
||||
ANDROID_EXTRA_PACKAGES += ['com.google.android.gms.measurement']
|
||||
ANDROID_EXTRA_RES_DIRS += ['%' + CONFIG['ANDROID_PLAY_SERVICES_MEASUREMENT_AAR_RES']]
|
||||
resjar.generated_sources += ['com/google/android/gms/measurement/R.java']
|
||||
# (no resources) resjar.generated_sources += ['android/support/v7/palette/R.java']
|
||||
|
||||
if CONFIG['MOZ_INSTALL_TRACKING']:
|
||||
gbjar.extra_jars += [
|
||||
|
@ -87,7 +87,6 @@
|
||||
<description>&noupdates.intro.desc;</description>
|
||||
<separator class="thin"/>
|
||||
<hbox id="updateCheckErrorNotFound" class="alertBox" hidden="true" align="top">
|
||||
<image id="alert"/>
|
||||
<description flex="1">&noupdates.error.desc;</description>
|
||||
</hbox>
|
||||
<separator class="thin"/>
|
||||
@ -157,7 +156,6 @@
|
||||
onpageshow="gAdminDisabledPage.onPageShow();">
|
||||
<separator/>
|
||||
<hbox class="alertBox" align="top">
|
||||
<image id="alert"/>
|
||||
<description flex="1">&adminDisabled.warning.label;</description>
|
||||
</hbox>
|
||||
<separator flex="1"/>
|
||||
|
@ -193,10 +193,6 @@ treechildren::-moz-tree-progressmeter {
|
||||
color: ThreeDShadow;
|
||||
}
|
||||
|
||||
treechildren::-moz-tree-progressmeter(progressUndetermined) {
|
||||
list-style-image: url("chrome://global/skin/progressmeter/progressmeter-busy.gif");
|
||||
}
|
||||
|
||||
treechildren::-moz-tree-cell-text(progressmeter) {
|
||||
margin: 2px 4px;
|
||||
}
|
||||
|
@ -155,11 +155,6 @@ treechildren::-moz-tree-progressmeter {
|
||||
-moz-border-left-colors: #AAAAAA #000000;
|
||||
}
|
||||
|
||||
/*
|
||||
treechildren::-moz-tree-progressmeter(progressUndetermined) {
|
||||
}
|
||||
*/
|
||||
|
||||
treechildren::-moz-tree-cell-text(progressmeter) {
|
||||
margin: 2px 4px;
|
||||
-moz-appearance: progressbar;
|
||||
|
@ -2,10 +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/. */
|
||||
|
||||
#alert {
|
||||
list-style-image: url("chrome://mozapps/skin/update/warning.gif");
|
||||
}
|
||||
|
||||
.throbber {
|
||||
list-style-image: url("chrome://global/skin/icons/loading.png");
|
||||
width: 16px;
|
||||
|
@ -90,6 +90,8 @@
|
||||
skin/classic/global/icons/windowControls.png (../../windows/global/icons/windowControls.png)
|
||||
skin/classic/global/radio/radio-check.gif (../../windows/global/radio/radio-check.gif)
|
||||
skin/classic/global/radio/radio-check-dis.gif (../../windows/global/radio/radio-check-dis.gif)
|
||||
skin/classic/global/scale/scale-tray-horiz.gif (../../windows/global/scale/scale-tray-horiz.gif)
|
||||
skin/classic/global/scale/scale-tray-vert.gif (../../windows/global/scale/scale-tray-vert.gif)
|
||||
skin/classic/global/scrollbar/slider.gif (../../windows/global/scrollbar/slider.gif)
|
||||
skin/classic/global/splitter/grip-bottom.gif (../../windows/global/splitter/grip-bottom.gif)
|
||||
skin/classic/global/splitter/grip-top.gif (../../windows/global/splitter/grip-top.gif)
|
||||
|
@ -192,10 +192,6 @@ treechildren::-moz-tree-progressmeter {
|
||||
color: ThreeDShadow;
|
||||
}
|
||||
|
||||
treechildren::-moz-tree-progressmeter(progressUndetermined) {
|
||||
list-style-image: url("chrome://global/skin/progressmeter/progressmeter-busy.gif");
|
||||
}
|
||||
|
||||
treechildren::-moz-tree-cell-text(progressmeter) {
|
||||
margin: 2px 4px;
|
||||
}
|
||||
|
@ -2,10 +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/. */
|
||||
|
||||
#alert {
|
||||
list-style-image: url("chrome://mozapps/skin/update/update.png");
|
||||
}
|
||||
|
||||
.throbber {
|
||||
list-style-image: url("chrome://global/skin/icons/loading.png");
|
||||
width: 16px;
|
||||
|
Loading…
Reference in New Issue
Block a user