merge fx-team to mozilla-central a=merge

This commit is contained in:
Carsten "Tomcat" Book 2016-09-13 11:54:01 +02:00
Родитель 2884834832 7c9a418c0a
Коммит 9c1897dafa
30 изменённых файлов: 211 добавлений и 72 удалений

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

@ -10,8 +10,6 @@
#if defined(XP_WIN)
#include <windows.h>
#include <stdlib.h>
#include <io.h>
#include <fcntl.h>
#elif defined(XP_UNIX)
#include <sys/resource.h>
#include <unistd.h>
@ -284,8 +282,8 @@ InitXPCOMGlue(const char *argv0, nsIFile **xreDirectory)
}
char *lastSlash = strrchr(exePath, XPCOM_FILE_PATH_SEPARATOR[0]);
if (!lastSlash || (size_t(lastSlash - exePath) > MAXPATHLEN -
sizeof(XPCOM_DLL) - 1))
if (!lastSlash ||
(size_t(lastSlash - exePath) > MAXPATHLEN - sizeof(XPCOM_DLL) - 1))
return NS_ERROR_FAILURE;
strcpy(lastSlash + 1, XPCOM_DLL);

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

@ -5,6 +5,12 @@
* Tests if the a function call's stack is properly displayed in the UI.
*/
// Force the old debugger UI since it's directly used (see Bug 1301705)
Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
registerCleanupFunction(function* () {
Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
});
function* ifTestingSupported() {
let { target, panel } = yield initCanvasDebuggerFrontend(SIMPLE_CANVAS_DEEP_STACK_URL);
let { window, $, $all, EVENTS, SnapshotsListView, CallsListView } = panel.panelWin;

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

@ -6,6 +6,12 @@
* and jumping to source in the debugger for the topmost call item works.
*/
// Force the old debugger UI since it's directly used (see Bug 1301705)
Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
registerCleanupFunction(function* () {
Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
});
function* ifTestingSupported() {
let { target, panel } = yield initCanvasDebuggerFrontend(SIMPLE_CANVAS_DEEP_STACK_URL);
let { window, $, $all, EVENTS, SnapshotsListView, CallsListView } = panel.panelWin;

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

@ -22,6 +22,7 @@ DebuggerPanel.prototype = {
threadClient: this.toolbox.threadClient,
tabTarget: this.toolbox.target
});
this.isReady = true;
return this;
});
},

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

@ -31,7 +31,11 @@ const FRAME_SCRIPT_URL = getRootDirectory(gTestPath) + "code_frame-script.js";
const CHROME_URL = "chrome://mochitests/content/browser/devtools/client/debugger/test/mochitest/";
const CHROME_URI = Services.io.newURI(CHROME_URL, null, null);
Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
registerCleanupFunction(function* () {
Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
info("finish() was called, cleaning up...");
Services.prefs.setBoolPref("devtools.debugger.log", gEnableLogging);

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

@ -13,6 +13,12 @@ thisTestLeaksUncaughtRejectionsAndShouldBeFixed(
* when tagging an already source mapped location initially.
*/
// Force the old debugger UI since it's directly used (see Bug 1301705)
Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
registerCleanupFunction(function* () {
Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
});
const DEBUGGER_ROOT = "http://example.com/browser/devtools/client/debugger/test/mochitest/";
// Empty page
const PAGE_URL = `${DEBUGGER_ROOT}doc_empty-tab-01.html`;

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

@ -7,6 +7,12 @@
* and un pretty printing.
*/
// Force the old debugger UI since it's directly used (see Bug 1301705)
Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
registerCleanupFunction(function* () {
Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
});
const DEBUGGER_ROOT = "http://example.com/browser/devtools/client/debugger/test/mochitest/";
// Empty page
const PAGE_URL = `${DEBUGGER_ROOT}doc_empty-tab-01.html`;

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

@ -13,6 +13,12 @@ let panelWin = null;
const URL = "data:text/html;charset=utf8,test split console key delegation";
const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
// Force the old debugger UI since it's directly used (see Bug 1301705)
Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
registerCleanupFunction(function* () {
Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
});
add_task(function* () {
let tab = yield addTab(URL);
let target = TargetFactory.forTab(tab);

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

@ -11,6 +11,12 @@
var URL = `${URL_ROOT}doc_viewsource.html`;
var JS_URL = `${URL_ROOT}code_math.js`;
// Force the old debugger UI since it's directly used (see Bug 1301705)
Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
registerCleanupFunction(function* () {
Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
});
function* viewSource() {
let toolbox = yield openNewTabAndToolbox(URL);

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

@ -10,6 +10,12 @@
var URL = `${URL_ROOT}doc_viewsource.html`;
var JS_URL = `${URL_ROOT}code_math.js`;
// Force the old debugger UI since it's directly used (see Bug 1301705)
Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
registerCleanupFunction(function* () {
Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
});
function* viewSource() {
let toolbox = yield openNewTabAndToolbox(URL);
let { panelWin: debuggerWin } = yield toolbox.selectTool("jsdebugger");

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

@ -1,11 +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/.
# LOCALIZATION NOTE These strings are used inside the Promise debugger
# which is available as a panel in the Debugger.
# The correct localization of this file might be to keep it in
# English, or another language commonly spoken among web developers.
# You want to make that choice consistent across the developer tools.
# A good criteria is the language in which you'd find the best
# documentation on web development on the web.

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

@ -92,7 +92,12 @@ pref("devtools.debugger.auto-pretty-print", false);
pref("devtools.debugger.auto-black-box", true);
pref("devtools.debugger.workers", false);
pref("devtools.debugger.promise", false);
#if defined(NIGHTLY_BUILD)
pref("devtools.debugger.new-debugger-frontend", true);
#else
pref("devtools.debugger.new-debugger-frontend", false);
#endif
// The default Debugger UI settings
pref("devtools.debugger.ui.panes-workers-and-sources-width", 200);

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

@ -278,7 +278,7 @@ Editor.prototype = {
win, "utf8"
);
this.container = env;
this._setup(win.document.body);
this._setup(win.document.body, el.ownerDocument);
env.removeEventListener("load", onLoad, true);
def.resolve();
@ -301,7 +301,8 @@ Editor.prototype = {
* used by both append functions above, and does all the hard work to
* configure CodeMirror with all the right options/modes/etc.
*/
_setup: function (el) {
_setup: function (el, doc) {
doc = doc || el.ownerDocument;
let win = el.ownerDocument.defaultView;
let scriptsToInject = CM_SCRIPTS.concat(this.config.externalScripts);
@ -373,7 +374,7 @@ Editor.prototype = {
let popup = this.config.contextMenu;
if (typeof popup == "string") {
popup = el.ownerDocument.getElementById(this.config.contextMenu);
popup = doc.getElementById(this.config.contextMenu);
}
this.emit("popupOpen", ev, popup);

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

@ -1,10 +1,9 @@
<!-- 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/. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="#5FC749">
<path d="M6.9 7.8c-.3.1-.6.4-.6.7-.1.5.2 1 .7 1.1.3 0 .7-.1.9-.3l2.5-2.9-3.5 1.4z"/>
<path opacity="0.5" d="M4.7 10.6c.7 1.1 1.9 1.9 3.3 1.9s2.6-.8 3.3-1.9H4.7z"/>
<path d="M-12.7-2.5c-3.8 0-6.7 3-6.7 6.7s3 6.7 6.7 6.7c3.8 0 6.7-3 6.7-6.7s-2.9-6.7-6.7-6.7zM-12.8 9c-2.5 0-4.6-2.1-4.8-4.5v-.2h.6c.6 0 1-.4 1-1s-.4-1-1-1h-.4c.4-.9.8-1.4 1.5-1.9l.2.4c.3.5.8.7 1.3.4.5-.2.7-.7.4-1.2l-.2-.4c.4-.1.9-.2 1.4-.2.6 0 1.1.1 1.6.3l-.2.4c-.3.5-.1 1 .4 1.3.5.3 1 .1 1.3-.4l.2-.6c.6.6 1.2 1.5 1.4 1.8h-.4c-.6 0-1 .4-1 1s.4 1 1 1h.6v.2C-8.2 6.9-10.3 9-12.8 9zM-12.8 12.7c-3.4 0-6.2 2.7-6.2 6.2s2.7 6.3 6.3 6.3c3.5 0 6.3-2.7 6.3-6.3-.1-3.4-2.9-6.2-6.4-6.2zm0 11.4c-2.9 0-5.2-2.3-5.2-5.2 0-2.9 2.3-5.2 5.2-5.2s5.2 2.3 5.2 5.2c0 3-2.2 5.2-5.2 5.2z"/>
<path d="M-14.5 16.3c-.2 0-.4.2-.4.4v4.5c0 .2.3.4.5.4s.5-.2.5-.4v-4.5c0-.2-.3-.4-.5-.4"/>
<path d="M8 2.3C4.5 2.3 1.8 5 1.8 8.5s2.7 6.3 6.3 6.3c3.5 0 6.3-2.7 6.3-6.3-.2-3.4-2.9-6.2-6.4-6.2zm0 11.4c-2.9 0-5.2-2.3-5.2-5.2v-.3h1.7c.2 0 .4-.3.4-.5s-.2-.6-.4-.6H2.9C3.3 5.9 4 4.8 5 4.1l1.4 1.3c.1.1.5.1.6-.1.1-.1.2-.5.1-.6L6 3.6c.6-.2 1.3-.4 2-.4.8 0 1.5.2 2.2.5L9 4.8c-.1.1 0 .5.1.6s.5.2.6.1L11 4.3c1 .7 1.7 1.7 2 2.8h-1.7c-.2 0-.4.3-.4.5s.2.5.4.5h1.9v.3c0 3.1-2.2 5.3-5.2 5.3z"/>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="#5FC749" fill-rule="evenodd">
<path d="M15 9.004C14.51 12.394 11.578 15 8.035 15 4.15 15 1 11.866 1 8s3.15-7 7.036-7c1.941 0 3.7.783 4.972 2.048l-.709.709A6.027 6.027 0 0 0 8.036 2c-3.33 0-6.03 2.686-6.03 6s2.7 6 6.03 6a6.023 6.023 0 0 0 5.946-4.993l1.017-.003z"/>
<path d="M4.137 9H3.1a5.002 5.002 0 0 0 9.8 0h-.965a4.023 4.023 0 0 1-3.9 3 4.023 4.023 0 0 1-3.898-3z" fill-opacity=".5"/>
<path d="M8.036 11a2.994 2.994 0 0 0 2.987-3c0-1.657-1.338-3-2.987-3a2.994 2.994 0 0 0-2.988 3c0 1.657 1.338 3 2.988 3zm0-1c1.11 0 2.011-.895 2.011-2s-.9-2-2.011-2c-1.111 0-2.012.895-2.012 2s.9 2 2.012 2z"/>
<path d="M10.354 6.354l4-4a.5.5 0 0 0-.708-.708l-4 4a.5.5 0 1 0 .708.708z"/>
</svg>

До

Ширина:  |  Высота:  |  Размер: 1.5 KiB

После

Ширина:  |  Высота:  |  Размер: 990 B

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

@ -112,6 +112,12 @@ a {
max-width: 40%;
}
.stack-trace {
/* The markup contains extra whitespace to improve formatting of clipboard text.
Make sure this whitespace doesn't affect the HTML rendering */
white-space: normal;
}
.stack-trace .frame-link-source,
.message-location .frame-link-source {
/* Makes the file name truncated (and ellipsis shown) on the left side */

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

@ -8,6 +8,12 @@
"use strict";
// Force the old debugger UI since it's directly used (see Bug 1301705)
Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
registerCleanupFunction(function* () {
Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
});
function test() {
Task.spawn(function* () {
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +

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

@ -12,18 +12,26 @@
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"test/test-eval-in-stackframe.html";
// Force the old debugger UI since it's directly used (see Bug 1301705)
Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
registerCleanupFunction(function* () {
Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
});
add_task(function* () {
yield loadTab(TEST_URI);
let hud = yield openConsole();
let dbgPanel = yield openDebugger();
yield waitForFrameAdded(dbgPanel);
yield waitForFrameAdded();
yield openConsole();
yield testVariablesView(hud);
});
function* waitForFrameAdded(dbgPanel) {
let thread = dbgPanel.panelWin.DebuggerController.activeThread;
function* waitForFrameAdded() {
let target = TargetFactory.forTab(gBrowser.selectedTab);
let toolbox = gDevTools.getToolbox(target);
let thread = toolbox.threadClient;
info("Waiting for framesadded");
yield new Promise(resolve => {

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

@ -11,20 +11,28 @@
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"test/test-eval-in-stackframe.html";
// Force the old debugger UI since it's directly used (see Bug 1301705)
Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
registerCleanupFunction(function* () {
Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
});
add_task(function* () {
yield loadTab(TEST_URI);
let hud = yield openConsole();
let dbgPanel = yield openDebugger();
yield openInspector();
yield waitForFrameAdded(dbgPanel);
yield waitForFrameAdded();
yield openConsole();
yield testVariablesView(hud);
});
function* waitForFrameAdded(dbgPanel) {
let thread = dbgPanel.panelWin.DebuggerController.activeThread;
function* waitForFrameAdded() {
let target = TargetFactory.forTab(gBrowser.selectedTab);
let toolbox = gDevTools.getToolbox(target);
let thread = toolbox.threadClient;
info("Waiting for framesadded");
yield new Promise(resolve => {

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

@ -14,6 +14,12 @@ const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
var gWebConsole, gJSTerm, gDebuggerWin, gThread, gDebuggerController;
var gStackframes;
// Force the old debugger UI since it's directly used (see Bug 1301705)
Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
registerCleanupFunction(function* () {
Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
});
function test() {
loadTab(TEST_URI).then(() => {
openConsole().then(consoleOpened);

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

@ -11,6 +11,13 @@
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"test/test-eval-in-stackframe.html";
// Force the old debugger UI since it's directly used (see Bug 1301705)
Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
registerCleanupFunction(function* () {
Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
});
add_task(function* () {
yield loadTab(TEST_URI);

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

@ -11,6 +11,12 @@
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"test/test-autocomplete-in-stackframe.html";
// Force the old debugger UI since it's directly used (see Bug 1301705)
Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
registerCleanupFunction(function* () {
Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
});
var gStackframes;
registerCleanupFunction(function () {
gStackframes = null;

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

@ -10,6 +10,12 @@
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"test/test-bug_1050691_click_function_to_source.html";
// Force the old debugger UI since it's directly used (see Bug 1301705)
Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
registerCleanupFunction(function* () {
Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
});
add_task(function* () {
yield loadTab(TEST_URI);
let hud = yield openConsole();

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

@ -11,6 +11,12 @@
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/test" +
"/test-bug-766001-js-console-links.html";
// Force the old debugger UI since it's directly used (see Bug 1301705)
Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
registerCleanupFunction(function* () {
Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
});
function test() {
let hud;

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

@ -13,6 +13,12 @@ const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
var gWebConsole, gJSTerm, gVariablesView;
// Force the old debugger UI since it's directly used (see Bug 1301705)
Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
registerCleanupFunction(function* () {
Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
});
function test() {
registerCleanupFunction(() => {
gWebConsole = gJSTerm = gVariablesView = null;

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

@ -26,7 +26,7 @@ add_task(function* () {
is(hud.jsterm.inputNode.hasAttribute("focused"), false,
"inputNode shouldn't be focused");
yield openDebugger();
yield openInspector();
hud = yield openConsole();
is(hud.jsterm.inputNode.hasAttribute("focused"), true,

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

@ -145,10 +145,11 @@ var inputTests = [
input: "new Object({1: 'this\\nis\\nsupposed\\nto\\nbe\\na\\nvery" +
"\\nlong\\nstring\\n,shown\\non\\na\\nsingle\\nline', " +
"2: 'a shorter string', 3: 100})",
output: 'Object { 1: "this is supposed to be a very long ' + ELLIPSIS +
'", 2: "a shorter string", 3: 100 }',
output: '[ <1 empty slot>, "this is supposed to be a very long ' + ELLIPSIS +
'", "a shorter string", 100 ]',
printOutput: "[object Object]",
inspectable: false,
inspectable: true,
variablesViewLabel: "Object[4]"
},
// 15

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

@ -131,10 +131,10 @@ var inputTests = [
// 14
{
input: '({0: "a", 42: "b"})',
output: 'Object { 0: "a", 42: "b" }',
output: '[ "a", <9 empty slots>, 33 more\u2026 ]',
printOutput: "[object Object]",
inspectable: true,
variablesViewLabel: "Object",
variablesViewLabel: "Object[43]",
},
// 15
@ -189,10 +189,10 @@ var inputTests = [
// 20
{
input: '({length: 1})',
output: 'Object { length: 1 }',
output: '[ <1 empty slot> ]',
printOutput: "[object Object]",
inspectable: true,
variablesViewLabel: "Object",
variablesViewLabel: "Object[1]",
},
// 21
@ -216,10 +216,10 @@ var inputTests = [
// 23
{
input: '({0: "a", 1: "b", length: 3})',
output: 'Object { length: 3, 2 more\u2026 }',
output: '[ "a", "b", <1 empty slot> ]',
printOutput: "[object Object]",
inspectable: true,
variablesViewLabel: "Object",
variablesViewLabel: "Object[3]",
},
// 24
@ -234,10 +234,10 @@ var inputTests = [
// 25
{
input: '({0: "a", 2: "b", length: 3})',
output: 'Object { length: 3, 2 more\u2026 }',
output: '[ "a", <1 empty slot>, "b" ]',
printOutput: "[object Object]",
inspectable: true,
variablesViewLabel: "Object",
variablesViewLabel: "Object[3]",
},
// 26
@ -257,6 +257,15 @@ var inputTests = [
inspectable: true,
variablesViewLabel: "Object",
},
// 28
{
input: '({42: "a"})',
output: 'Object { 42: "a" }',
printOutput: "[object Object]",
inspectable: true,
variablesViewLabel: "Object",
},
];
function test() {

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

@ -13,6 +13,12 @@
const TEST_URI = "https://example.com/browser/devtools/client/webconsole/" +
"test/test-mixedcontent-securityerrors.html";
// Force the old debugger UI since it's directly used (see Bug 1301705)
Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
registerCleanupFunction(function* () {
Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
});
add_task(function* () {
yield loadTab(TEST_URI);
let hud = yield openConsole(null);

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

@ -1793,36 +1793,45 @@ DebuggerServer.ObjectActorPreviewers.Object = [
},
function PseudoArray({obj, hooks}, grip, rawObj) {
let length = 0;
let length;
let keys = obj.getOwnPropertyNames();
if (keys.length == 0) {
return false;
}
// Pseudo-arrays should only have array indices and, optionally, a "length" property.
// Since array indices are sorted first, check if the last property is "length".
if(keys[keys.length-1] === "length") {
keys.pop();
// The value of "length" should equal the number of other properties. If eventually
// we allow sparse pseudo-arrays, we should check whether it's a Uint32 instead.
if(rawObj.length !== keys.length) {
return false;
}
}
// Ensure that the keys are consecutive integers starting at "0". If eventually we
// allow sparse pseudo-arrays, we should check that they are array indices, that is:
// `(key >>> 0) + '' === key && key !== "4294967295"`.
// Checking the last property first allows us to avoid useless iterations when
// there is any property which is not an array index.
if(keys.length && keys[keys.length-1] !== keys.length - 1 + '') {
// If no item is going to be displayed in preview, better display as sparse object.
// The first key should contain the smallest integer index (if any).
if(keys[0] >= OBJECT_PREVIEW_MAX_ITEMS) {
return false;
}
for (let key of keys) {
if (key !== (length++) + '') {
// Pseudo-arrays should only have array indices and, optionally, a "length" property.
// Since integer indices are sorted first, check if the last property is "length".
if(keys[keys.length-1] === "length") {
keys.pop();
length = DevToolsUtils.getProperty(obj, "length");
} else {
// Otherwise, let length be the (presumably) greatest array index plus 1.
length = +keys[keys.length-1] + 1;
}
// Check if length is a valid array length, i.e. is a Uint32 number.
if(typeof length !== "number" || length >>> 0 !== length) {
return false;
}
// Ensure all keys are increasing array indices smaller than length. The order is not
// guaranteed for exotic objects but, in most cases, big array indices and properties
// which are not integer indices should be at the end. Then, iterating backwards
// allows us to return earlier when the object is not completely a pseudo-array.
let prev = length;
for(let i = keys.length - 1; i >= 0; --i) {
let key = keys[i];
let numKey = key >>> 0; // ToUint32(key)
if (numKey + '' !== key || numKey >= prev) {
return false;
}
prev = numKey;
}
grip.preview = {
@ -1836,12 +1845,14 @@ DebuggerServer.ObjectActorPreviewers.Object = [
}
let items = grip.preview.items = [];
let numItems = Math.min(OBJECT_PREVIEW_MAX_ITEMS, length);
let i = 0;
for (let key of keys) {
if (rawObj.hasOwnProperty(key) && i++ < OBJECT_PREVIEW_MAX_ITEMS) {
let value = makeDebuggeeValueIfNeeded(obj, rawObj[key]);
items.push(hooks.createValueGrip(value));
for (let i = 0; i < numItems; ++i) {
let desc = obj.getOwnPropertyDescriptor(i);
if (desc && 'value' in desc) {
items.push(hooks.createValueGrip(desc.value));
} else {
items.push(null);
}
}

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

@ -32,8 +32,16 @@ SpecialPowers.pushPrefEnv({"set": [["media.webvtt.regions.enabled", true]]},
trackThree.kind = "chapters";
var events = 0;
function countEvent() {
ok(true, "A load or error event should have happened.");
function trackOneEvent() {
ok(true, "A load event for trackOne should have happened.");
events++ && events == 3 && SimpleTest.finish();
}
function trackTwoEvent() {
ok(true, "An error event for trackTwo should have happened.");
events++ && events == 3 && SimpleTest.finish();
}
function trackThreeEvent() {
ok(true, "An error event for trackThree should have happened.");
events++ && events == 3 && SimpleTest.finish();
}
@ -41,12 +49,12 @@ SpecialPowers.pushPrefEnv({"set": [["media.webvtt.regions.enabled", true]]},
ok(false, "Event should not have been called.");
}
trackOne.addEventListener("load", countEvent);
trackOne.addEventListener("load", trackOneEvent);
trackOne.addEventListener("error", shouldNotBeCalled)
trackTwo.addEventListener("load", shouldNotBeCalled);
trackTwo.addEventListener("error", countEvent);
trackTwo.addEventListener("error", trackTwoEvent);
trackThree.addEventListener("load", shouldNotBeCalled);
trackThree.addEventListener("error", countEvent);
trackThree.addEventListener("error", trackThreeEvent);
document.getElementById("content").appendChild(video);
video.appendChild(trackOne);