mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:30:27 +00:00
021f317ebe
- Bug 1256545: avoid compiler warning for pointer truncation when checking low bits r=bwc (d16c97ba81)
- Bug 1255655 - Const-ify and shrink octet_weight. r=hurley. (d5b4c89e87)
- Bug 1216837: add explicit error checks for packet length in srtp r=mcmanus rs=jesup (ce11d6694e)
- Bug 1248565 - Let child processes have its own MOZ_LOG_FILE. r=erahm (a242c8fa08)
- Bug 1256558 - Change MUST_CONVERT to avoid C4311 in VS2015; r=khuey (81b1f997f6)
- Bug 580313 - Use deque instead of manual queue im nsPrefetchService. r=smaug (023e0115e8)
- Bug 580313 - New resource hints for link. r=smaug (3c7949ab9a)
- Bug 1253593 - Fix applicationCache.onchecking notification on e10s. r=jduell (debb998b9d)
- Bug 1234177 - check to see if mFunctions.append returned error. r=bholley (0dc9d44233)
- Bug 1183754, part 1 - Get rid of aligned spacing for XPCWrappedNative fields. r=bholley (dfb09ad1a4)
- Bug 1183754, part 2 - Remove clearing of the next chunk. r=bholley (78e8c4d7cb)
- Bug 1183754, part 3 - Use a UniquePtr for XPCWrappedNativeChunk::mNextChunk. r=bholley (26d816ff0c)
- Bug 1183754, part 4 - Eliminate XPCWrappedNativeTearOffChunk. r=bholley (0f50e6c9ff)
- Bug 1252154: Delay allocation metadata collection for inline typed objects. r=sfink (9f3cea8d76)
- Bug 1250195: In TypedObject.from, decide that the input is typed only if it's an array type; r=pnkfelix (2ceb08c793)
- Bug 1250842 - Fix initialization of script source object when modules are compiled off main thread r=shu (ca3f9b900e)
- Bug 1257053 - Only make use of error stashing (via PossibleError) when it is necessary; r=jorendorff (f3744899c4)
- Bug 1253847 - Do not count the skipped EOL inside template literal. r=jorendorff (f63926bb2d)
- Bug 1221378: Don't collect allocation metadata when lazily creating standard prototypes. r=fitzgen (667e752baf)
- Bug 1249469 - Allow any script to execute when resolving constructors. (r=jimb) (474fae3645)
- Bug 1221378: SpiderMonkey: Assert against re-entrant constructor resolution. r=fitzgen (15619325de)
- Bug 1249469 - Followup: missing #include on a CLOSED TREE. (3c62bbbb31)
- Bug 1248412 - inlineIsTypedArrayHelper: Check for TypedArray and Proxy classes when we allow wrapped TypedArray. r=Waldo (1bcaba804b)
- Bug 1250307 - Add the by: "bucket" breakdown option; r=jimb (8ca32dc781)
- Bug 1221378: Add JSCLASS_DELAY_METADATA_CALLBACK flag to UnboxedPlainObject. r=jandem (7e0eb0be01)
- Bug 1064543 - Don't emit FilterTypeSet if it wouldn't remove any types. r=h4writer (d1a1a4e127)
- Bug 1242462 - Add a newline when calling TypeSet::print from a debugger. r=jandem (2e4c07aaf3)
- Bug 1247140 - Use mozilla::BinarySearch{,If} for more manual binary searches in SpiderMonkey. r=jandem (b948fe7f60)
- Bug 1249193 - Fix Debugger.Frame.this to work correctly if we're still in the script's prologue. r=shu (0f17a78c1a)
- Bug 1249193 part 2 - Fix DebugScopeProxy to return correct this-value if we're still in the prologue. r=shu (5e17bdb2c9)
- Bug 1187450 - avoid leaking cstr in SPSProfiler::allocProfileString. r=jorendorff (96964744b2)
- Bug 1251790 - Add help for "interface objects", r=terrence (9a5d8cc3fa)
- Bug 944164 - Implement proper redirection with ref counted underlying files, r=terrence (f4182fff75)
- Bug 1248352 - Allow shell option parsing code to handle help text containing blank lines r=jandem (d7f2814665)
- Bug 1249954 - Handle OOM in SingleStepCallback. r=terrence (460f323729)
- Bug 1257223 - Fix os.file.redirect(null), r=jonco (2ca40fd839)
- Bug 1245310 - Restore null check in GetFocusedNode(). r=khuey (fa816d87b2)
- Bug 1256424. Get rid of ThreadsafeAutoSafeJSContext. r=bholley (445aa7dd4b)
- Bug 1256424 followup to actually address the review comments (d085cf1900)
- Bug 1003432: Expose CustomEvent in Worker. r=smaug (3b143dc6e4)
- Bug 1256414 - Hide MozSettingsEvent from the Web; r=khuey (52fe18e823)
- Bug 1257038: Remove the worker descriptor for WorkerLocation. r=bz (2b9721e4fe)
- Bug 1257039: Remove the worker descriptor for FileReaderSync. r=bz (cc33ce76e6)
- Bug 1257355: Remove the worker descriptor for WorkerNavigator. r=bz (067f1fc9ea)
- Bug 1257480 - null check for GetOrCreateGlobalScope() in WorkerDebuggerGlobalScope, r=khuey (0d3d640fc0)
- Make split-profile run jprof in the directory with the jprof-log. No bug. (58f5060e39)
- Bug 1250333 - do not create accessibles for trailing BRs, r=davidb, roc (d8e1193adc)
- Bug 1251712 - propagate a context flag for alerts, r=davdib (d5ef6167ea)
- Bug 1251752 - logging: add tree specific methods, r=yzen (f974c207ca)
- Bug 1251218 - add special TreeWalker constructor for children creation, r=marcoz (74f939b93e)
- Bug 1251337 - TreeWalker doesn't have to check ARIA owned children for each DOM state, r=yzen (19d83af7e1)
- Bug 1249730 - make TreeWalker bi-directional, r=yzen (a229a591e1)
- Bug 1249730 - make TreeWalker bi-directional, r=yzen (5acc1155b1)
- Bug 1251743 - ARIA owns reallocation may insert a child at wrong index, r=yzen (d95065109b)
- Bug 1249253 - content removal processing can wrongly remove ARIA owned children, r=yzen (45df52f4c9)
- Bug 1254989 - extend TreeWalker::Next to accept a stopper node, r=yzen (c5dfbbdc96)
- Bug 1249730 - make TreeWalker bi-directional, follow up fix, r=yzen (747504b5ec)
- Bug 1196652 - OriginSuffix is shown in about:serviceworker on b2g. r=ferjm (f21d534755)
- Bug 1224570 - [Service Workers Panel] Service Workers panel fails to show registered service workers after restart. r=fabrice (7d7e95db4c)
- Bug 1169674 - Use originNoSuffix for permission event. r=fabrice, f=bholley (8f389cb0c7)
- Bug 1207499 - Part 1: Remove use of expression closure from b2g/. r=sicking (42b96cbfdf)
- Bug 1207499 - Part 2: Remove use of expression closure from chrome/. r=bsmedberg (7abb390349)
- Bug 1207499 - Part 3: Remove use of expression closure from docshell/. r=bz (aee60733a9)
- Bug 1207499 - Part 5: Remove use of expression closure from modules/. r=mwu (6c29c775fe)
- Bug 1147562 - Update remaining callsites of newChannel before landing the shim in netwerk/ (r=jduell) (2d37fab088)
- Bug 1207499 - Part 6: Remove use of expression closure from netwerk/. r=jduell (2881b3450f)
- Bug 1207499 - Part 7: Remove use of expression closure from parser/. r=jst (2519fb1fff)
- Bug 1229913 - Prevent race conditions when there are many animation mutations; r=miker (442a1af761)
- Bug 1208204 - Pressing space in the animation inspector should toggle play/pause. r=pbrosset (f15cb19dcb)
- Bug 1249719 - Use promise.all instead of Promise.all to release player fronts; r=ochameau (560b1de176)
- Bug 1207499 - Part 8: Remove use of expression closure from security/. r=keeler (de33d27e8f)
- Bug 1207499 - Part 12: Remove use of expression closure from widget/. r=roc (0e7fd889d9)
- Bug 1207499 - Part 13: Remove use of expression closure from xpcom/. r=froydnj (f95a4eefde)
- Bug 1213680 - Stop using picker by default when opening inspector (r=pbrosset) (64c2741a0b)
- Bug 1233497 - Avoid unsafe CPOWs in devtools tests. r=jryans (d8bdcac868)
- Bug 1059312 - Fix highlighter offset after switching iframe context; =pbro (da36ee302d)
- Bug 1188695 - Increase the timeout of browser_markupview_keybindings_04.js (d94bafb1ef)
- Bug 1199180 - Wait for the inspector-updated event after selecting nodes with UP key. r=pbrosset (3ffcead1cd)
- Bug 1245654 - Make the inspector shortcut start the pick mode again; r=bgrins (f30b156b44)
- Bug 1244120 - Enable browser_rules_content_02.js with e10s; r=bgrins (94f9e97f20)
- Bug 1208864 - Duplicate node context menu item in markup view. r=pbro (1044d79738)
- Bug 1233363 - Fix timelime typo in animationinspector.css; r=me (0e4338c17e)
- Bug 1229000 - Adds separator borders in the timeline toolbar; r=miker (f0c07b9555)
- Bug 1233367 - Right-border of current time label has wrong color with the dark-theme .r=pbrosset (9017ea3e21)
- Bug 1239298 - Make sure percentage width of iterations and delays in the timeline are relative to the same parent (c900c4f4eb)
- Bug 1221494 - Fix the playback rate selector size on Linux; r=pbro (ddcd686764)
- Bug 1245276 - Make 'All animations' left border darker in dark theme. r=bgrins (d6b9edbda9)
- Bug 1228978 - Add a drop-mark to the playback-rate selector in the animation-inspector's toolbar; r=pbro (1948d0aeb4)
- Bug 1231945 - Display animation.id when it exists; r=tromey (291203c9a4)
- Bug 1231688 - Use waapi computed timing in devtools animation actors; r=tromey (4a6fd44649)
- Bug 1245849 - Remove mochitest browser_animation_name.js and add a xpcshell test instead; r=ochameau (bb1a570057)
- Bug 1232681 - Display script-generated animations correctly. r=pbro (15501a8ccb)
- Bug 1199712 - Prevent the animation panel from scrolling when space is pressed; r=pbro (c291c8541f)
- Bug 1247243 - Animations are shown only every 2 reloads. r=pbrosset (6162103af6)
- Bug 1249219 - Part 1: Define NonOwningAnimationTarget. r=birtles (c13d77b5d9)
- Bug 1249219 - Part 2: Remove struct PseudoElementHashKey. r=birtles (f8ff47d484)
- Bug 1249219 - Part 3: Replace Pair<Element*, CSSPseudoElementType> with NonOwningAnimationTarget. r=birtles (68a1a5e149)
- Bug 1218620 - Allow opacity animation running on compositor even if the frame has any restricted transforms. r=birtles (0f26c81fb0)
- Bug 1254419 - Move GetPropertyState alongside GetFrames; r=hiro (046dbce30e)
- Bug 1246320 part 0 - Whitespace fixes; r=whitespace-only (eda3e8b8ae)
- Bug 1247531 - Annotate intentional switch fallthrough to suppress -Wimplicit-fallthrough warning in dom/animations/. r=dholbert (fbdff98c25)
- Bug 1246320 part 1 - Add AnimationUtils::GetCurrentRealmDocument; r=bz (53c52acbe7)
- Bug 1246320 part 2 - Pass document to ParseEasing; r=hiro (269325c142)
- Bug 1246320 part 3 - Rework KeyframeEffect(ReadOnly) constructor helpers; r=hiro (e0c58fbe49)
- Bug 1246320 part 4 - Pass a document to TimingParams; r=hiro (f9ef7bc956)
- Bug 1246320 part 5 - Simplify KeyframeEffect(ReadOnly) Constructor overloads further; r=hiro (ec932de9a7)
- Bug 1254419 - Rename getPropertyState() to getProperties(); r=heycam, r=bz (4ab86c889d)
- Bug 1254419 - Fix zero-length segment handling; r=heycam (a638e5bbd7)
- Bug 1254419 - Fill in values sequence in getProperties(); r=heycam (c7c233f5ce)
- Bug 1254419 - Return animation property information from getProperties() even if the property is overridden; r=hiro (55537b4445)
- Bug 1254419 - Add values member to AnimationPropertyDetails; r=heycam, r=bz (3ea6c1fb7f)
- Bug 1254419 - Add tests for getProperties(); r=heycam (ff9999286d)
- Bug 1254419 - Make always-set members of AnimationProperty(Value)Details required; r=bz (07ef47d79a)
- Bug 1254419 - Throw if we fail to allocate memory for a values array in getProperties(); r=bz (51ae5d9f99)
- Bug 1003204: Removed CommonUtils.exceptionStr() in toolkit/ r=gfritzsche (d1c2efa08f)
- Bug 1243936 - Convert remaining callsites within devtools/ and toolkit/ to use channel.open2() (54f398eb47)
- Bug 1187270 - Add Telemetry session ID to crash annotations, r=gfritzsche (6c08170c5a)
- Bug 1249219 - Part 4: Use NonOwningAnimationTarget as the returned value of some animation target getters. r=birtles (df788abe39)
- Bug 1249219 - Part 5: Add a wrapper of AnimationAdded/Changed/Removed. r=birtles (58cf3a3ce2)
- Bug 1249219 - Part 6: Support pseudo elements in Animation Mutation Observer. r=heycam (d10c901821)
- Bug 1249219 - Part 7: Test. r=birtles (e2b78422be)
- Bug 1249219 - Part 8: Avoid adding animations on pseudo elements for Inspector temporary. r=pbro (2bff38bfe1)
- add back some utils of Bug 751291 used in tests (8fd2cc847f)
- Bug 1253470 - Part 1: Produce console warnings for invalid duration. r=birtles (a0491eeab4)
- Bug 1253470 - Part 2: Produce console warnings for invalid iterationStart. r=birtles (6a910650c9)
- Bug 1253470 - Part 3: Produce console warnings for invalid iterations. r=birtles (e3210e754e)
- Bug 1253470 - Part 4: Produce console warnings for invalid easing. r=birtles (fc1868b3c0)
- Bug 1245748 - Move ComputedTiming to a separate file; r=heycam (22a76e4f03)
- Bug 1245748 - Rename Keyframe-related IDL types to match changes to Web Animations spec; r=heycam, r=bz (e79338bafd)
- Bug 1245748 - Update handling of 'composite' dictionary members to match changes to the spec; r=heycam, r=bz (d9cc71cde8)
- Bug 1245748 - Define the Keyframe type for storing specified keyframes; r=heycam (a429e2bf46)
- Bug 1245748 - Add missing includes to TimingParams.{cpp,h}; r=heycam (3e1e121c6f)
- Bug 1245748 - Move keyframe handling code to a separate KeyframeUtils class; r=heycam (e359f26244)
- Bug 1245748 - Add KeyframeUtils::GetKeyframesFromObject; r=heycam (eda69445d7)
- Bug 1245748 - Add nsStyleContext parameter to StyleAnimationValue::ComputeValue(s); r=heycam (2c22b9926c)
- Bug 1245748 - Add a variant of StyleAnimationValue::ComputeValues that takes an nsCSSValue; r=heycam (12386559dd)
- Bug 1245748 - Split PropertyPriorityComparator into a separate (reusable) class; r=heycam (132394bf45)
- Bug 1245748 - Add PropertyPriorityIterator; r=heycam (bfef46fd12)
- Bug 1245748 - Add GetAnimationPropertiesFromKeyframes; r=heycam (4681ac8407)
- Bug 1245748 - Add ApplyDistributeSpacing for Keyframe objects; r=heycam (9c0bc885c9)
- Bug 1245748 - Use Keyframe-based utility functions when constructing KeyframeEffect(ReadOnly); r=heycam (e0b7460548)
- Bug 1229859 - Introduce new import-globals-from eslint rule to import globals from other modules; r=Mossop (10075a136c)
- Bug 1227477 - Polish the way the timeline time graduations are calculated; r=pbro (eb383aa4a0)
- Bug 1219611 - When animations end in the timeline, make sure the time-label shows the right time; r=pbro (518b574e74)
- Bug 1242898 - Clean devtools/client/animationinspector of eslint errors; r=me (df8451951b)
- Bug 1203398 - Increase the timeout of browser_animation_empty_on_invalid_nodes.js (c339d66030)
- Bug 1222937 - Show a dedicated error message for animated pseudo elements; r=pbro (b0858c955c)
- Bug 1231362 - Part 1: Upgrade existing addons to CodeMirror 5.9.0 r=bgrins (626a3129ee)
- Bug 1231362 - Part 2: Upgrade existing CodeMirror keymap to 5.9.0 r=bgrins (43f135e34b)
- Bug 1231362 - Part 3: Upgrade to CodeMirror 5.9.0 r=bgrins (e14212f0b1)
- Bug 1231362 - Part 4: Upgrade CodeMirror mode to 5.9.0 r=bgrins (049181c2b7)
- Bug 1231362 - Part 5: Upgrade existing CodeMirror tests to 5.9.0 r=bgrins (15ce59f2cc)
- Bug 1231362 - Part 6: Apply CodeMirror customization for search.js r=bgrins (a326658816)
- Bug 1231362 - Part 7: Update CodeMirror README for version 5.9.0 r=bgrins (13eca0cd85)
- Bug 1234374 - Part 1: Upgrade existing addons to CodeMirror 5.10.0 r=bgrins (0cf4d63559)
- Bug 1234374 - Part 2: Upgrade existing CodeMirror keymap to 5.10.0 r=grins (47bdb7b9b1)
- Bug 1234374 - Part 3: Upgrade to CodeMirror 5.10.0 r=bgrins (0c20797954)
- Bug 1234374 - Part 4: Upgrade CodeMirror mode to 5.10.0 r=bgrins (9678c17894)
- Bug 1234374 - Part 5: Upgrade existing CodeMirror tests to 5.10.0 r=bgrins (477daf4c8b)
- Bug 1234374 - Part 6: Update CodeMirror README for version 5.10.0 r=bgrins (dacf42a87b)
- Bug 1242309 - Upgrade to CodeMirror 5.11.0 r=bgrins (e99b62fdc7)
- Bug 762979 - Implement shorlander's line gutter mockup for the source editor. r=vporof, bgrins (a23de53dbe)
- Bug 762979 - Implement conditional breakpoint gutter style. r=jlongster (dbbfed7ef9)
- Bug 1245030 - simplify breakpoint colors in debugger to reduce visual clutter r=hholmes (643e596727)
- reshuffle modules a little (69d9409a23)
- Bug 1238537 - make nsBrowserContentHandler.js use Services.jsm, r=florian.dapted since we still have Preference Windows (136514e705)
- fix exception (ccbcb581e1)
- Bug 436564 - Add unit tests for distribution.js; r=mixedpuppy (aa3474f7ed)
- Bug 1249630 - Add language support to distribution.js; r=mixedpuppy (cfea768ef2)
- Bug 1249742 - Don't set prefs at all if overridden by lang or locale; r=mixedpuppy (3a94e1aff6)
- Bug 1251729 - Don't use eval for distribution.js; r=mixedpuppy (b2e199f68b)
- Bug 1252466 - Switch distribution.js to use Preferences.jsm; r=mixedpuppy (9ce63143ce)
- Bug 782924 - Allow locale specific preferences in distribution.ini; r=mixedpuppy (016c42ab53)
- Bug 1252627 - distribution defaultLocale shoudld take precedence over user agent locale; r=mixedpuppy (d154458567)
- Bug 1248829 - Fix number of characters reserved in memory table's cells; r=jsantell (052b7d7ca3)
- Bug 1242296 - mem. profiler: clear snapshots icon; r=ntim (2f7b316334)
- Bug 1224660 - New icon for snapshot diff view button. r=ntim (900c618352)
- Bug 1219584 - Test that we show the allocations recording hint at the correct times. r=jsantell (5af9ca4486)
- Bug 1149385 - Render retaining paths in the dominators view; r=jsantell (bd05c3a138)
- Bug 1171903 - Add endless scrolling to storage inspector to view more items. r=miker (7c9aed5f3a)
- Bug 1003860 - Various tweaks to the storage inspector. r=mratcliffe (9badb236c9)
- Bug 1171903 - Optimise storage inspector CSS and disable animations for tests. r=miker (4297543cf2)
- Bug 1248563 - eslint cleanup of storage inspector code r=pbrosset (0d9f0219c8)
- Bug 1224115 - Allow filtering the storage inspector table. r=mratcliffe (21be5a691e)
- Bug 1224115 - Properly refresh zebra stripes in the table. r=mratcliffe (6a52bd7de1)
- Bug 1253072 - Small bug fixes to the Storage Inspector functionality. r=miker (74e5bd52c6)
- Bug 1140839 - Scratchpad should remember View options. r=past (6da9c4d13f)
- Bug 1253125 - Stop duplicating telemetry from inside tools. r=mratcliffe (736ab1872f)
- Bug 1250833 - Stop using browser.xul globals specific to devtools. r=jryans (956939f560)
- Bug 1167478 - Menu items "Larger Font" and "Smaller Font" should be disabled if the current font size is equals to MAXIMUM_FONT_SIZE or MINIMUM_FONT_SIZE constants. r=past (ececdb4ac1)
- cleanup (447f001158)
- Bug 1246273 - Add localized strings for types and attempts in the JIT opts view. r=vp (a9875992a5)
983 lines
30 KiB
JavaScript
983 lines
30 KiB
JavaScript
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
|
/* vim: set ft=javascript 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/. */
|
|
"use strict";
|
|
|
|
const SOURCE_SYNTAX_HIGHLIGHT_MAX_FILE_SIZE = 1048576; // 1 MB in bytes
|
|
const SOURCE_URL_DEFAULT_MAX_LENGTH = 64; // chars
|
|
const STACK_FRAMES_SOURCE_URL_MAX_LENGTH = 15; // chars
|
|
const STACK_FRAMES_SOURCE_URL_TRIM_SECTION = "center";
|
|
const STACK_FRAMES_SCROLL_DELAY = 100; // ms
|
|
const BREAKPOINT_SMALL_WINDOW_WIDTH = 850; // px
|
|
const RESULTS_PANEL_POPUP_POSITION = "before_end";
|
|
const RESULTS_PANEL_MAX_RESULTS = 10;
|
|
const FILE_SEARCH_ACTION_MAX_DELAY = 300; // ms
|
|
const GLOBAL_SEARCH_EXPAND_MAX_RESULTS = 50;
|
|
const GLOBAL_SEARCH_LINE_MAX_LENGTH = 300; // chars
|
|
const GLOBAL_SEARCH_ACTION_MAX_DELAY = 1500; // ms
|
|
const FUNCTION_SEARCH_ACTION_MAX_DELAY = 400; // ms
|
|
const SEARCH_GLOBAL_FLAG = "!";
|
|
const SEARCH_FUNCTION_FLAG = "@";
|
|
const SEARCH_TOKEN_FLAG = "#";
|
|
const SEARCH_LINE_FLAG = ":";
|
|
const SEARCH_VARIABLE_FLAG = "*";
|
|
const SEARCH_AUTOFILL = [SEARCH_GLOBAL_FLAG, SEARCH_FUNCTION_FLAG, SEARCH_TOKEN_FLAG];
|
|
const EDITOR_VARIABLE_HOVER_DELAY = 750; // ms
|
|
const EDITOR_VARIABLE_POPUP_POSITION = "topcenter bottomleft";
|
|
const TOOLBAR_ORDER_POPUP_POSITION = "topcenter bottomleft";
|
|
const RESIZE_REFRESH_RATE = 50; // ms
|
|
const PROMISE_DEBUGGER_URL =
|
|
"chrome://devtools/content/promisedebugger/promise-debugger.xhtml";
|
|
|
|
const EventListenersView = require('./content/views/event-listeners-view');
|
|
const SourcesView = require('./content/views/sources-view');
|
|
var actions = Object.assign(
|
|
{},
|
|
require('./content/globalActions'),
|
|
require('./content/actions/breakpoints'),
|
|
require('./content/actions/sources'),
|
|
require('./content/actions/event-listeners')
|
|
);
|
|
var queries = require('./content/queries');
|
|
var constants = require('./content/constants');
|
|
|
|
/**
|
|
* Object defining the debugger view components.
|
|
*/
|
|
var DebuggerView = {
|
|
/**
|
|
* Initializes the debugger view.
|
|
*
|
|
* @return object
|
|
* A promise that is resolved when the view finishes initializing.
|
|
*/
|
|
initialize: function() {
|
|
if (this._startup) {
|
|
return this._startup;
|
|
}
|
|
const deferred = promise.defer();
|
|
this._startup = deferred.promise;
|
|
|
|
this._initializePanes();
|
|
this.Toolbar.initialize();
|
|
this.Options.initialize();
|
|
this.Filtering.initialize();
|
|
this.StackFrames.initialize();
|
|
this.StackFramesClassicList.initialize();
|
|
this.Workers.initialize();
|
|
this.Sources.initialize();
|
|
this.VariableBubble.initialize();
|
|
this.WatchExpressions.initialize();
|
|
this.EventListeners.initialize();
|
|
this.GlobalSearch.initialize();
|
|
this._initializeVariablesView();
|
|
|
|
this._initializeEditor(deferred.resolve);
|
|
this._editorSource = {};
|
|
|
|
document.title = L10N.getStr("DebuggerWindowTitle");
|
|
|
|
this.editor.on("cursorActivity", this.Sources._onEditorCursorActivity);
|
|
|
|
this.controller = DebuggerController;
|
|
const getState = this.controller.getState;
|
|
|
|
onReducerEvents(this.controller, {
|
|
"source-text-loaded": this.renderSourceText,
|
|
"source-selected": this.renderSourceText,
|
|
"blackboxed": this.renderBlackBoxed,
|
|
"prettyprinted": this.renderPrettyPrinted,
|
|
"breakpoint-added": this.addEditorBreakpoint,
|
|
"breakpoint-enabled": this.addEditorBreakpoint,
|
|
"breakpoint-disabled": this.removeEditorBreakpoint,
|
|
"breakpoint-removed": this.removeEditorBreakpoint,
|
|
"breakpoint-condition-updated": this.renderEditorBreakpointCondition,
|
|
"breakpoint-moved": ({ breakpoint, prevLocation }) => {
|
|
const selectedSource = queries.getSelectedSource(getState());
|
|
const { location } = breakpoint;
|
|
|
|
if (selectedSource &&
|
|
selectedSource.actor === location.actor) {
|
|
this.editor.moveBreakpoint(prevLocation.line - 1,
|
|
location.line - 1);
|
|
}
|
|
}
|
|
}, this);
|
|
|
|
return deferred.promise;
|
|
},
|
|
|
|
/**
|
|
* Destroys the debugger view.
|
|
*
|
|
* @return object
|
|
* A promise that is resolved when the view finishes destroying.
|
|
*/
|
|
destroy: function() {
|
|
if (this._hasShutdown) {
|
|
return;
|
|
}
|
|
this._hasShutdown = true;
|
|
|
|
window.removeEventListener("resize", this._onResize, false);
|
|
this.editor.off("cursorActivity", this.Sources._onEditorCursorActivity);
|
|
|
|
this.Toolbar.destroy();
|
|
this.Options.destroy();
|
|
this.Filtering.destroy();
|
|
this.StackFrames.destroy();
|
|
this.StackFramesClassicList.destroy();
|
|
this.Sources.destroy();
|
|
this.VariableBubble.destroy();
|
|
this.WatchExpressions.destroy();
|
|
this.EventListeners.destroy();
|
|
this.GlobalSearch.destroy();
|
|
this._destroyPromiseDebugger();
|
|
this._destroyPanes();
|
|
|
|
this.editor.destroy();
|
|
this.editor = null;
|
|
|
|
this.controller.dispatch(actions.removeAllBreakpoints());
|
|
},
|
|
|
|
/**
|
|
* Initializes the UI for all the displayed panes.
|
|
*/
|
|
_initializePanes: function() {
|
|
dumpn("Initializing the DebuggerView panes");
|
|
|
|
this._body = document.getElementById("body");
|
|
this._editorDeck = document.getElementById("editor-deck");
|
|
this._workersAndSourcesPane = document.getElementById("workers-and-sources-pane");
|
|
this._instrumentsPane = document.getElementById("instruments-pane");
|
|
this._instrumentsPaneToggleButton = document.getElementById("instruments-pane-toggle");
|
|
this._promisePane = document.getElementById("promise-debugger-pane");
|
|
|
|
this.showEditor = this.showEditor.bind(this);
|
|
this.showBlackBoxMessage = this.showBlackBoxMessage.bind(this);
|
|
this.showProgressBar = this.showProgressBar.bind(this);
|
|
|
|
this._onTabSelect = this._onInstrumentsPaneTabSelect.bind(this);
|
|
this._instrumentsPane.tabpanels.addEventListener("select", this._onTabSelect);
|
|
|
|
this._collapsePaneString = L10N.getStr("collapsePanes");
|
|
this._expandPaneString = L10N.getStr("expandPanes");
|
|
|
|
this._workersAndSourcesPane.setAttribute("width", Prefs.workersAndSourcesWidth);
|
|
this._instrumentsPane.setAttribute("width", Prefs.instrumentsWidth);
|
|
this.toggleInstrumentsPane({ visible: Prefs.panesVisibleOnStartup });
|
|
|
|
this.updateLayoutMode();
|
|
|
|
this._onResize = this._onResize.bind(this);
|
|
window.addEventListener("resize", this._onResize, false);
|
|
},
|
|
|
|
/**
|
|
* Destroys the UI for all the displayed panes.
|
|
*/
|
|
_destroyPanes: function() {
|
|
dumpn("Destroying the DebuggerView panes");
|
|
|
|
if (gHostType != "side") {
|
|
Prefs.workersAndSourcesWidth = this._workersAndSourcesPane.getAttribute("width");
|
|
Prefs.instrumentsWidth = this._instrumentsPane.getAttribute("width");
|
|
}
|
|
|
|
this._workersAndSourcesPane = null;
|
|
this._instrumentsPane = null;
|
|
this._instrumentsPaneToggleButton = null;
|
|
this._promisePane = null;
|
|
},
|
|
|
|
/**
|
|
* Initializes the VariablesView instance and attaches a controller.
|
|
*/
|
|
_initializeVariablesView: function() {
|
|
this.Variables = new VariablesView(document.getElementById("variables"), {
|
|
searchPlaceholder: L10N.getStr("emptyVariablesFilterText"),
|
|
emptyText: L10N.getStr("emptyVariablesText"),
|
|
onlyEnumVisible: Prefs.variablesOnlyEnumVisible,
|
|
searchEnabled: Prefs.variablesSearchboxVisible,
|
|
eval: (variable, value) => {
|
|
let string = variable.evaluationMacro(variable, value);
|
|
DebuggerController.StackFrames.evaluate(string);
|
|
},
|
|
lazyEmpty: true
|
|
});
|
|
|
|
// Attach the current toolbox to the VView so it can link DOMNodes to
|
|
// the inspector/highlighter
|
|
this.Variables.toolbox = DebuggerController._toolbox;
|
|
|
|
// Attach a controller that handles interfacing with the debugger protocol.
|
|
VariablesViewController.attach(this.Variables, {
|
|
getEnvironmentClient: aObject => gThreadClient.environment(aObject),
|
|
getObjectClient: aObject => {
|
|
return gThreadClient.pauseGrip(aObject)
|
|
}
|
|
});
|
|
|
|
// Relay events from the VariablesView.
|
|
this.Variables.on("fetched", (aEvent, aType) => {
|
|
switch (aType) {
|
|
case "scopes":
|
|
window.emit(EVENTS.FETCHED_SCOPES);
|
|
break;
|
|
case "variables":
|
|
window.emit(EVENTS.FETCHED_VARIABLES);
|
|
break;
|
|
case "properties":
|
|
window.emit(EVENTS.FETCHED_PROPERTIES);
|
|
break;
|
|
}
|
|
});
|
|
},
|
|
|
|
/**
|
|
* Initialie the Promise Debugger instance.
|
|
*/
|
|
_initializePromiseDebugger: function() {
|
|
let iframe = this._promiseDebuggerIframe = document.createElement("iframe");
|
|
iframe.setAttribute("flex", 1);
|
|
|
|
let onLoad = (event) => {
|
|
iframe.removeEventListener("load", onLoad, true);
|
|
|
|
let doc = event.target;
|
|
let win = doc.defaultView;
|
|
|
|
win.setPanel(DebuggerController._toolbox);
|
|
};
|
|
|
|
iframe.addEventListener("load", onLoad, true);
|
|
iframe.setAttribute("src", PROMISE_DEBUGGER_URL);
|
|
this._promisePane.appendChild(iframe);
|
|
},
|
|
|
|
/**
|
|
* Destroy the Promise Debugger instance.
|
|
*/
|
|
_destroyPromiseDebugger: function() {
|
|
if (this._promiseDebuggerIframe) {
|
|
this._promiseDebuggerIframe.contentWindow.destroy();
|
|
|
|
this._promiseDebuggerIframe.parentNode.removeChild(
|
|
this._promiseDebuggerIframe);
|
|
|
|
this._promiseDebuggerIframe = null;
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Initializes the Editor instance.
|
|
*
|
|
* @param function aCallback
|
|
* Called after the editor finishes initializing.
|
|
*/
|
|
_initializeEditor: function(callback) {
|
|
dumpn("Initializing the DebuggerView editor");
|
|
|
|
let extraKeys = {};
|
|
bindKey("_doTokenSearch", "tokenSearchKey");
|
|
bindKey("_doGlobalSearch", "globalSearchKey", { alt: true });
|
|
bindKey("_doFunctionSearch", "functionSearchKey");
|
|
extraKeys[Editor.keyFor("jumpToLine")] = false;
|
|
extraKeys["Esc"] = false;
|
|
|
|
function bindKey(func, key, modifiers = {}) {
|
|
key = document.getElementById(key).getAttribute("key");
|
|
let shortcut = Editor.accel(key, modifiers);
|
|
extraKeys[shortcut] = () => DebuggerView.Filtering[func]();
|
|
}
|
|
|
|
let gutters = ["breakpoints"];
|
|
|
|
this.editor = new Editor({
|
|
mode: Editor.modes.text,
|
|
readOnly: true,
|
|
lineNumbers: true,
|
|
showAnnotationRuler: true,
|
|
gutters: gutters,
|
|
extraKeys: extraKeys,
|
|
contextMenu: "sourceEditorContextMenu",
|
|
enableCodeFolding: false
|
|
});
|
|
|
|
this.editor.appendTo(document.getElementById("editor")).then(() => {
|
|
this.editor.extend(DebuggerEditor);
|
|
this._loadingText = L10N.getStr("loadingText");
|
|
callback();
|
|
});
|
|
|
|
this.editor.on("gutterClick", (ev, line, button) => {
|
|
// A right-click shouldn't do anything but keep track of where
|
|
// it was clicked.
|
|
if (button == 2) {
|
|
this.clickedLine = line;
|
|
}
|
|
else {
|
|
const source = queries.getSelectedSource(this.controller.getState());
|
|
if (source) {
|
|
const location = { actor: source.actor, line: line + 1 };
|
|
if (this.editor.hasBreakpoint(line)) {
|
|
this.controller.dispatch(actions.removeBreakpoint(location));
|
|
} else {
|
|
this.controller.dispatch(actions.addBreakpoint(location));
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
this.editor.on("cursorActivity", () => {
|
|
this.clickedLine = null;
|
|
});
|
|
},
|
|
|
|
updateEditorBreakpoints: function(source) {
|
|
const breakpoints = queries.getBreakpoints(this.controller.getState());
|
|
const sources = queries.getSources(this.controller.getState());
|
|
|
|
for (let bp of breakpoints) {
|
|
if (sources[bp.location.actor] && !bp.disabled) {
|
|
this.addEditorBreakpoint(bp);
|
|
}
|
|
else {
|
|
this.removeEditorBreakpoint(bp);
|
|
}
|
|
}
|
|
},
|
|
|
|
addEditorBreakpoint: function(breakpoint) {
|
|
const { location, condition } = breakpoint;
|
|
const source = queries.getSelectedSource(this.controller.getState());
|
|
|
|
if (source &&
|
|
source.actor === location.actor &&
|
|
!breakpoint.disabled) {
|
|
this.editor.addBreakpoint(location.line - 1, condition);
|
|
}
|
|
},
|
|
|
|
removeEditorBreakpoint: function (breakpoint) {
|
|
const { location } = breakpoint;
|
|
const source = queries.getSelectedSource(this.controller.getState());
|
|
|
|
if (source && source.actor === location.actor) {
|
|
this.editor.removeBreakpoint(location.line - 1);
|
|
}
|
|
},
|
|
|
|
renderEditorBreakpointCondition: function (breakpoint) {
|
|
const { location, condition } = breakpoint;
|
|
const source = queries.getSelectedSource(this.controller.getState());
|
|
|
|
if (source && source.actor === location.actor) {
|
|
if (condition) {
|
|
this.editor.setBreakpointCondition(location.line - 1);
|
|
} else {
|
|
this.editor.removeBreakpointCondition(location.line - 1);
|
|
}
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Display the source editor.
|
|
*/
|
|
showEditor: function() {
|
|
this._editorDeck.selectedIndex = 0;
|
|
},
|
|
|
|
/**
|
|
* Display the black box message.
|
|
*/
|
|
showBlackBoxMessage: function() {
|
|
this._editorDeck.selectedIndex = 1;
|
|
},
|
|
|
|
/**
|
|
* Display the progress bar.
|
|
*/
|
|
showProgressBar: function() {
|
|
this._editorDeck.selectedIndex = 2;
|
|
},
|
|
|
|
/**
|
|
* Sets the currently displayed text contents in the source editor.
|
|
* This resets the mode and undo stack.
|
|
*
|
|
* @param string aTextContent
|
|
* The source text content.
|
|
*/
|
|
_setEditorText: function(aTextContent = "") {
|
|
this.editor.setMode(Editor.modes.text);
|
|
this.editor.setText(aTextContent);
|
|
this.editor.clearDebugLocation();
|
|
this.editor.clearHistory();
|
|
},
|
|
|
|
/**
|
|
* Sets the proper editor mode (JS or HTML) according to the specified
|
|
* content type, or by determining the type from the url or text content.
|
|
*
|
|
* @param string aUrl
|
|
* The source url.
|
|
* @param string aContentType [optional]
|
|
* The source content type.
|
|
* @param string aTextContent [optional]
|
|
* The source text content.
|
|
*/
|
|
_setEditorMode: function(aUrl, aContentType = "", aTextContent = "") {
|
|
// Avoid setting the editor mode for very large files.
|
|
// Is this still necessary? See bug 929225.
|
|
if (aTextContent.length >= SOURCE_SYNTAX_HIGHLIGHT_MAX_FILE_SIZE) {
|
|
return void this.editor.setMode(Editor.modes.text);
|
|
}
|
|
|
|
// Use JS mode for files with .js and .jsm extensions.
|
|
if (SourceUtils.isJavaScript(aUrl, aContentType)) {
|
|
return void this.editor.setMode(Editor.modes.js);
|
|
}
|
|
|
|
// Use HTML mode for files in which the first non whitespace character is
|
|
// <, regardless of extension.
|
|
if (aTextContent.match(/^\s*</)) {
|
|
return void this.editor.setMode(Editor.modes.html);
|
|
}
|
|
|
|
// Unknown language, use text.
|
|
this.editor.setMode(Editor.modes.text);
|
|
},
|
|
|
|
renderBlackBoxed: function(source) {
|
|
this._renderSourceText(
|
|
source,
|
|
queries.getSourceText(this.controller.getState(), source.actor)
|
|
);
|
|
},
|
|
|
|
renderPrettyPrinted: function(source) {
|
|
this._renderSourceText(
|
|
source,
|
|
queries.getSourceText(this.controller.getState(), source.actor)
|
|
);
|
|
},
|
|
|
|
renderSourceText: function(source) {
|
|
this._renderSourceText(
|
|
source,
|
|
queries.getSourceText(this.controller.getState(), source.actor),
|
|
queries.getSelectedSourceOpts(this.controller.getState())
|
|
);
|
|
},
|
|
|
|
_renderSourceText: function(source, textInfo, opts = {}) {
|
|
const selectedSource = queries.getSelectedSource(this.controller.getState());
|
|
|
|
if (!selectedSource || selectedSource.actor !== source.actor) {
|
|
return;
|
|
}
|
|
|
|
if (source.isBlackBoxed) {
|
|
this.showBlackBoxMessage();
|
|
setTimeout(() => {
|
|
window.emit(EVENTS.SOURCE_SHOWN, source);
|
|
}, 0);
|
|
return;
|
|
}
|
|
else {
|
|
this.showEditor();
|
|
}
|
|
|
|
if (textInfo.loading) {
|
|
// TODO: bug 1228866, we need to update `_editorSource` here but
|
|
// still make the editor be updated when the full text comes
|
|
// through somehow.
|
|
this._setEditorText(L10N.getStr("loadingText"));
|
|
return;
|
|
}
|
|
else if (textInfo.error) {
|
|
let url = textInfo.error;
|
|
let msg = L10N.getFormatStr("errorLoadingText2", url);
|
|
this._setEditorText(msg);
|
|
Cu.reportError(msg);
|
|
dumpn(msg);
|
|
|
|
this.showEditor();
|
|
window.emit(EVENTS.SOURCE_ERROR_SHOWN, source);
|
|
return;
|
|
}
|
|
|
|
// If the line is not specified, default to the current frame's position,
|
|
// if available and the frame's url corresponds to the requested url.
|
|
if (!('line' in opts)) {
|
|
let cachedFrames = DebuggerController.activeThread.cachedFrames;
|
|
let currentDepth = DebuggerController.StackFrames.currentFrameDepth;
|
|
let frame = cachedFrames[currentDepth];
|
|
if (frame && frame.source.actor == source.actor) {
|
|
opts.line = frame.where.line;
|
|
}
|
|
}
|
|
|
|
if (this._editorSource.actor === source.actor &&
|
|
this._editorSource.prettyPrinted === source.isPrettyPrinted &&
|
|
this._editorSource.blackboxed === source.isBlackBoxed) {
|
|
this.updateEditorPosition(opts);
|
|
return;
|
|
}
|
|
|
|
this._editorSource.actor = source.actor;
|
|
this._editorSource.prettyPrinted = source.isPrettyPrinted;
|
|
this._editorSource.blackboxed = source.isBlackBoxed;
|
|
|
|
let { text, contentType } = textInfo;
|
|
this._setEditorText(text);
|
|
this._setEditorMode(source.url, contentType, text);
|
|
this.updateEditorBreakpoints(source);
|
|
setTimeout(() => {
|
|
window.emit(EVENTS.SOURCE_SHOWN, source);
|
|
}, 0);
|
|
|
|
this.updateEditorPosition(opts);
|
|
},
|
|
|
|
updateEditorPosition: function(opts) {
|
|
let line = opts.line || 0;
|
|
|
|
// Line numbers in the source editor should start from 1. If
|
|
// invalid or not specified, then don't do anything.
|
|
if (line < 1) {
|
|
window.emit(EVENTS.EDITOR_LOCATION_SET);
|
|
return;
|
|
}
|
|
|
|
if (opts.charOffset) {
|
|
line += this.editor.getPosition(opts.charOffset).line;
|
|
}
|
|
if (opts.lineOffset) {
|
|
line += opts.lineOffset;
|
|
}
|
|
if (opts.moveCursor) {
|
|
let location = { line: line - 1, ch: opts.columnOffset || 0 };
|
|
this.editor.setCursor(location);
|
|
}
|
|
if (!opts.noDebug) {
|
|
this.editor.setDebugLocation(line - 1);
|
|
}
|
|
window.emit(EVENTS.EDITOR_LOCATION_SET);
|
|
},
|
|
|
|
/**
|
|
* Update the source editor's current caret and debug location based on
|
|
* a requested url and line.
|
|
*
|
|
* @param string aActor
|
|
* The target actor id.
|
|
* @param number aLine [optional]
|
|
* The target line in the source.
|
|
* @param object aFlags [optional]
|
|
* Additional options for showing the source. Supported options:
|
|
* - charOffset: character offset for the caret or debug location
|
|
* - lineOffset: line offset for the caret or debug location
|
|
* - columnOffset: column offset for the caret or debug location
|
|
* - noCaret: don't set the caret location at the specified line
|
|
* - noDebug: don't set the debug location at the specified line
|
|
* - align: string specifying whether to align the specified line
|
|
* at the "top", "center" or "bottom" of the editor
|
|
* - force: boolean forcing all text to be reshown in the editor
|
|
* @return object
|
|
* A promise that is resolved after the source text has been set.
|
|
*/
|
|
setEditorLocation: function(aActor, aLine, aFlags = {}) {
|
|
// Avoid trying to set a source for a url that isn't known yet.
|
|
if (!this.Sources.containsValue(aActor)) {
|
|
throw new Error("Unknown source for the specified URL.");
|
|
}
|
|
|
|
let sourceItem = this.Sources.getItemByValue(aActor);
|
|
let source = sourceItem.attachment.source;
|
|
|
|
// Make sure the requested source client is shown in the editor,
|
|
// then update the source editor's caret position and debug
|
|
// location.
|
|
this.controller.dispatch(actions.selectSource(source, {
|
|
line: aLine,
|
|
charOffset: aFlags.charOffset,
|
|
lineOffset: aFlags.lineOffset,
|
|
columnOffset: aFlags.columnOffset,
|
|
moveCursor: !aFlags.noCaret,
|
|
noDebug: aFlags.noDebug,
|
|
forceUpdate: aFlags.force
|
|
}));
|
|
},
|
|
|
|
/**
|
|
* Gets the visibility state of the instruments pane.
|
|
* @return boolean
|
|
*/
|
|
get instrumentsPaneHidden() {
|
|
return this._instrumentsPane.hasAttribute("pane-collapsed");
|
|
},
|
|
|
|
/**
|
|
* Gets the currently selected tab in the instruments pane.
|
|
* @return string
|
|
*/
|
|
get instrumentsPaneTab() {
|
|
return this._instrumentsPane.selectedTab.id;
|
|
},
|
|
|
|
/**
|
|
* Sets the instruments pane hidden or visible.
|
|
*
|
|
* @param object aFlags
|
|
* An object containing some of the following properties:
|
|
* - visible: true if the pane should be shown, false to hide
|
|
* - animated: true to display an animation on toggle
|
|
* - delayed: true to wait a few cycles before toggle
|
|
* - callback: a function to invoke when the toggle finishes
|
|
* @param number aTabIndex [optional]
|
|
* The index of the intended selected tab in the details pane.
|
|
*/
|
|
toggleInstrumentsPane: function(aFlags, aTabIndex) {
|
|
let pane = this._instrumentsPane;
|
|
let button = this._instrumentsPaneToggleButton;
|
|
|
|
ViewHelpers.togglePane(aFlags, pane);
|
|
|
|
if (aFlags.visible) {
|
|
button.removeAttribute("pane-collapsed");
|
|
button.setAttribute("tooltiptext", this._collapsePaneString);
|
|
} else {
|
|
button.setAttribute("pane-collapsed", "");
|
|
button.setAttribute("tooltiptext", this._expandPaneString);
|
|
}
|
|
|
|
if (aTabIndex !== undefined) {
|
|
pane.selectedIndex = aTabIndex;
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Sets the instruments pane visible after a short period of time.
|
|
*
|
|
* @param function aCallback
|
|
* A function to invoke when the toggle finishes.
|
|
*/
|
|
showInstrumentsPane: function(aCallback) {
|
|
DebuggerView.toggleInstrumentsPane({
|
|
visible: true,
|
|
animated: true,
|
|
delayed: true,
|
|
callback: aCallback
|
|
}, 0);
|
|
},
|
|
|
|
/**
|
|
* Handles a tab selection event on the instruments pane.
|
|
*/
|
|
_onInstrumentsPaneTabSelect: function() {
|
|
if (this._instrumentsPane.selectedTab.id == "events-tab") {
|
|
this.controller.dispatch(actions.fetchEventListeners());
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Handles a host change event issued by the parent toolbox.
|
|
*
|
|
* @param string aType
|
|
* The host type, either "bottom", "side" or "window".
|
|
*/
|
|
handleHostChanged: function(hostType) {
|
|
this._hostType = hostType;
|
|
this.updateLayoutMode();
|
|
},
|
|
|
|
/**
|
|
* Resize handler for this container's window.
|
|
*/
|
|
_onResize: function (evt) {
|
|
// Allow requests to settle down first.
|
|
setNamedTimeout(
|
|
"resize-events", RESIZE_REFRESH_RATE, () => this.updateLayoutMode());
|
|
},
|
|
|
|
/**
|
|
* Set the layout to "vertical" or "horizontal" depending on the host type.
|
|
*/
|
|
updateLayoutMode: function() {
|
|
if (this._isSmallWindowHost() || this._hostType == "side") {
|
|
this._setLayoutMode("vertical");
|
|
} else {
|
|
this._setLayoutMode("horizontal");
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Check if the current host is in window mode and is
|
|
* too small for horizontal layout
|
|
*/
|
|
_isSmallWindowHost: function() {
|
|
if (this._hostType != "window") {
|
|
return false;
|
|
}
|
|
|
|
return window.outerWidth <= BREAKPOINT_SMALL_WINDOW_WIDTH;
|
|
},
|
|
|
|
/**
|
|
* Enter the provided layoutMode. Do nothing if the layout is the same as the current one.
|
|
* @param {String} layoutMode new layout ("vertical" or "horizontal")
|
|
*/
|
|
_setLayoutMode: function(layoutMode) {
|
|
if (this._body.getAttribute("layout") == layoutMode) {
|
|
return;
|
|
}
|
|
|
|
if (layoutMode == "vertical") {
|
|
this._enterVerticalLayout();
|
|
} else {
|
|
this._enterHorizontalLayout();
|
|
}
|
|
|
|
this._body.setAttribute("layout", layoutMode);
|
|
window.emit(EVENTS.LAYOUT_CHANGED, layoutMode);
|
|
},
|
|
|
|
/**
|
|
* Switches the debugger widgets to a vertical layout.
|
|
*/
|
|
_enterVerticalLayout: function() {
|
|
let vertContainer = document.getElementById("vertical-layout-panes-container");
|
|
|
|
// Move the soruces and instruments panes in a different container.
|
|
let splitter = document.getElementById("sources-and-instruments-splitter");
|
|
vertContainer.insertBefore(this._workersAndSourcesPane, splitter);
|
|
vertContainer.appendChild(this._instrumentsPane);
|
|
|
|
// Make sure the vertical layout container's height doesn't repeatedly
|
|
// grow or shrink based on the displayed sources, variables etc.
|
|
vertContainer.setAttribute("height",
|
|
vertContainer.getBoundingClientRect().height);
|
|
},
|
|
|
|
/**
|
|
* Switches the debugger widgets to a horizontal layout.
|
|
*/
|
|
_enterHorizontalLayout: function() {
|
|
let normContainer = document.getElementById("debugger-widgets");
|
|
let editorPane = document.getElementById("editor-and-instruments-pane");
|
|
|
|
// The sources and instruments pane need to be inserted at their
|
|
// previous locations in their normal container.
|
|
let splitter = document.getElementById("sources-and-editor-splitter");
|
|
normContainer.insertBefore(this._workersAndSourcesPane, splitter);
|
|
editorPane.appendChild(this._instrumentsPane);
|
|
|
|
// Revert to the preferred sources and instruments widths, because
|
|
// they flexed in the vertical layout.
|
|
this._workersAndSourcesPane.setAttribute("width", Prefs.workersAndSourcesWidth);
|
|
this._instrumentsPane.setAttribute("width", Prefs.instrumentsWidth);
|
|
},
|
|
|
|
/**
|
|
* Handles any initialization on a tab navigation event issued by the client.
|
|
*/
|
|
handleTabNavigation: function() {
|
|
dumpn("Handling tab navigation in the DebuggerView");
|
|
|
|
this.Filtering.clearSearch();
|
|
this.GlobalSearch.clearView();
|
|
this.StackFrames.empty();
|
|
this.Sources.empty();
|
|
this.Variables.empty();
|
|
this.EventListeners.empty();
|
|
|
|
if (this.editor) {
|
|
this.editor.setMode(Editor.modes.text);
|
|
this.editor.setText("");
|
|
this.editor.clearHistory();
|
|
this._editorSource = {};
|
|
}
|
|
},
|
|
|
|
Toolbar: null,
|
|
Options: null,
|
|
Filtering: null,
|
|
GlobalSearch: null,
|
|
StackFrames: null,
|
|
Sources: null,
|
|
Variables: null,
|
|
VariableBubble: null,
|
|
WatchExpressions: null,
|
|
EventListeners: null,
|
|
editor: null,
|
|
_loadingText: "",
|
|
_body: null,
|
|
_editorDeck: null,
|
|
_workersAndSourcesPane: null,
|
|
_instrumentsPane: null,
|
|
_instrumentsPaneToggleButton: null,
|
|
_collapsePaneString: "",
|
|
_expandPaneString: ""
|
|
};
|
|
|
|
/**
|
|
* A custom items container, used for displaying views like the
|
|
* FilteredSources, FilteredFunctions etc., inheriting the generic WidgetMethods.
|
|
*/
|
|
function ResultsPanelContainer() {
|
|
}
|
|
|
|
ResultsPanelContainer.prototype = Heritage.extend(WidgetMethods, {
|
|
/**
|
|
* Sets the anchor node for this container panel.
|
|
* @param nsIDOMNode aNode
|
|
*/
|
|
set anchor(aNode) {
|
|
this._anchor = aNode;
|
|
|
|
// If the anchor node is not null, create a panel to attach to the anchor
|
|
// when showing the popup.
|
|
if (aNode) {
|
|
if (!this._panel) {
|
|
this._panel = document.createElement("panel");
|
|
this._panel.id = "results-panel";
|
|
this._panel.setAttribute("level", "top");
|
|
this._panel.setAttribute("noautofocus", "true");
|
|
this._panel.setAttribute("consumeoutsideclicks", "false");
|
|
document.documentElement.appendChild(this._panel);
|
|
}
|
|
if (!this.widget) {
|
|
this.widget = new SimpleListWidget(this._panel);
|
|
this.autoFocusOnFirstItem = false;
|
|
this.autoFocusOnSelection = false;
|
|
this.maintainSelectionVisible = false;
|
|
}
|
|
}
|
|
// Cleanup the anchor and remove the previously created panel.
|
|
else {
|
|
this._panel.remove();
|
|
this._panel = null;
|
|
this.widget = null;
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Gets the anchor node for this container panel.
|
|
* @return nsIDOMNode
|
|
*/
|
|
get anchor() {
|
|
return this._anchor;
|
|
},
|
|
|
|
/**
|
|
* Sets the container panel hidden or visible. It's hidden by default.
|
|
* @param boolean aFlag
|
|
*/
|
|
set hidden(aFlag) {
|
|
if (aFlag) {
|
|
this._panel.hidden = true;
|
|
this._panel.hidePopup();
|
|
} else {
|
|
this._panel.hidden = false;
|
|
this._panel.openPopup(this._anchor, this.position, this.left, this.top);
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Gets this container's visibility state.
|
|
* @return boolean
|
|
*/
|
|
get hidden() {
|
|
return this._panel.state == "closed" ||
|
|
this._panel.state == "hiding";
|
|
},
|
|
|
|
/**
|
|
* Removes all items from this container and hides it.
|
|
*/
|
|
clearView: function() {
|
|
this.hidden = true;
|
|
this.empty();
|
|
},
|
|
|
|
/**
|
|
* Selects the next found item in this container.
|
|
* Does not change the currently focused node.
|
|
*/
|
|
selectNext: function() {
|
|
let nextIndex = this.selectedIndex + 1;
|
|
if (nextIndex >= this.itemCount) {
|
|
nextIndex = 0;
|
|
}
|
|
this.selectedItem = this.getItemAtIndex(nextIndex);
|
|
},
|
|
|
|
/**
|
|
* Selects the previously found item in this container.
|
|
* Does not change the currently focused node.
|
|
*/
|
|
selectPrev: function() {
|
|
let prevIndex = this.selectedIndex - 1;
|
|
if (prevIndex < 0) {
|
|
prevIndex = this.itemCount - 1;
|
|
}
|
|
this.selectedItem = this.getItemAtIndex(prevIndex);
|
|
},
|
|
|
|
/**
|
|
* Customization function for creating an item's UI.
|
|
*
|
|
* @param string aLabel
|
|
* The item's label string.
|
|
* @param string aBeforeLabel
|
|
* An optional string shown before the label.
|
|
* @param string aBelowLabel
|
|
* An optional string shown underneath the label.
|
|
*/
|
|
_createItemView: function(aLabel, aBelowLabel, aBeforeLabel) {
|
|
let container = document.createElement("vbox");
|
|
container.className = "results-panel-item";
|
|
|
|
let firstRowLabels = document.createElement("hbox");
|
|
let secondRowLabels = document.createElement("hbox");
|
|
|
|
if (aBeforeLabel) {
|
|
let beforeLabelNode = document.createElement("label");
|
|
beforeLabelNode.className = "plain results-panel-item-label-before";
|
|
beforeLabelNode.setAttribute("value", aBeforeLabel);
|
|
firstRowLabels.appendChild(beforeLabelNode);
|
|
}
|
|
|
|
let labelNode = document.createElement("label");
|
|
labelNode.className = "plain results-panel-item-label";
|
|
labelNode.setAttribute("value", aLabel);
|
|
firstRowLabels.appendChild(labelNode);
|
|
|
|
if (aBelowLabel) {
|
|
let belowLabelNode = document.createElement("label");
|
|
belowLabelNode.className = "plain results-panel-item-label-below";
|
|
belowLabelNode.setAttribute("value", aBelowLabel);
|
|
secondRowLabels.appendChild(belowLabelNode);
|
|
}
|
|
|
|
container.appendChild(firstRowLabels);
|
|
container.appendChild(secondRowLabels);
|
|
|
|
return container;
|
|
},
|
|
|
|
_anchor: null,
|
|
_panel: null,
|
|
position: RESULTS_PANEL_POPUP_POSITION,
|
|
left: 0,
|
|
top: 0
|
|
});
|
|
|
|
DebuggerView.EventListeners = new EventListenersView(DebuggerController);
|
|
DebuggerView.Sources = new SourcesView(DebuggerController, DebuggerView);
|