This commit is contained in:
Richard Newman 2012-11-01 12:28:15 -07:00
Родитель 6d04eaa6ed 230cef6d6b
Коммит 6092e36cd9
689 изменённых файлов: 7918 добавлений и 3591 удалений

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

@ -9,7 +9,7 @@ const Ci = Components.interfaces;
const Cu = Components.utils;
const Cr = Components.results;
var EXPORTED_SYMBOLS = ['AccessFu'];
this.EXPORTED_SYMBOLS = ['AccessFu'];
Cu.import('resource://gre/modules/Services.jsm');
Cu.import('resource://gre/modules/Geometry.jsm');
@ -21,7 +21,7 @@ const ACCESSFU_DISABLE = 0;
const ACCESSFU_ENABLE = 1;
const ACCESSFU_AUTO = 2;
var AccessFu = {
this.AccessFu = {
/**
* Initialize chrome-layer accessibility functionality.
* If accessibility is enabled on the platform, then a special accessibility

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

@ -13,9 +13,9 @@ Cu.import('resource://gre/modules/accessibility/TraversalRules.jsm');
Cu.import('resource://gre/modules/Services.jsm');
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
var EXPORTED_SYMBOLS = ['EventManager'];
this.EXPORTED_SYMBOLS = ['EventManager'];
var EventManager = {
this.EventManager = {
editState: {},
start: function start(aSendMsgFunc) {

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

@ -9,7 +9,23 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
INSTALL_TARGETS += ACCESSFU
ACCESSFU_FILES := \
AccessFu.css \
AccessFu.jsm \
content-script.js \
EventManager.jsm \
jar.mn \
Makefile.in \
Presenters.jsm \
TouchAdapter.jsm \
TraversalRules.jsm \
Utils.jsm \
UtteranceGenerator.jsm \
$(NULL)
ACCESSFU_DEST = $(FINAL_TARGET)/modules/accessibility
include $(topsrcdir)/config/rules.mk
libs::
$(NSINSTALL) $(srcdir)/*.jsm $(FINAL_TARGET)/modules/accessibility

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

@ -13,11 +13,11 @@ Cu.import('resource://gre/modules/accessibility/Utils.jsm');
Cu.import('resource://gre/modules/accessibility/UtteranceGenerator.jsm');
Cu.import('resource://gre/modules/Geometry.jsm');
var EXPORTED_SYMBOLS = ['VisualPresenter',
'AndroidPresenter',
'DummyAndroidPresenter',
'SpeechPresenter',
'PresenterContext'];
this.EXPORTED_SYMBOLS = ['VisualPresenter',
'AndroidPresenter',
'DummyAndroidPresenter',
'SpeechPresenter',
'PresenterContext'];
/**
* The interface for all presenter classes. A presenter could be, for example,
@ -111,7 +111,7 @@ Presenter.prototype = {
* Visual presenter. Draws a box around the virtual cursor's position.
*/
function VisualPresenter() {}
this.VisualPresenter = function VisualPresenter() {}
VisualPresenter.prototype = {
__proto__: Presenter.prototype,
@ -179,7 +179,7 @@ VisualPresenter.prototype = {
* Android presenter. Fires Android a11y events.
*/
function AndroidPresenter() {}
this.AndroidPresenter = function AndroidPresenter() {}
AndroidPresenter.prototype = {
__proto__: Presenter.prototype,
@ -332,7 +332,7 @@ AndroidPresenter.prototype = {
* A speech presenter for direct TTS output
*/
function SpeechPresenter() {}
this.SpeechPresenter = function SpeechPresenter() {}
SpeechPresenter.prototype = {
__proto__: Presenter.prototype,
@ -376,7 +376,7 @@ SpeechPresenter.prototype = {
* PresenterContext: An object that generates and caches context information
* for a given accessible and its relationship with another accessible.
*/
function PresenterContext(aAccessible, aOldAccessible) {
this.PresenterContext = function PresenterContext(aAccessible, aOldAccessible) {
this._accessible = aAccessible;
this._oldAccessible =
this._isDefunct(aOldAccessible) ? null : aOldAccessible;

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

@ -9,7 +9,7 @@ const Ci = Components.interfaces;
const Cu = Components.utils;
const Cr = Components.results;
var EXPORTED_SYMBOLS = ['TouchAdapter', 'AndroidTouchAdapter'];
this.EXPORTED_SYMBOLS = ['TouchAdapter', 'AndroidTouchAdapter'];
Cu.import('resource://gre/modules/accessibility/Utils.jsm');
@ -17,7 +17,7 @@ Cu.import('resource://gre/modules/accessibility/Utils.jsm');
// It is granular enough to feel natural, and it does not hammer the CPU.
const EXPLORE_THROTTLE = 100;
var TouchAdapter = {
this.TouchAdapter = {
// minimal swipe distance in inches
SWIPE_MIN_DISTANCE: 0.4,
@ -366,7 +366,7 @@ var Mouse2Touch = {
}
};
var AndroidTouchAdapter = {
this.AndroidTouchAdapter = {
attach: function AndroidTouchAdapter_attach(aWindow) {
if (this.chromeWin)
return;

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

@ -9,7 +9,7 @@ const Ci = Components.interfaces;
const Cu = Components.utils;
const Cr = Components.results;
var EXPORTED_SYMBOLS = ['TraversalRules'];
this.EXPORTED_SYMBOLS = ['TraversalRules'];
Cu.import('resource://gre/modules/accessibility/Utils.jsm');
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
@ -70,7 +70,7 @@ var gSimpleTraversalRoles =
// Used for traversing in to child OOP frames.
Ci.nsIAccessibleRole.ROLE_INTERNAL_FRAME];
var TraversalRules = {
this.TraversalRules = {
Simple: new BaseTraversalRule(
gSimpleTraversalRoles,
function Simple_match(aAccessible) {

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

@ -10,9 +10,9 @@ const Ci = Components.interfaces;
Cu.import('resource://gre/modules/Services.jsm');
var EXPORTED_SYMBOLS = ['Utils', 'Logger'];
this.EXPORTED_SYMBOLS = ['Utils', 'Logger'];
var Utils = {
this.Utils = {
_buildAppMap: {
'{3c2e2abc-06d4-11e1-ac3b-374f68613e61}': 'b2g',
'{ec8030f7-c20a-464f-9b0e-13a3a9e97384}': 'browser',
@ -156,7 +156,7 @@ var Utils = {
}
};
var Logger = {
this.Logger = {
DEBUG: 0,
INFO: 1,
WARNING: 2,

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

@ -18,7 +18,7 @@ var gStringBundle = Cc['@mozilla.org/intl/stringbundle;1'].
createBundle('chrome://global/locale/AccessFu.properties');
var EXPORTED_SYMBOLS = ['UtteranceGenerator'];
this.EXPORTED_SYMBOLS = ['UtteranceGenerator'];
Cu.import('resource://gre/modules/accessibility/Utils.jsm');
@ -38,7 +38,7 @@ Cu.import('resource://gre/modules/accessibility/Utils.jsm');
* clicked event. Speaking only 'clicked' makes sense. Speaking 'button' does
* not.
*/
var UtteranceGenerator = {
this.UtteranceGenerator = {
gActionMap: {
jump: 'jumpAction',
press: 'pressAction',

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

@ -6,7 +6,7 @@ var gNameRulesFileURL = "markuprules.xml";
var gRuleDoc = null;
// Debuggin stuff.
var gDumpToConsole = true;
var gDumpToConsole = false;
/**
* Start name tests. Run through markup elements and test names for test
@ -14,7 +14,7 @@ var gDumpToConsole = true;
*/
function testNames()
{
enableLogging("tree");
//enableLogging("tree"); // debugging
var request = new XMLHttpRequest();
request.open("get", gNameRulesFileURL, false);
@ -66,7 +66,7 @@ var gTestIterator =
this.markupIdx++;
if (this.markupIdx == this.markupElms.length) {
disableLogging("tree");
//disableLogging("tree"); // debugging
SimpleTest.finish();
return;
}
@ -132,12 +132,20 @@ function testNamesForMarkupRules(aMarkupElm, aContainer)
var serializer = new XMLSerializer();
var expr = "//html/body/div[@id='test']/" + aMarkupElm.getAttribute("ref");
var elms = evaluateXPath(document, expr, htmlDocResolver);
var elm = evaluateXPath(document, expr, htmlDocResolver)[0];
var ruleId = aMarkupElm.getAttribute("ruleset");
var ruleElms = getRuleElmsByRulesetId(ruleId);
gTestIterator.iterateRules(elms[0], aContainer, ruleElms);
var processMarkupRules =
gTestIterator.iterateRules.bind(gTestIterator, elm, aContainer, ruleElms);
// Images may be recreated after we append them into subtree. We need to wait
// in this case.
if (isAccessible(elm))
processMarkupRules();
else
waitForEvent(EVENT_SHOW, elm, processMarkupRules);
}
/**

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

@ -530,9 +530,18 @@ pref("ui.showHideScrollbars", 1);
// background.
pref("dom.ipc.processPriorityManager.enabled", true);
pref("dom.ipc.processPriorityManager.gracePeriodMS", 1000);
// Kernel parameters for how processes are killed on low-memory.
pref("gonk.systemMemoryPressureRecoveryPollMS", 5000);
pref("hal.processPriorityManager.gonk.masterOomScoreAdjust", 0);
pref("hal.processPriorityManager.gonk.masterKillUnderMB", 1);
pref("hal.processPriorityManager.gonk.foregroundOomScoreAdjust", 67);
pref("hal.processPriorityManager.gonk.foregroundKillUnderMB", 4);
pref("hal.processPriorityManager.gonk.backgroundOomScoreAdjust", 400);
pref("hal.processPriorityManager.gonk.backgroundKillUnderMB", 8);
pref("hal.processPriorityManager.gonk.notifyLowMemUnderMB", 10);
// Niceness values (i.e., CPU priorities) for B2G processes.
pref("hal.processPriorityManager.gonk.masterNice", -1);
pref("hal.processPriorityManager.gonk.foregroundNice", 0);
pref("hal.processPriorityManager.gonk.backgroundNice", 10);
@ -576,3 +585,5 @@ pref("network.activity.blipIntervalMilliseconds", 250);
// Send some sites a custom user-agent.
pref("general.useragent.override.facebook.com", "\(Mobile#(Android; Mobile");
pref("general.useragent.override.youtube.com", "\(Mobile#(Android; Mobile");
pref("jsloader.reuseGlobal", false);

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

@ -83,6 +83,8 @@ SettingsListener.observe('language.current', 'en-US', function(value) {
if (!((new RegExp('^' + value + '[^a-z-_] *[,;]?', 'i')).test(intl))) {
Services.prefs.setCharPref(prefName, value + ', ' + intl);
}
shell.start();
});
@ -153,8 +155,10 @@ Components.utils.import('resource://gre/modules/ctypes.jsm');
})();
// =================== Debugger ====================
SettingsListener.observe('devtools.debugger.remote-enabled', false, function(enabled) {
SettingsListener.observe('devtools.debugger.remote-enabled', false, function(value) {
Services.prefs.setBoolPref('devtools.debugger.remote-enabled', value);
// This preference is consulted during startup
Services.prefs.savePrefFile(null);
});
SettingsListener.observe('devtools.debugger.log', false, function(value) {

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

@ -11,7 +11,6 @@
sizemode="fullscreen"
#endif
style="background: black; overflow: hidden; width:320px; height:480px"
onload="shell.start();"
onunload="shell.stop();">
<script type="application/javascript" src="chrome://browser/content/settings.js"/>

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

@ -67,5 +67,5 @@ ActivitiesDialog.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIActivityUIGlue, Ci.nsIRunnable])
}
const NSGetFactory = XPCOMUtils.generateNSGetFactory([ActivitiesDialog]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ActivitiesDialog]);

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

@ -24,4 +24,4 @@ AlertsService.prototype = {
}
};
const NSGetFactory = XPCOMUtils.generateNSGetFactory([AlertsService]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([AlertsService]);

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

@ -50,4 +50,4 @@ ContentHandler.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentHandler])
};
var NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentHandler]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentHandler]);

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

@ -145,4 +145,4 @@ ContentPermissionPrompt.prototype = {
//module initialization
const NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentPermissionPrompt]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentPermissionPrompt]);

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

@ -77,4 +77,4 @@ DirectoryProvider.prototype = {
}
};
const NSGetFactory = XPCOMUtils.generateNSGetFactory([DirectoryProvider]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DirectoryProvider]);

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

@ -43,4 +43,4 @@ MailtoProtocolHandler.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIProtocolHandler])
};
let NSGetFactory = XPCOMUtils.generateNSGetFactory([MailtoProtocolHandler]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([MailtoProtocolHandler]);

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

@ -136,5 +136,5 @@ MozKeyboard.prototype = {
}
};
const NSGetFactory = XPCOMUtils.generateNSGetFactory([MozKeyboard]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([MozKeyboard]);

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

@ -169,4 +169,4 @@ PaymentUI.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIPaymentUIGlue])
}
const NSGetFactory = XPCOMUtils.generateNSGetFactory([PaymentUI]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PaymentUI]);

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

@ -57,4 +57,4 @@ ProcessGlobal.prototype = {
},
};
var NSGetFactory = XPCOMUtils.generateNSGetFactory([ProcessGlobal]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ProcessGlobal]);

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

@ -90,4 +90,4 @@ RecoveryService.prototype = {
}
};
const NSGetFactory = XPCOMUtils.generateNSGetFactory([RecoveryService]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([RecoveryService]);

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

@ -56,4 +56,4 @@ SmsProtocolHandler.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIProtocolHandler])
};
let NSGetFactory = XPCOMUtils.generateNSGetFactory([SmsProtocolHandler]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SmsProtocolHandler]);

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

@ -55,4 +55,4 @@ TelProtocolHandler.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIProtocolHandler])
};
let NSGetFactory = XPCOMUtils.generateNSGetFactory([TelProtocolHandler]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TelProtocolHandler]);

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

@ -4,12 +4,12 @@
"use strict";
let EXPORTED_SYMBOLS = ["TelURIParser"];
this.EXPORTED_SYMBOLS = ["TelURIParser"];
/**
* Singleton providing functionality for parsing tel: and sms: URIs
*/
let TelURIParser = {
this.TelURIParser = {
parseURI: function(scheme, uri) {
// Ignore MWI and USSD codes. See 794034.
if (uri.indexOf('*') != -1 || uri.indexOf('#') != -1) {

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

@ -411,4 +411,4 @@ UpdatePrompt.prototype = {
onStatus: function UP_onStatus(aRequest, aUpdate, aStatus, aStatusArg) { }
};
const NSGetFactory = XPCOMUtils.generateNSGetFactory([UpdatePrompt]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([UpdatePrompt]);

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

@ -129,4 +129,4 @@ YoutubeProtocolHandler.prototype = {
}
};
const NSGetFactory = XPCOMUtils.generateNSGetFactory([YoutubeProtocolHandler]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([YoutubeProtocolHandler]);

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

@ -2,7 +2,7 @@
* 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/. */
EXPORTED_SYMBOLS = [ "DistributionCustomizer" ];
this.EXPORTED_SYMBOLS = [ "DistributionCustomizer" ];
const Ci = Components.interfaces;
const Cc = Components.classes;
@ -16,7 +16,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
"resource://gre/modules/PlacesUtils.jsm");
function DistributionCustomizer() {
this.DistributionCustomizer = function DistributionCustomizer() {
let dirSvc = Cc["@mozilla.org/file/directory_service;1"].
getService(Ci.nsIProperties);
let iniFile = dirSvc.get("XCurProcD", Ci.nsIFile);

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

@ -1114,7 +1114,8 @@ DownloadsViewItemController.prototype = {
return this.dataItem.openable && this.dataItem.localFile.exists();
}
case "downloadsCmd_show": {
return this.dataItem.localFile.exists();
return this.dataItem.localFile.exists() ||
this.dataItem.partFile.exists();
}
case "downloadsCmd_pauseResume":
return this.dataItem.inProgress && this.dataItem.resumable;

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

@ -6,7 +6,7 @@
"use strict";
var EXPORTED_SYMBOLS = [
this.EXPORTED_SYMBOLS = [
"DownloadsCommon",
];
@ -80,6 +80,8 @@ XPCOMUtils.defineLazyGetter(this, "DownloadsLocalFileCtor", function () {
"nsILocalFile", "initWithPath");
});
const kPartialDownloadSuffix = ".part";
////////////////////////////////////////////////////////////////////////////////
//// DownloadsCommon
@ -87,7 +89,7 @@ XPCOMUtils.defineLazyGetter(this, "DownloadsLocalFileCtor", function () {
* This object is exposed directly to the consumers of this JavaScript module,
* and provides shared methods for all the instances of the user interface.
*/
const DownloadsCommon = {
this.DownloadsCommon = {
/**
* Returns an object whose keys are the string names from the downloads string
* bundle, and whose values are either the translated strings or functions
@ -870,19 +872,48 @@ DownloadsDataItem.prototype = {
* Windows path is stored and then the item is accessed on a Mac.
*/
get localFile()
{
return this._getFile(this.file);
},
/**
* Returns the nsILocalFile for the partially downloaded target.
*
* @throws if the native path is not valid. This can happen if the same
* profile is used on different platforms, for example if a native
* Windows path is stored and then the item is accessed on a Mac.
*/
get partFile()
{
return this._getFile(this.file + kPartialDownloadSuffix);
},
/**
* Returns an nsILocalFile for aFilename. aFilename might be a file URL or
* a native path.
*
* @param aFilename the filename of the file to retrieve.
* @return an nsILocalFile for the file.
* @throws if the native path is not valid. This can happen if the same
* profile is used on different platforms, for example if a native
* Windows path is stored and then the item is accessed on a Mac.
* @note This function makes no guarantees about the file's existence -
* callers should check that the returned file exists.
*/
_getFile: function DDI__getFile(aFilename)
{
// The download database may contain targets stored as file URLs or native
// paths. This can still be true for previously stored items, even if new
// items are stored using their file URL. See also bug 239948 comment 12.
if (this.file.startsWith("file:")) {
if (aFilename.startsWith("file:")) {
// Assume the file URL we obtained from the downloads database or from the
// "spec" property of the target has the UTF-8 charset.
let fileUrl = NetUtil.newURI(this.file).QueryInterface(Ci.nsIFileURL);
let fileUrl = NetUtil.newURI(aFilename).QueryInterface(Ci.nsIFileURL);
return fileUrl.file.clone().QueryInterface(Ci.nsILocalFile);
} else {
// The downloads database contains a native path. Try to create a local
// file, though this may throw an exception if the path is invalid.
return new DownloadsLocalFileCtor(this.file);
return new DownloadsLocalFileCtor(aFilename);
}
}
};

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

@ -273,4 +273,4 @@ DownloadsStartup.prototype = {
////////////////////////////////////////////////////////////////////////////////
//// Module
const NSGetFactory = XPCOMUtils.generateNSGetFactory([DownloadsStartup]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DownloadsStartup]);

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

@ -104,4 +104,4 @@ DownloadsUI.prototype = {
////////////////////////////////////////////////////////////////////////////////
//// Module
const NSGetFactory = XPCOMUtils.generateNSGetFactory([DownloadsUI]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DownloadsUI]);

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

@ -579,4 +579,4 @@ var components = [FeedConverter,
PodCastProtocolHandler];
const NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components);

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

@ -1378,4 +1378,4 @@ FeedWriter.prototype = {
Ci.nsINavHistoryObserver])
};
var NSGetFactory = XPCOMUtils.generateNSGetFactory([FeedWriter]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([FeedWriter]);

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

@ -899,4 +899,4 @@ WebContentConverterRegistrar.prototype = {
}]
};
var NSGetFactory = XPCOMUtils.generateNSGetFactory([WebContentConverterRegistrar]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([WebContentConverterRegistrar]);

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

@ -340,4 +340,4 @@ ChromeProfileMigrator.prototype.classDescription = "Chrome Profile Migrator";
ChromeProfileMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=chrome";
ChromeProfileMigrator.prototype.classID = Components.ID("{4cec1de4-1671-4fc3-a53e-6c539dc77a26}");
const NSGetFactory = XPCOMUtils.generateNSGetFactory([ChromeProfileMigrator]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ChromeProfileMigrator]);

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

@ -91,4 +91,4 @@ FirefoxProfileMigrator.prototype.classDescription = "Firefox Profile Migrator";
FirefoxProfileMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=firefox";
FirefoxProfileMigrator.prototype.classID = Components.ID("{91185366-ba97-4438-acba-48deaca63386}");
const NSGetFactory = XPCOMUtils.generateNSGetFactory([FirefoxProfileMigrator]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([FirefoxProfileMigrator]);

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

@ -675,4 +675,4 @@ IEProfileMigrator.prototype.classDescription = "IE Profile Migrator";
IEProfileMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=ie";
IEProfileMigrator.prototype.classID = Components.ID("{3d2532e3-4932-4774-b7ba-968f5899d3a4}");
const NSGetFactory = XPCOMUtils.generateNSGetFactory([IEProfileMigrator]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([IEProfileMigrator]);

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

@ -4,7 +4,7 @@
"use strict";
let EXPORTED_SYMBOLS = ["MigrationUtils", "MigratorPrototype"];
this.EXPORTED_SYMBOLS = ["MigrationUtils", "MigratorPrototype"];
const Cu = Components.utils;
const Ci = Components.interfaces;
@ -86,7 +86,7 @@ function getMigratorKeyForDefaultBrowser() {
* override |sourceHomePageURL| getter.
* 7. For startup-only migrators, override |startupOnlyMigrator|.
*/
let MigratorPrototype = {
this.MigratorPrototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIBrowserProfileMigrator]),
/**
@ -323,7 +323,7 @@ let MigratorPrototype = {
}
};
let MigrationUtils = Object.freeze({
this.MigrationUtils = Object.freeze({
resourceTypes: {
SETTINGS: Ci.nsIBrowserProfileMigrator.SETTINGS,
COOKIES: Ci.nsIBrowserProfileMigrator.COOKIES,

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

@ -18,4 +18,4 @@ ProfileMigrator.prototype = {
classID: Components.ID("6F8BB968-C14F-4D6F-9733-6C6737B35DCE")
};
let NSGetFactory = XPCOMUtils.generateNSGetFactory([ProfileMigrator]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ProfileMigrator]);

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

@ -677,4 +677,4 @@ SafariProfileMigrator.prototype.classDescription = "Safari Profile Migrator";
SafariProfileMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=safari";
SafariProfileMigrator.prototype.classID = Components.ID("{4b609ecf-60b2-4655-9df4-dc149e474da1}");
const NSGetFactory = XPCOMUtils.generateNSGetFactory([SafariProfileMigrator]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SafariProfileMigrator]);

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

@ -825,4 +825,4 @@ nsDefaultCommandLineHandler.prototype = {
};
var components = [nsBrowserContentHandler, nsDefaultCommandLineHandler];
var NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components);

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

@ -1751,4 +1751,4 @@ ContentPermissionPrompt.prototype = {
};
var components = [BrowserGlue, ContentPermissionPrompt];
var NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components);

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

@ -46,4 +46,4 @@ PlacesProtocolHandler.prototype = {
classID: Components.ID("{6bcb9bde-9018-4443-a071-c32653469597}")
};
var NSGetFactory = XPCOMUtils.generateNSGetFactory([PlacesProtocolHandler]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PlacesProtocolHandler]);

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

@ -3,7 +3,7 @@
* 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/. */
var EXPORTED_SYMBOLS = ["PlacesUIUtils"];
this.EXPORTED_SYMBOLS = ["PlacesUIUtils"];
var Ci = Components.interfaces;
var Cc = Components.classes;
@ -21,7 +21,7 @@ XPCOMUtils.defineLazyGetter(this, "PlacesUtils", function() {
return PlacesUtils;
});
var PlacesUIUtils = {
this.PlacesUIUtils = {
ORGANIZER_LEFTPANE_VERSION: 7,
ORGANIZER_FOLDER_ANNO: "PlacesOrganizer/OrganizerFolder",
ORGANIZER_QUERY_ANNO: "PlacesOrganizer/OrganizerQuery",

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

@ -591,4 +591,4 @@ PrivateBrowsingService.prototype = {
}
};
var NSGetFactory = XPCOMUtils.generateNSGetFactory([PrivateBrowsingService]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PrivateBrowsingService]);

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

@ -2,7 +2,7 @@
* 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/. */
EXPORTED_SYMBOLS = [ "DocumentUtils" ];
this.EXPORTED_SYMBOLS = [ "DocumentUtils" ];
const Cu = Components.utils;
const Ci = Components.interfaces;
@ -10,7 +10,7 @@ const Ci = Components.interfaces;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource:///modules/sessionstore/XPathGenerator.jsm");
let DocumentUtils = {
this.DocumentUtils = {
/**
* Obtain form data for a DOMDocument instance.
*

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

@ -2,7 +2,7 @@
* 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/. */
let EXPORTED_SYMBOLS = ["SessionStorage"];
this.EXPORTED_SYMBOLS = ["SessionStorage"];
const Cu = Components.utils;
@ -12,7 +12,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "SessionStore",
"resource:///modules/sessionstore/SessionStore.jsm");
let SessionStorage = {
this.SessionStorage = {
/**
* Updates all sessionStorage "super cookies"
* @param aDocShell

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

@ -2,7 +2,7 @@
* 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/. */
let EXPORTED_SYMBOLS = ["SessionStore"];
this.EXPORTED_SYMBOLS = ["SessionStore"];
const Cu = Components.utils;
const Cc = Components.classes;
@ -99,7 +99,7 @@ function debug(aMsg) {
Services.console.logStringMessage(aMsg);
}
let SessionStore = {
this.SessionStore = {
get canRestoreLastSession() {
return SessionStoreInternal.canRestoreLastSession;
},

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

@ -2,9 +2,9 @@
* 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/. */
let EXPORTED_SYMBOLS = ["XPathGenerator"];
this.EXPORTED_SYMBOLS = ["XPathGenerator"];
let XPathGenerator = {
this.XPathGenerator = {
// these two hashes should be kept in sync
namespaceURIs: { "xhtml": "http://www.w3.org/1999/xhtml" },
namespacePrefixes: { "http://www.w3.org/1999/xhtml": "xhtml" },

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

@ -319,4 +319,4 @@ SessionStartup.prototype = {
classID: Components.ID("{ec7a6c20-e081-11da-8ad9-0800200c9a66}"),
};
var NSGetFactory = XPCOMUtils.generateNSGetFactory([SessionStartup]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SessionStartup]);

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

@ -34,4 +34,4 @@ SessionStoreService.prototype.classID =
SessionStoreService.prototype.QueryInterface =
XPCOMUtils.generateQI([Ci.nsISessionStore]);
let NSGetFactory = XPCOMUtils.generateNSGetFactory([SessionStoreService]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SessionStoreService]);

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

@ -28,4 +28,4 @@ nsSetDefaultBrowser.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsICommandLineHandler]),
};
var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsSetDefaultBrowser]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([nsSetDefaultBrowser]);

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

@ -183,7 +183,7 @@ nsSidebar.prototype.classInfo = XPCOMUtils.generateCI({classID: SIDEBAR_CID,
nsSidebar.prototype.QueryInterface = XPCOMUtils.generateQI([nsISidebar, nsISidebarExternal]);
var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsSidebar]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([nsSidebar]);
/* static functions */
if (DEBUG)

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

@ -7,7 +7,7 @@
// **********
// Title: utils.js
let EXPORTED_SYMBOLS = ["Point", "Rect", "Range", "Subscribable", "Utils", "MRUList"];
this.EXPORTED_SYMBOLS = ["Point", "Rect", "Range", "Subscribable", "Utils", "MRUList"];
// #########
const Ci = Components.interfaces;
@ -23,7 +23,7 @@ Cu.import("resource://gre/modules/Services.jsm");
// If a is a Point, creates a copy of it. Otherwise, expects a to be x,
// and creates a Point with it along with y. If either a or y are omitted,
// 0 is used in their place.
function Point(a, y) {
this.Point = function Point(a, y) {
if (Utils.isPoint(a)) {
this.x = a.x;
this.y = a.y;
@ -60,7 +60,7 @@ Point.prototype = {
// Constructor: Rect
// If a is a Rect, creates a copy of it. Otherwise, expects a to be left,
// and creates a Rect with it along with top, width, and height.
function Rect(a, top, width, height) {
this.Rect = function Rect(a, top, width, height) {
// Note: perhaps 'a' should really be called 'rectOrLeft'
if (Utils.isRect(a)) {
this.left = a.left;
@ -251,7 +251,7 @@ Rect.prototype = {
//
// Constructor: Range
// Creates a Range with the given min and max
function Range(min, max) {
this.Range = function Range(min, max) {
if (Utils.isRange(min) && !max) { // if the one variable given is a range, copy it.
this.min = min.min;
this.max = min.max;
@ -357,7 +357,7 @@ Range.prototype = {
// ##########
// Class: Subscribable
// A mix-in for allowing objects to collect subscribers for custom events.
function Subscribable() {
this.Subscribable = function Subscribable() {
this.subscribers = null;
};
@ -438,7 +438,7 @@ Subscribable.prototype = {
// ##########
// Class: Utils
// Singelton with common utility functions.
let Utils = {
this.Utils = {
// ----------
// Function: toString
// Prints [Utils] for debug use
@ -768,7 +768,7 @@ let Utils = {
//
// Constructor: MRUList
// If a is an array of entries, creates a copy of it.
function MRUList(a) {
this.MRUList = function MRUList(a) {
if (Array.isArray(a))
this._list = a.concat();
else

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

@ -4,7 +4,7 @@
"use strict";
let EXPORTED_SYMBOLS = ["PageThumbs", "PageThumbsStorage"];
this.EXPORTED_SYMBOLS = ["PageThumbs", "PageThumbsStorage"];
const Cu = Components.utils;
const Cc = Components.classes;
@ -59,7 +59,7 @@ XPCOMUtils.defineLazyGetter(this, "gUnicodeConverter", function () {
* Singleton providing functionality for capturing web page thumbnails and for
* accessing them if already cached.
*/
let PageThumbs = {
this.PageThumbs = {
_initialized: false,
/**
@ -278,7 +278,7 @@ let PageThumbs = {
},
};
let PageThumbsStorage = {
this.PageThumbsStorage = {
getDirectory: function Storage_getDirectory(aCreate = true) {
return FileUtils.getDir("ProfLD", [THUMBNAIL_DIRECTORY], aCreate);
},

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

@ -88,7 +88,7 @@ Protocol.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIProtocolHandler])
};
let NSGetFactory = XPCOMUtils.generateNSGetFactory([Protocol]);
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([Protocol]);
/**
* Parses a given URI and extracts all parameters relevant to this protocol.

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

@ -4,7 +4,7 @@
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
let EXPORTED_SYMBOLS = [ "Flags" ];
this.EXPORTED_SYMBOLS = [ "Flags" ];
Cu.import("resource:///modules/devtools/gcli.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
@ -15,7 +15,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
// We need to use an object in which to store any flags because a primitive
// would remain undefined.
let Flags = {
this.Flags = {
addonsLoaded: false
};

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

@ -4,7 +4,7 @@
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
let EXPORTED_SYMBOLS = [ ];
this.EXPORTED_SYMBOLS = [ ];
Cu.import("resource:///modules/devtools/gcli.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");

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

@ -4,7 +4,7 @@
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
let EXPORTED_SYMBOLS = [ ];
this.EXPORTED_SYMBOLS = [ ];
Cu.import("resource:///modules/devtools/gcli.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");

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

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
let EXPORTED_SYMBOLS = [ ];
this.EXPORTED_SYMBOLS = [ ];
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;

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

@ -2,7 +2,7 @@
* 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/. */
let EXPORTED_SYMBOLS = [ "CmdCommands" ];
this.EXPORTED_SYMBOLS = [ "CmdCommands" ];
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
@ -32,7 +32,7 @@ let commands = [];
/**
* Exported API
*/
let CmdCommands = {
this.CmdCommands = {
/**
* Called to look in a directory pointed at by the devtools.commands.dir pref
* for *.mozcmd files which are then loaded.

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

@ -4,7 +4,7 @@
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
let EXPORTED_SYMBOLS = [ ];
this.EXPORTED_SYMBOLS = [ ];
Cu.import("resource:///modules/devtools/gcli.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");

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

@ -4,7 +4,7 @@
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
let EXPORTED_SYMBOLS = [ ];
this.EXPORTED_SYMBOLS = [ ];
Cu.import("resource:///modules/devtools/gcli.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");

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

@ -4,7 +4,7 @@
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
let EXPORTED_SYMBOLS = [ ];
this.EXPORTED_SYMBOLS = [ ];
Cu.import("resource:///modules/devtools/gcli.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");

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

@ -4,7 +4,7 @@
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
let EXPORTED_SYMBOLS = [ ];
this.EXPORTED_SYMBOLS = [ ];
Cu.import("resource:///modules/devtools/gcli.jsm");

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

@ -3,7 +3,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
let EXPORTED_SYMBOLS = [ ];
this.EXPORTED_SYMBOLS = [ ];
Cu.import("resource:///modules/devtools/gcli.jsm");

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

@ -6,7 +6,7 @@ const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
const XMLHttpRequest =
Components.Constructor("@mozilla.org/xmlextras/xmlhttprequest;1");
let EXPORTED_SYMBOLS = [ ];
this.EXPORTED_SYMBOLS = [ ];
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource:///modules/devtools/gcli.jsm");

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

@ -4,7 +4,7 @@
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
let EXPORTED_SYMBOLS = [ ];
this.EXPORTED_SYMBOLS = [ ];
Cu.import("resource:///modules/devtools/gcli.jsm");

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

@ -4,7 +4,7 @@
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
let EXPORTED_SYMBOLS = [ ];
this.EXPORTED_SYMBOLS = [ ];
Cu.import("resource:///modules/devtools/gcli.jsm");
Cu.import("resource://gre/modules/Services.jsm");

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

@ -4,7 +4,7 @@
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
let EXPORTED_SYMBOLS = [ ];
this.EXPORTED_SYMBOLS = [ ];
Cu.import("resource:///modules/devtools/gcli.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");

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

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
let EXPORTED_SYMBOLS = [ ];
this.EXPORTED_SYMBOLS = [ ];
const Cu = Components.utils;

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

@ -24,7 +24,7 @@
* For more information, ask Joe Walker <jwalker@mozilla.com>
*/
var EXPORTED_SYMBOLS = [ "gcli" ];
this.EXPORTED_SYMBOLS = [ "gcli" ];
Components.utils.import("resource://gre/modules/devtools/Require.jsm");
Components.utils.import("resource://gre/modules/devtools/Console.jsm");
@ -10479,4 +10479,4 @@ define("text!gcli/ui/tooltip.html", [], "\n" +
// Satisfy EXPORTED_SYMBOLS
const gcli = require('gcli/index');
this.gcli = require('gcli/index');

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

@ -54,7 +54,7 @@
* of GCLI and can be run as a test case.
*/
var EXPORTED_SYMBOLS = [ 'helpers' ];
this.EXPORTED_SYMBOLS = [ 'helpers' ];
var test = { };
@ -503,7 +503,7 @@ DeveloperToolbarTest.closeAllTabs = function() {
///////////////////////////////////////////////////////////////////////////////
var helpers = {};
this.helpers = {};
var assert = { ok: ok, is: is, log: info };

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

@ -25,7 +25,7 @@ XPCOMUtils.defineLazyModuleGetter(this,
XPCOMUtils.defineLazyModuleGetter(this,
"FileUtils", "resource:///modules/FileUtils.jsm");
let EXPORTED_SYMBOLS = ["DebuggerUI"];
this.EXPORTED_SYMBOLS = ["DebuggerUI"];
/**
* Provides a simple mechanism of managing debugger instances.
@ -33,10 +33,10 @@ let EXPORTED_SYMBOLS = ["DebuggerUI"];
* @param nsIDOMWindow aWindow
* The chrome window for which the DebuggerUI instance is created.
*/
function DebuggerUI(aWindow) {
this.DebuggerUI = function DebuggerUI(aWindow) {
this.chromeWindow = aWindow;
this.listenToTabs();
}
};
DebuggerUI.prototype = {
/**

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

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
let EXPORTED_SYMBOLS = [ ];
this.EXPORTED_SYMBOLS = [ ];
Cu.import("resource:///modules/devtools/gcli.jsm");

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

@ -12,7 +12,7 @@ Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource:///modules/devtools/LayoutHelpers.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
var EXPORTED_SYMBOLS = ["Highlighter"];
this.EXPORTED_SYMBOLS = ["Highlighter"];
const INSPECTOR_INVISIBLE_ELEMENTS = {
"head": true,
@ -113,7 +113,7 @@ const PSEUDO_CLASSES = [":hover", ":active", ":focus"];
*
* @param object aWindow
*/
function Highlighter(aWindow)
this.Highlighter = function Highlighter(aWindow)
{
this.chromeWin = aWindow;
this.tabbrowser = aWindow.gBrowser;

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

@ -9,7 +9,7 @@ const Cu = Components.utils;
const Ci = Components.interfaces;
const Cr = Components.results;
var EXPORTED_SYMBOLS = ["InspectorUI"];
this.EXPORTED_SYMBOLS = ["InspectorUI"];
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
@ -411,7 +411,7 @@ Inspector.prototype = {
* @param nsIDOMWindow aWindow
* The chrome window for which the Inspector instance is created.
*/
function InspectorUI(aWindow)
this.InspectorUI = function InspectorUI(aWindow)
{
// Let style inspector tools register themselves.
let tmp = {};

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

@ -54,7 +54,7 @@
* of GCLI and can be run as a test case.
*/
var EXPORTED_SYMBOLS = [ 'helpers' ];
this.EXPORTED_SYMBOLS = [ 'helpers' ];
var test = { };
@ -496,7 +496,7 @@ DeveloperToolbarTest.closeAllTabs = function() {
///////////////////////////////////////////////////////////////////////////////
var helpers = {};
this.helpers = {};
helpers._display = undefined;

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

@ -12,9 +12,9 @@ Cu.import("resource:///modules/inspector.jsm");
Cu.import("resource:///modules/devtools/LayoutHelpers.jsm");
Cu.import("resource:///modules/devtools/CssLogic.jsm");
var EXPORTED_SYMBOLS = ["LayoutView"];
this.EXPORTED_SYMBOLS = ["LayoutView"];
function LayoutView(aOptions)
this.LayoutView = function LayoutView(aOptions)
{
this.chromeDoc = aOptions.document;
this.inspector = aOptions.inspector;

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

@ -13,7 +13,7 @@ const PAGE_SIZE = 10;
const PREVIEW_AREA = 700;
var EXPORTED_SYMBOLS = ["MarkupView"];
this.EXPORTED_SYMBOLS = ["MarkupView"];
Cu.import("resource:///modules/devtools/LayoutHelpers.jsm");
Cu.import("resource:///modules/devtools/CssRuleView.jsm");
@ -39,7 +39,7 @@ Cu.import("resource://gre/modules/Services.jsm");
* @param iframe aFrame
* An iframe in which the caller has kindly loaded markup-view.xhtml.
*/
function MarkupView(aInspector, aFrame)
this.MarkupView = function MarkupView(aInspector, aFrame)
{
this._inspector = aInspector;
this._frame = aFrame;
@ -867,7 +867,11 @@ function ElementEditor(aContainer, aNode)
return;
}
this._applyAttributes(aVal);
try {
this._applyAttributes(aVal);
} catch (x) {
return;
}
}.bind(this)
});
@ -962,11 +966,16 @@ ElementEditor.prototype = {
this.undo.startBatch();
// Remove the attribute stored in this editor and re-add any attributes
// parsed out of the input element.
this._removeAttribute(this.node, aAttr.name)
this._applyAttributes(aVal, attr);
this.undo.endBatch();
// parsed out of the input element. Restore original attribute if
// parsing fails.
this._removeAttribute(this.node, aAttr.name);
try {
this._applyAttributes(aVal, attr);
this.undo.endBatch();
} catch (e) {
this.undo.endBatch();
this.undo.undo();
}
}.bind(this)
});
@ -987,6 +996,7 @@ ElementEditor.prototype = {
* @param Element aAttrNode the attribute editor that created this
* set of attributes, used to place new attributes where the
* user put them.
* @throws SYNTAX_ERR if aValue is not well-formed.
*/
_applyAttributes: function EE__applyAttributes(aValue, aAttrNode)
{
@ -996,6 +1006,7 @@ ElementEditor.prototype = {
let parseTag = (this.node.namespaceURI.match(/svg/i) ? "svg" :
(this.node.namespaceURI.match(/mathml/i) ? "math" : "div"));
let parseText = "<" + parseTag + " " + aValue + "/>";
// Throws exception if parseText is not well-formed.
dummyNode.innerHTML = parseText;
let parsedNode = dummyNode.firstChild;

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

@ -33,6 +33,9 @@
</div>
</div>
</div>
<div id="node22" class="unchanged"></div>
<div id="node23"></div>
<div id="node24"></div>
<div id="retag-me">
<div id="retag-me-2"></div>
</div>

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

@ -73,6 +73,28 @@ function test() {
}
},
// Try change an attribute to a badly formed string
{
before: function() {
assertAttributes(doc.querySelector("#node22"), {
id: "node22",
class: "unchanged"
});
},
execute: function() {
let editor = markup.getContainer(doc.querySelector("#node22")).editor;
let attr = editor.attrs["class"].querySelector(".editable");
editField(attr, 'class="""');
},
after: function() {
assertAttributes(doc.querySelector("#node22"), {
id: "node22",
class: "unchanged"
});
}
},
// Remove an attribute
{
before: function() {
@ -114,6 +136,25 @@ function test() {
}
},
// Try add a badly formed attribute by clicking the empty space after a node
{
before: function() {
assertAttributes(doc.querySelector("#node23"), {
id: "node23",
});
},
execute: function() {
let editor = markup.getContainer(doc.querySelector("#node23")).editor;
let attr = editor.newAttr;
editField(attr, 'class="newclass" style="""');
},
after: function() {
assertAttributes(doc.querySelector("#node23"), {
id: "node23",
});
}
},
// Add attributes by adding to an existing attribute's entry
{
setup: function() {
@ -140,6 +181,25 @@ function test() {
}
},
// Try add attributes by adding to an existing attribute's entry
{
before: function() {
assertAttributes(doc.querySelector("#node24"), {
id: "node24",
});
},
execute: function() {
let editor = markup.getContainer(doc.querySelector("#node24")).editor;
let attr = editor.attrs["id"].querySelector(".editable");
editField(attr, attr.textContent + ' class="""');
},
after: function() {
assertAttributes(doc.querySelector("#node24"), {
id: "node24",
});
}
},
// Remove an element with the delete key
{
before: function() {

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

@ -4,7 +4,7 @@
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
let EXPORTED_SYMBOLS = [ ];
this.EXPORTED_SYMBOLS = [ ];
Cu.import("resource:///modules/devtools/gcli.jsm");

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

@ -12,7 +12,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource:///modules/devtools/FloatingScrollbars.jsm");
Cu.import("resource:///modules/devtools/EventEmitter.jsm");
var EXPORTED_SYMBOLS = ["ResponsiveUIManager"];
this.EXPORTED_SYMBOLS = ["ResponsiveUIManager"];
const MIN_WIDTH = 50;
const MIN_HEIGHT = 50;
@ -20,7 +20,7 @@ const MIN_HEIGHT = 50;
const MAX_WIDTH = 10000;
const MAX_HEIGHT = 10000;
let ResponsiveUIManager = {
this.ResponsiveUIManager = {
/**
* Check if the a tab is in a responsive mode.
* Leave the responsive mode if active,

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

@ -54,7 +54,7 @@
* of GCLI and can be run as a test case.
*/
var EXPORTED_SYMBOLS = [ 'helpers' ];
this.EXPORTED_SYMBOLS = [ 'helpers' ];
var test = { };
@ -496,7 +496,7 @@ DeveloperToolbarTest.closeAllTabs = function() {
///////////////////////////////////////////////////////////////////////////////
var helpers = {};
this.helpers = {};
helpers._display = undefined;

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

@ -5,7 +5,7 @@
"use strict";
var EXPORTED_SYMBOLS = ["ScratchpadManager"];
this.EXPORTED_SYMBOLS = ["ScratchpadManager"];
const Cc = Components.classes;
const Ci = Components.interfaces;
@ -21,7 +21,7 @@ Cu.import("resource://gre/modules/Services.jsm");
* of open scratchpads for session restore. There's only one ScratchpadManager in
* the life of the browser.
*/
var ScratchpadManager = {
this.ScratchpadManager = {
_nextUid: 1,
_scratchpads: [],

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

@ -729,13 +729,16 @@ var Scratchpad = {
*/
getRecentFiles: function SP_getRecentFiles()
{
let maxRecent = Services.prefs.getIntPref(PREF_RECENT_FILES_MAX);
let branch = Services.prefs.
getBranch("devtools.scratchpad.");
let branch = Services.prefs.getBranch("devtools.scratchpad.");
let filePaths = [];
// WARNING: Do not use getCharPref here, it doesn't play nicely with
// Unicode strings.
if (branch.prefHasUserValue("recentFilePaths")) {
filePaths = JSON.parse(branch.getCharPref("recentFilePaths"));
let data = branch.getComplexValue("recentFilePaths",
Ci.nsISupportsString).data;
filePaths = JSON.parse(data);
}
return filePaths;
@ -781,10 +784,16 @@ var Scratchpad = {
filePaths.push(aFile.path);
let branch = Services.prefs.
getBranch("devtools.scratchpad.");
branch.setCharPref("recentFilePaths", JSON.stringify(filePaths));
return;
// WARNING: Do not use setCharPref here, it doesn't play nicely with
// Unicode strings.
let str = Cc["@mozilla.org/supports-string;1"]
.createInstance(Ci.nsISupportsString);
str.data = JSON.stringify(filePaths);
let branch = Services.prefs.getBranch("devtools.scratchpad.");
branch.setComplexValue("recentFilePaths",
Ci.nsISupportsString, str);
},
/**
@ -868,11 +877,19 @@ var Scratchpad = {
let filePaths = this.getRecentFiles();
if (maxRecent < filePaths.length) {
let branch = Services.prefs.
getBranch("devtools.scratchpad.");
let diff = filePaths.length - maxRecent;
filePaths.splice(0, diff);
branch.setCharPref("recentFilePaths", JSON.stringify(filePaths));
// WARNING: Do not use setCharPref here, it doesn't play nicely with
// Unicode strings.
let str = Cc["@mozilla.org/supports-string;1"]
.createInstance(Ci.nsISupportsString);
str.data = JSON.stringify(filePaths);
let branch = Services.prefs.getBranch("devtools.scratchpad.");
branch.setComplexValue("recentFilePaths",
Ci.nsISupportsString, str);
}
}
},

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

@ -27,7 +27,7 @@ var lists = {
// Temporary file names.
let gFileName01 = "file01_ForBug651942.tmp"
let gFileName02 = "file02_ForBug651942.tmp"
let gFileName02 = "☕" // See bug 783858 for more information
let gFileName03 = "file03_ForBug651942.tmp"
let gFileName04 = "file04_ForBug651942.tmp"

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

@ -11,14 +11,14 @@
* forwards to dump();
*/
const EXPORTED_SYMBOLS = [ "Node", "HTMLElement", "setTimeout", "clearTimeout" ];
this.EXPORTED_SYMBOLS = [ "Node", "HTMLElement", "setTimeout", "clearTimeout" ];
/**
* Expose Node/HTMLElement objects. This allows us to use the Node constants
* without resorting to hardcoded numbers
*/
const Node = Components.interfaces.nsIDOMNode;
const HTMLElement = Components.interfaces.nsIDOMHTMLElement;
this.Node = Components.interfaces.nsIDOMNode;
this.HTMLElement = Components.interfaces.nsIDOMHTMLElement;
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
@ -66,7 +66,7 @@ TimerCallback.prototype.notify = function(timer) {
* @return the ID of the timeout, which can be used later with
* window.clearTimeout.
*/
const setTimeout = function setTimeout(callback, delay) {
this.setTimeout = function setTimeout(callback, delay) {
const timer = Components.classes["@mozilla.org/timer;1"]
.createInstance(Components.interfaces.nsITimer);
@ -83,7 +83,7 @@ const setTimeout = function setTimeout(callback, delay) {
* @param timerID the ID of the timeout you wish to clear, as returned by
* window.setTimeout().
*/
const clearTimeout = function clearTimeout(timerID) {
this.clearTimeout = function clearTimeout(timerID) {
let timer = timers[timerID];
if (timer) {
timer.cancel();

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

@ -2,7 +2,7 @@
* 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/. */
const EXPORTED_SYMBOLS = ["DOMHelpers"];
this.EXPORTED_SYMBOLS = ["DOMHelpers"];
/**
* DOMHelpers
@ -12,7 +12,7 @@ const EXPORTED_SYMBOLS = ["DOMHelpers"];
* @param nsIDOMWindow aWindow
* The content window, owning the document to traverse.
*/
function DOMHelpers(aWindow) {
this.DOMHelpers = function DOMHelpers(aWindow) {
this.window = aWindow;
};

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

@ -4,7 +4,7 @@
"use strict";
const EXPORTED_SYMBOLS = [ "DeveloperToolbar" ];
this.EXPORTED_SYMBOLS = [ "DeveloperToolbar" ];
const NS_XHTML = "http://www.w3.org/1999/xhtml";
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
@ -46,7 +46,7 @@ XPCOMUtils.defineLazyGetter(this, "isLinux", function () {
* @param aChromeWindow The browser window to which this toolbar is attached
* @param aToolbarElement See browser.xul:<toolbar id="developer-toolbar">
*/
function DeveloperToolbar(aChromeWindow, aToolbarElement)
this.DeveloperToolbar = function DeveloperToolbar(aChromeWindow, aToolbarElement)
{
this._chromeWindow = aChromeWindow;

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

@ -1,6 +1,8 @@
var EXPORTED_SYMBOLS = ["EventEmitter"];
// XXXkhuey this should have a license header.
function EventEmitter() {
this.EXPORTED_SYMBOLS = ["EventEmitter"];
this.EventEmitter = function EventEmitter() {
}
EventEmitter.prototype = {

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

@ -6,7 +6,7 @@
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
const EXPORTED_SYMBOLS = [ "switchToFloatingScrollbars", "switchToNativeScrollbars" ];
this.EXPORTED_SYMBOLS = [ "switchToFloatingScrollbars", "switchToNativeScrollbars" ];
Cu.import("resource://gre/modules/Services.jsm");
@ -20,7 +20,7 @@ let trackedTabs = new WeakMap();
* @param aTab the targeted tab.
*
*/
function switchToFloatingScrollbars(aTab) {
this.switchToFloatingScrollbars = function switchToFloatingScrollbars(aTab) {
let mgr = trackedTabs.get(aTab);
if (!mgr) {
mgr = new ScrollbarManager(aTab);
@ -34,7 +34,7 @@ function switchToFloatingScrollbars(aTab) {
* @param aTab the targeted tab.
*
*/
function switchToNativeScrollbars(aTab) {
this.switchToNativeScrollbars = function switchToNativeScrollbars(aTab) {
let mgr = trackedTabs.get(aTab);
if (mgr) {
mgr.reset();

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

@ -56,9 +56,9 @@
*/
let EXPORTED_SYMBOLS = ["js_beautify"];
this.EXPORTED_SYMBOLS = ["js_beautify"];
function js_beautify(js_source_text, options) {
this.js_beautify = function js_beautify(js_source_text, options) {
var input, output, token_text, last_type, last_text, last_last_text, last_word, flags, flag_store, indent_string;
var whitespace, wordchar, punct, parser_pos, line_starters, digits;

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

@ -18,9 +18,9 @@ XPCOMUtils.defineLazyGetter(this, "PlatformKeys", function() {
"chrome://global-platform/locale/platformKeys.properties");
});
var EXPORTED_SYMBOLS = ["LayoutHelpers"];
this.EXPORTED_SYMBOLS = ["LayoutHelpers"];
LayoutHelpers = {
this.LayoutHelpers = LayoutHelpers = {
/**
* Compute the position and the dimensions for the visible portion

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

@ -5,7 +5,7 @@
"use strict";
const EXPORTED_SYMBOLS = ["SplitView"];
this.EXPORTED_SYMBOLS = ["SplitView"];
/* this must be kept in sync with CSS (ie. splitview.css) */
const LANDSCAPE_MEDIA_QUERY = "(min-width: 551px)";
@ -26,7 +26,7 @@ const BINDING_USERDATA = "splitview-binding";
* @param DOMElement aRoot
* @see appendItem
*/
function SplitView(aRoot)
this.SplitView = function SplitView(aRoot)
{
this._root = aRoot;
this._controller = aRoot.querySelector(".splitview-controller");

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

@ -15,7 +15,7 @@
*/
var EXPORTED_SYMBOLS = [ "Templater", "template" ];
this.EXPORTED_SYMBOLS = [ "Templater", "template" ];
Components.utils.import("resource://gre/modules/Services.jsm");
const Node = Components.interfaces.nsIDOMNode;
@ -44,7 +44,7 @@ const Node = Components.interfaces.nsIDOMNode;
* convert null/undefined to ''. By setting blankNullUndefined:true, this
* conversion is handled by DOMTemplate
*/
function template(node, data, options) {
this.template = function template(node, data, options) {
var template = new Templater(options || {});
template.processNode(node, data);
return template;
@ -54,7 +54,7 @@ function template(node, data, options) {
* Construct a Templater object. Use template() in preference to this ctor.
* @deprecated Use template(node, data, options);
*/
function Templater(options) {
this.Templater = function Templater(options) {
if (options == null) {
options = { allowEval: true };
}

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

@ -5,7 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const Cu = Components.utils;
var EXPORTED_SYMBOLS=["UndoStack"];
this.EXPORTED_SYMBOLS = ["UndoStack"];
/**
* A simple undo stack manager.
@ -19,7 +19,7 @@ var EXPORTED_SYMBOLS=["UndoStack"];
* @param integer aMaxUndo Maximum number of undo steps.
* defaults to 50.
*/
function UndoStack(aMaxUndo)
this.UndoStack = function UndoStack(aMaxUndo)
{
this.maxUndo = aMaxUndo || 50;
this._stack = [];

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

@ -54,7 +54,7 @@
* of GCLI and can be run as a test case.
*/
var EXPORTED_SYMBOLS = [ 'helpers' ];
this.EXPORTED_SYMBOLS = [ 'helpers' ];
var test = { };
@ -496,7 +496,7 @@ DeveloperToolbarTest.closeAllTabs = function() {
///////////////////////////////////////////////////////////////////////////////
var helpers = {};
this.helpers = {};
helpers._display = undefined;

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше