This commit is contained in:
Tim Taubert 2012-09-05 13:18:58 +02:00
Родитель 59cedff1d9 41cb0ed033
Коммит 3b96f62c69
22 изменённых файлов: 107 добавлений и 82 удалений

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

@ -91,7 +91,7 @@
<command id="Tools:DevToolbar" oncommand="DeveloperToolbar.toggle();" disabled="true" hidden="true"/>
<command id="Tools:DevToolbarFocus" oncommand="DeveloperToolbar.focus();" disabled="true"/>
<command id="Tools:WebConsole" oncommand="HUDConsoleUI.toggleHUD();"/>
<command id="Tools:Inspect" oncommand="InspectorUI.toggleInspectorUI();" disabled="true" hidden="true"/>
<command id="Tools:Inspect" oncommand="InspectorUI.toggleInspectorUI();"/>
<command id="Tools:Debugger" oncommand="DebuggerUI.toggleDebugger();" disabled="true" hidden="true"/>
<command id="Tools:RemoteDebugger" oncommand="DebuggerUI.toggleRemoteDebugger();" disabled="true" hidden="true"/>
<command id="Tools:ChromeDebugger" oncommand="DebuggerUI.toggleChromeDebugger();" disabled="true" hidden="true"/>

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

@ -605,7 +605,7 @@ html|*#gcli-output-frame,
/* Responsive Mode */
vbox[anonid=browserContainer][responsivemode] {
.browserContainer[responsivemode] {
overflow: auto;
}
@ -613,16 +613,16 @@ vbox[anonid=browserContainer][responsivemode] {
-moz-box-pack: end;
}
stack[anonid=browserStack][responsivemode] {
.browserStack[responsivemode] {
transition-duration: 200ms;
transition-timing-function: linear;
}
stack[anonid=browserStack][responsivemode] {
.browserStack[responsivemode] {
transition-property: min-width, max-width, min-height, max-height;
}
stack[anonid=browserStack][responsivemode][notransition] {
.browserStack[responsivemode][notransition] {
transition: none;
}

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

@ -1434,14 +1434,6 @@ var gBrowserInit = {
}
}
// Enable Inspector?
let enabled = gPrefService.getBoolPref("devtools.inspector.enabled");
if (enabled) {
let cmd = document.getElementById("Tools:Inspect");
cmd.removeAttribute("disabled");
cmd.removeAttribute("hidden");
}
// Enable Debugger?
let enabled = gPrefService.getBoolPref("devtools.debugger.enabled");
if (enabled) {

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

@ -26,12 +26,14 @@
onselect="if (event.target.localName == 'tabpanels') this.parentNode.updateCurrentBrowser();">
<xul:tabpanels flex="1" class="plain" selectedIndex="0" anonid="panelcontainer">
<xul:notificationbox flex="1">
<xul:vbox flex="1" anonid="browserContainer">
<xul:stack flex="1" anonid="browserStack">
<xul:browser type="content-primary" message="true" disablehistory="true"
xbl:inherits="tooltip=contenttooltip,contextmenu=contentcontextmenu,autocompletepopup"/>
</xul:stack>
</xul:vbox>
<xul:hbox flex="1" class="browserSidebarContainer">
<xul:vbox flex="1" class="browserContainer">
<xul:stack flex="1" class="browserStack">
<xul:browser anonid="initialBrowser" type="content-primary" message="true" disablehistory="true"
xbl:inherits="tooltip=contenttooltip,contextmenu=contentcontextmenu,autocompletepopup"/>
</xul:stack>
</xul:vbox>
</xul:hbox>
</xul:notificationbox>
</xul:tabpanels>
</xul:tabbox>
@ -292,6 +294,15 @@
</method>
<method name="getNotificationBox">
<parameter name="aBrowser"/>
<body>
<![CDATA[
return this.getSidebarContainer(aBrowser).parentNode;
]]>
</body>
</method>
<method name="getSidebarContainer">
<parameter name="aBrowser"/>
<body>
<![CDATA[
@ -1292,24 +1303,32 @@
var stack = document.createElementNS(
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
"stack");
stack.setAttribute("anonid", "browserStack");
stack.className = "browserStack";
stack.appendChild(b);
stack.setAttribute("flex", "1");
// Create the browserContainer
var box = document.createElementNS(
var browserContainer = document.createElementNS(
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
"vbox");
box.setAttribute("anonid", "browserContainer");
box.appendChild(stack);
box.setAttribute("flex", "1");
browserContainer.className = "browserContainer";
browserContainer.appendChild(stack);
browserContainer.setAttribute("flex", "1");
// Create the sidebar container
var browserSidebarContainer = document.createElementNS(
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
"hbox");
browserSidebarContainer.className = "browserSidebarContainer";
browserSidebarContainer.appendChild(browserContainer);
browserSidebarContainer.setAttribute("flex", "1");
// Add the Message and the Browser to the box
var notificationbox = document.createElementNS(
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
"notificationbox");
notificationbox.setAttribute("flex", "1");
notificationbox.appendChild(box);
notificationbox.appendChild(browserSidebarContainer);
var position = this.tabs.length - 1;
var uniqueId = "panel" + Date.now() + position;
@ -1754,7 +1773,7 @@
// This will unload the document. An unload handler could remove
// dependant tabs, so it's important that the tabbrowser is now in
// a consistent state (tab removed, tab positions updated, etc.).
panel.removeChild(this.getBrowserContainer(browser));
browser.parentNode.removeChild(browser);
// Release the browser in case something is erroneously holding a
// reference to the tab after its removal.
@ -2559,7 +2578,7 @@
<constructor>
<![CDATA[
this.mCurrentBrowser = this.mPanelContainer.firstChild.firstChild.firstChild.firstChild;
this.mCurrentBrowser = document.getAnonymousElementByAttribute(this, "anonid", "initialBrowser");
this.mCurrentTab = this.tabContainer.firstChild;
document.addEventListener("keypress", this, false);
window.addEventListener("sizemodechange", this, false);

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

@ -15,7 +15,7 @@ var runs = [
is(tabbrowser.browsers.length, 1, "Window has one browser");
is(tabbrowser.selectedTab, newTab, "Remaining tab is selected");
is(tabbrowser.selectedBrowser, newBrowser, "Browser for remaining tab is selected");
is(tabbrowser.mTabBox.selectedPanel, newBrowser.parentNode.parentNode.parentNode, "Panel for remaining tab is selected");
is(tabbrowser.mTabBox.selectedPanel, newBrowser.parentNode.parentNode.parentNode.parentNode, "Panel for remaining tab is selected");
}
}
];

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

@ -148,18 +148,18 @@ Highlighter.prototype = {
this.highlighterContainer.appendChild(outlineContainer);
this.highlighterContainer.appendChild(controlsBox);
stack.appendChild(this.highlighterContainer);
this.showOutline();
// Insert the highlighter right after the browser
stack.insertBefore(this.highlighterContainer, stack.childNodes[1]);
this.buildInfobar(controlsBox);
this.transitionDisabler = null;
this.pageEventsMuter = null;
this.computeZoomFactor();
this.unlock();
this.hide();
this.hidden = true;
this.show();
},
/**
@ -220,6 +220,10 @@ Highlighter.prototype = {
this.invalidateSize(!!aScroll);
if (this._highlighting) {
this.showOutline();
}
if (oldNode !== this.node) {
this.emitEvent("nodeselected");
}

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

@ -896,6 +896,10 @@ InspectorUI.prototype = {
this.inspectCommand.setAttribute("checked", "false");
this.inspecting = false;
if (this.closing)
return;
if (this.highlighter.getNode()) {
this.select(this.highlighter.getNode(), true, !aPreventScroll);
} else {

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

@ -93,7 +93,7 @@ function ResponsiveUI(aWindow, aTab)
this.browser = aTab.linkedBrowser;
this.chromeDoc = aWindow.document;
this.container = aWindow.gBrowser.getBrowserContainer(this.browser);
this.stack = this.container.querySelector("[anonid=browserStack]");
this.stack = this.container.querySelector(".browserStack");
// Try to load presets from prefs
if (Services.prefs.prefHasUserValue("devtools.responsiveUI.presets")) {
@ -282,12 +282,12 @@ ResponsiveUI.prototype = {
/**
* Build the toolbar and the resizers.
*
* <vbox anonid="browserContainer"> From tabbrowser.xml
* <vbox class="browserContainer"> From tabbrowser.xml
* <toolbar class="devtools-toolbar devtools-responsiveui-toolbar">
* <menulist class="devtools-menulist"/> // presets
* <toolbarbutton tabindex="0" class="devtools-toolbarbutton" label="rotate"/> // rotate
* </toolbar>
* <stack anonid="browserStack"> From tabbrowser.xml
* <stack class="browserStack"> From tabbrowser.xml
* <browser/>
* <box class="devtools-responsiveui-resizehandle" bottom="0" right="0"/>
* <box class="devtools-responsiveui-resizebar" top="0" right="0"/>

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

@ -61,14 +61,11 @@ const UNHIGHLIGHTING = Tilt.NOTIFICATIONS.UNHIGHLIGHTING;
const NODE_REMOVED = Tilt.NOTIFICATIONS.NODE_REMOVED;
const TILT_ENABLED = Services.prefs.getBoolPref("devtools.tilt.enabled");
const INSP_ENABLED = Services.prefs.getBoolPref("devtools.inspector.enabled");
function isTiltEnabled() {
let enabled = TILT_ENABLED && INSP_ENABLED;
info("Apparently, Tilt is" + (enabled ? "" : " not") + " enabled.");
return enabled;
info("Apparently, Tilt is" + (TILT_ENABLED ? "" : " not") + " enabled.");
return TILT_ENABLED;
}
function isWebGLSupported() {

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

@ -2487,13 +2487,13 @@ html|*#gcli-output-frame {
/* Responsive Mode */
vbox[anonid=browserContainer][responsivemode] {
.browserContainer[responsivemode] {
background: #2a3643 url("chrome://browser/skin/devtools/responsive-background.png");
box-shadow: 0 0 7px black inset;
padding: 0 20px 20px 20px;
}
stack[anonid=browserStack][responsivemode] {
.browserStack[responsivemode] {
box-shadow: 0 0 7px black;
}

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

@ -3206,13 +3206,13 @@ html|*#gcli-output-frame {
/* Responsive Mode */
vbox[anonid=browserContainer][responsivemode] {
.browserContainer[responsivemode] {
background: #2a3643 url("chrome://browser/skin/devtools/responsive-background.png");
box-shadow: 0 0 7px black inset;
padding: 0 20px 20px 20px;
}
stack[anonid=browserStack][responsivemode] {
.browserStack[responsivemode] {
box-shadow: 0 0 7px black;
}

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

@ -3167,13 +3167,13 @@ html|*#gcli-output-frame {
/* Responsive Mode */
vbox[anonid=browserContainer][responsivemode] {
.browserContainer[responsivemode] {
background: #2a3643 url("chrome://browser/skin/devtools/responsive-background.png");
box-shadow: 0 0 7px black inset;
padding: 0 20px 20px 20px;
}
stack[anonid=browserStack][responsivemode] {
.browserStack[responsivemode] {
box-shadow: 0 0 7px black;
}

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

@ -157,7 +157,7 @@ RDFSerializer.prototype = {
target.Value + "</em:" + prop + ">\n");
}
else {
throw new Error("Cannot serialize unknown literal type");
throw Components.Exception("Cannot serialize unknown literal type");
}
}
}
@ -184,7 +184,7 @@ RDFSerializer.prototype = {
serializeResource: function RDFS_serializeResource(aDs, aResource, aIndent) {
if (this.resources.indexOf(aResource) != -1 ) {
// We cannot output multiple references to the same resource.
throw new Error("Cannot serialize multiple references to " + aResource.Value);
throw Components.Exception("Cannot serialize multiple references to " + aResource.Value);
}
if (aIndent === undefined)
aIndent = "";
@ -256,7 +256,7 @@ function parseRDFManifest(aId, aType, aUpdateKey, aRequest) {
function getRequiredProperty(aDs, aSource, aProperty) {
let value = getProperty(aDs, aSource, aProperty);
if (!value)
throw new Error("Update manifest is missing a required " + aProperty + " property.");
throw Components.Exception("Update manifest is missing a required " + aProperty + " property.");
return value;
}
@ -284,7 +284,7 @@ function parseRDFManifest(aId, aType, aUpdateKey, aRequest) {
if (aUpdateKey) {
let signature = getProperty(ds, extensionRes, "signature");
if (!signature)
throw new Error("Update manifest for " + aId + " does not contain a required signature");
throw Components.Exception("Update manifest for " + aId + " does not contain a required signature");
let serializer = new RDFSerializer();
let updateString = null;
@ -292,7 +292,8 @@ function parseRDFManifest(aId, aType, aUpdateKey, aRequest) {
updateString = serializer.serializeResource(ds, extensionRes);
}
catch (e) {
throw new Error("Failed to generate signed string for " + aId + ". Serializer threw " + e);
throw Components.Exception("Failed to generate signed string for " + aId + ". Serializer threw " + e,
e.result);
}
let result = false;
@ -303,11 +304,12 @@ function parseRDFManifest(aId, aType, aUpdateKey, aRequest) {
result = verifier.verifyData(updateString, signature, aUpdateKey);
}
catch (e) {
throw new Error("The signature or updateKey for " + aId + " is malformed");
throw Components.Exception("The signature or updateKey for " + aId + " is malformed." +
"Verifier threw " + e, e.result);
}
if (!result)
throw new Error("The signature for " + aId + " was not created by the add-on's updateKey");
throw Components.Exception("The signature for " + aId + " was not created by the add-on's updateKey");
}
let updates = ds.GetTarget(extensionRes, EM_R("updates"), true);
@ -320,12 +322,12 @@ function parseRDFManifest(aId, aType, aUpdateKey, aRequest) {
}
if (!(updates instanceof Ci.nsIRDFResource))
throw new Error("Missing updates property for " + extensionRes.Value);
throw Components.Exception("Missing updates property for " + extensionRes.Value);
let cu = Cc["@mozilla.org/rdf/container-utils;1"].
getService(Ci.nsIRDFContainerUtils);
if (!cu.IsContainer(ds, updates))
throw new Error("Updates property was not an RDF container");
throw Components.Exception("Updates property was not an RDF container");
let results = [];
let ctr = Cc["@mozilla.org/rdf/container;1"].

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

@ -8,9 +8,10 @@
(function(){
let Cc = Components.classes;
let Ci = Components.interfaces;
let Cu = Components.utils;
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
const Cr = Components.results;
const MSG_INSTALL_ENABLED = "WebInstallerIsInstallEnabled";
const MSG_INSTALL_ADDONS = "WebInstallerInstallAddonsFromWebpage";
@ -65,7 +66,8 @@ function createInstallTrigger(window) {
*/
install: function(aArgs, aCallback) {
if (!aArgs || typeof aArgs != "object")
throw new Error("Incorrect arguments passed to InstallTrigger.install()");
throw Components.Exception("Incorrect arguments passed to InstallTrigger.install()",
Cr.NS_ERROR_INVALID_ARGS);
var params = {
installerId: this.installerId,
@ -82,13 +84,13 @@ function createInstallTrigger(window) {
if (typeof item === 'string') {
item = { URL: item };
} else if (!("URL" in item) || item.URL === undefined) {
throw new Error("Missing URL property for '" + name + "'");
throw Components.Exception("Missing URL property for '" + name + "'");
}
// Resolve and validate urls
var url = this.resolveURL(item.URL);
if (!this.checkLoadURIFromScript(url))
throw new Error("insufficient permissions to install: " + url);
throw Components.Exception("Insufficient permissions to install: " + url);
var iconUrl = null;
if ("IconURL" in item && item.IconURL !== undefined) {

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

@ -7,6 +7,7 @@
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
const Cr = Components.results;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
@ -221,7 +222,7 @@ var FakeHistory = {
back: function FakeHistory_back() {
if (this.pos == 0)
throw new Error("Cannot go back from this point");
throw Components.Exception("Cannot go back from this point");
this.pos--;
gViewController.updateState(this.states[this.pos]);
@ -231,7 +232,7 @@ var FakeHistory = {
forward: function FakeHistory_forward() {
if ((this.pos + 1) >= this.states.length)
throw new Error("Cannot go forward from this point");
throw Components.Exception("Cannot go forward from this point");
this.pos++;
gViewController.updateState(this.states[this.pos]);
@ -251,7 +252,7 @@ var FakeHistory = {
popState: function FakeHistory_popState() {
if (this.pos == 0)
throw new Error("Cannot popState from this view");
throw Components.Exception("Cannot popState from this view");
this.states.splice(this.pos, this.states.length);
this.pos--;
@ -580,11 +581,11 @@ var gViewController = {
var view = this.parseViewId(aViewId);
if (!view.type || !(view.type in this.viewObjects))
throw new Error("Invalid view: " + view.type);
throw Components.Exception("Invalid view: " + view.type);
var viewObj = this.viewObjects[view.type];
if (!viewObj.node)
throw new Error("Root node doesn't exist for '" + view.type + "' view");
throw Components.Exception("Root node doesn't exist for '" + view.type + "' view");
if (this.currentViewObj && aViewId != aPreviousView) {
try {
@ -2335,7 +2336,7 @@ var gListView = {
show: function gListView_show(aType, aRequest) {
if (!(aType in AddonManager.addonTypes))
throw new Error("Attempting to show unknown type " + aType);
throw Components.Exception("Attempting to show unknown type " + aType, Cr.NS_ERROR_INVALID_ARG);
this._type = aType;
this.node.setAttribute("type", aType);

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

@ -82,7 +82,7 @@
]]></getter>
<setter><![CDATA[
if (val != "average" || val != "user")
throw new Error("Invalid value");
throw Components.Exception("Invalid value", Components.results.NS_ERROR_ILLEGAL_VALUE);
this.setAttribute("showrating", val);
this._updateStars();
]]></setter>

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

@ -39,7 +39,7 @@
aIID.equals(Ci.nsISupports))
return this;
throw Components.results.NS_ERROR_NO_INTERFACE;
throw Components.Exception("No interface", Components.results.NS_ERROR_NO_INTERFACE);
},
observe: function(aSubject, aTopic, aPrefName) {
@ -78,7 +78,8 @@
<body>
<![CDATA[
// Should be code to set the from the preference input.value
throw "No valueFromPreference implementation";
throw Components.Exception("No valueFromPreference implementation",
Components.results.NS_ERROR_NOT_IMPLEMENTED);
]]>
</body>
</method>
@ -87,7 +88,8 @@
<body>
<![CDATA[
// Should be code to set the input.value from the preference
throw "No valueToPreference implementation";
throw Components.Exception("No valueToPreference implementation",
Components.results.NS_ERROR_NOT_IMPLEMENTED);
]]>
</body>
</method>

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

@ -56,13 +56,15 @@ let CustomChromeProtocol = {
// nsIFactory
createInstance: function BNPH_createInstance(aOuter, aIID) {
if (aOuter) {
throw Components.results.NS_ERROR_NO_AGGREGATION;
throw Components.Exception("Class does not allow aggregation",
Components.results.NS_ERROR_NO_AGGREGATION);
}
return CustomChromeProtocol.QueryInterface(aIID);
},
lockFactory: function BNPH_lockFactory(aLock) {
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
throw Components.Exception("Function lockFactory is not implemented",
Components.results.NS_ERROR_NOT_IMPLEMENTED);
},
QueryInterface: XPCOMUtils.generateQI([

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

@ -505,7 +505,7 @@ CertOverrideListener.prototype = {
aIID.equals(Ci.nsISupports))
return this;
throw Components.results.NS_ERROR_NO_INTERFACE;
throw Components.Exception("No interface", Components.results.NS_ERROR_NO_INTERFACE);
},
notifyCertProblem: function (socketInfo, sslStatus, targetHost) {
@ -1044,7 +1044,7 @@ MockAddon.prototype = {
uninstall: function() {
if (this.pendingOperations & AddonManager.PENDING_UNINSTALL)
throw new Error("Add-on is already pending uninstall");
throw Components.Exception("Add-on is already pending uninstall");
var needsRestart = !!(this.operationsRequiringRestart & AddonManager.OP_NEEDS_RESTART_UNINSTALL);
this.pendingOperations |= AddonManager.PENDING_UNINSTALL;
@ -1057,7 +1057,7 @@ MockAddon.prototype = {
cancelUninstall: function() {
if (!(this.pendingOperations & AddonManager.PENDING_UNINSTALL))
throw new Error("Add-on is not pending uninstall");
throw Components.Exception("Add-on is not pending uninstall");
this.pendingOperations -= AddonManager.PENDING_UNINSTALL;
AddonManagerPrivate.callAddonListeners("onOperationCancelled", this);

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

@ -6,8 +6,6 @@
// Disables security checking our updates which haven't been signed
Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false);
AddonManager.checkCompatibility = false;
var ADDONS = [
"test_bug470377_1",
"test_bug470377_2",
@ -28,6 +26,7 @@ function run_test() {
server.start(4444);
startupManager();
AddonManager.checkCompatibility = false;
installAllFiles([do_get_addon(a) for each (a in ADDONS)], function() {
restartManager();

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

@ -40,9 +40,9 @@ function run_test() {
}
function run_test_1() {
AddonManager.checkCompatibility = false;
startupManager();
AddonManager.checkCompatibility = false;
restartManager();
AddonManager.getAddonsByIDs(["bug470377_1@tests.mozilla.org",
"bug470377_2@tests.mozilla.org",

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

@ -8,7 +8,6 @@ const ID = "bug521905@tests.mozilla.org";
// Disables security checking our updates which haven't been signed
Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false);
AddonManager.checkCompatibility = false;
function run_test() {
// This test is only relevant on builds where the version is included in the
@ -21,6 +20,8 @@ function run_test() {
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2.0pre", "2");
startupManager();
AddonManager.checkCompatibility = false;
installAllFiles([do_get_addon(ADDON)], function() {
restartManager();