merge fx-team to mozilla-central

This commit is contained in:
Carsten "Tomcat" Book 2013-08-16 10:29:59 +02:00
commit 51ca40e611
60 changed files with 703 additions and 427 deletions

View File

@ -484,53 +484,54 @@ exports.testTabsEvent_onClose = function(test) {
// TEST: onClose event handler when a window is closed
exports.testTabsEvent_onCloseWindow = function(test) {
test.waitUntilDone();
let closeCount = 0;
let individualCloseCount = 0;
openBrowserWindow(function(window, browser) {
let closeCount = 0, individualCloseCount = 0;
function listener() {
closeCount++;
openBrowserWindow(function(window) {
tabs.on("close", function listener() {
if (++closeCount == 4) {
tabs.removeListener("close", listener);
}
});
function endTest() {
if (++individualCloseCount < 3) {
return;
}
test.assertEqual(closeCount, 4, "Correct number of close events received");
test.assertEqual(individualCloseCount, 3,
"Each tab with an attached onClose listener received a close " +
"event when the window was closed");
test.done();
}
tabs.on('close', listener);
// One tab is already open with the window
let openTabs = 1;
function testCasePossiblyLoaded() {
if (++openTabs == 4) {
beginCloseWindow();
window.close();
}
}
tabs.open({
url: "data:text/html;charset=utf-8,tab2",
onOpen: function() testCasePossiblyLoaded(),
onClose: function() individualCloseCount++
onOpen: testCasePossiblyLoaded,
onClose: endTest
});
tabs.open({
url: "data:text/html;charset=utf-8,tab3",
onOpen: function() testCasePossiblyLoaded(),
onClose: function() individualCloseCount++
onOpen: testCasePossiblyLoaded,
onClose: endTest
});
tabs.open({
url: "data:text/html;charset=utf-8,tab4",
onOpen: function() testCasePossiblyLoaded(),
onClose: function() individualCloseCount++
onOpen: testCasePossiblyLoaded,
onClose: endTest
});
function beginCloseWindow() {
closeBrowserWindow(window, function testFinished() {
tabs.removeListener("close", listener);
test.assertEqual(closeCount, 4, "Correct number of close events received");
test.assertEqual(individualCloseCount, 3,
"Each tab with an attached onClose listener received a close " +
"event when the window was closed");
test.done();
});
}
});
}
@ -843,18 +844,20 @@ exports['test window focus changes active tab'] = function(test) {
let win2 = openBrowserWindow(function() {
test.pass("window 2 is open");
tabs.on("activate", function onActivate(tab) {
tabs.removeListener("activate", onActivate);
test.pass("activate was called on windows focus change.");
test.assertEqual(tab.url, url1, 'the activated tab url is correct');
focus(win2).then(function() {
tabs.on("activate", function onActivate(tab) {
tabs.removeListener("activate", onActivate);
test.pass("activate was called on windows focus change.");
test.assertEqual(tab.url, url1, 'the activated tab url is correct');
close(win2).then(function() {
test.pass('window 2 was closed');
return close(win1);
}).then(test.done.bind(test));
close(win2).then(function() {
test.pass('window 2 was closed');
return close(win1);
}).then(test.done.bind(test));
});
win1.focus();
});
win1.focus();
}, "data:text/html;charset=utf-8,test window focus changes active tab</br><h1>Window #2");
}, url1);
};

View File

@ -81,7 +81,6 @@ SocialUI = {
this._updateMenuItems();
SocialFlyout.unload();
SocialChatBar.closeWindows();
SocialChatBar.update();
SocialShare.update();
SocialSidebar.update();
@ -339,21 +338,13 @@ SocialUI = {
}
SocialChatBar = {
closeWindows: function() {
// close all windows of type Social:Chat
let windows = Services.wm.getEnumerator("Social:Chat");
while (windows.hasMoreElements()) {
let win = windows.getNext();
win.close();
}
},
get chatbar() {
return document.getElementById("pinnedchats");
},
// Whether the chatbar is available for this window. Note that in full-screen
// mode chats are available, but not shown.
get isAvailable() {
return SocialUI.enabled && Social.haveLoggedInUser();
return SocialUI.enabled;
},
// Does this chatbar have any chats (whether minimized, collapsed or normal)
get hasChats() {
@ -373,7 +364,6 @@ SocialChatBar = {
update: function() {
let command = document.getElementById("Social:FocusChat");
if (!this.isAvailable) {
this.chatbar.removeAll();
this.chatbar.hidden = command.hidden = true;
} else {
this.chatbar.hidden = command.hidden = false;

View File

@ -6319,25 +6319,26 @@ function undoCloseTab(aIndex) {
if (gBrowser.tabs.length == 1 && isTabEmpty(gBrowser.selectedTab))
blankTabToRemove = gBrowser.selectedTab;
var tab = null;
var ss = Cc["@mozilla.org/browser/sessionstore;1"].
getService(Ci.nsISessionStore);
let numberOfTabsToUndoClose = 0;
if (Number.isInteger(aIndex)) {
if (ss.getClosedTabCount(window) > aIndex) {
numberOfTabsToUndoClose = 1;
} else {
return tab;
}
} else {
let index = Number(aIndex);
if (isNaN(index)) {
index = 0;
numberOfTabsToUndoClose = ss.getNumberOfTabsClosedLast(window);
aIndex = 0;
} else {
if (0 > index || index >= ss.getClosedTabCount(window))
return null;
numberOfTabsToUndoClose = 1;
}
let tab = null;
while (numberOfTabsToUndoClose > 0 &&
numberOfTabsToUndoClose--) {
TabView.prepareUndoCloseTab(blankTabToRemove);
tab = ss.undoCloseTab(window, aIndex);
tab = ss.undoCloseTab(window, index);
TabView.afterUndoCloseTab();
if (blankTabToRemove) {
gBrowser.removeTab(blankTabToRemove);

View File

@ -74,10 +74,33 @@ var tests = {
Services.wm.removeListener(this);
// wait for load to ensure the window is ready for us to test
domwindow.addEventListener("load", function _load() {
domwindow.removeEventListener("load", _load, false);
let doc = domwindow.document;
if (doc.location.href != "chrome://browser/content/chatWindow.xul")
return;
domwindow.removeEventListener("load", _load, false);
domwindow.addEventListener("unload", function _close() {
domwindow.removeEventListener("unload", _close, false);
info("window has been closed");
waitForCondition(function() {
return chats.selectedChat && chats.selectedChat.contentDocument &&
chats.selectedChat.contentDocument.readyState == "complete";
},function () {
ok(chats.selectedChat, "should have a chatbox in our window again");
ok(chats.selectedChat.getAttribute("label") == chatTitle,
"the new chatbox should show the title of the chat window again");
let testdiv = chats.selectedChat.contentDocument.getElementById("testdiv");
is(testdiv.getAttribute("test"), "2", "docshell should have been swapped");
chats.selectedChat.close();
waitForCondition(function() {
return chats.children.length == 0;
},function () {
next();
});
});
}, false);
is(doc.documentElement.getAttribute("windowtype"), "Social:Chat", "Social:Chat window opened");
is(doc.location.href, "chrome://browser/content/chatWindow.xul", "Should have seen the right window open");
// window is loaded, but the docswap does not happen until after load,
// and we have no event to wait on, so we'll wait for document state
// to be ready
@ -97,25 +120,76 @@ var tests = {
swap.click();
}, domwindow);
}, false);
domwindow.addEventListener("unload", function _close() {
domwindow.removeEventListener("unload", _close, false);
info("window has been closed");
waitForCondition(function() {
return chats.selectedChat && chats.selectedChat.contentDocument &&
chats.selectedChat.contentDocument.readyState == "complete";
},function () {
ok(chats.selectedChat, "should have a chatbox in our window again");
ok(chats.selectedChat.getAttribute("label") == chatTitle,
"the new chatbox should show the title of the chat window again");
let testdiv = chats.selectedChat.contentDocument.getElementById("testdiv");
is(testdiv.getAttribute("test"), "2", "docshell should have been swapped");
chats.selectedChat.close();
next();
});
}, false);
}
});
port.postMessage({topic: "test-init", data: { id: 1 }});
}
},
testCloseOnLogout: function(next) {
let chats = document.getElementById("pinnedchats");
const chatUrl = "https://example.com/browser/browser/base/content/test/social/social_chat.html";
let port = Social.provider.getWorkerPort();
ok(port, "provider has a port");
port.postMessage({topic: "test-init"});
port.onmessage = function (e) {
let topic = e.data.topic;
switch (topic) {
case "got-chatbox-visibility":
// chatbox is open, lets detach. The new chat window will be caught in
// the window watcher below
let doc = chats.selectedChat.contentDocument;
// This message is (sometimes!) received a second time
// before we start our tests from the onCloseWindow
// callback.
if (doc.location == "about:blank")
return;
info("chatbox is open, detach from window");
let swap = document.getAnonymousElementByAttribute(chats.selectedChat, "anonid", "swap");
swap.click();
break;
}
}
Services.wm.addListener({
onWindowTitleChange: function() {},
onCloseWindow: function(xulwindow) {},
onOpenWindow: function(xulwindow) {
let domwindow = xulwindow.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIDOMWindow);
Services.wm.removeListener(this);
// wait for load to ensure the window is ready for us to test, make sure
// we're not getting called for about:blank
domwindow.addEventListener("load", function _load() {
let doc = domwindow.document;
if (doc.location.href != "chrome://browser/content/chatWindow.xul")
return;
domwindow.removeEventListener("load", _load, false);
domwindow.addEventListener("unload", function _close() {
domwindow.removeEventListener("unload", _close, false);
ok(true, "window has been closed");
next();
}, false);
is(doc.documentElement.getAttribute("windowtype"), "Social:Chat", "Social:Chat window opened");
// window is loaded, but the docswap does not happen until after load,
// and we have no event to wait on, so we'll wait for document state
// to be ready
let chatbox = doc.getElementById("chatter");
waitForCondition(function() {
return chats.children.length == 0 &&
chatbox.contentDocument &&
chatbox.contentDocument.readyState == "complete";
},function() {
// logout, we should get unload next
port.postMessage({topic: "test-logout"});
}, domwindow);
}, false);
}
});
port.postMessage({topic: "test-worker-chat", data: chatUrl});
},
}

View File

@ -440,6 +440,7 @@ var tests = {
ok(!window.SocialChatBar.hasChats, "first window has no chats");
ok(secondWindow.SocialChatBar.hasChats, "second window has a chat");
secondWindow.close();
port.close();
next();
});
});
@ -453,20 +454,32 @@ var tests = {
const chatUrl = "https://example.com/browser/browser/base/content/test/social/social_chat.html";
let port = Social.provider.getWorkerPort();
ok(port, "provider has a port");
port.postMessage({topic: "test-init"});
let opened = false;
port.onmessage = function (e) {
let topic = e.data.topic;
switch (topic) {
case "test-init-done":
info("open first chat window");
port.postMessage({topic: "test-worker-chat", data: chatUrl});
break;
case "got-chatbox-message":
ok(true, "got a chat window opened");
port.postMessage({topic: "test-logout"});
port.close();
waitForCondition(function() document.getElementById("pinnedchats").firstChild == null,
next,
"chat windows didn't close");
if (opened) {
port.postMessage({topic: "test-logout"});
waitForCondition(function() document.getElementById("pinnedchats").firstChild == null,
function() {
port.close();
next();
},
"chat windows didn't close");
} else {
// open a second chat window
opened = true;
port.postMessage({topic: "test-worker-chat", data: chatUrl+"?id=1"});
}
break;
}
}
port.postMessage({topic: "test-worker-chat", data: chatUrl});
},
port.postMessage({topic: "test-init"});
}
}

View File

@ -222,8 +222,8 @@ function checkSocialUI(win) {
isbool(win.SocialSidebar.canShow, enabled, "social sidebar active?");
if (enabled)
isbool(win.SocialSidebar.opened, enabled, "social sidebar open?");
isbool(win.SocialChatBar.isAvailable, enabled && Social.haveLoggedInUser(), "chatbar available?");
isbool(!win.SocialChatBar.chatbar.hidden, enabled && Social.haveLoggedInUser(), "chatbar visible?");
isbool(win.SocialChatBar.isAvailable, enabled, "chatbar available?");
isbool(!win.SocialChatBar.chatbar.hidden, enabled, "chatbar visible?");
let markVisible = enabled && provider.pageMarkInfo;
let canMark = markVisible && win.SocialMark.canMarkPage(win.gBrowser.currentURI);
@ -246,7 +246,7 @@ function checkSocialUI(win) {
// and for good measure, check all the social commands.
isbool(!doc.getElementById("Social:Toggle").hidden, active, "Social:Toggle visible?");
isbool(!doc.getElementById("Social:ToggleNotifications").hidden, enabled, "Social:ToggleNotifications visible?");
isbool(!doc.getElementById("Social:FocusChat").hidden, enabled && Social.haveLoggedInUser(), "Social:FocusChat visible?");
isbool(!doc.getElementById("Social:FocusChat").hidden, enabled, "Social:FocusChat visible?");
isbool(doc.getElementById("Social:FocusChat").getAttribute("disabled"), enabled ? "false" : "true", "Social:FocusChat disabled?");
_is(doc.getElementById("Social:TogglePageMark").getAttribute("disabled"), canMark ? "false" : "true", "Social:TogglePageMark enabled?");

View File

@ -9,8 +9,8 @@ pref("app.update.interval", 43200); // 12 hours
// The time interval between the downloading of mar file chunks in the
// background (in seconds)
pref("app.update.download.backgroundInterval", 60);
// Give the user x seconds to react before showing the big UI. default=24 hours
pref("app.update.promptWaitTime", 86400);
// Give the user x seconds to react before showing the big UI. default=48 hours
pref("app.update.promptWaitTime", 172800);
// URL user can browse to manually if for some reason all update installation
// attempts fail.
pref("app.update.url.manual", "https://www.mozilla.org/firefox/");

View File

@ -2,74 +2,85 @@
* 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 TEST_URL = "data:text/html;charset=utf-8,<input%20id=txt>" +
"<input%20type=checkbox%20id=chk>";
/**
* This test ensures that closing a window is a reversible action. We will
* close the the window, restore it and check that all data has been restored.
* This includes window-specific data as well as form data for tabs.
*/
function test() {
waitForExplicitFinish();
let testURL = "about:config";
let uniqueKey = "bug 394759";
let uniqueValue = "unik" + Date.now();
let uniqueText = "pi != " + Math.random();
// Be consistent: let the page actually display, as we are "interacting" with it.
Services.prefs.setBoolPref("general.warnOnAboutConfig", false);
// make sure that the next closed window will increase getClosedWindowCount
let max_windows_undo = Services.prefs.getIntPref("browser.sessionstore.max_windows_undo");
Services.prefs.setIntPref("browser.sessionstore.max_windows_undo", max_windows_undo + 1);
let closedWindowCount = ss.getClosedWindowCount();
// Clear the list of closed windows.
while (SessionStore.getClosedWindowCount()) {
SessionStore.forgetClosedWindow(0);
}
provideWindow(function onTestURLLoaded(newWin) {
newWin.gBrowser.addTab().linkedBrowser.stop();
// mark the window with some unique data to be restored later on
ss.setWindowValue(newWin, uniqueKey, uniqueValue);
let textbox = newWin.content.document.getElementById("textbox");
textbox.value = uniqueText;
let [txt, chk] = newWin.content.document.querySelectorAll("#txt, #chk");
txt.value = uniqueText;
newWin.close();
// Toggle the checkbox to cause a SessionStore:input message to be sent.
EventUtils.sendMouseEvent({type: "click"}, chk);
is(ss.getClosedWindowCount(), closedWindowCount + 1,
"The closed window was added to Recently Closed Windows");
let data = JSON.parse(ss.getClosedWindowData())[0];
ok(data.title == testURL && JSON.stringify(data).indexOf(uniqueText) > -1,
"The closed window data was stored correctly");
let browser = newWin.gBrowser.selectedBrowser;
waitForContentMessage(browser, "SessionStore:input", 1000, result => {
ok(result, "received message for input changes");
// reopen the closed window and ensure its integrity
let newWin2 = ss.undoCloseWindow(0);
newWin.close();
ok(newWin2 instanceof ChromeWindow,
"undoCloseWindow actually returned a window");
is(ss.getClosedWindowCount(), closedWindowCount,
"The reopened window was removed from Recently Closed Windows");
is(ss.getClosedWindowCount(), 1,
"The closed window was added to Recently Closed Windows");
let data = JSON.parse(ss.getClosedWindowData())[0];
ok(data.title == TEST_URL && JSON.stringify(data).indexOf(uniqueText) > -1,
"The closed window data was stored correctly");
// SSTabRestored will fire more than once, so we need to make sure we count them
let restoredTabs = 0;
let expectedTabs = data.tabs.length;
newWin2.addEventListener("SSTabRestored", function sstabrestoredListener(aEvent) {
++restoredTabs;
info("Restored tab " + restoredTabs + "/" + expectedTabs);
if (restoredTabs < expectedTabs) {
return;
}
// reopen the closed window and ensure its integrity
let newWin2 = ss.undoCloseWindow(0);
newWin2.removeEventListener("SSTabRestored", sstabrestoredListener, true);
ok(newWin2 instanceof ChromeWindow,
"undoCloseWindow actually returned a window");
is(ss.getClosedWindowCount(), 0,
"The reopened window was removed from Recently Closed Windows");
is(newWin2.gBrowser.tabs.length, 2,
"The window correctly restored 2 tabs");
is(newWin2.gBrowser.currentURI.spec, testURL,
"The window correctly restored the URL");
// SSTabRestored will fire more than once, so we need to make sure we count them
let restoredTabs = 0;
let expectedTabs = data.tabs.length;
newWin2.addEventListener("SSTabRestored", function sstabrestoredListener(aEvent) {
++restoredTabs;
info("Restored tab " + restoredTabs + "/" + expectedTabs);
if (restoredTabs < expectedTabs) {
return;
}
let textbox = newWin2.content.document.getElementById("textbox");
is(textbox.value, uniqueText,
"The window correctly restored the form");
is(ss.getWindowValue(newWin2, uniqueKey), uniqueValue,
"The window correctly restored the data associated with it");
is(restoredTabs, expectedTabs, "correct number of tabs restored");
newWin2.removeEventListener("SSTabRestored", sstabrestoredListener, true);
// clean up
newWin2.close();
Services.prefs.clearUserPref("browser.sessionstore.max_windows_undo");
Services.prefs.clearUserPref("general.warnOnAboutConfig");
finish();
}, true);
}, testURL);
is(newWin2.gBrowser.tabs.length, 2,
"The window correctly restored 2 tabs");
is(newWin2.gBrowser.currentURI.spec, TEST_URL,
"The window correctly restored the URL");
let [txt, chk] = newWin2.content.document.querySelectorAll("#txt, #chk");
ok(txt.value == uniqueText && chk.checked,
"The window correctly restored the form");
is(ss.getWindowValue(newWin2, uniqueKey), uniqueValue,
"The window correctly restored the data associated with it");
// clean up
newWin2.close();
finish();
}, true);
});
}, TEST_URL);
}

View File

@ -7,6 +7,57 @@
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
const NET_STRINGS_URI = "chrome://browser/locale/devtools/netmonitor.properties";
const LISTENERS = [ "NetworkActivity" ];
const NET_PREFS = { "NetworkMonitor.saveRequestAndResponseBodies": true };
// The panel's window global is an EventEmitter firing the following events:
const EVENTS = {
// When the monitored target begins and finishes navigating.
TARGET_WILL_NAVIGATE: "NetMonitor:TargetWillNavigate",
TARGET_DID_NAVIGATE: "NetMonitor:TargetNavigate",
// When a network event is received.
// See https://developer.mozilla.org/docs/Tools/Web_Console/remoting for
// more information about what each packet is supposed to deliver.
NETWORK_EVENT: "NetMonitor:NetworkEvent",
// When request headers begin and finish receiving.
UPDATING_REQUEST_HEADERS: "NetMonitor:NetworkEventUpdating:RequestHeaders",
RECEIVED_REQUEST_HEADERS: "NetMonitor:NetworkEventUpdated:RequestHeaders",
// When request cookies begin and finish receiving.
UPDATING_REQUEST_COOKIES: "NetMonitor:NetworkEventUpdating:RequestCookies",
RECEIVED_REQUEST_COOKIES: "NetMonitor:NetworkEventUpdated:RequestCookies",
// When request post data begins and finishes receiving.
UPDATING_REQUEST_POST_DATA: "NetMonitor:NetworkEventUpdating:RequestPostData",
RECEIVED_REQUEST_POST_DATA: "NetMonitor:NetworkEventUpdated:RequestPostData",
// When response headers begin and finish receiving.
UPDATING_RESPONSE_HEADERS: "NetMonitor:NetworkEventUpdating:ResponseHeaders",
RECEIVED_RESPONSE_HEADERS: "NetMonitor:NetworkEventUpdated:ResponseHeaders",
// When response cookies begin and finish receiving.
UPDATING_RESPONSE_COOKIES: "NetMonitor:NetworkEventUpdating:ResponseCookies",
RECEIVED_RESPONSE_COOKIES: "NetMonitor:NetworkEventUpdated:ResponseCookies",
// When event timings begin and finish receiving.
UPDATING_EVENT_TIMINGS: "NetMonitor:NetworkEventUpdating:EventTimings",
RECEIVED_EVENT_TIMINGS: "NetMonitor:NetworkEventUpdated:EventTimings",
// When response content begins, updates and finishes receiving.
STARTED_RECEIVING_RESPONSE: "NetMonitor:NetworkEventUpdating:ResponseStart",
UPDATING_RESPONSE_CONTENT: "NetMonitor:NetworkEventUpdating:ResponseContent",
RECEIVED_RESPONSE_CONTENT: "NetMonitor:NetworkEventUpdated:ResponseContent",
// When the request post params are displayed in the UI.
REQUEST_POST_PARAMS_DISPLAYED: "NetMonitor:RequestPostParamsAvailable",
// When the response body is displayed in the UI.
RESPONSE_BODY_DISPLAYED: "NetMonitor:ResponseBodyAvailable"
}
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
let promise = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js").Promise;
@ -33,10 +84,6 @@ Object.defineProperty(this, "NetworkHelper", {
XPCOMUtils.defineLazyServiceGetter(this, "clipboardHelper",
"@mozilla.org/widget/clipboardhelper;1", "nsIClipboardHelper");
const NET_STRINGS_URI = "chrome://browser/locale/devtools/netmonitor.properties";
const LISTENERS = [ "NetworkActivity" ];
const NET_PREFS = { "NetworkMonitor.saveRequestAndResponseBodies": true };
/**
* Object defining the network monitor controller components.
*/
@ -255,11 +302,11 @@ TargetEventsHandler.prototype = {
nsIURL.store.clear();
drain.store.clear();
window.emit("NetMonitor:TargetWillNavigate");
window.emit(EVENTS.TARGET_WILL_NAVIGATE);
break;
}
case "navigate": {
window.emit("NetMonitor:TargetNavigate");
window.emit(EVENTS.TARGET_DID_NAVIGATE);
break;
}
}
@ -325,7 +372,7 @@ NetworkEventsHandler.prototype = {
let { actor, startedDateTime, method, url, isXHR } = aPacket.eventActor;
NetMonitorView.RequestsMenu.addRequest(actor, startedDateTime, method, url, isXHR);
window.emit("NetMonitor:NetworkEvent");
window.emit(EVENTS.NETWORK_EVENT);
},
/**
@ -342,23 +389,23 @@ NetworkEventsHandler.prototype = {
switch (aPacket.updateType) {
case "requestHeaders":
this.webConsoleClient.getRequestHeaders(actor, this._onRequestHeaders);
window.emit("NetMonitor:NetworkEventUpdating:RequestHeaders");
window.emit(EVENTS.UPDATING_REQUEST_HEADERS);
break;
case "requestCookies":
this.webConsoleClient.getRequestCookies(actor, this._onRequestCookies);
window.emit("NetMonitor:NetworkEventUpdating:RequestCookies");
window.emit(EVENTS.UPDATING_REQUEST_COOKIES);
break;
case "requestPostData":
this.webConsoleClient.getRequestPostData(actor, this._onRequestPostData);
window.emit("NetMonitor:NetworkEventUpdating:RequestPostData");
window.emit(EVENTS.UPDATING_REQUEST_POST_DATA);
break;
case "responseHeaders":
this.webConsoleClient.getResponseHeaders(actor, this._onResponseHeaders);
window.emit("NetMonitor:NetworkEventUpdating:ResponseHeaders");
window.emit(EVENTS.UPDATING_RESPONSE_HEADERS);
break;
case "responseCookies":
this.webConsoleClient.getResponseCookies(actor, this._onResponseCookies);
window.emit("NetMonitor:NetworkEventUpdating:ResponseCookies");
window.emit(EVENTS.UPDATING_RESPONSE_COOKIES);
break;
case "responseStart":
NetMonitorView.RequestsMenu.updateRequest(aPacket.from, {
@ -367,7 +414,7 @@ NetworkEventsHandler.prototype = {
statusText: aPacket.response.statusText,
headersSize: aPacket.response.headersSize
});
window.emit("NetMonitor:NetworkEventUpdating:ResponseStart");
window.emit(EVENTS.STARTED_RECEIVING_RESPONSE);
break;
case "responseContent":
NetMonitorView.RequestsMenu.updateRequest(aPacket.from, {
@ -375,14 +422,14 @@ NetworkEventsHandler.prototype = {
mimeType: aPacket.mimeType
});
this.webConsoleClient.getResponseContent(actor, this._onResponseContent);
window.emit("NetMonitor:NetworkEventUpdating:ResponseContent");
window.emit(EVENTS.UPDATING_RESPONSE_CONTENT);
break;
case "eventTimings":
NetMonitorView.RequestsMenu.updateRequest(aPacket.from, {
totalTime: aPacket.totalTime
});
this.webConsoleClient.getEventTimings(actor, this._onEventTimings);
window.emit("NetMonitor:NetworkEventUpdating:EventTimings");
window.emit(EVENTS.UPDATING_EVENT_TIMINGS);
break;
}
},
@ -397,7 +444,7 @@ NetworkEventsHandler.prototype = {
NetMonitorView.RequestsMenu.updateRequest(aResponse.from, {
requestHeaders: aResponse
});
window.emit("NetMonitor:NetworkEventUpdated:RequestHeaders");
window.emit(EVENTS.RECEIVED_REQUEST_HEADERS);
},
/**
@ -410,7 +457,7 @@ NetworkEventsHandler.prototype = {
NetMonitorView.RequestsMenu.updateRequest(aResponse.from, {
requestCookies: aResponse
});
window.emit("NetMonitor:NetworkEventUpdated:RequestCookies");
window.emit(EVENTS.RECEIVED_REQUEST_COOKIES);
},
/**
@ -423,7 +470,7 @@ NetworkEventsHandler.prototype = {
NetMonitorView.RequestsMenu.updateRequest(aResponse.from, {
requestPostData: aResponse
});
window.emit("NetMonitor:NetworkEventUpdated:RequestPostData");
window.emit(EVENTS.RECEIVED_REQUEST_POST_DATA);
},
/**
@ -436,7 +483,7 @@ NetworkEventsHandler.prototype = {
NetMonitorView.RequestsMenu.updateRequest(aResponse.from, {
responseHeaders: aResponse
});
window.emit("NetMonitor:NetworkEventUpdated:ResponseHeaders");
window.emit(EVENTS.RECEIVED_RESPONSE_HEADERS);
},
/**
@ -449,7 +496,7 @@ NetworkEventsHandler.prototype = {
NetMonitorView.RequestsMenu.updateRequest(aResponse.from, {
responseCookies: aResponse
});
window.emit("NetMonitor:NetworkEventUpdated:ResponseCookies");
window.emit(EVENTS.RECEIVED_RESPONSE_COOKIES);
},
/**
@ -462,7 +509,7 @@ NetworkEventsHandler.prototype = {
NetMonitorView.RequestsMenu.updateRequest(aResponse.from, {
responseContent: aResponse
});
window.emit("NetMonitor:NetworkEventUpdated:ResponseContent");
window.emit(EVENTS.RECEIVED_RESPONSE_CONTENT);
},
/**
@ -475,7 +522,7 @@ NetworkEventsHandler.prototype = {
NetMonitorView.RequestsMenu.updateRequest(aResponse.from, {
eventTimings: aResponse
});
window.emit("NetMonitor:NetworkEventUpdated:EventTimings");
window.emit(EVENTS.RECEIVED_EVENT_TIMINGS);
},
/**

View File

@ -1790,7 +1790,7 @@ NetworkDetailsView.prototype = {
aEditor.setText(aString);
});
}
window.emit("NetMonitor:ResponsePostParamsAvailable");
window.emit(EVENTS.REQUEST_POST_PARAMS_DISPLAYED);
});
},
@ -1913,7 +1913,7 @@ NetworkDetailsView.prototype = {
}
});
}
window.emit("NetMonitor:ResponseBodyAvailable");
window.emit(EVENTS.RESPONSE_BODY_DISPLAYED);
});
},

View File

@ -28,7 +28,7 @@ function test() {
document.querySelectorAll("#details-pane tab")[3]);
NetMonitorView.editor("#response-content-textarea").then((aEditor) => {
is(aEditor.getText().indexOf("\u044F"), 189, // я
is(aEditor.getText().indexOf("\u044F"), 302, // я
"The text shown in the source editor is incorrect.");
is(aEditor.getMode(), SourceEditor.MODES.HTML,
"The mode active in the source editor is incorrect.");

View File

@ -29,7 +29,7 @@ function test() {
time: true
});
aMonitor.panelWin.once("NetMonitor:ResponseBodyAvailable", () => {
aMonitor.panelWin.once(aMonitor.panelWin.EVENTS.RESPONSE_BODY_DISPLAYED, () => {
testResponseTab();
teardown(aMonitor).then(finish);
});

View File

@ -25,7 +25,7 @@ function test() {
statusText: "OK"
});
aMonitor.panelWin.once("NetMonitor:ResponseBodyAvailable", () => {
aMonitor.panelWin.once(aMonitor.panelWin.EVENTS.RESPONSE_BODY_DISPLAYED, () => {
NetMonitorView.editor("#response-content-textarea").then((aEditor) => {
ok(aEditor.getText().match(/^<p>/),
"The text shown in the source editor is incorrect.");

View File

@ -15,11 +15,11 @@ function test() {
function testNavigate(aCallback) {
info("Navigating forward...");
aMonitor.panelWin.once("NetMonitor:TargetWillNavigate", () => {
aMonitor.panelWin.once(aMonitor.panelWin.EVENTS.TARGET_WILL_NAVIGATE, () => {
is(aDebuggee.location, SIMPLE_URL,
"Target started navigating to the correct location.");
aMonitor.panelWin.once("NetMonitor:TargetNavigate", () => {
aMonitor.panelWin.once(aMonitor.panelWin.EVENTS.TARGET_DID_NAVIGATE, () => {
is(aDebuggee.location, NAVIGATE_URL,
"Target finished navigating to the correct location.");
@ -33,11 +33,11 @@ function test() {
function testNavigateBack(aCallback) {
info("Navigating backward...");
aMonitor.panelWin.once("NetMonitor:TargetWillNavigate", () => {
aMonitor.panelWin.once(aMonitor.panelWin.EVENTS.TARGET_WILL_NAVIGATE, () => {
is(aDebuggee.location, NAVIGATE_URL,
"Target started navigating back to the previous location.");
aMonitor.panelWin.once("NetMonitor:TargetNavigate", () => {
aMonitor.panelWin.once(aMonitor.panelWin.EVENTS.TARGET_DID_NAVIGATE, () => {
is(aDebuggee.location, SIMPLE_URL,
"Target finished navigating back to the previous location.");

View File

@ -26,7 +26,7 @@ function test() {
is(RequestsMenu.selectedItem, null,
"There should be no selected item in the requests menu.");
aMonitor.panelWin.once("NetMonitor:NetworkEvent", () => {
aMonitor.panelWin.once(aMonitor.panelWin.EVENTS.NETWORK_EVENT, () => {
is(document.querySelector("#details-pane-toggle")
.hasAttribute("disabled"), false,
"The pane toggle button should be enabled after the first request.");

View File

@ -18,7 +18,7 @@ function test() {
.then(() => teardown(aMonitor))
.then(finish);
aMonitor.panelWin.once("NetMonitor:NetworkEvent", () => {
aMonitor.panelWin.once(aMonitor.panelWin.EVENTS.NETWORK_EVENT, () => {
is(RequestsMenu.selectedItem, null,
"There shouldn't be any selected item in the requests menu.");
is(RequestsMenu.itemCount, 1,
@ -81,7 +81,7 @@ function test() {
verifyRequestItemTarget(requestItem, "GET", SIMPLE_SJS);
});
aMonitor.panelWin.once("NetMonitor:NetworkEventUpdated:RequestHeaders", () => {
aMonitor.panelWin.once(aMonitor.panelWin.EVENTS.RECEIVED_REQUEST_HEADERS, () => {
let requestItem = RequestsMenu.getItemAtIndex(0);
ok(requestItem.attachment.requestHeaders,
@ -98,7 +98,7 @@ function test() {
verifyRequestItemTarget(requestItem, "GET", SIMPLE_SJS);
});
aMonitor.panelWin.once("NetMonitor:NetworkEventUpdated:RequestCookies", () => {
aMonitor.panelWin.once(aMonitor.panelWin.EVENTS.RECEIVED_REQUEST_COOKIES, () => {
let requestItem = RequestsMenu.getItemAtIndex(0);
ok(requestItem.attachment.requestCookies,
@ -109,11 +109,11 @@ function test() {
verifyRequestItemTarget(requestItem, "GET", SIMPLE_SJS);
});
aMonitor.panelWin.once("NetMonitor:NetworkEventUpdated:RequestPostData", () => {
aMonitor.panelWin.once(aMonitor.panelWin.EVENTS.RECEIVED_REQUEST_POST_DATA, () => {
ok(false, "Trap listener: this request doesn't have any post data.")
});
aMonitor.panelWin.once("NetMonitor:NetworkEventUpdated:ResponseHeaders", () => {
aMonitor.panelWin.once(aMonitor.panelWin.EVENTS.RECEIVED_RESPONSE_HEADERS, () => {
let requestItem = RequestsMenu.getItemAtIndex(0);
ok(requestItem.attachment.responseHeaders,
@ -126,7 +126,7 @@ function test() {
verifyRequestItemTarget(requestItem, "GET", SIMPLE_SJS);
});
aMonitor.panelWin.once("NetMonitor:NetworkEventUpdated:ResponseCookies", () => {
aMonitor.panelWin.once(aMonitor.panelWin.EVENTS.RECEIVED_RESPONSE_COOKIES, () => {
let requestItem = RequestsMenu.getItemAtIndex(0);
ok(requestItem.attachment.responseCookies,
@ -137,7 +137,7 @@ function test() {
verifyRequestItemTarget(requestItem, "GET", SIMPLE_SJS);
});
aMonitor.panelWin.once("NetMonitor:NetworkEventUpdating:ResponseStart", () => {
aMonitor.panelWin.once(aMonitor.panelWin.EVENTS.STARTED_RECEIVING_RESPONSE, () => {
let requestItem = RequestsMenu.getItemAtIndex(0);
is(requestItem.attachment.httpVersion, "HTTP/1.1",
@ -155,7 +155,7 @@ function test() {
});
});
aMonitor.panelWin.once("NetMonitor:NetworkEventUpdating:ResponseContent", () => {
aMonitor.panelWin.once(aMonitor.panelWin.EVENTS.UPDATING_RESPONSE_CONTENT, () => {
let requestItem = RequestsMenu.getItemAtIndex(0);
is(requestItem.attachment.contentSize, "12",
@ -170,7 +170,7 @@ function test() {
});
});
aMonitor.panelWin.once("NetMonitor:NetworkEventUpdated:ResponseContent", () => {
aMonitor.panelWin.once(aMonitor.panelWin.EVENTS.RECEIVED_RESPONSE_CONTENT, () => {
let requestItem = RequestsMenu.getItemAtIndex(0);
ok(requestItem.attachment.responseContent,
@ -189,7 +189,7 @@ function test() {
});
});
aMonitor.panelWin.once("NetMonitor:NetworkEventUpdating:EventTimings", () => {
aMonitor.panelWin.once(aMonitor.panelWin.EVENTS.UPDATING_EVENT_TIMINGS, () => {
let requestItem = RequestsMenu.getItemAtIndex(0);
is(typeof requestItem.attachment.totalTime, "number",
@ -207,7 +207,7 @@ function test() {
});
});
aMonitor.panelWin.once("NetMonitor:NetworkEventUpdated:EventTimings", () => {
aMonitor.panelWin.once(aMonitor.panelWin.EVENTS.RECEIVED_EVENT_TIMINGS, () => {
let requestItem = RequestsMenu.getItemAtIndex(0);
ok(requestItem.attachment.eventTimings,

View File

@ -25,7 +25,7 @@ function test() {
is(NetMonitorView.detailsPaneHidden, true,
"The details pane should be hidden when the frontend is opened.");
aMonitor.panelWin.once("NetMonitor:NetworkEvent", () => {
aMonitor.panelWin.once(aMonitor.panelWin.EVENTS.NETWORK_EVENT, () => {
is(document.querySelector("#details-pane-toggle")
.hasAttribute("disabled"), false,
"The pane toggle button should be enabled after the first request.");
@ -37,7 +37,7 @@ function test() {
is(NetMonitorView.detailsPaneHidden, true,
"The details pane should still be hidden after the first request.");
aMonitor.panelWin.once("NetMonitor:NetworkEvent", () => {
aMonitor.panelWin.once(aMonitor.panelWin.EVENTS.NETWORK_EVENT, () => {
is(document.querySelector("#details-pane-toggle")
.hasAttribute("disabled"), false,
"The pane toggle button should be still be enabled after a reload.");

View File

@ -148,41 +148,41 @@ function waitForNetworkEvents(aMonitor, aGetRequests, aPostRequests = 0) {
if (genericEvents == (aGetRequests + aPostRequests) * 13 &&
postEvents == aPostRequests * 2) {
panel.off("NetMonitor:NetworkEventUpdating:RequestHeaders", onGenericEvent);
panel.off("NetMonitor:NetworkEventUpdated:RequestHeaders", onGenericEvent);
panel.off("NetMonitor:NetworkEventUpdating:RequestCookies", onGenericEvent);
panel.off("NetMonitor:NetworkEventUpdating:RequestPostData", onPostEvent);
panel.off("NetMonitor:NetworkEventUpdated:RequestPostData", onPostEvent);
panel.off("NetMonitor:NetworkEventUpdated:RequestCookies", onGenericEvent);
panel.off("NetMonitor:NetworkEventUpdating:ResponseHeaders", onGenericEvent);
panel.off("NetMonitor:NetworkEventUpdated:ResponseHeaders", onGenericEvent);
panel.off("NetMonitor:NetworkEventUpdating:ResponseCookies", onGenericEvent);
panel.off("NetMonitor:NetworkEventUpdated:ResponseCookies", onGenericEvent);
panel.off("NetMonitor:NetworkEventUpdating:ResponseStart", onGenericEvent);
panel.off("NetMonitor:NetworkEventUpdating:ResponseContent", onGenericEvent);
panel.off("NetMonitor:NetworkEventUpdated:ResponseContent", onGenericEvent);
panel.off("NetMonitor:NetworkEventUpdating:EventTimings", onGenericEvent);
panel.off("NetMonitor:NetworkEventUpdated:EventTimings", onGenericEvent);
panel.off(panel.EVENTS.UPDATING_REQUEST_HEADERS, onGenericEvent);
panel.off(panel.EVENTS.RECEIVED_REQUEST_HEADERS, onGenericEvent);
panel.off(panel.EVENTS.UPDATING_REQUEST_COOKIES, onGenericEvent);
panel.off(panel.EVENTS.RECEIVED_REQUEST_COOKIES, onGenericEvent);
panel.off(panel.EVENTS.UPDATING_REQUEST_POST_DATA, onPostEvent);
panel.off(panel.EVENTS.RECEIVED_REQUEST_POST_DATA, onPostEvent);
panel.off(panel.EVENTS.UPDATING_RESPONSE_HEADERS, onGenericEvent);
panel.off(panel.EVENTS.RECEIVED_RESPONSE_HEADERS, onGenericEvent);
panel.off(panel.EVENTS.UPDATING_RESPONSE_COOKIES, onGenericEvent);
panel.off(panel.EVENTS.RECEIVED_RESPONSE_COOKIES, onGenericEvent);
panel.off(panel.EVENTS.STARTED_RECEIVING_RESPONSE, onGenericEvent);
panel.off(panel.EVENTS.UPDATING_RESPONSE_CONTENT, onGenericEvent);
panel.off(panel.EVENTS.RECEIVED_RESPONSE_CONTENT, onGenericEvent);
panel.off(panel.EVENTS.UPDATING_EVENT_TIMINGS, onGenericEvent);
panel.off(panel.EVENTS.RECEIVED_EVENT_TIMINGS, onGenericEvent);
executeSoon(deferred.resolve);
}
}
panel.on("NetMonitor:NetworkEventUpdating:RequestHeaders", onGenericEvent);
panel.on("NetMonitor:NetworkEventUpdated:RequestHeaders", onGenericEvent);
panel.on("NetMonitor:NetworkEventUpdating:RequestCookies", onGenericEvent);
panel.on("NetMonitor:NetworkEventUpdating:RequestPostData", onPostEvent);
panel.on("NetMonitor:NetworkEventUpdated:RequestPostData", onPostEvent);
panel.on("NetMonitor:NetworkEventUpdated:RequestCookies", onGenericEvent);
panel.on("NetMonitor:NetworkEventUpdating:ResponseHeaders", onGenericEvent);
panel.on("NetMonitor:NetworkEventUpdated:ResponseHeaders", onGenericEvent);
panel.on("NetMonitor:NetworkEventUpdating:ResponseCookies", onGenericEvent);
panel.on("NetMonitor:NetworkEventUpdated:ResponseCookies", onGenericEvent);
panel.on("NetMonitor:NetworkEventUpdating:ResponseStart", onGenericEvent);
panel.on("NetMonitor:NetworkEventUpdating:ResponseContent", onGenericEvent);
panel.on("NetMonitor:NetworkEventUpdated:ResponseContent", onGenericEvent);
panel.on("NetMonitor:NetworkEventUpdating:EventTimings", onGenericEvent);
panel.on("NetMonitor:NetworkEventUpdated:EventTimings", onGenericEvent);
panel.on(panel.EVENTS.UPDATING_REQUEST_HEADERS, onGenericEvent);
panel.on(panel.EVENTS.RECEIVED_REQUEST_HEADERS, onGenericEvent);
panel.on(panel.EVENTS.UPDATING_REQUEST_COOKIES, onGenericEvent);
panel.on(panel.EVENTS.RECEIVED_REQUEST_COOKIES, onGenericEvent);
panel.on(panel.EVENTS.UPDATING_REQUEST_POST_DATA, onPostEvent);
panel.on(panel.EVENTS.RECEIVED_REQUEST_POST_DATA, onPostEvent);
panel.on(panel.EVENTS.UPDATING_RESPONSE_HEADERS, onGenericEvent);
panel.on(panel.EVENTS.RECEIVED_RESPONSE_HEADERS, onGenericEvent);
panel.on(panel.EVENTS.UPDATING_RESPONSE_COOKIES, onGenericEvent);
panel.on(panel.EVENTS.RECEIVED_RESPONSE_COOKIES, onGenericEvent);
panel.on(panel.EVENTS.STARTED_RECEIVING_RESPONSE, onGenericEvent);
panel.on(panel.EVENTS.UPDATING_RESPONSE_CONTENT, onGenericEvent);
panel.on(panel.EVENTS.RECEIVED_RESPONSE_CONTENT, onGenericEvent);
panel.on(panel.EVENTS.UPDATING_EVENT_TIMINGS, onGenericEvent);
panel.on(panel.EVENTS.RECEIVED_EVENT_TIMINGS, onGenericEvent);
return deferred.promise;
}

View File

@ -1,3 +1,5 @@
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!doctype html>
<html>

View File

@ -1,3 +1,5 @@
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!doctype html>
<html>

View File

@ -1,3 +1,5 @@
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!doctype html>
<html>

View File

@ -1,3 +1,5 @@
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!doctype html>
<html>

View File

@ -1,3 +1,5 @@
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!doctype html>
<html>

View File

@ -1,3 +1,5 @@
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!doctype html>
<html>

View File

@ -1,3 +1,5 @@
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!doctype html>
<html>

View File

@ -1,3 +1,5 @@
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!doctype html>
<html>

View File

@ -1,3 +1,5 @@
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!doctype html>
<html>

View File

@ -1,3 +1,5 @@
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!doctype html>
<html>

View File

@ -1,3 +1,5 @@
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!doctype html>
<html>

View File

@ -1,3 +1,5 @@
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!doctype html>
<html>

View File

@ -1,3 +1,5 @@
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!doctype html>
<html>

View File

@ -1,3 +1,5 @@
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!doctype html>
<html>

View File

@ -133,6 +133,17 @@ var ContentAreaObserver = {
let newWidth = width || this.width;
let newHeight = height || this.contentHeight;
if (Browser.selectedBrowser) {
let notificationBox = Browser.getNotificationBox();
// If a notification and navbar are visible together,
// make the notification appear above the navbar.
if (ContextUI.navbarVisible && !notificationBox.notificationsHidden &&
notificationBox.allNotifications.length != 0) {
newHeight -= Elements.navbar.getBoundingClientRect().height;
}
}
if (newHeight == oldHeight && newWidth == oldWidth)
return;
@ -187,8 +198,9 @@ var ContentAreaObserver = {
},
onBrowserCreated: function onBrowserCreated(aBrowser) {
aBrowser.classList.add("content-width");
aBrowser.classList.add("content-height");
let notificationBox = aBrowser.parentNode.parentNode;
notificationBox.classList.add("content-width");
notificationBox.classList.add("content-height");
},
/*

View File

@ -21,7 +21,6 @@ var ContextUI = {
init: function init() {
Elements.browsers.addEventListener("mousedown", this, true);
Elements.browsers.addEventListener("touchstart", this, true);
Elements.browsers.addEventListener("AlertActive", this, true);
Elements.browsers.addEventListener('URLChanged', this, true);
Elements.tabList.addEventListener('TabSelect', this, true);
@ -170,6 +169,7 @@ var ContextUI = {
// Display the nav bar
displayNavbar: function () {
Elements.navbar.show();
ContentAreaObserver.updateContentArea();
},
// Display the tab tray
@ -182,6 +182,7 @@ var ContextUI = {
dismissNavbar: function dismissNavbar() {
if (!BrowserUI.isStartTabVisible) {
Elements.navbar.dismiss();
ContentAreaObserver.updateContentArea();
}
},
@ -274,12 +275,14 @@ var ContextUI = {
case "mousedown":
if (BrowserUI.isStartTabVisible)
break;
if (aEvent.button == 0 && this.isVisible)
let box = Browser.getNotificationBox();
if (!box.contains(aEvent.target) &&
aEvent.button == 0 && this.isVisible) {
this.dismiss();
}
break;
case "ToolPanelShown":
case "ToolPanelHidden":
case "AlertActive":
this.dismiss();
break;
case "touchstart":

View File

@ -1718,9 +1718,6 @@ Tab.prototype = {
browser.id = "browser-" + this._id;
this._chromeTab.linkedBrowser = browser;
// let the content area manager know about this browser.
ContentAreaObserver.onBrowserCreated(browser);
browser.setAttribute("type", "content");
let useRemote = Services.prefs.getBoolPref("browser.tabs.remote");
@ -1735,6 +1732,11 @@ Tab.prototype = {
notification.appendChild(stack);
Elements.browsers.insertBefore(notification, aInsertBefore);
notification.dir = "reverse";
// let the content area manager know about this browser.
ContentAreaObserver.onBrowserCreated(browser);
// stop about:blank from loading
browser.stop();

View File

@ -128,37 +128,39 @@
<key id="key_backspace" keycode="VK_BACK" command="cmd_handleBackspace"/>
<key id="key_shift_backspace" keycode="VK_BACK" command="cmd_handleShiftBackspace" modifiers="shift"/>
<key id="key_reload" keycode="VK_F5" command="cmd_reload"/>
<key id="key_reload2" key="r" modifiers="accel" command="cmd_reload"/>
<key id="key_reload2" key="&reload.key;" modifiers="accel" command="cmd_reload"/>
<key id="key_forceReload" keycode="VK_F5" modifiers="shift" command="cmd_forceReload"/>
<key id="key_forceReload2" key="r" modifiers="accel,shift" command="cmd_forceReload"/>
<key id="key_focusURL" key="l" modifiers="accel" command="cmd_openLocation"/>
<key id="key_forceReload2" key="&reload.key;" modifiers="accel,shift" command="cmd_forceReload"/>
<key id="key_focusURL" key="&focusURL.key;" modifiers="accel" command="cmd_openLocation"/>
<key id="key_focusURL2" key="&urlbar.accesskey;" modifiers="alt" command="cmd_openLocation"/>
<key id="key_home" keycode="VK_HOME" modifiers="accel" command="cmd_home"/>
<key id="key_open" key="o" modifiers="accel" command="cmd_openFile"/>
<key id="key_save" key="s" modifiers="accel" command="cmd_savePage"/>
<key id="key_open" key="&openFile.key;" modifiers="accel" command="cmd_openFile"/>
<key id="key_save" key="&savePage.key;" modifiers="accel" command="cmd_savePage"/>
<!-- misc -->
<key id="key_find" key="f" modifiers="accel" command="cmd_find"/>
<key id="key_find" key="&find.key;" modifiers="accel" command="cmd_find"/>
<key id="key_find" key="/" command="cmd_find"/>
<key id="key_findNext" keycode="VK_F3" command="cmd_findNext"/>
<key id="key_findNext2" key="g" modifiers="accel" command="cmd_findNext"/>
<key id="key_findNext2" key="&findNext.key;" modifiers="accel" command="cmd_findNext"/>
<key id="key_findPrevious" keycode="VK_F3" modifiers="shift" command="cmd_findPrevious"/>
<key id="key_findPrevious2" key="g" modifiers="accel,shift" command="cmd_findPrevious"/>
<key id="key_quit" key="q" modifiers="accel" command="cmd_quit"/>
<key id="key_addBoomkark" key="d" modifiers="accel" command="cmd_addBookmark"/>
<key id="key_console" key="j" modifiers="accel,shift" oncommand="PanelUI.show('console-container')"/>
<key id="key_options" key="o" modifiers="accel,shift" oncommand="FlyoutPanelsUI.show('PrefsFlyoutPanel')" />
<key id="key_findPrevious2" key="&findNext.key;" modifiers="accel,shift" command="cmd_findPrevious"/>
<key id="key_quit" key="&quit.key;" modifiers="accel" command="cmd_quit"/>
<key id="key_addBoomkark" key="&addBookmark.key;" modifiers="accel" command="cmd_addBookmark"/>
<!-- development/testing -->
<key id="key_console" key="&jsConsole.key;" modifiers="accel,shift" oncommand="PanelUI.show('console-container')"/>
<key id="key_options" key="&optionsFlyout.key;" modifiers="accel,shift" oncommand="FlyoutPanelsUI.show('PrefsFlyoutPanel')" />
#ifdef MOZ_SERVICES_SYNC
<key id="key_options" key="s" modifiers="accel,shift" oncommand="FlyoutPanelsUI.show('SyncFlyoutPanel')" />
<key id="key_options" key="&syncFlyout.key;" modifiers="accel,shift" oncommand="FlyoutPanelsUI.show('SyncFlyoutPanel')" />
#endif
<key id="key_options" key="a" modifiers="accel,shift" oncommand="FlyoutPanelsUI.show('AboutFlyoutPanel')" />
<key id="key_options" key="&aboutFlyout.key;" modifiers="accel,shift" oncommand="FlyoutPanelsUI.show('AboutFlyoutPanel')" />
<!-- manage tabs -->
<key id="key_newTab" key="t" modifiers="accel" command="cmd_newTab"/>
<key id="key_newTab2" key="n" modifiers="accel" command="cmd_newTab"/>
<key id="key_closeTab" key="w" modifiers="accel" command="cmd_closeTab"/>
<key id="key_newTab" key="&newTab.key;" modifiers="accel" command="cmd_newTab"/>
<key id="key_newTab2" key="&newTab2.key;" modifiers="accel" command="cmd_newTab"/>
<key id="key_closeTab" key="&closeTab.key;" modifiers="accel" command="cmd_closeTab"/>
<key id="key_closeTab2" keycode="VK_F4" modifiers="accel" command="cmd_closeTab"/>
<key id="key_undoCloseTab" key="t" modifiers="accel,shift" command="cmd_undoCloseTab"/>
<key id="key_undoCloseTab" key="&newTab.key;" modifiers="accel,shift" command="cmd_undoCloseTab"/>
<!-- tab selection -->
<key id="key_nextTab" oncommand="BrowserUI.selectNextTab();" keycode="VK_TAB" modifiers="accel"/>

View File

@ -54,6 +54,7 @@ var Downloads = {
Services.obs.addObserver(this, "dl-done", true);
Services.obs.addObserver(this, "dl-run", true);
Services.obs.addObserver(this, "dl-failed", true);
Services.obs.addObserver(this, "dl-request", true);
this._notificationBox = Browser.getNotificationBox();
@ -69,6 +70,7 @@ var Downloads = {
Services.obs.removeObserver(this, "dl-done");
Services.obs.removeObserver(this, "dl-run");
Services.obs.removeObserver(this, "dl-failed");
Services.obs.removeObserver(this, "dl-request");
}
},
@ -444,6 +446,11 @@ var Downloads = {
download = aSubject.QueryInterface(Ci.nsIDownload);
this._showDownloadFailedNotification(download);
break;
case "dl-request":
setTimeout(function() {
ContextUI.displayNavbar();
}, 1000);
break;
}
},

View File

@ -332,7 +332,7 @@ gTests.push({
// invoke selection context menu
let promise = waitForEvent(document, "popupshown");
sendContextMenuClick(225, 310);
sendContextMenuClickToElement(browserwin, span);
yield promise;
// should be visible and at a specific position
@ -342,7 +342,7 @@ gTests.push({
let notification = notificationBox.getNotificationWithValue("popup-blocked");
let notificationHeight = notification.boxObject.height;
checkContextMenuPositionRange(ContextMenuUI._panel, 65, 80, notificationHeight + 155, notificationHeight + 180);
checkContextMenuPositionRange(ContextMenuUI._panel, 0, 15, 175, 190);
promise = waitForEvent(document, "popuphidden");
ContextMenuUI.hide();

View File

@ -79,7 +79,7 @@ gTests.push({
is(SelectionHelperUI.isActive, true, "selection active");
is(getTrimmedSelection(textarea).toString(), "Alice", "selection test");
let xpos = SelectionHelperUI.endMark.xPos;
let ypos = SelectionHelperUI.endMark.yPos + 10;

View File

@ -57,6 +57,7 @@ HelperAppLauncherDialog.prototype = {
},
_showDownloadInfobar: function do_showDownloadInfobar(aLauncher) {
Services.obs.notifyObservers(null, "dl-request", "");
let browserBundle = Services.strings.createBundle("chrome://browser/locale/browser.properties");
let runButtonText =

View File

@ -5,7 +5,6 @@
<!-- NAVBAR AND AUTOCOMPLETE -->
<!ENTITY urlbar.emptytext "Enter Search or Address">
<!ENTITY urlbar.accesskey "d">
<!ENTITY back.label "Back">
<!ENTITY forward.label "Forward">
@ -88,3 +87,23 @@
<!ENTITY contextSaveVideoLib.label "Save to video library">
<!ENTITY contextCopyVideoLocation.label "Copy video location">
<!ENTITY contextOpenVideoTab.label "Open video in new tab">
<!-- KEYBOARD SHORTCUTS -->
<!ENTITY reload.key "r">
<!ENTITY focusURL.key "l">
<!ENTITY urlbar.accesskey "d">
<!ENTITY openFile.key "o">
<!ENTITY savePage.key "s">
<!ENTITY find.key "f">
<!ENTITY findNext.key "g">
<!ENTITY quit.key "q">
<!ENTITY addBookmark.key "d">
<!ENTITY newTab.key "t">
<!ENTITY newTab2.key "n">
<!ENTITY closeTab.key "w">
<!-- DEVELOPER SHORTCUTS (control+shift+key) -->
<!ENTITY jsConsole.key "j">
<!ENTITY optionsFlyout.key "o">
<!ENTITY syncFlyout.key "s">
<!ENTITY aboutFlyout.key "a">

View File

@ -407,15 +407,10 @@
}
.variables-view-scope > .variables-view-element-details:not(:empty) {
margin-top: 1px;
-moz-margin-start: 2px;
-moz-margin-end: 1px;
}
.variables-view-scope > .variables-view-element-details.enum:not(:empty) {
border-bottom: 1px solid #ddd;
}
/* Generic traits applied to both variables and properties */
.variable-or-property {

View File

@ -407,15 +407,10 @@
}
.variables-view-scope > .variables-view-element-details:not(:empty) {
margin-top: 1px;
-moz-margin-start: 2px;
-moz-margin-end: 1px;
}
.variables-view-scope > .variables-view-element-details.enum:not(:empty) {
border-bottom: 1px solid #ddd;
}
/* Generic traits applied to both variables and properties */
.variable-or-property {

View File

@ -410,15 +410,10 @@
}
.variables-view-scope > .variables-view-element-details:not(:empty) {
margin-top: 1px;
-moz-margin-start: 2px;
-moz-margin-end: 1px;
}
.variables-view-scope > .variables-view-element-details.enum:not(:empty) {
border-bottom: 1px solid #ddd;
}
/* Generic traits applied to both variables and properties */
.variable-or-property {

View File

@ -739,6 +739,12 @@ nsScriptLoader::ProcessRequest(nsScriptLoadRequest* aRequest)
true, true, &runScript);
}
// Inner window could have gone away after firing beforescriptexecute
pwin = mDocument->GetInnerWindow();
if (!pwin) {
runScript = false;
}
nsresult rv = NS_OK;
if (runScript) {
if (doc) {

View File

@ -27,7 +27,7 @@
should be updated. If this page starts using a different favicon
than neterrorm nsFaviconService->SetAndLoadFaviconForPage
should be updated to ignore this one as well. -->
<link rel="icon" type="image/png" id="favicon" sizes="64x64" href="chrome://global/skin/icons/warning-64.png"/>
<link rel="icon" type="image/png" id="favicon" sizes="64x64" href="chrome://browser/skin/images/certerror-warning.png"/>
<script type="application/javascript"><![CDATA[
// Error url MUST be formatted like this:
@ -179,8 +179,8 @@
function toggle(id) {
var el = document.getElementById(id);
if (el.getAttribute("collapsed"))
el.setAttribute("collapsed", false);
if (el.hasAttribute("collapsed"))
el.removeAttribute("collapsed");
else
el.setAttribute("collapsed", true);
}
@ -189,14 +189,14 @@
<body id="errorPage" class="certerror" dir="&locale.dir;">
<!-- Error Title -->
<div id="errorTitle">
<h1 class="errorTitleText">&certerror.longpagetitle;</h1>
</div>
<!-- PAGE CONTAINER (for styling purposes only) -->
<div id="errorPageContainer">
<!-- Error Title -->
<div id="errorTitle">
<h1 class="errorTitleText">&certerror.longpagetitle;</h1>
</div>
<!-- LONG CONTENT (the section most likely to require scrolling) -->
<div id="errorLongContent">
<div id="introContent">
@ -214,12 +214,12 @@
<!-- The following sections can be unhidden by default by setting the
"browser.xul.error_pages.expert_bad_cert" pref to true -->
<div id="technicalContent" collapsed="true">
<h2 onclick="toggle('technicalContent');" id="technicalContentHeading">&certerror.technical.heading;</h2>
<h2 class="expander" onclick="toggle('technicalContent');" id="technicalContentHeading">&certerror.technical.heading;</h2>
<p id="technicalContentText"/>
</div>
<div id="expertContent" collapsed="true">
<h2 onclick="toggle('expertContent');" id="expertContentHeading">&certerror.expert.heading;</h2>
<h2 class="expander" onclick="toggle('expertContent');" id="expertContentHeading">&certerror.expert.heading;</h2>
<div>
<p>&certerror.expert.content;</p>
<p>&certerror.expert.contentPara2;</p>

View File

@ -19,7 +19,7 @@
<head>
<meta name="viewport" content="width=device-width; user-scalable=false" />
<link rel="stylesheet" href="chrome://global/skin/netError.css" type="text/css" media="all" />
<link rel="icon" type="image/png" id="favicon" sizes="64x64" href="chrome://global/skin/icons/blacklist_large.png"/>
<link rel="icon" type="image/png" id="favicon" sizes="64x64" href="chrome://browser/skin/images/blocked-warning.png"/>
<script type="application/javascript"><![CDATA[
// Error url MUST be formatted like this:
@ -123,40 +123,18 @@
.innerHTML;
}
]]></script>
<style type="text/css">
/* Style warning button to look like a small text link in the
bottom right. This is preferable to just using a text link
since there is already a mechanism in browser.js for trapping
oncommand events from unprivileged chrome pages (BrowserOnCommand).*/
#ignoreWarningButton {
-moz-appearance: none;
background: transparent;
border: none;
text-decoration: underline;
margin: 0;
padding: 0;
position: relative;
top: 23px;
left: 20px;
font-size: smaller;
}
#ignoreWarning {
text-align: right;
}
</style>
</head>
<body id="errorPage" class="blockedsite" dir="&locale.dir;">
<!-- Error Title -->
<div id="errorTitle">
<h1 id="errorTitleText_phishing" class="errorTitleText">&safeb.blocked.phishingPage.title2;</h1>
<h1 id="errorTitleText_malware" class="errorTitleText">&safeb.blocked.malwarePage.title;</h1>
</div>
<div id="errorPageContainer">
<!-- Error Title -->
<div id="errorTitle">
<h1 id="errorTitleText_phishing" class="errorTitleText">&safeb.blocked.phishingPage.title2;</h1>
<h1 id="errorTitleText_malware" class="errorTitleText">&safeb.blocked.malwarePage.title;</h1>
</div>
<div id="errorLongContent">
<!-- Short Description -->

View File

@ -24,7 +24,7 @@
<link rel="stylesheet" href="chrome://global/skin/netError.css" type="text/css" media="all" />
<!-- If the location of the favicon is changed here, the FAVICON_ERRORPAGE_URL symbol in
toolkit/components/places/src/nsFaviconService.h should be updated. -->
<link rel="icon" type="image/png" id="favicon" sizes="64x64" href="chrome://global/skin/icons/warning-64.png"/>
<link rel="icon" type="image/png" id="favicon" sizes="64x64" href="chrome://browser/skin/images/errorpage-warning.png"/>
<script type="application/javascript"><![CDATA[
// Error url MUST be formatted like this:
@ -330,14 +330,14 @@
</div>
</div>
<!-- Error Title -->
<div id="errorTitle">
<h1 class="errorTitleText" />
</div>
<!-- PAGE CONTAINER (for styling purposes only) -->
<div id="errorPageContainer">
<!-- Error Title -->
<div id="errorTitle">
<h1 class="errorTitleText" />
</div>
<!-- LONG CONTENT (the section most likely to require scrolling) -->
<div id="errorLongContent">

Binary file not shown.

After

Width:  |  Height:  |  Size: 962 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 959 B

View File

@ -0,0 +1,10 @@
<?xml version="1.0"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<svg width="7px" height="10px" version="1.1" xmlns="http://www.w3.org/2000/svg">
<polyline points="1 1 6 5 1 9" stroke="#414141" stroke-width="2"
stroke-linecap="round" fill="transparent" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 471 B

View File

@ -5,5 +5,6 @@
<svg width="10px" height="7px" version="1.1" xmlns="http://www.w3.org/2000/svg">
<polyline points="1 1 5 6 9 1" stroke="#414141" stroke-width="2" stroke-linecap="round" fill="transparent" stroke-linejoin="round"/>
<polyline points="1 1 5 6 9 1" stroke="#414141" stroke-width="2" stroke-linecap="round"
fill="transparent" stroke-linejoin="round"/>
</svg>

Before

Width:  |  Height:  |  Size: 459 B

After

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 631 B

After

Width:  |  Height:  |  Size: 960 B

View File

@ -37,6 +37,7 @@ chrome.jar:
skin/images/arrowleft-16.png (images/arrowleft-16.png)
skin/images/arrowright-16.png (images/arrowright-16.png)
skin/images/arrowdown-16.png (images/arrowdown-16.png)
skin/images/blocked-warning.png (images/blocked-warning.png)
skin/images/checkbox_checked.png (images/checkbox_checked.png)
skin/images/checkbox_checked_disabled.png (images/checkbox_checked_disabled.png)
skin/images/checkbox_checked_pressed.png (images/checkbox_checked_pressed.png)
@ -46,8 +47,9 @@ chrome.jar:
skin/images/chevron.png (images/chevron.png)
skin/images/default-app-icon.png (images/default-app-icon.png)
skin/images/dropmarker.svg (images/dropmarker.svg)
skin/images/dropmarker-right.svg (images/dropmarker-right.svg)
skin/images/errorpage-warning.png (images/errorpage-warning.png)
skin/images/errorpage-warning.png (images/errorpage-warning.png)
skin/images/certerror-warning.png (images/certerror-warning.png)
skin/images/errorpage-larry-white.png (images/errorpage-larry-white.png)
skin/images/errorpage-larry-black.png (images/errorpage-larry-black.png)
skin/images/marketplace-logo.png (images/marketplace-logo.png)

View File

@ -2,130 +2,184 @@
* 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/. */
/*
* This defines the look-and-feel styling of the error pages.
* (see: netError.xhtml)
*
* Original styling by William Price <bugzilla@mob.rice.edu>
* Updated for mobile by: Wes Johnston <wjohnston@mozilla.com>
*/
html,
body {
margin: 0;
padding: 0 8px 8px;
font-family: "Nokia Sans", Tahoma, sans-serif !important;
padding: 0;
}
body {
/* Add a set of stripes at the top of pages */
background-image: linear-gradient(-45deg, #dfe8ee, #dfe8ee 33%,
#ecf0f3 33%, #ecf0f3 66%,
#dfe8ee 66%, #dfe8ee);
background-size: 64px 32px;
background-repeat: repeat-x;
background-color: #f1f1f1;
min-height: 100%;
padding: 0 20px;
font-weight: 300;
font-size: 13px;
-moz-text-size-adjust: none;
font-family: "Open Sans", sans-serif;
}
ul {
/* Shove the list indicator so that its left aligned, but use outside so that text
* doesn't don't wrap the text around it */
padding: 1em;
margin: 0;
list-style: round outside none;
}
li:not(:last-of-type),
#errorLongDesc,
#errorLongContent {
padding-bottom: 10px;
}
h1 {
font-size: 22px;
padding: 1rem 0;
font-weight: 300;
border-bottom: 1px solid #e0e2e5;
}
h2 {
font-size: 16px;
font-size: small;
padding: 0;
margin: 0;
}
ul {
margin: 0px;
padding: 0px 0px 0px 1em;
}
li {
margin: 0px;
padding: 8px 0px;
}
#errorPage {
background-color: #CEE6F4;
}
#errorPage.certerror {
background-color: #EFD400;
}
#errorPage.blockedsite {
background-color: #BF0000;
}
#errorTitle {
background: url("chrome://browser/skin/images/errorpage-warning.png") left center no-repeat;
/* Scaled by .666 of their actual size */
background-size: 40px 40px;
background-origin: content-box;
min-height: 60px;
margin-left: auto;
margin-right: auto;
max-width: 500px;
margin-left: auto;
margin-right: auto;
}
#errorPage.certerror #errorTitle {
background-image: url("chrome://browser/skin/images/errorpage-larry-black.png");
}
#errorPage.blockedsite #errorTitle {
background-image: url("chrome://browser/skin/images/errorpage-larry-white.png");
color: white;
}
.errorTitleText {
padding: 0px 0px 0px 50px;
display: inline-block;
vertical-align: middle
}
#errorPageContainer {
background-color: white;
border: 1px solid #999999;
border-radius: 6px;
padding: 6px 20px 20px;
font-size: 14px;
max-width: 500px;
margin-left: auto;
margin-right: auto;
}
#errorShortDesc > p:empty {
display: none;
}
#errorShortDesc > p {
overflow: auto;
border-bottom: 1px solid #999999;
padding-bottom: 1em;
}
#errorPage.blockedsite #errorShortDesc > p {
font-weight: bold;
border-bottom: none;
padding-bottom: 0px;
}
#securityOverrideDiv {
padding-top: 10px;
}
div[collapsed] {
padding-left: 15px;
background-image: url("chrome://browser/skin/images/arrowright-16.png");
background-size: 11px 11px;
background-repeat: no-repeat;
background-position: left 0.3em;
}
div[collapsed="true"] {
background-image: url("chrome://browser/skin/images/arrowright-16.png");
}
div[collapsed="false"] {
background-image: url("chrome://browser/skin/images/arrowdown-16.png");
}
div[collapsed="true"] > p,
div[collapsed="true"] > div {
display: none;
p {
margin-top: 0;
}
button {
padding: 0.3em !important;
width: 100%;
border: none;
padding: 1rem;
font-family: "Open Sans", sans-serif;
background-color: #e0e2e5;
font-size: 1rem; /* Not sure why this has to be specified. See bug 892843. */
font-weight: 300;
border-radius: 2px;
background-image: none;
}
button + button {
margin-top: 1em;
}
.certerror {
background-image: linear-gradient(-45deg, #f0d000, #f0d000 33%,
#fedc00 33%, #fedc00 66%,
#f0d000 66%, #f0d000);
}
.blockedsite {
background-image: linear-gradient(-45deg, #9b2e2e, #9b2e2e 33%,
#a83232 33%, #a83232 66%,
#9b2e2e 66%, #9b2e2e);
background-color: #b14646;
color: white;
}
#errorPageContainer {
/* If the page is greater than 550px center the content.
* This number should be kept in sync with the media query for tablets below */
max-width: 550px;
margin-left: auto;
margin-right: auto;
padding-top: 1rem;
/* Ensure that there's some space at the bottom of the page.
* On about:blocked we have an absolutely positioned link that should take this space */
padding-bottom: 5rem;
}
/* Expanders have a structure of
* <div collapsed="true/false">
* <h2 class="expander">Title</h2>
* <p>Content</p>
* </div>
*
* This shows an arrow to the right of the h2 element, and hides the content when collapsed="true". */
.expander {
margin: 1rem 0;
background-image: url("chrome://browser/skin/images/dropmarker.svg");
background-repeat: no-repeat;
/* dropmarker.svg is 10x7. Ensure that its centered in the middle of an 18x18 box */
background-position: 3px 5.5px;
background-size: 10px 7px;
padding-left: 18px;
}
.expander:first-of-type {
/* Double the margin here so that the space above the first expander
* is the same as the space between multiple expanders */
margin-top: 20px;
}
div[collapsed="true"] > .expander {
background-image: url("chrome://browser/skin/images/dropmarker-right.svg");
/* dropmarker.svg is 7x10. Ensure that its centered in the middle of an 18x18 box */
background-size: 7px 10px;
background-position: 5.5px 4px;
}
/* Hide the first element after the expander */
div[collapsed="true"] > .expander + * {
display: none;
}
.blockedsite h1 {
border-bottom-color: #9b2e2e;
}
.blockedsite button {
background-color: #9b2e2e;
color: white;
}
/* Style warning button to look like a small text link in the
bottom. This is preferable to just using a text link
since there is already a mechanism in browser.js for trapping
oncommand events from unprivileged chrome pages (ErrorPageEventHandler).*/
#ignoreWarningButton {
width: 100%;
-moz-appearance: none;
background: #b14646;
border: none;
text-decoration: underline;
margin: 0;
font-size: smaller;
border-bottom: none;
position: absolute;
bottom: 0;
left: 0;
}
/* On large screen devices (hopefully a 7+ inch tablet, we already center content (see #errorPageContainer above).
Apply tablet specific styles here */
@media (min-width: 550px) {
button {
min-width: 160px;
width: auto;
}
button + button {
margin-top: 0;
}
/* If the tablet is tall as well, add some padding to make content feel a bit more centered */
@media (min-height: 550px) {
#errorPageContainer {
padding-top: 64px;
}
}
}

View File

@ -11,7 +11,7 @@ const Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
const XHTML_NS = "http://www.w3.org/1999/xhtml";
const MAXIMUM_PIXELS = Math.pow(128, 2);
const MAXIMUM_PIXELS = Math.pow(144, 2);
function ColorAnalyzer() {
// a queue of callbacks for each job we give to the worker

View File

@ -233,11 +233,13 @@ tests.push(function test_interestingColorPreferenceNotTooLenient() {
}, 0xFF0000, "interestingColorPreferenceNotTooLenient analysis returns red");
});
// make sure that images larger than 128x128 fail
let maxPixels = 144; // see ColorAnalyzer MAXIMUM_PIXELS const
// make sure that images larger than maxPixels*maxPixels fail
tests.push(function test_imageTooLarge() {
canvasTest(129, 129, function(ctx) {
canvasTest(1+maxPixels, 1+maxPixels, function(ctx) {
ctx.fillStyle = "red";
ctx.fillRect(0, 0, 129, 129);
ctx.fillRect(0, 0, 1+maxPixels, 1+maxPixels);
}, null, "imageTooLarge analysis fails");
});

View File

@ -10,7 +10,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "SocialService", "resource://gre/modules/SocialService.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils", "resource://gre/modules/PrivateBrowsingUtils.jsm");
this.EXPORTED_SYMBOLS = ["MozSocialAPI", "openChatWindow", "findChromeWindowForChats"];
this.EXPORTED_SYMBOLS = ["MozSocialAPI", "openChatWindow", "findChromeWindowForChats", "closeAllChatWindows"];
this.MozSocialAPI = {
_enabled: false,
@ -315,3 +315,27 @@ this.openChatWindow =
// we can call it unconditionally.
chromeWindow.getAttention();
}
this.closeAllChatWindows =
function closeAllChatWindows(provider) {
// close all attached chat windows
let winEnum = Services.wm.getEnumerator("navigator:browser");
while (winEnum.hasMoreElements()) {
let win = winEnum.getNext();
if (!win.SocialChatBar)
continue;
let chats = [c for (c of win.SocialChatBar.chatbar.children) if (c.content.getAttribute("origin") == provider.origin)];
[c.close() for (c of chats)];
}
// close all standalone chat windows
winEnum = Services.wm.getEnumerator("Social:Chat");
while (winEnum.hasMoreElements()) {
let win = winEnum.getNext();
if (win.closed)
continue;
let origin = win.document.getElementById("chatter").content.getAttribute("origin");
if (provider.origin == origin)
win.close();
}
}

View File

@ -19,6 +19,7 @@ const STRING_TYPE_NAME = "type.%ID%.name";
XPCOMUtils.defineLazyModuleGetter(this, "getFrameWorkerHandle", "resource://gre/modules/FrameWorker.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "WorkerAPI", "resource://gre/modules/WorkerAPI.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "MozSocialAPI", "resource://gre/modules/MozSocialAPI.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "closeAllChatWindows", "resource://gre/modules/MozSocialAPI.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "DeferredTask", "resource://gre/modules/DeferredTask.jsm");
XPCOMUtils.defineLazyServiceGetter(this, "etld",
@ -830,6 +831,7 @@ SocialProvider.prototype = {
updateUserProfile: function(profile) {
if (!profile)
profile = {};
let accountChanged = !this.profile || this.profile.userName != profile.userName;
this.profile = profile;
// Sanitize the portrait from any potential script-injection.
@ -862,6 +864,8 @@ SocialProvider.prototype = {
}
Services.obs.notifyObservers(null, "social:profile-changed", this.origin);
if (accountChanged)
closeAllChatWindows(this);
},
// Called by the workerAPI to add/update a notification icon.
@ -887,6 +891,7 @@ SocialProvider.prototype = {
},
_terminate: function _terminate() {
closeAllChatWindows(this);
if (this.workerURL) {
try {
getFrameWorkerHandle(this.workerURL).terminate();

View File

@ -980,13 +980,9 @@ MetroInput::HandleSingleTap(const LayoutDeviceIntPoint& aPoint)
POINT point;
if (GetCursorPos(&point)) {
ScreenToClient((HWND)mWidget->GetNativeData(NS_NATIVE_WINDOW), &point);
Foundation::Point oldMousePosition;
oldMousePosition.X = static_cast<FLOAT>(point.x);
oldMousePosition.Y = static_cast<FLOAT>(point.y);
mouseEvent.refPoint = aPoint;
mouseEvent.refPoint = LayoutDeviceIntPoint(point.x, point.y);
mouseEvent.message = NS_MOUSE_MOVE;
mouseEvent.button = 0;
DispatchEventIgnoreStatus(&mouseEvent);
}