mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
Merge m-c to b-s.
This commit is contained in:
commit
ae5e8e9dcf
@ -45,6 +45,7 @@
|
||||
#include "nsEventShell.h"
|
||||
#include "nsTextAccessible.h"
|
||||
#include "TextUpdater.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -105,6 +105,7 @@
|
||||
|
||||
#include "mozilla/unused.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
|
@ -66,6 +66,7 @@
|
||||
#include "nsContentCID.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
static NS_DEFINE_IID(kRangeCID, NS_RANGE_CID);
|
||||
|
||||
|
@ -43,6 +43,7 @@
|
||||
#include "nsCoreUtils.h"
|
||||
|
||||
#include "nsEventStates.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsHTMLLinkAccessible
|
||||
|
@ -58,6 +58,7 @@
|
||||
#include "nsWidgetsCID.h"
|
||||
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
|
@ -6797,9 +6797,9 @@ var gPluginHandler = {
|
||||
submitReport : function(pluginDumpID, browserDumpID) {
|
||||
// The crash reporter wants a DOM element it can append an IFRAME to,
|
||||
// which it uses to submit a form. Let's just give it gBrowser.
|
||||
this.CrashSubmit.submit(pluginDumpID, gBrowser, null, null);
|
||||
this.CrashSubmit.submit(pluginDumpID);
|
||||
if (browserDumpID)
|
||||
this.CrashSubmit.submit(browserDumpID, gBrowser, null, null);
|
||||
this.CrashSubmit.submit(browserDumpID);
|
||||
},
|
||||
|
||||
// Callback for user clicking a "reload page" link
|
||||
|
@ -330,6 +330,7 @@
|
||||
</popupset>
|
||||
|
||||
<textbox id="scratchpad-textbox"
|
||||
class="monospace"
|
||||
multiline="true"
|
||||
flex="1"
|
||||
context="scratchpad-text-popup"
|
||||
|
@ -1372,15 +1372,19 @@
|
||||
// aReferrerURI is null or undefined if the tab is opened from
|
||||
// an external application or bookmark, i.e. somewhere other
|
||||
// than the current tab.
|
||||
if ((aRelatedToCurrent == null ? aReferrerURI : aRelatedToCurrent) &&
|
||||
Services.prefs.getBoolPref("browser.tabs.insertRelatedAfterCurrent")) {
|
||||
if (aRelatedToCurrent == null ? aReferrerURI : aRelatedToCurrent) {
|
||||
let newTabPos = (this._lastRelatedTab ||
|
||||
this.selectedTab)._tPos + 1;
|
||||
|
||||
if (this._lastRelatedTab)
|
||||
this._lastRelatedTab.owner = null;
|
||||
else
|
||||
t.owner = this.selectedTab;
|
||||
this.moveTabTo(t, newTabPos);
|
||||
|
||||
if (!this.selectedTab.pinned &&
|
||||
Services.prefs.getBoolPref("browser.tabs.insertRelatedAfterCurrent"))
|
||||
this.moveTabTo(t, newTabPos);
|
||||
|
||||
this._lastRelatedTab = t;
|
||||
}
|
||||
|
||||
|
@ -124,15 +124,6 @@ function GroupItem(listOfEls, options) {
|
||||
.css({zIndex: -100})
|
||||
.appendTo("body");
|
||||
|
||||
// ___ New Tab Button
|
||||
this.$ntb = iQ("<div>")
|
||||
.addClass('newTabButton')
|
||||
.click(function() {
|
||||
self.newTab();
|
||||
})
|
||||
.attr('title', tabviewString('groupItem.newTabButton'))
|
||||
.appendTo($container);
|
||||
|
||||
// ___ Resizer
|
||||
this.$resizer = iQ("<div>")
|
||||
.addClass('resizer')
|
||||
@ -1660,9 +1651,45 @@ GroupItem.prototype = Utils.extend(new Item(), new Subscribable(), {
|
||||
// Helper routine for the constructor; adds various event handlers to the container.
|
||||
_addHandlers: function GroupItem__addHandlers(container) {
|
||||
let self = this;
|
||||
let lastMouseDownTarget;
|
||||
|
||||
var dropIndex = false;
|
||||
var dropSpaceTimer = null;
|
||||
container.mousedown(function(e) {
|
||||
let target = e.target;
|
||||
// only set the last mouse down target if it is a left click, not on the
|
||||
// close button, not on the new tab button, not on the title bar and its
|
||||
// element
|
||||
if (Utils.isLeftClick(e) &&
|
||||
self.$closeButton[0] != target &&
|
||||
self.$titlebar[0] != target &&
|
||||
!self.$titlebar.contains(target) &&
|
||||
!self.$appTabTray.contains(target)) {
|
||||
lastMouseDownTarget = target;
|
||||
} else {
|
||||
lastMouseDownTarget = null;
|
||||
}
|
||||
});
|
||||
container.mouseup(function(e) {
|
||||
let same = (e.target == lastMouseDownTarget);
|
||||
lastMouseDownTarget = null;
|
||||
|
||||
if (same && !self.isDragging) {
|
||||
if (gBrowser.selectedTab.pinned &&
|
||||
UI.getActiveTab() != self.getActiveTab() &&
|
||||
self.getChildren().length > 0) {
|
||||
UI.setActive(self, { dontSetActiveTabInGroup: true });
|
||||
UI.goToTab(gBrowser.selectedTab);
|
||||
} else {
|
||||
let tabItem = self.getTopChild();
|
||||
if (tabItem)
|
||||
tabItem.zoomIn();
|
||||
else
|
||||
self.newTab();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
let dropIndex = false;
|
||||
let dropSpaceTimer = null;
|
||||
|
||||
// When the _dropSpaceActive flag is turned on on a group, and a tab is
|
||||
// dragged on top, a space will open up.
|
||||
|
@ -144,11 +144,6 @@ body {
|
||||
/* Other
|
||||
----------------------------------*/
|
||||
|
||||
.newTabButton {
|
||||
position: absolute !important;
|
||||
z-index: 99999;
|
||||
}
|
||||
|
||||
.titlebar {
|
||||
position: absolute;
|
||||
}
|
||||
|
@ -260,6 +260,9 @@ _BROWSER_FILES = \
|
||||
browser_addon_bar_shortcut.js \
|
||||
browser_addon_bar_aomlistener.js \
|
||||
test_bug628179.html \
|
||||
browser_wyciwyg_urlbarCopying.js \
|
||||
test_wyciwyg_copying.html \
|
||||
authenticate.sjs \
|
||||
browser_minimize.js \
|
||||
$(NULL)
|
||||
|
||||
|
205
browser/base/content/test/authenticate.sjs
Normal file
205
browser/base/content/test/authenticate.sjs
Normal file
@ -0,0 +1,205 @@
|
||||
function handleRequest(request, response)
|
||||
{
|
||||
try {
|
||||
reallyHandleRequest(request, response);
|
||||
} catch (e) {
|
||||
response.setStatusLine("1.0", 200, "AlmostOK");
|
||||
response.write("Error handling request: " + e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function reallyHandleRequest(request, response) {
|
||||
var match;
|
||||
var requestAuth = true, requestProxyAuth = true;
|
||||
|
||||
// Allow the caller to drive how authentication is processed via the query.
|
||||
// Eg, http://localhost:8888/authenticate.sjs?user=foo&realm=bar
|
||||
var query = request.queryString;
|
||||
|
||||
var expected_user = "", expected_pass = "", realm = "mochitest";
|
||||
var proxy_expected_user = "", proxy_expected_pass = "", proxy_realm = "mochi-proxy";
|
||||
var huge = false, plugin = false;
|
||||
var authHeaderCount = 1;
|
||||
// user=xxx
|
||||
match = /user=([^&]*)/.exec(query);
|
||||
if (match)
|
||||
expected_user = match[1];
|
||||
|
||||
// pass=xxx
|
||||
match = /pass=([^&]*)/.exec(query);
|
||||
if (match)
|
||||
expected_pass = match[1];
|
||||
|
||||
// realm=xxx
|
||||
match = /realm=([^&]*)/.exec(query);
|
||||
if (match)
|
||||
realm = match[1];
|
||||
|
||||
// proxy_user=xxx
|
||||
match = /proxy_user=([^&]*)/.exec(query);
|
||||
if (match)
|
||||
proxy_expected_user = match[1];
|
||||
|
||||
// proxy_pass=xxx
|
||||
match = /proxy_pass=([^&]*)/.exec(query);
|
||||
if (match)
|
||||
proxy_expected_pass = match[1];
|
||||
|
||||
// proxy_realm=xxx
|
||||
match = /proxy_realm=([^&]*)/.exec(query);
|
||||
if (match)
|
||||
proxy_realm = match[1];
|
||||
|
||||
// huge=1
|
||||
match = /huge=1/.exec(query);
|
||||
if (match)
|
||||
huge = true;
|
||||
|
||||
// plugin=1
|
||||
match = /plugin=1/.exec(query);
|
||||
if (match)
|
||||
plugin = true;
|
||||
|
||||
// multiple=1
|
||||
match = /multiple=([^&]*)/.exec(query);
|
||||
if (match)
|
||||
authHeaderCount = match[1]+0;
|
||||
|
||||
|
||||
// Look for an authentication header, if any, in the request.
|
||||
//
|
||||
// EG: Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
|
||||
//
|
||||
// This test only supports Basic auth. The value sent by the client is
|
||||
// "username:password", obscured with base64 encoding.
|
||||
|
||||
var actual_user = "", actual_pass = "", authHeader;
|
||||
if (request.hasHeader("Authorization")) {
|
||||
authHeader = request.getHeader("Authorization");
|
||||
match = /Basic (.+)/.exec(authHeader);
|
||||
if (match.length != 2)
|
||||
throw "Couldn't parse auth header: " + authHeader;
|
||||
|
||||
var userpass = base64ToString(match[1]); // no atob() :-(
|
||||
match = /(.*):(.*)/.exec(userpass);
|
||||
if (match.length != 3)
|
||||
throw "Couldn't decode auth header: " + userpass;
|
||||
actual_user = match[1];
|
||||
actual_pass = match[2];
|
||||
}
|
||||
|
||||
var proxy_actual_user = "", proxy_actual_pass = "";
|
||||
if (request.hasHeader("Proxy-Authorization")) {
|
||||
authHeader = request.getHeader("Proxy-Authorization");
|
||||
match = /Basic (.+)/.exec(authHeader);
|
||||
if (match.length != 2)
|
||||
throw "Couldn't parse auth header: " + authHeader;
|
||||
|
||||
var userpass = base64ToString(match[1]); // no atob() :-(
|
||||
match = /(.*):(.*)/.exec(userpass);
|
||||
if (match.length != 3)
|
||||
throw "Couldn't decode auth header: " + userpass;
|
||||
proxy_actual_user = match[1];
|
||||
proxy_actual_pass = match[2];
|
||||
}
|
||||
|
||||
// Don't request authentication if the credentials we got were what we
|
||||
// expected.
|
||||
if (expected_user == actual_user &&
|
||||
expected_pass == actual_pass) {
|
||||
requestAuth = false;
|
||||
}
|
||||
if (proxy_expected_user == proxy_actual_user &&
|
||||
proxy_expected_pass == proxy_actual_pass) {
|
||||
requestProxyAuth = false;
|
||||
}
|
||||
|
||||
if (requestProxyAuth) {
|
||||
response.setStatusLine("1.0", 407, "Proxy authentication required");
|
||||
for (i = 0; i < authHeaderCount; ++i)
|
||||
response.setHeader("Proxy-Authenticate", "basic realm=\"" + proxy_realm + "\"", true);
|
||||
} else if (requestAuth) {
|
||||
response.setStatusLine("1.0", 401, "Authentication required");
|
||||
for (i = 0; i < authHeaderCount; ++i)
|
||||
response.setHeader("WWW-Authenticate", "basic realm=\"" + realm + "\"", true);
|
||||
} else {
|
||||
response.setStatusLine("1.0", 200, "OK");
|
||||
}
|
||||
|
||||
response.setHeader("Content-Type", "application/xhtml+xml", false);
|
||||
response.write("<html xmlns='http://www.w3.org/1999/xhtml'>");
|
||||
response.write("<p>Login: <span id='ok'>" + (requestAuth ? "FAIL" : "PASS") + "</span></p>\n");
|
||||
response.write("<p>Proxy: <span id='proxy'>" + (requestProxyAuth ? "FAIL" : "PASS") + "</span></p>\n");
|
||||
response.write("<p>Auth: <span id='auth'>" + authHeader + "</span></p>\n");
|
||||
response.write("<p>User: <span id='user'>" + actual_user + "</span></p>\n");
|
||||
response.write("<p>Pass: <span id='pass'>" + actual_pass + "</span></p>\n");
|
||||
|
||||
if (huge) {
|
||||
response.write("<div style='display: none'>");
|
||||
for (i = 0; i < 100000; i++) {
|
||||
response.write("123456789\n");
|
||||
}
|
||||
response.write("</div>");
|
||||
response.write("<span id='footnote'>This is a footnote after the huge content fill</span>");
|
||||
}
|
||||
|
||||
if (plugin) {
|
||||
response.write("<embed id='embedtest' style='width: 400px; height: 100px;' " +
|
||||
"type='application/x-test'></embed>\n");
|
||||
}
|
||||
|
||||
response.write("</html>");
|
||||
}
|
||||
|
||||
|
||||
// base64 decoder
|
||||
//
|
||||
// Yoinked from extensions/xml-rpc/src/nsXmlRpcClient.js because btoa()
|
||||
// doesn't seem to exist. :-(
|
||||
/* Convert Base64 data to a string */
|
||||
const toBinaryTable = [
|
||||
-1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
|
||||
-1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
|
||||
-1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63,
|
||||
52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1, 0,-1,-1,
|
||||
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14,
|
||||
15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1,
|
||||
-1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40,
|
||||
41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1
|
||||
];
|
||||
const base64Pad = '=';
|
||||
|
||||
function base64ToString(data) {
|
||||
|
||||
var result = '';
|
||||
var leftbits = 0; // number of bits decoded, but yet to be appended
|
||||
var leftdata = 0; // bits decoded, but yet to be appended
|
||||
|
||||
// Convert one by one.
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var c = toBinaryTable[data.charCodeAt(i) & 0x7f];
|
||||
var padding = (data[i] == base64Pad);
|
||||
// Skip illegal characters and whitespace
|
||||
if (c == -1) continue;
|
||||
|
||||
// Collect data into leftdata, update bitcount
|
||||
leftdata = (leftdata << 6) | c;
|
||||
leftbits += 6;
|
||||
|
||||
// If we have 8 or more bits, append 8 bits to the result
|
||||
if (leftbits >= 8) {
|
||||
leftbits -= 8;
|
||||
// Append if not padding.
|
||||
if (!padding)
|
||||
result += String.fromCharCode((leftdata >> leftbits) & 0xff);
|
||||
leftdata &= (1 << leftbits) - 1;
|
||||
}
|
||||
}
|
||||
|
||||
// If there are any bits left, the base64 string was corrupted
|
||||
if (leftbits)
|
||||
throw Components.Exception('Corrupted base64 string');
|
||||
|
||||
return result;
|
||||
}
|
@ -46,6 +46,10 @@ function testURL(url, loadFunc, endFunc) {
|
||||
loadFunc(url);
|
||||
|
||||
addPageShowListener(function () {
|
||||
let fm = Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager);
|
||||
is(fm.focusedElement, null, "should be no focused element");
|
||||
is(fm.focusedWindow, gBrowser.contentWindow, "content window should be focused");
|
||||
|
||||
ok(!gBrowser.contentPrincipal.equals(pagePrincipal),
|
||||
"load of " + url + " by " + loadFunc.name + " should produce a page with a different principal");
|
||||
endFunc();
|
||||
|
@ -78,5 +78,14 @@ function test() {
|
||||
testPosition(7, 8, "blank tab without referrer opens at the end");
|
||||
testPosition(8, 9, "tab without referrer opens at the end");
|
||||
|
||||
gBrowser.selectedTab = tabs[0];
|
||||
gBrowser.pinTab(gBrowser.selectedTab);
|
||||
addTab("http://mochi.test:8888/#8", gBrowser.currentURI);
|
||||
testPosition(9, 10, "tab with referrer should open at the end when the selected tab is pinned");
|
||||
gBrowser.selectedTab = tabs[9];
|
||||
gBrowser.removeTab(tabs.pop());
|
||||
is(gBrowser.selectedTab, tabs[0],
|
||||
"opening a tab from a pinned tab, selecting it and closing it should go back to the pinned tab");
|
||||
|
||||
tabs.forEach(gBrowser.removeTab, gBrowser);
|
||||
}
|
||||
|
@ -6,105 +6,85 @@
|
||||
* <https://bugzilla.mozilla.org/show_bug.cgi?id=564387>
|
||||
*/
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
// --- Testing support library ---
|
||||
gBrowser.loadURI("http://mochi.test:8888/browser/browser/base/content/test/bug564387.html");
|
||||
|
||||
// Import the toolkit test support library in the scope of the current test.
|
||||
// This operation also defines the common constants Cc, Ci, Cu, Cr and Cm.
|
||||
Components.classes["@mozilla.org/moz/jssubscript-loader;1"].
|
||||
getService(Components.interfaces.mozIJSSubScriptLoader).loadSubScript(
|
||||
"chrome://mochitests/content/browser/toolkit/content/tests/browser/common/_loadAll.js",
|
||||
this);
|
||||
registerCleanupFunction(function () {
|
||||
gBrowser.addTab();
|
||||
gBrowser.removeCurrentTab();
|
||||
});
|
||||
|
||||
// --- Test implementation ---
|
||||
gBrowser.addEventListener("pageshow", function pageShown(event) {
|
||||
if (event.target.location == "about:blank")
|
||||
return;
|
||||
gBrowser.removeEventListener("pageshow", pageShown);
|
||||
|
||||
const kBaseUrl =
|
||||
"http://mochi.test:8888/browser/browser/base/content/test/";
|
||||
executeSoon(function () {
|
||||
document.addEventListener("popupshown", contextMenuOpened);
|
||||
|
||||
function pageShown(event) {
|
||||
if (event.target.location != "about:blank")
|
||||
testRunner.continueTest();
|
||||
}
|
||||
|
||||
function saveVideoAs_TestGenerator() {
|
||||
// Load Test page
|
||||
gBrowser.addEventListener("pageshow", pageShown, false);
|
||||
gBrowser.loadURI(kBaseUrl + "bug564387.html");
|
||||
yield;
|
||||
gBrowser.removeEventListener("pageshow", pageShown, false);
|
||||
|
||||
// Ensure that the window is focused.
|
||||
SimpleTest.waitForFocus(testRunner.continueTest);
|
||||
yield;
|
||||
|
||||
try {
|
||||
// get the video element
|
||||
var video1 = gBrowser.contentDocument.getElementById("video1");
|
||||
|
||||
// Synthesize the right click on the context menu, and
|
||||
// wait for it to be shown
|
||||
document.addEventListener("popupshown", testRunner.continueTest, false);
|
||||
EventUtils.synthesizeMouseAtCenter(video1,
|
||||
{ type: "contextmenu", button: 2 },
|
||||
gBrowser.contentWindow);
|
||||
yield;
|
||||
});
|
||||
});
|
||||
|
||||
// Create the folder the video will be saved into.
|
||||
var destDir = createTemporarySaveDirectory();
|
||||
try {
|
||||
// Call the appropriate save function defined in contentAreaUtils.js.
|
||||
mockFilePickerSettings.destDir = destDir;
|
||||
mockFilePickerSettings.filterIndex = 1; // kSaveAsType_URL
|
||||
function contextMenuOpened(event) {
|
||||
event.currentTarget.removeEventListener("popupshown", contextMenuOpened);
|
||||
|
||||
// register mock file picker object
|
||||
mockFilePickerRegisterer.register();
|
||||
try {
|
||||
// register mock download progress listener
|
||||
mockTransferForContinuingRegisterer.register();
|
||||
try {
|
||||
// Select "Save Video As" option from context menu
|
||||
var saveVideoCommand = document.getElementById("context-savevideo");
|
||||
saveVideoCommand.doCommand();
|
||||
// Create the folder the video will be saved into.
|
||||
var destDir = createTemporarySaveDirectory();
|
||||
|
||||
// Unregister the popupshown listener
|
||||
document.removeEventListener("popupshown",
|
||||
testRunner.continueTest, false);
|
||||
// Close the context menu
|
||||
document.getElementById("placesContext").hidePopup();
|
||||
mockFilePickerSettings.destDir = destDir;
|
||||
mockFilePickerSettings.filterIndex = 1; // kSaveAsType_URL
|
||||
mockFilePickerRegisterer.register();
|
||||
|
||||
// Wait for the download to finish, and exit if it wasn't successful.
|
||||
var downloadSuccess = yield;
|
||||
if (!downloadSuccess)
|
||||
throw "Unexpected failure in downloading Video file!";
|
||||
}
|
||||
finally {
|
||||
// unregister download progress listener
|
||||
mockTransferForContinuingRegisterer.unregister();
|
||||
}
|
||||
}
|
||||
finally {
|
||||
// unregister mock file picker object
|
||||
mockFilePickerRegisterer.unregister();
|
||||
}
|
||||
mockTransferCallback = onTransferComplete;
|
||||
mockTransferRegisterer.register();
|
||||
|
||||
// Read the name of the saved file.
|
||||
var fileName = mockFilePickerResults.selectedFile.leafName;
|
||||
registerCleanupFunction(function () {
|
||||
mockTransferRegisterer.unregister();
|
||||
mockFilePickerRegisterer.unregister();
|
||||
destDir.remove(true);
|
||||
});
|
||||
|
||||
is(fileName, "Bug564387-expectedName.ogv",
|
||||
"Video File Name is correctly retrieved from Content-Disposition http header");
|
||||
}
|
||||
finally {
|
||||
// Clean up the saved file.
|
||||
destDir.remove(true);
|
||||
}
|
||||
}
|
||||
finally {
|
||||
// Replace the current tab with a clean one.
|
||||
gBrowser.addTab().linkedBrowser.stop();
|
||||
gBrowser.removeCurrentTab();
|
||||
}
|
||||
// Select "Save Video As" option from context menu
|
||||
var saveVideoCommand = document.getElementById("context-savevideo");
|
||||
saveVideoCommand.doCommand();
|
||||
|
||||
event.target.hidePopup();
|
||||
}
|
||||
|
||||
// --- Run the test ---
|
||||
testRunner.runTest(saveVideoAs_TestGenerator);
|
||||
function onTransferComplete(downloadSuccess) {
|
||||
ok(downloadSuccess, "Video file should have been downloaded successfully");
|
||||
|
||||
// Read the name of the saved file.
|
||||
var fileName = mockFilePickerResults.selectedFile.leafName;
|
||||
|
||||
is(fileName, "Bug564387-expectedName.ogv",
|
||||
"Video file name is correctly retrieved from Content-Disposition http header");
|
||||
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
Cc["@mozilla.org/moz/jssubscript-loader;1"]
|
||||
.getService(Ci.mozIJSSubScriptLoader)
|
||||
.loadSubScript("chrome://mochitests/content/browser/toolkit/content/tests/browser/common/mockTransfer.js",
|
||||
this);
|
||||
|
||||
Cc["@mozilla.org/moz/jssubscript-loader;1"]
|
||||
.getService(Ci.mozIJSSubScriptLoader)
|
||||
.loadSubScript("chrome://mochitests/content/browser/toolkit/content/tests/browser/common/mockFilePicker.js",
|
||||
this);
|
||||
|
||||
function createTemporarySaveDirectory() {
|
||||
var saveDir = Cc["@mozilla.org/file/directory_service;1"]
|
||||
.getService(Ci.nsIProperties)
|
||||
.get("TmpD", Ci.nsIFile);
|
||||
saveDir.append("testsavedir");
|
||||
if (!saveDir.exists())
|
||||
saveDir.create(Ci.nsIFile.DIRECTORY_TYPE, 0755);
|
||||
return saveDir;
|
||||
}
|
||||
|
@ -2,18 +2,21 @@
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
const trimPref = "browser.urlbar.trimURLs";
|
||||
const phishyUserPassPref = "network.http.phishy-userpass-length";
|
||||
|
||||
function test() {
|
||||
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
let tab = gBrowser.selectedTab = gBrowser.addTab();
|
||||
|
||||
registerCleanupFunction(function () {
|
||||
gBrowser.removeCurrentTab();
|
||||
gBrowser.removeTab(tab);
|
||||
Services.prefs.clearUserPref(trimPref);
|
||||
Services.prefs.clearUserPref(phishyUserPassPref);
|
||||
URLBarSetURI();
|
||||
});
|
||||
|
||||
Services.prefs.setBoolPref(trimPref, true);
|
||||
Services.prefs.setIntPref(phishyUserPassPref, 32); // avoid prompting about phishing
|
||||
|
||||
waitForExplicitFinish();
|
||||
|
||||
@ -32,7 +35,6 @@ var tests = [
|
||||
copyExpected: "e"
|
||||
},
|
||||
|
||||
|
||||
// pageproxystate="valid" from this point on (due to the load)
|
||||
{
|
||||
loadURL: "http://example.com/",
|
||||
@ -52,6 +54,13 @@ var tests = [
|
||||
copyExpected: "http://e"
|
||||
},
|
||||
|
||||
// Test that userPass is stripped out
|
||||
{
|
||||
loadURL: "http://user:pass@mochi.test:8888/browser/browser/base/content/test/authenticate.sjs?user=user&pass=pass",
|
||||
expectedURL: "mochi.test:8888/browser/browser/base/content/test/authenticate.sjs?user=user&pass=pass",
|
||||
copyExpected: "http://mochi.test:8888/browser/browser/base/content/test/authenticate.sjs?user=user&pass=pass"
|
||||
},
|
||||
|
||||
// Test escaping
|
||||
{
|
||||
loadURL: "http://example.com/()%C3%A9",
|
||||
|
39
browser/base/content/test/browser_wyciwyg_urlbarCopying.js
Normal file
39
browser/base/content/test/browser_wyciwyg_urlbarCopying.js
Normal file
@ -0,0 +1,39 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
let url = "http://mochi.test:8888/browser/browser/base/content/test/test_wyciwyg_copying.html";
|
||||
let tab = gBrowser.selectedTab = gBrowser.addTab(url);
|
||||
tab.linkedBrowser.addEventListener("pageshow", function () {
|
||||
let btn = content.document.getElementById("btn");
|
||||
executeSoon(function () {
|
||||
EventUtils.synthesizeMouseAtCenter(btn, {}, content);
|
||||
let currentURL = gBrowser.currentURI.spec;
|
||||
ok(/^wyciwyg:\/\//i.test(currentURL), currentURL + " is a wyciwyg URI");
|
||||
|
||||
executeSoon(function () {
|
||||
testURLBarCopy(url, endTest);
|
||||
});
|
||||
});
|
||||
}, false);
|
||||
|
||||
function endTest() {
|
||||
while (gBrowser.tabs.length > 1)
|
||||
gBrowser.removeCurrentTab();
|
||||
finish();
|
||||
}
|
||||
|
||||
function testURLBarCopy(targetValue, cb) {
|
||||
info("Expecting copy of: " + targetValue);
|
||||
waitForClipboard(targetValue, function () {
|
||||
gURLBar.focus();
|
||||
gURLBar.select();
|
||||
|
||||
goDoCommand("cmd_copy");
|
||||
}, cb, cb);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -150,6 +150,7 @@ _BROWSER_FILES = \
|
||||
browser_tabview_bug663421.js \
|
||||
browser_tabview_bug665502.js \
|
||||
browser_tabview_bug669694.js \
|
||||
browser_tabview_click_group.js \
|
||||
browser_tabview_dragdrop.js \
|
||||
browser_tabview_exit_button.js \
|
||||
browser_tabview_expander.js \
|
||||
@ -167,7 +168,6 @@ _BROWSER_FILES = \
|
||||
head.js \
|
||||
search1.html \
|
||||
search2.html \
|
||||
test_bug599626.html \
|
||||
test_bug600645.html \
|
||||
test_bug644097.html \
|
||||
$(NULL)
|
||||
|
@ -1,53 +1,37 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
let contentWindow;
|
||||
let groupItemTwoId;
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
window.addEventListener("tabviewshown", setup, false);
|
||||
TabView.toggle();
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
while (gBrowser.tabs[1])
|
||||
gBrowser.removeTab(gBrowser.tabs[1]);
|
||||
hideTabView(function() {});
|
||||
});
|
||||
gBrowser.loadOneTab("about:blank", { inBackground: true });
|
||||
showTabView(setup);
|
||||
}
|
||||
|
||||
function setup() {
|
||||
window.removeEventListener("tabviewshown", setup, false);
|
||||
registerCleanupFunction(function() {
|
||||
let groupItem = contentWindow.GroupItems.groupItem(groupItemTwoId);
|
||||
if (groupItem)
|
||||
closeGroupItem(groupItem, function() {});
|
||||
});
|
||||
|
||||
let contentWindow = document.getElementById("tab-view").contentWindow;
|
||||
let contentWindow = TabView.getContentWindow();
|
||||
is(contentWindow.GroupItems.groupItems.length, 1, "Has only one group");
|
||||
|
||||
let groupItemOne = contentWindow.GroupItems.groupItems[0];
|
||||
// add a blank tab to group one.
|
||||
createNewTabItemInGroupItem(groupItemOne, contentWindow, function() {
|
||||
is(groupItemOne.getChildren().length, 2, "Group one has 2 tab items");
|
||||
is(groupItemOne.getChildren().length, 2, "Group one has 2 tab items");
|
||||
|
||||
// create group two with a blank tab.
|
||||
let groupItemTwo = createEmptyGroupItem(contentWindow, 250, 250, 40);
|
||||
createNewTabItemInGroupItem(groupItemTwo, contentWindow, function() {
|
||||
// start the first test.
|
||||
testGroups(groupItemOne, groupItemTwo, contentWindow);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function createNewTabItemInGroupItem(groupItem, contentWindow, callback) {
|
||||
// click on the + button to create a blank tab in group item
|
||||
let newTabButton = groupItem.container.getElementsByClassName("newTabButton");
|
||||
ok(newTabButton[0], "New tab button exists");
|
||||
|
||||
let onTabViewHidden = function() {
|
||||
window.removeEventListener("tabviewhidden", onTabViewHidden, false);
|
||||
|
||||
ok(!TabView.isVisible(), "Tab View is hidden because we just opened a tab");
|
||||
TabView.toggle();
|
||||
};
|
||||
let onTabViewShown = function() {
|
||||
window.removeEventListener("tabviewshown", onTabViewShown, false);
|
||||
|
||||
ok(TabView.isVisible(), "Tab View is visible");
|
||||
callback();
|
||||
};
|
||||
window.addEventListener("tabviewhidden", onTabViewHidden, false);
|
||||
window.addEventListener("tabviewshown", onTabViewShown, false);
|
||||
EventUtils.sendMouseEvent({ type: "click" }, newTabButton[0], contentWindow);
|
||||
let groupItemTwo = createGroupItemWithBlankTabs(window, 250, 250, 40, 1);
|
||||
groupItemTwoId = groupItemTwo.id;
|
||||
testGroups(groupItemOne, groupItemTwo, contentWindow);
|
||||
}
|
||||
|
||||
function testGroups(groupItemOne, groupItemTwo, contentWindow) {
|
||||
@ -70,15 +54,12 @@ function testGroups(groupItemOne, groupItemTwo, contentWindow) {
|
||||
is(contentWindow.UI.getActiveTab(), groupItemOne.getChild(0),
|
||||
"The first tab item in group one is active");
|
||||
|
||||
let onTabViewHidden = function() {
|
||||
window.removeEventListener("tabviewhidden", onTabViewHidden, false);
|
||||
whenTabViewIsHidden(function() {
|
||||
is(groupItemOne.getChildren().length, 2,
|
||||
"The num of childen in group one is 2");
|
||||
|
||||
// clean up and finish
|
||||
groupItemTwo.addSubscriber("close", function onClose() {
|
||||
groupItemTwo.removeSubscriber("close", onClose);
|
||||
|
||||
closeGroupItem(groupItemTwo, function() {
|
||||
gBrowser.removeTab(groupItemOne.getChild(1).tab);
|
||||
is(contentWindow.GroupItems.groupItems.length, 1, "Has only one group");
|
||||
is(groupItemOne.getChildren().length, 1,
|
||||
@ -87,10 +68,7 @@ function testGroups(groupItemOne, groupItemTwo, contentWindow) {
|
||||
|
||||
finish();
|
||||
});
|
||||
gBrowser.removeTab(groupItemTwo.getChild(0).tab);
|
||||
groupItemTwo.close();
|
||||
}
|
||||
window.addEventListener("tabviewhidden", onTabViewHidden, false);
|
||||
});
|
||||
EventUtils.synthesizeKey("t", { accelKey: true });
|
||||
});
|
||||
// close a tab item in group one
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
let originalTab;
|
||||
let newTabOne;
|
||||
let groupItemTwoId;
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
@ -11,10 +12,20 @@ function test() {
|
||||
// add a tab to the existing group.
|
||||
newTabOne = gBrowser.addTab();
|
||||
|
||||
let onTabviewShown = function() {
|
||||
window.removeEventListener("tabviewshown", onTabviewShown, false);
|
||||
registerCleanupFunction(function() {
|
||||
while (gBrowser.tabs[1])
|
||||
gBrowser.removeTab(gBrowser.tabs[1]);
|
||||
hideTabView(function() {});
|
||||
});
|
||||
|
||||
let contentWindow = document.getElementById("tab-view").contentWindow;
|
||||
showTabView(function() {
|
||||
let contentWindow = TabView.getContentWindow();
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
let groupItem = contentWindow.GroupItems.groupItem(groupItemTwoId);
|
||||
if (groupItem)
|
||||
closeGroupItem(groupItem, function() {});
|
||||
});
|
||||
|
||||
is(contentWindow.GroupItems.groupItems.length, 1,
|
||||
"There is one group item on startup");
|
||||
@ -25,22 +36,13 @@ function test() {
|
||||
"The currently selected tab should be the first tab in the groupItemOne");
|
||||
|
||||
// create another group with a tab.
|
||||
let groupItemTwo = createEmptyGroupItem(contentWindow, 300, 300, 200);
|
||||
|
||||
let onTabViewHidden = function() {
|
||||
window.removeEventListener("tabviewhidden", onTabViewHidden, false);
|
||||
let groupItemTwo = createGroupItemWithBlankTabs(window, 300, 300, 200, 1);
|
||||
groupItemTwoId = groupItemTwoId;
|
||||
hideTabView(function() {
|
||||
// start the test
|
||||
testGroupSwitch(contentWindow, groupItemOne, groupItemTwo);
|
||||
};
|
||||
window.addEventListener("tabviewhidden", onTabViewHidden, false);
|
||||
|
||||
// click on the + button
|
||||
let newTabButton = groupItemTwo.container.getElementsByClassName("newTabButton");
|
||||
ok(newTabButton[0], "New tab button exists");
|
||||
EventUtils.sendMouseEvent({ type: "click" }, newTabButton[0], contentWindow);
|
||||
};
|
||||
window.addEventListener("tabviewshown", onTabviewShown, false);
|
||||
TabView.toggle();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function testGroupSwitch(contentWindow, groupItemOne, groupItemTwo) {
|
||||
|
@ -23,75 +23,49 @@ function test() {
|
||||
}
|
||||
|
||||
function testOne() {
|
||||
whenSearchEnabledAndDisabled(testTwo);
|
||||
hideSearchWhenSearchEnabled(testTwo);
|
||||
// press cmd/ctrl F
|
||||
EventUtils.synthesizeKey("f", {accelKey: true}, cw);
|
||||
}
|
||||
|
||||
function testTwo() {
|
||||
whenSearchEnabledAndDisabled(testThree);
|
||||
hideSearchWhenSearchEnabled(testThree);
|
||||
// press /
|
||||
EventUtils.synthesizeKey("VK_SLASH", {}, cw);
|
||||
}
|
||||
|
||||
function testThree() {
|
||||
let onTabViewShown = function () {
|
||||
is(cw.UI.getActiveTab(), groupItem.getChild(0),
|
||||
"The active tab is newly created tab item");
|
||||
ok(win.TabView.isVisible(), "Tab View is visible");
|
||||
// create another group with a tab.
|
||||
let groupItem = createGroupItemWithBlankTabs(win, 300, 300, 200, 1);
|
||||
is(cw.UI.getActiveTab(), groupItem.getChild(0),
|
||||
"The active tab is newly created tab item");
|
||||
|
||||
let onSearchEnabled = function () {
|
||||
let doc = cw.document;
|
||||
let searchBox = cw.iQ("#searchbox");
|
||||
let hasFocus = doc.hasFocus() && doc.activeElement == searchBox[0];
|
||||
ok(hasFocus, "The search box has focus");
|
||||
whenSearchIsEnabled(function () {
|
||||
let doc = cw.document;
|
||||
let searchBox = cw.iQ("#searchbox");
|
||||
let hasFocus = doc.hasFocus() && doc.activeElement == searchBox[0];
|
||||
ok(hasFocus, "The search box has focus");
|
||||
|
||||
let tab = win.gBrowser.tabs[1];
|
||||
searchBox.val(tab._tabViewTabItem.$tabTitle[0].innerHTML);
|
||||
let tab = win.gBrowser.tabs[1];
|
||||
searchBox.val(tab._tabViewTabItem.$tabTitle[0].innerHTML);
|
||||
|
||||
cw.performSearch();
|
||||
cw.performSearch();
|
||||
|
||||
whenTabViewIsHidden(function () {
|
||||
is(tab, win.gBrowser.selectedTab, "The search result tab is shown");
|
||||
waitForFocus(finish);
|
||||
}, win);
|
||||
whenTabViewIsHidden(function () {
|
||||
is(tab, win.gBrowser.selectedTab, "The search result tab is shown");
|
||||
finish()
|
||||
}, win);
|
||||
|
||||
// use the tabview menu (the same as pressing cmd/ctrl + e)
|
||||
win.document.getElementById("menu_tabview").doCommand();
|
||||
};
|
||||
|
||||
whenSearchEnabled(onSearchEnabled);
|
||||
EventUtils.synthesizeKey("VK_SLASH", {}, cw);
|
||||
};
|
||||
|
||||
whenTabViewIsHidden(function () {
|
||||
showTabView(onTabViewShown, win);
|
||||
// use the tabview menu (the same as pressing cmd/ctrl + e)
|
||||
win.document.getElementById("menu_tabview").doCommand();
|
||||
}, win);
|
||||
|
||||
// click on the + button
|
||||
let groupItem = createEmptyGroupItem(cw, 300, 300, 200);
|
||||
let newTabButton = groupItem.container.getElementsByClassName("newTabButton");
|
||||
ok(newTabButton[0], "New tab button exists");
|
||||
|
||||
EventUtils.sendMouseEvent({type: "click"}, newTabButton[0], cw);
|
||||
EventUtils.synthesizeKey("VK_SLASH", {}, cw);
|
||||
}
|
||||
|
||||
function whenSearchEnabledAndDisabled(callback) {
|
||||
whenSearchEnabled(function () {
|
||||
whenSearchDisabled(callback);
|
||||
cw.hideSearch();
|
||||
});
|
||||
function hideSearchWhenSearchEnabled(callback) {
|
||||
whenSearchIsEnabled(function() {
|
||||
hideSearch(callback, win);
|
||||
}, win);
|
||||
}
|
||||
|
||||
function whenSearchEnabled(callback) {
|
||||
cw.addEventListener("tabviewsearchenabled", function onSearchEnabled() {
|
||||
cw.removeEventListener("tabviewsearchenabled", onSearchEnabled, false);
|
||||
callback();
|
||||
}, false);
|
||||
}
|
||||
|
||||
function whenSearchDisabled(callback) {
|
||||
cw.addEventListener("tabviewsearchdisabled", function onSearchDisabled() {
|
||||
cw.removeEventListener("tabviewsearchdisabled", onSearchDisabled, false);
|
||||
callback();
|
||||
}, false);
|
||||
}
|
||||
|
@ -1,41 +1,26 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
let handleDialog;
|
||||
let timer; // keep in outer scope so it's not GC'd before firing
|
||||
const TEST_URL = 'data:text/html,<script>window.onbeforeunload=' +
|
||||
'function(e){e.returnValue="?"}</script>';
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
window.addEventListener("tabviewshown", onTabViewWindowLoaded, false);
|
||||
TabView.toggle();
|
||||
showTabView(onTabViewShown);
|
||||
}
|
||||
|
||||
function onTabViewWindowLoaded() {
|
||||
window.removeEventListener("tabviewshown", onTabViewWindowLoaded, false);
|
||||
|
||||
let contentWindow = document.getElementById("tab-view").contentWindow;
|
||||
function onTabViewShown() {
|
||||
let contentWindow = TabView.getContentWindow();
|
||||
let groupItemOne = contentWindow.GroupItems.getActiveGroupItem();
|
||||
let groupItemTwo = createGroupItemWithTabs(window, 300, 300, 10, [TEST_URL]);
|
||||
|
||||
// Create a group and make it active
|
||||
let box = new contentWindow.Rect(10, 10, 300, 300);
|
||||
let groupItemTwo = new contentWindow.GroupItem([], { bounds: box });
|
||||
contentWindow.UI.setActive(groupItemTwo);
|
||||
|
||||
let testTab =
|
||||
gBrowser.addTab(
|
||||
"http://mochi.test:8888/browser/browser/base/content/test/tabview/test_bug599626.html");
|
||||
let browser = gBrowser.getBrowserForTab(testTab);
|
||||
let onLoad = function() {
|
||||
browser.removeEventListener("load", onLoad, true);
|
||||
|
||||
afterAllTabsLoaded(function () {
|
||||
testStayOnPage(contentWindow, groupItemOne, groupItemTwo);
|
||||
}
|
||||
browser.addEventListener("load", onLoad, true);
|
||||
});
|
||||
}
|
||||
|
||||
function testStayOnPage(contentWindow, groupItemOne, groupItemTwo) {
|
||||
setupAndRun(contentWindow, groupItemOne, groupItemTwo, function(doc) {
|
||||
whenDialogOpened(function (dialog) {
|
||||
groupItemTwo.addSubscriber("groupShown", function onShown() {
|
||||
groupItemTwo.removeSubscriber("groupShown", onShown);
|
||||
|
||||
@ -44,22 +29,21 @@ function testStayOnPage(contentWindow, groupItemOne, groupItemTwo) {
|
||||
is(contentWindow.TabItems.getItems().length, 2,
|
||||
"The total number of tab items is 2 when staying on the page");
|
||||
|
||||
let onTabViewShown = function() {
|
||||
window.removeEventListener("tabviewshown", onTabViewShown, false);
|
||||
|
||||
showTabView(function () {
|
||||
// start the next test
|
||||
testLeavePage(contentWindow, groupItemOne, groupItemTwo);
|
||||
};
|
||||
window.addEventListener("tabviewshown", onTabViewShown, false);
|
||||
TabView.toggle();
|
||||
});
|
||||
});
|
||||
|
||||
// stay on page
|
||||
doc.documentElement.getButton("cancel").click();
|
||||
dialog.cancelDialog();
|
||||
});
|
||||
|
||||
closeGroupItem(groupItemTwo);
|
||||
}
|
||||
|
||||
function testLeavePage(contentWindow, groupItemOne, groupItemTwo) {
|
||||
setupAndRun(contentWindow, groupItemOne, groupItemTwo, function(doc) {
|
||||
whenDialogOpened(function (dialog) {
|
||||
// clean up and finish the test
|
||||
groupItemTwo.addSubscriber("close", function onClose() {
|
||||
groupItemTwo.removeSubscriber("close", onClose);
|
||||
@ -69,93 +53,35 @@ function testLeavePage(contentWindow, groupItemOne, groupItemTwo) {
|
||||
is(contentWindow.TabItems.getItems().length, 1,
|
||||
"The total number of tab items is 1 after leaving the page");
|
||||
|
||||
let endGame = function() {
|
||||
window.removeEventListener("tabviewhidden", endGame, false);
|
||||
finish();
|
||||
};
|
||||
window.addEventListener("tabviewhidden", endGame, false);
|
||||
hideTabView(finish);
|
||||
});
|
||||
|
||||
// Leave page
|
||||
doc.documentElement.getButton("accept").click();
|
||||
dialog.acceptDialog();
|
||||
});
|
||||
|
||||
closeGroupItem(groupItemTwo);
|
||||
}
|
||||
|
||||
function setupAndRun(contentWindow, groupItemOne, groupItemTwo, callback) {
|
||||
let closeButton = groupItemTwo.container.getElementsByClassName("close");
|
||||
ok(closeButton[0], "Group close button exists");
|
||||
// click the close button
|
||||
EventUtils.sendMouseEvent({ type: "click" }, closeButton[0], contentWindow);
|
||||
// ----------
|
||||
function whenDialogOpened(callback) {
|
||||
let listener = {
|
||||
onCloseWindow: function () {},
|
||||
onWindowTitleChange: function () {},
|
||||
|
||||
let onTabViewHidden = function() {
|
||||
window.removeEventListener("tabviewhidden", onTabViewHidden, false);
|
||||
onOpenWindow: function (xulWin) {
|
||||
let domWin = xulWin.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDOMWindow);
|
||||
|
||||
handleDialog = function(doc) {
|
||||
callback(doc);
|
||||
};
|
||||
startCallbackTimer();
|
||||
whenWindowLoaded(domWin, function () {
|
||||
let dialog = domWin.document.querySelector("dialog");
|
||||
if (dialog) {
|
||||
Services.wm.removeListener(listener);
|
||||
callback(dialog);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
window.addEventListener("tabviewhidden", onTabViewHidden, false);
|
||||
|
||||
let tabItem = groupItemOne.getChild(0);
|
||||
tabItem.zoomIn();
|
||||
}
|
||||
|
||||
// Copied from http://mxr.mozilla.org/mozilla-central/source/toolkit/components/places/tests/mochitest/prompt_common.js
|
||||
let observer = {
|
||||
QueryInterface : function (iid) {
|
||||
const interfaces = [Ci.nsIObserver, Ci.nsISupports, Ci.nsISupportsWeakReference];
|
||||
|
||||
if (!interfaces.some( function(v) { return iid.equals(v) } ))
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
return this;
|
||||
},
|
||||
|
||||
observe : function (subject, topic, data) {
|
||||
let doc = getDialogDoc();
|
||||
if (doc)
|
||||
handleDialog(doc);
|
||||
else
|
||||
startCallbackTimer(); // try again in a bit
|
||||
}
|
||||
};
|
||||
|
||||
function startCallbackTimer() {
|
||||
// Delay before the callback twiddles the prompt.
|
||||
const dialogDelay = 10;
|
||||
|
||||
// Use a timer to invoke a callback to twiddle the authentication dialog
|
||||
timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
||||
timer.init(observer, dialogDelay, Ci.nsITimer.TYPE_ONE_SHOT);
|
||||
}
|
||||
|
||||
function getDialogDoc() {
|
||||
// Find the <browser> which contains notifyWindow, by looking
|
||||
// through all the open windows and all the <browsers> in each.
|
||||
let wm = Cc["@mozilla.org/appshell/window-mediator;1"].
|
||||
getService(Ci.nsIWindowMediator);
|
||||
let enumerator = wm.getXULWindowEnumerator(null);
|
||||
|
||||
while (enumerator.hasMoreElements()) {
|
||||
let win = enumerator.getNext();
|
||||
let windowDocShell = win.QueryInterface(Ci.nsIXULWindow).docShell;
|
||||
|
||||
let containedDocShells = windowDocShell.getDocShellEnumerator(
|
||||
Ci.nsIDocShellTreeItem.typeChrome,
|
||||
Ci.nsIDocShell.ENUMERATE_FORWARDS);
|
||||
while (containedDocShells.hasMoreElements()) {
|
||||
// Get the corresponding document for this docshell
|
||||
let childDocShell = containedDocShells.getNext();
|
||||
// We don't want it if it's not done loading.
|
||||
if (childDocShell.busyFlags != Ci.nsIDocShell.BUSY_FLAGS_NONE)
|
||||
continue;
|
||||
let childDoc = childDocShell.QueryInterface(Ci.nsIDocShell).
|
||||
contentViewer.DOMDocument;
|
||||
|
||||
if (childDoc.location.href == "chrome://global/content/commonDialog.xul")
|
||||
return childDoc;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
Services.wm.addListener(listener);
|
||||
}
|
||||
|
@ -65,11 +65,6 @@ function test() {
|
||||
simulateDoubleClick(container, 2);
|
||||
assertNumberOfTabs(1);
|
||||
|
||||
// simulate double click with left mouse button
|
||||
let container = groupItem.container;
|
||||
simulateDoubleClick(container);
|
||||
assertNumberOfTabs(1);
|
||||
|
||||
groupItem.close();
|
||||
hideTabView(finishTest);
|
||||
}
|
||||
|
@ -0,0 +1,68 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
let contentWindow;
|
||||
let groupItem;
|
||||
let groupItemId;
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
contentWindow.gPrefBranch.clearUserPref("animate_zoom");
|
||||
let createdGroupItem = contentWindow.GroupItems.groupItem(groupItemId)
|
||||
if (createdGroupItem)
|
||||
closeGroupItem(createdGroupItem, function() {});
|
||||
hideTabView(function() {});
|
||||
});
|
||||
|
||||
showTabView(function() {
|
||||
contentWindow = TabView.getContentWindow();
|
||||
groupItem = createEmptyGroupItem(contentWindow, 300, 300, 200);
|
||||
groupItemId = groupItem.id;
|
||||
testMouseClickOnEmptyGroupItem();
|
||||
});
|
||||
}
|
||||
|
||||
function testMouseClickOnEmptyGroupItem() {
|
||||
whenTabViewIsHidden(function() {
|
||||
is(groupItem.getChildren().length, 1, "The group item contains one tab item now");
|
||||
showTabView(testDraggingWithinGroupItem);
|
||||
});
|
||||
is(groupItem.getChildren().length, 0, "The group item doesn't contain any tab items");
|
||||
EventUtils.sendMouseEvent({ type: "mousedown" }, groupItem.container, contentWindow);
|
||||
EventUtils.sendMouseEvent({ type: "mouseup" }, groupItem.container, contentWindow);
|
||||
}
|
||||
|
||||
function testDraggingWithinGroupItem() {
|
||||
let target = groupItem.container;
|
||||
contentWindow.gPrefBranch.setBoolPref("animate_zoom", false);
|
||||
|
||||
// stimulate drag and drop
|
||||
EventUtils.sendMouseEvent( {type: "mousedown" }, target, contentWindow);
|
||||
EventUtils.synthesizeMouse(target, 10, 10, { type: "mousemove" }, contentWindow);
|
||||
ok(groupItem.isDragging, "The group item is being dragged")
|
||||
|
||||
EventUtils.sendMouseEvent({ type: "mouseup" }, target, contentWindow);
|
||||
ok(!groupItem.isDragging, "The dragging is competely");
|
||||
|
||||
executeSoon(function() {
|
||||
ok(TabView.isVisible(), "The tab view is still visible after dragging");
|
||||
contentWindow.gPrefBranch.clearUserPref("animate_zoom");
|
||||
|
||||
testMouseClickOnGroupItem();
|
||||
});
|
||||
}
|
||||
|
||||
function testMouseClickOnGroupItem() {
|
||||
whenTabViewIsHidden(function() {
|
||||
is(groupItem.getChildren().length, 1, "The group item still contains one tab item");
|
||||
|
||||
closeGroupItem(groupItem, function() {
|
||||
hideTabView(finish);
|
||||
});
|
||||
});
|
||||
EventUtils.sendMouseEvent({ type: "mousedown" }, groupItem.container, contentWindow);
|
||||
EventUtils.sendMouseEvent({ type: "mouseup" }, groupItem.container, contentWindow);
|
||||
}
|
||||
|
@ -4,18 +4,16 @@
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
window.addEventListener("tabviewshown", onTabViewWindowLoaded, false);
|
||||
TabView.toggle();
|
||||
showTabView(onTabViewWindowLoaded);
|
||||
}
|
||||
|
||||
let originalGroupItem = null;
|
||||
let originalTab = null;
|
||||
|
||||
function onTabViewWindowLoaded() {
|
||||
window.removeEventListener("tabviewshown", onTabViewWindowLoaded, false);
|
||||
ok(TabView.isVisible(), "Tab View is visible");
|
||||
|
||||
let contentWindow = document.getElementById("tab-view").contentWindow;
|
||||
let contentWindow = TabView.getContentWindow();
|
||||
|
||||
is(contentWindow.GroupItems.groupItems.length, 1, "There is one group item on startup");
|
||||
originalGroupItem = contentWindow.GroupItems.groupItems[0];
|
||||
@ -58,19 +56,7 @@ function testGroupItemWithTabItem(contentWindow) {
|
||||
let groupItem = createEmptyGroupItem(contentWindow, 300, 300, 200);
|
||||
let tabItemCount = 0;
|
||||
|
||||
let onTabViewHidden = function() {
|
||||
window.removeEventListener("tabviewhidden", onTabViewHidden, false);
|
||||
|
||||
is(groupItem.getChildren().length, ++tabItemCount,
|
||||
"The number of children in new tab group is increased by 1");
|
||||
|
||||
ok(!TabView.isVisible(), "Tab View is hidden because we just opened a tab");
|
||||
|
||||
TabView.toggle();
|
||||
};
|
||||
let onTabViewShown = function() {
|
||||
window.removeEventListener("tabviewshown", onTabViewShown, false);
|
||||
|
||||
let tabItem = groupItem.getChild(groupItem.getChildren().length - 1);
|
||||
ok(tabItem, "Tab item exists");
|
||||
|
||||
@ -85,19 +71,12 @@ function testGroupItemWithTabItem(contentWindow) {
|
||||
ok(tabItemClosed, "The tab item is closed");
|
||||
is(groupItem.getChildren().length, --tabItemCount,
|
||||
"The number of children in new tab group is decreased by 1");
|
||||
|
||||
|
||||
ok(TabView.isVisible(), "Tab View is still shown");
|
||||
|
||||
// Now there should only be one tab left, so we need to hide TabView
|
||||
// and go into that tab.
|
||||
is(gBrowser.tabs.length, 1, "There is only one tab left");
|
||||
|
||||
let endGame = function() {
|
||||
window.removeEventListener("tabviewhidden", endGame, false);
|
||||
ok(!TabView.isVisible(), "Tab View is hidden");
|
||||
finish();
|
||||
};
|
||||
window.addEventListener("tabviewhidden", endGame, false);
|
||||
|
||||
// after the last selected tabitem is closed, there would be not active
|
||||
// tabitem on the UI so we set the active tabitem before toggling the
|
||||
@ -106,7 +85,11 @@ function testGroupItemWithTabItem(contentWindow) {
|
||||
ok(tabItems[0], "A tab item exists");
|
||||
contentWindow.UI.setActive(tabItems[0]);
|
||||
|
||||
TabView.toggle();
|
||||
hideTabView(function() {
|
||||
ok(!TabView.isVisible(), "Tab View is hidden");
|
||||
|
||||
closeGroupItem(groupItem, finish);
|
||||
});
|
||||
});
|
||||
|
||||
// remove the tab item. The code detects mousedown and mouseup so we stimulate here
|
||||
@ -115,15 +98,14 @@ function testGroupItemWithTabItem(contentWindow) {
|
||||
|
||||
EventUtils.sendMouseEvent({ type: "mousedown" }, closeButton[0], contentWindow);
|
||||
EventUtils.sendMouseEvent({ type: "mouseup" }, closeButton[0], contentWindow);
|
||||
|
||||
TabView.toggle();
|
||||
};
|
||||
window.addEventListener("tabviewhidden", onTabViewHidden, false);
|
||||
window.addEventListener("tabviewshown", onTabViewShown, false);
|
||||
|
||||
// click on the + button
|
||||
let newTabButton = groupItem.container.getElementsByClassName("newTabButton");
|
||||
ok(newTabButton[0], "New tab button exists");
|
||||
|
||||
EventUtils.synthesizeMouse(newTabButton[0], 1, 1, {}, contentWindow);
|
||||
whenTabViewIsHidden(function() {
|
||||
is(groupItem.getChildren().length, ++tabItemCount,
|
||||
"The number of children in new tab group is increased by 1");
|
||||
|
||||
ok(!TabView.isVisible(), "Tab View is hidden because we just opened a tab");
|
||||
showTabView(onTabViewShown);
|
||||
});
|
||||
groupItem.newTab();
|
||||
}
|
||||
|
@ -31,21 +31,26 @@ function test() {
|
||||
let transitioned = 0;
|
||||
|
||||
let initCallback = function() {
|
||||
tabViewWindow = win.TabView._window;
|
||||
tabViewWindow = win.TabView.getContentWindow();
|
||||
function onTransitionEnd(event) {
|
||||
transitioned++;
|
||||
info(transitioned);
|
||||
}
|
||||
tabViewWindow.document.addEventListener("transitionend", onTransitionEnd, false);
|
||||
|
||||
showTabView(function() {
|
||||
// don't use showTabView() here because we only want to check whether
|
||||
// zoom out animation happens. Other animations would happen before
|
||||
// the callback as waitForFocus() was added to showTabView() in head.js
|
||||
let onTabViewShown = function() {
|
||||
tabViewWindow.removeEventListener("tabviewshown", onTabViewShown, false);
|
||||
tabViewWindow.document.removeEventListener("transitionend", onTransitionEnd, false);
|
||||
|
||||
ok(!transitioned, "There should be no transitions");
|
||||
|
||||
tabViewWindow.document.removeEventListener(
|
||||
"transitionend", onTransitionEnd, false);
|
||||
|
||||
finish();
|
||||
}, win);
|
||||
};
|
||||
tabViewWindow.addEventListener("tabviewshown", onTabViewShown, false);
|
||||
win.TabView.toggle();
|
||||
};
|
||||
|
||||
win.TabView._initFrame(initCallback);
|
||||
|
@ -4,45 +4,33 @@
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
window.addEventListener("tabviewshown", onTabViewWindowLoaded, false);
|
||||
TabView.toggle();
|
||||
registerCleanupFunction(function() {
|
||||
while (gBrowser.tabs[1])
|
||||
gBrowser.removeTab(gBrowser.tabs[1]);
|
||||
hideTabView(function() {});
|
||||
});
|
||||
showTabView(onTabViewWindowLoaded);
|
||||
}
|
||||
|
||||
function onTabViewWindowLoaded() {
|
||||
window.removeEventListener("tabviewshown", onTabViewWindowLoaded, false);
|
||||
ok(TabView.isVisible(), "Tab View is visible");
|
||||
|
||||
let contentWindow = document.getElementById("tab-view").contentWindow;
|
||||
let contentWindow = TabView.getContentWindow();
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
let groupItem = contentWindow.GroupItems.groupItem(groupItemId);
|
||||
if (groupItem)
|
||||
closeGroupItem(groupItem, function() {});
|
||||
});
|
||||
|
||||
// create a group item
|
||||
let box = new contentWindow.Rect(20, 400, 300, 300);
|
||||
let groupItem = new contentWindow.GroupItem([], { bounds: box });
|
||||
|
||||
// create a tab item in the new group
|
||||
let onTabViewHidden = function() {
|
||||
window.removeEventListener("tabviewhidden", onTabViewHidden, false);
|
||||
|
||||
ok(!TabView.isVisible(), "Tab View is hidden because we just opened a tab");
|
||||
// show tab view
|
||||
TabView.toggle();
|
||||
};
|
||||
let onTabViewShown = function() {
|
||||
window.removeEventListener("tabviewshown", onTabViewShown, false);
|
||||
|
||||
is(groupItem.getChildren().length, 1, "The new group has a tab item");
|
||||
// start the tests
|
||||
waitForFocus(function() {
|
||||
testUndoGroup(contentWindow, groupItem);
|
||||
}, contentWindow);
|
||||
};
|
||||
window.addEventListener("tabviewhidden", onTabViewHidden, false);
|
||||
window.addEventListener("tabviewshown", onTabViewShown, false);
|
||||
|
||||
// click on the + button
|
||||
let newTabButton = groupItem.container.getElementsByClassName("newTabButton");
|
||||
ok(newTabButton[0], "New tab button exists");
|
||||
|
||||
EventUtils.sendMouseEvent({ type: "click" }, newTabButton[0], contentWindow);
|
||||
let groupItem = createGroupItemWithBlankTabs(window, 300, 300, 400, 1);
|
||||
groupItemId = groupItem.id;
|
||||
is(groupItem.getChildren().length, 1, "The new group has a tab item");
|
||||
// start the tests
|
||||
waitForFocus(function() {
|
||||
testUndoGroup(contentWindow, groupItem);
|
||||
}, contentWindow);
|
||||
}
|
||||
|
||||
function testUndoGroup(contentWindow, groupItem) {
|
||||
@ -113,13 +101,6 @@ function testCloseUndoGroup(contentWindow, groupItem) {
|
||||
let theGroupItem = contentWindow.GroupItems.groupItem(groupItem.id);
|
||||
ok(!theGroupItem, "The group item doesn't exists");
|
||||
|
||||
let endGame = function() {
|
||||
window.removeEventListener("tabviewhidden", endGame, false);
|
||||
ok(!TabView.isVisible(), "Tab View is hidden");
|
||||
finish();
|
||||
};
|
||||
window.addEventListener("tabviewhidden", endGame, false);
|
||||
|
||||
// after the last selected tabitem is closed, there would be not active
|
||||
// tabitem on the UI so we set the active tabitem before toggling the
|
||||
// visibility of tabview
|
||||
@ -127,7 +108,10 @@ function testCloseUndoGroup(contentWindow, groupItem) {
|
||||
ok(tabItems[0], "A tab item exists");
|
||||
contentWindow.UI.setActive(tabItems[0]);
|
||||
|
||||
TabView.toggle();
|
||||
hideTabView(function() {
|
||||
ok(!TabView.isVisible(), "Tab View is hidden");
|
||||
finish();
|
||||
});
|
||||
});
|
||||
|
||||
let closeButton = groupItem.container.getElementsByClassName("close");
|
||||
|
@ -32,6 +32,9 @@ function createGroupItemWithTabs(win, width, height, padding, urls, animate) {
|
||||
ok(newItem.container, "Created element "+t+":"+newItem.container);
|
||||
++t;
|
||||
});
|
||||
// to set one of tabItem to be active since we load tabs into a group
|
||||
// in a non-standard flow.
|
||||
contentWindow.UI.setActive(groupItem);
|
||||
return groupItem;
|
||||
}
|
||||
|
||||
@ -133,11 +136,13 @@ function showTabView(callback, win) {
|
||||
win = win || window;
|
||||
|
||||
if (win.TabView.isVisible()) {
|
||||
callback();
|
||||
waitForFocus(callback, win);
|
||||
return;
|
||||
}
|
||||
|
||||
whenTabViewIsShown(callback, win);
|
||||
whenTabViewIsShown(function() {
|
||||
waitForFocus(callback, win);
|
||||
}, win);
|
||||
win.TabView.show();
|
||||
}
|
||||
|
||||
|
@ -1,10 +0,0 @@
|
||||
<html>
|
||||
<script>
|
||||
window.onbeforeunload = function(event){
|
||||
event.returnValue = 'Confirmation? ';
|
||||
}
|
||||
</script>
|
||||
<body>
|
||||
Test page
|
||||
</body>
|
||||
</html>
|
13
browser/base/content/test/test_wyciwyg_copying.html
Normal file
13
browser/base/content/test/test_wyciwyg_copying.html
Normal file
@ -0,0 +1,13 @@
|
||||
<html>
|
||||
<body>
|
||||
<script>
|
||||
function go() {
|
||||
var w = window.open();
|
||||
w.document.open();
|
||||
w.document.write("<html><body>test document</body></html>");
|
||||
w.document.close();
|
||||
}
|
||||
</script>
|
||||
<button id="btn" onclick="go();">test</button>
|
||||
</body>
|
||||
</html>
|
@ -327,6 +327,11 @@
|
||||
gBrowser.loadURIWithFlags(url, flags, null, null, postData);
|
||||
}
|
||||
|
||||
// Focus the content area before triggering loads, since if the load
|
||||
// occurs in a new tab, we want focus to be restored to the content
|
||||
// area when the current tab is re-selected.
|
||||
gBrowser.selectedBrowser.focus();
|
||||
|
||||
if (aTriggeringEvent instanceof MouseEvent) {
|
||||
// We have a mouse event (from the go button), so use the standard
|
||||
// UI link behaviors
|
||||
@ -335,18 +340,12 @@
|
||||
loadCurrent();
|
||||
} else {
|
||||
this.handleRevert();
|
||||
content.focus();
|
||||
openUILinkIn(url, where,
|
||||
{ allowThirdPartyFixup: true, postData: postData });
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (aTriggeringEvent &&
|
||||
aTriggeringEvent.altKey &&
|
||||
!isTabEmpty(gBrowser.selectedTab)) {
|
||||
} else if (aTriggeringEvent && aTriggeringEvent.altKey &&
|
||||
!isTabEmpty(gBrowser.selectedTab)) {
|
||||
this.handleRevert();
|
||||
content.focus();
|
||||
gBrowser.loadOneTab(url, {
|
||||
postData: postData,
|
||||
inBackground: false,
|
||||
@ -356,8 +355,6 @@
|
||||
} else {
|
||||
loadCurrent();
|
||||
}
|
||||
|
||||
gBrowser.selectedBrowser.focus();
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
@ -513,6 +510,10 @@
|
||||
return selectedVal;
|
||||
|
||||
let uri = gBrowser.currentURI;
|
||||
// Only copy exposable URIs
|
||||
try {
|
||||
uri = Cc["@mozilla.org/docshell/urifixup;1"].getService(Ci.nsIURIFixup).createExposableURI(uri);
|
||||
} catch (ex) {}
|
||||
|
||||
// If the entire URL is selected, just use the actual loaded URI.
|
||||
if (inputVal == selectedVal) {
|
||||
|
@ -992,7 +992,6 @@ xpicleanup@BIN_SUFFIX@
|
||||
modules/services-sync/type_records/prefs.js
|
||||
modules/services-sync/type_records/tabs.js
|
||||
modules/services-sync/util.js
|
||||
modules/SpatialNavigation.js
|
||||
modules/stylePanel.jsm
|
||||
modules/tabview/AllTabs.jsm
|
||||
modules/tabview/groups.jsm
|
||||
|
@ -18,7 +18,7 @@
|
||||
<!ENTITY useSmoothScrolling.label "Use smooth scrolling">
|
||||
<!ENTITY useSmoothScrolling.accesskey "m">
|
||||
<!ENTITY allowHWAccel.label "Use hardware acceleration when available">
|
||||
<!ENTITY allowHWAccel.accesskey "h">
|
||||
<!ENTITY allowHWAccel.accesskey "r">
|
||||
<!ENTITY checkSpelling.label "Check my spelling as I type">
|
||||
<!ENTITY checkSpelling.accesskey "t">
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
tabview.groupItem.newTabButton=New tab
|
||||
tabview.groupItem.defaultName=Name this tab group…
|
||||
tabview.groupItem.undoCloseGroup=Undo Close Group
|
||||
tabview.search.otherWindowTabs=Tabs from other windows
|
||||
|
@ -79,7 +79,6 @@ browser.jar:
|
||||
skin/classic/browser/tabbrowser/tab-overflow-border.png (tabbrowser/tab-overflow-border.png)
|
||||
skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png)
|
||||
skin/classic/browser/tabview/edit-light.png (tabview/edit-light.png)
|
||||
skin/classic/browser/tabview/new-tab.png (tabview/new-tab.png)
|
||||
skin/classic/browser/tabview/search.png (tabview/search.png)
|
||||
skin/classic/browser/tabview/stack-expander.png (tabview/stack-expander.png)
|
||||
skin/classic/browser/tabview/tabview.png (tabview/tabview.png)
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 466 B |
@ -190,7 +190,7 @@ html[dir=rtl] .stack-trayed .tab-title {
|
||||
----------------------------------*/
|
||||
|
||||
.groupItem {
|
||||
cursor: move;
|
||||
cursor: pointer;
|
||||
border: 1px solid rgba(230,230,230,1);
|
||||
background-color: window;
|
||||
background-image: -moz-linear-gradient(rgba(255,255,255,.3),rgba(255,255,255,.1));
|
||||
@ -385,25 +385,6 @@ html[dir=rtl] .guideTrench {
|
||||
/* Other
|
||||
----------------------------------*/
|
||||
|
||||
.newTabButton {
|
||||
width: 16px;
|
||||
height: 15px;
|
||||
bottom: 10px;
|
||||
left: 10px;
|
||||
cursor: pointer;
|
||||
opacity: .3;
|
||||
background-image: url(chrome://browser/skin/tabview/new-tab.png);
|
||||
}
|
||||
|
||||
html[dir=rtl] .newTabButton {
|
||||
left: auto;
|
||||
right: 10px;
|
||||
}
|
||||
|
||||
.newTabButton:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.active {
|
||||
box-shadow: 5px 5px 3px rgba(0,0,0,.5);
|
||||
}
|
||||
@ -421,6 +402,7 @@ html[dir=rtl] .acceptsDrop {
|
||||
}
|
||||
|
||||
.titlebar {
|
||||
cursor: move;
|
||||
font-size: 12px;
|
||||
height: 18px;
|
||||
}
|
||||
|
@ -117,7 +117,6 @@ browser.jar:
|
||||
skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png)
|
||||
skin/classic/browser/tabview/close.png (tabview/close.png)
|
||||
skin/classic/browser/tabview/edit-light.png (tabview/edit-light.png)
|
||||
skin/classic/browser/tabview/new-tab.png (tabview/new-tab.png)
|
||||
skin/classic/browser/tabview/search.png (tabview/search.png)
|
||||
skin/classic/browser/tabview/stack-expander.png (tabview/stack-expander.png)
|
||||
skin/classic/browser/tabview/tabview.png (tabview/tabview.png)
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 466 B |
@ -191,7 +191,7 @@ html[dir=rtl] .stack-trayed .tab-title {
|
||||
----------------------------------*/
|
||||
|
||||
.groupItem {
|
||||
cursor: move;
|
||||
cursor: pointer;
|
||||
background-color: rgb(240,240,240);
|
||||
border-radius: 0.4em;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
|
||||
@ -376,25 +376,6 @@ html[dir=rtl] .guideTrench {
|
||||
/* Other
|
||||
----------------------------------*/
|
||||
|
||||
.newTabButton {
|
||||
width: 16px;
|
||||
height: 15px;
|
||||
bottom: 10px;
|
||||
left: 10px;
|
||||
cursor: pointer;
|
||||
opacity: .3;
|
||||
background-image: url(chrome://browser/skin/tabview/new-tab.png);
|
||||
}
|
||||
|
||||
html[dir=rtl] .newTabButton {
|
||||
left: auto;
|
||||
right: 10px;
|
||||
}
|
||||
|
||||
.newTabButton:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.active {
|
||||
box-shadow: 5px 5px 3px rgba(0,0,0,.5);
|
||||
}
|
||||
@ -412,6 +393,7 @@ html[dir=rtl] .acceptsDrop {
|
||||
}
|
||||
|
||||
.titlebar {
|
||||
cursor: move;
|
||||
font-size: 12px;
|
||||
height: 18px;
|
||||
}
|
||||
|
BIN
browser/themes/winstripe/browser/Toolbar-inverted.png
Normal file
BIN
browser/themes/winstripe/browser/Toolbar-inverted.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.0 KiB |
@ -13,9 +13,9 @@
|
||||
|
||||
#appmenu-button {
|
||||
border-width: 2px;
|
||||
-moz-border-left-colors: rgba(255,255,255,.5) rgba(83,42,6,.9);
|
||||
-moz-border-bottom-colors: rgba(255,255,255,.5) rgba(83,42,6,.9);
|
||||
-moz-border-right-colors: rgba(255,255,255,.5) rgba(83,42,6,.9);
|
||||
-moz-border-left-colors: @appMenuButtonBorderColor@;
|
||||
-moz-border-bottom-colors: @appMenuButtonBorderColor@;
|
||||
-moz-border-right-colors: @appMenuButtonBorderColor@;
|
||||
margin-bottom: 1px; /* compensate white outer border */
|
||||
box-shadow: 0 1px 0 rgba(255,255,255,.25) inset,
|
||||
0 0 2px 1px rgba(255,255,255,.25) inset;
|
||||
@ -138,6 +138,13 @@
|
||||
border-right-style: none !important;
|
||||
}
|
||||
|
||||
#toolbar-menubar :-moz-any(@primaryToolbarButtons@):not(#alltabs-button):not(#tabview-button):not(#new-tab-button) > .toolbarbutton-icon:not(:-moz-lwtheme),
|
||||
#TabsToolbar[tabsontop=true] :-moz-any(@primaryToolbarButtons@):not(#alltabs-button):not(#tabview-button):not(#new-tab-button) > .toolbarbutton-icon:not(:-moz-lwtheme),
|
||||
#navigator-toolbox[tabsontop=false] > #nav-bar :-moz-any(@primaryToolbarButtons@):not(#alltabs-button):not(#tabview-button):not(#new-tab-button) > .toolbarbutton-icon:not(:-moz-lwtheme),
|
||||
#nav-bar + #customToolbars + #PersonalToolbar[collapsed=true] + #TabsToolbar[tabsontop=false]:last-child :-moz-any(@primaryToolbarButtons@):not(#alltabs-button):not(#tabview-button):not(#new-tab-button) > .toolbarbutton-icon:not(:-moz-lwtheme) {
|
||||
list-style-image: url("chrome://browser/skin/Toolbar-inverted.png");
|
||||
}
|
||||
|
||||
/* Vertical toolbar border */
|
||||
#main-window[sizemode=normal] #navigator-toolbox::after,
|
||||
#main-window[sizemode=normal] #navigator-toolbox[tabsontop=true] > toolbar:not(#toolbar-menubar):not(#TabsToolbar),
|
||||
|
@ -57,6 +57,17 @@
|
||||
%define bgTabTexture -moz-linear-gradient(transparent, hsla(0,0%,45%,.1) 1px, hsla(0,0%,32%,.2) 80%, hsla(0,0%,0%,.2))
|
||||
%define bgTabTextureHover -moz-linear-gradient(hsla(0,0%,100%,.3) 1px, hsla(0,0%,75%,.2) 80%, hsla(0,0%,60%,.2))
|
||||
%define navbarTextboxCustomBorder border-color: rgba(0,0,0,.32);
|
||||
%define navbarLargeIcons #navigator-toolbox[iconsize=large][mode=icons] > #nav-bar
|
||||
|
||||
%ifdef MOZ_OFFICIAL_BRANDING
|
||||
%define appMenuButtonBorderColor rgba(255,255,255,.5) rgba(83,42,6,.9)
|
||||
%else
|
||||
%if MOZ_UPDATE_CHANNEL == aurora
|
||||
%define appMenuButtonBorderColor hsla(0,0%,100%,.5) hsla(214,89%,21%,.9)
|
||||
%else
|
||||
%define appMenuButtonBorderColor hsla(0,0%,100%,.5) hsla(210,59%,13%,.9)
|
||||
%endif
|
||||
%endif
|
||||
|
||||
#menubar-items {
|
||||
-moz-box-orient: vertical; /* for flex hack */
|
||||
@ -133,13 +144,10 @@
|
||||
|
||||
#appmenu-button {
|
||||
-moz-appearance: none;
|
||||
background: -moz-linear-gradient(rgb(247,182,82), rgb(215,98,10) 95%);
|
||||
background-clip: padding-box;
|
||||
border-radius: 0 0 4px 4px;
|
||||
border: 1px solid rgba(83,42,6,.9);
|
||||
border: 1px solid;
|
||||
border-top: none;
|
||||
box-shadow: 0 1px 0 rgba(255,255,255,.25) inset,
|
||||
0 0 0 1px rgba(255,255,255,.25) inset;
|
||||
color: white;
|
||||
text-shadow: 0 0 1px rgba(0,0,0,.7),
|
||||
0 1px 1.5px rgba(0,0,0,.5);
|
||||
@ -162,20 +170,85 @@
|
||||
}
|
||||
%endif
|
||||
|
||||
#main-window[privatebrowsingmode=temporary] #appmenu-button {
|
||||
background-image: -moz-linear-gradient(rgb(153,38,211), rgb(105,19,163) 95%);
|
||||
border-color: rgba(43,8,65,.9);
|
||||
#appmenu-button:hover:active,
|
||||
#appmenu-button[open] {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
%ifdef MOZ_OFFICIAL_BRANDING
|
||||
#appmenu-button {
|
||||
background-image: -moz-linear-gradient(rgb(247,182,82), rgb(215,98,10) 95%);
|
||||
border-color: rgba(83,42,6,.9);
|
||||
box-shadow: 0 1px 0 rgba(255,255,255,.25) inset,
|
||||
0 0 0 1px rgba(255,255,255,.25) inset;
|
||||
}
|
||||
#appmenu-button:hover:not(:active):not([open]) {
|
||||
background-image: -moz-radial-gradient(center bottom, farthest-side, rgba(252,240,89,.5) 10%, rgba(252,240,89,0) 70%),
|
||||
-moz-radial-gradient(center bottom, farthest-side, rgb(236,133,0), rgba(255,229,172,0)),
|
||||
-moz-linear-gradient(rgb(246,170,69), rgb(209,74,0) 95%);
|
||||
border-color: rgba(83,42,6,.9);
|
||||
box-shadow: 0 1px 0 rgba(255,255,255,.1) inset,
|
||||
0 0 1.5px 1px rgba(250,234,169,.7) inset,
|
||||
0 0 2px 1px rgba(250,234,169,.7) inset,
|
||||
0 -1px 0 rgba(250,234,169,.5) inset;
|
||||
}
|
||||
#appmenu-button:hover:active,
|
||||
#appmenu-button[open] {
|
||||
background-image: -moz-linear-gradient(rgb(246,170,69), rgb(209,74,0) 95%);
|
||||
box-shadow: 0 2px 3px rgba(0,0,0,.4) inset,
|
||||
0 1px 1px rgba(0,0,0,.2) inset;
|
||||
}
|
||||
%else
|
||||
%if MOZ_UPDATE_CHANNEL == aurora
|
||||
#appmenu-button {
|
||||
background-image: -moz-linear-gradient(hsl(208,99%,37%), hsl(214,90%,23%) 95%);
|
||||
border-color: hsla(214,89%,21%,.9);
|
||||
box-shadow: 0 1px 0 hsla(205,100%,72%,.2) inset,
|
||||
0 0 2px 1px hsla(205,100%,72%,.25) inset;
|
||||
}
|
||||
#appmenu-button:hover:not(:active):not([open]) {
|
||||
background-image: -moz-radial-gradient(center bottom, farthest-side, hsla(202,100%,85%,.5) 10%, hsla(202,100%,85%,0) 70%),
|
||||
-moz-radial-gradient(center bottom, farthest-side, hsla(205,100%,72%,.7), hsla(205,100%,72%,0)),
|
||||
-moz-linear-gradient(hsl(208,98%,34%), hsl(213,87%,20%) 95%);
|
||||
border-color: hsla(214,89%,21%,.9);
|
||||
box-shadow: 0 1px 0 hsla(205,100%,72%,.15) inset,
|
||||
0 0 2px 1px hsla(205,100%,72%,.5) inset,
|
||||
0 -1px 0 hsla(205,100%,72%,.2) inset;
|
||||
}
|
||||
#appmenu-button:hover:active,
|
||||
#appmenu-button[open] {
|
||||
background-image: -moz-linear-gradient(hsl(208,95%,30%), hsl(214,85%,17%) 95%);
|
||||
box-shadow: 0 2px 3px rgba(0,0,0,.4) inset,
|
||||
0 1px 1px rgba(0,0,0,.2) inset;
|
||||
}
|
||||
%else
|
||||
#appmenu-button {
|
||||
background-image: -moz-linear-gradient(hsl(211,33%,32%), hsl(209,53%,10%) 95%);
|
||||
border-color: hsla(210,59%,13%,.9);
|
||||
box-shadow: 0 1px 0 hsla(210,48%,90%,.15) inset,
|
||||
0 0 2px 1px hsla(211,65%,85%,.15) inset;
|
||||
}
|
||||
#appmenu-button:hover:not(:active):not([open]) {
|
||||
background-image: -moz-radial-gradient(center bottom, farthest-side, hsla(210,48%,90%,.5) 10%, hsla(210,48%,90%,0) 70%),
|
||||
-moz-radial-gradient(center bottom, farthest-side, hsla(211,70%,83%,.5), hsla(211,70%,83%,0)),
|
||||
-moz-linear-gradient(hsl(211,33%,32%), hsl(209,53%,10%) 95%);
|
||||
border-color: hsla(210,59%,13%,.9);
|
||||
box-shadow: 0 1px 0 hsla(210,48%,90%,.15) inset,
|
||||
0 0 2px 1px hsla(210,48%,90%,.4) inset,
|
||||
0 -1px 0 hsla(210,48%,90%,.2) inset;
|
||||
}
|
||||
#appmenu-button:hover:active,
|
||||
#appmenu-button[open] {
|
||||
background-image: -moz-linear-gradient(hsl(211,33%,26%), hsl(209,53%,6%) 95%);
|
||||
box-shadow: 0 2px 3px rgba(0,0,0,.4) inset,
|
||||
0 1px 1px rgba(0,0,0,.2) inset;
|
||||
}
|
||||
%endif
|
||||
%endif
|
||||
|
||||
#main-window[privatebrowsingmode=temporary] #appmenu-button {
|
||||
background-image: -moz-linear-gradient(rgb(153,38,211), rgb(105,19,163) 95%);
|
||||
border-color: rgba(43,8,65,.9);
|
||||
}
|
||||
|
||||
#main-window[privatebrowsingmode=temporary] #appmenu-button:hover:not(:active):not([open]) {
|
||||
background-image: -moz-radial-gradient(center bottom, farthest-side, rgba(240,193,255,.5) 10%, rgba(240,193,255,0) 70%),
|
||||
@ -187,14 +260,6 @@
|
||||
0 -1px 0 rgba(240,193,255,.5) inset;
|
||||
}
|
||||
|
||||
#appmenu-button:hover:active,
|
||||
#appmenu-button[open] {
|
||||
background-image: -moz-linear-gradient(rgb(246,170,69), rgb(209,74,0) 95%);
|
||||
border-radius: 0;
|
||||
box-shadow: 0 2px 3px rgba(0,0,0,.4) inset,
|
||||
0 1px 1px rgba(0,0,0,.2) inset;
|
||||
}
|
||||
|
||||
#main-window[privatebrowsingmode=temporary] #appmenu-button:hover:active,
|
||||
#main-window[privatebrowsingmode=temporary] #appmenu-button[open] {
|
||||
background-image: -moz-linear-gradient(rgb(144,20,207), rgb(95,0,158) 95%);
|
||||
@ -582,6 +647,10 @@ menuitem.bookmark-item {
|
||||
list-style-image: url("chrome://browser/skin/Toolbar.png");
|
||||
}
|
||||
|
||||
.toolbarbutton-1:-moz-lwtheme-brighttext {
|
||||
list-style-image: url("chrome://browser/skin/Toolbar-inverted.png");
|
||||
}
|
||||
|
||||
.toolbarbutton-1:not([type="menu-button"]) {
|
||||
-moz-box-orient: vertical;
|
||||
}
|
||||
@ -596,19 +665,18 @@ menuitem.bookmark-item {
|
||||
counter-reset: smallicons;
|
||||
}
|
||||
|
||||
#navigator-toolbox[iconsize=small] > #nav-bar {
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1px;
|
||||
}
|
||||
|
||||
#navigator-toolbox[iconsize=large][mode=icons] > #nav-bar {
|
||||
@navbarLargeIcons@ {
|
||||
-moz-padding-start: 0;
|
||||
-moz-padding-end: 2px;
|
||||
}
|
||||
|
||||
#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-button,
|
||||
#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker,
|
||||
#nav-bar .toolbarbutton-1 {
|
||||
@navbarLargeIcons@ :-moz-any(@primaryToolbarButtons@):not(#alltabs-button):not(#tabview-button):not(#new-tab-button) > .toolbarbutton-icon {
|
||||
list-style-image: url("chrome://browser/skin/Toolbar.png") !important;
|
||||
}
|
||||
|
||||
@navbarLargeIcons@ .toolbarbutton-1 > .toolbarbutton-menubutton-button,
|
||||
@navbarLargeIcons@ .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker,
|
||||
@navbarLargeIcons@ .toolbarbutton-1 {
|
||||
-moz-appearance: none;
|
||||
padding: 1px 5px;
|
||||
background: rgba(151,152,153,.05)
|
||||
@ -624,14 +692,12 @@ menuitem.bookmark-item {
|
||||
text-shadow: 0 0 2px white;
|
||||
}
|
||||
|
||||
#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker,
|
||||
#navigator-toolbox[iconsize="small"][mode="icons"] > #nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-button,
|
||||
#navigator-toolbox[iconsize="small"][mode="icons"] > #nav-bar .toolbarbutton-1 {
|
||||
@navbarLargeIcons@ .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker {
|
||||
padding-left: 3px;
|
||||
padding-right: 3px;
|
||||
}
|
||||
|
||||
#nav-bar .toolbarbutton-1[type="menu-button"] {
|
||||
@navbarLargeIcons@ .toolbarbutton-1[type="menu-button"] {
|
||||
-moz-appearance: none;
|
||||
padding: 0;
|
||||
background: none !important;
|
||||
@ -639,44 +705,39 @@ menuitem.bookmark-item {
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
#nav-bar .toolbarbutton-1 {
|
||||
@navbarLargeIcons@ .toolbarbutton-1 {
|
||||
margin: 1px 3px;
|
||||
}
|
||||
|
||||
#navigator-toolbox[iconsize="small"][mode="icons"] > #nav-bar .toolbarbutton-1 {
|
||||
margin-left: 2px;
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker {
|
||||
@navbarLargeIcons@ .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker {
|
||||
-moz-border-start-style: none;
|
||||
}
|
||||
|
||||
#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-button:-moz-locale-dir(ltr),
|
||||
#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker:-moz-locale-dir(rtl) {
|
||||
@navbarLargeIcons@ .toolbarbutton-1 > .toolbarbutton-menubutton-button:-moz-locale-dir(ltr),
|
||||
@navbarLargeIcons@ .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker:-moz-locale-dir(rtl) {
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
|
||||
#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-button:-moz-locale-dir(rtl),
|
||||
#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker:-moz-locale-dir(ltr) {
|
||||
@navbarLargeIcons@ .toolbarbutton-1 > .toolbarbutton-menubutton-button:-moz-locale-dir(rtl),
|
||||
@navbarLargeIcons@ .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker:-moz-locale-dir(ltr) {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
|
||||
#nav-bar .toolbarbutton-1[disabled="true"] {
|
||||
@navbarLargeIcons@ .toolbarbutton-1[disabled="true"] {
|
||||
opacity: .4;
|
||||
}
|
||||
|
||||
#nav-bar .toolbarbutton-1[disabled="true"] > .toolbarbutton-menubutton-button > .toolbarbutton-icon,
|
||||
#nav-bar .toolbarbutton-1[disabled="true"] > .toolbarbutton-icon {
|
||||
@navbarLargeIcons@ .toolbarbutton-1[disabled="true"] > .toolbarbutton-menubutton-button > .toolbarbutton-icon,
|
||||
@navbarLargeIcons@ .toolbarbutton-1[disabled="true"] > .toolbarbutton-icon {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-button:not([disabled="true"]):not(:active):hover,
|
||||
#nav-bar .toolbarbutton-1:not([open="true"]):not(:active):hover > .toolbarbutton-menubutton-dropmarker:not([disabled="true"]),
|
||||
#nav-bar .toolbarbutton-1:not([type="menu-button"]):not([disabled="true"]):not([checked="true"]):not([open="true"]):not(:active):hover,
|
||||
#navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button:not([disabled="true"]):not([open]):not(:active):hover > .toolbarbutton-icon {
|
||||
@navbarLargeIcons@ .toolbarbutton-1 > .toolbarbutton-menubutton-button:not([disabled="true"]):not(:active):hover,
|
||||
@navbarLargeIcons@ .toolbarbutton-1:not([open="true"]):not(:active):hover > .toolbarbutton-menubutton-dropmarker:not([disabled="true"]),
|
||||
@navbarLargeIcons@ .toolbarbutton-1:not([type="menu-button"]):not([disabled="true"]):not([checked="true"]):not([open="true"]):not(:active):hover,
|
||||
@navbarLargeIcons@ #back-button:not([disabled="true"]):not([open]):not(:active):hover > .toolbarbutton-icon {
|
||||
background-color: hsla(190,60%,70%,.5);
|
||||
border-color: hsla(190,50%,65%,.8) hsla(190,50%,50%,.8) hsla(190,50%,40%,.8);
|
||||
box-shadow: 0 0 0 1px rgba(255,255,255,.3) inset,
|
||||
@ -687,12 +748,12 @@ menuitem.bookmark-item {
|
||||
box-shadow .3s ease-in;
|
||||
}
|
||||
|
||||
#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-button:not([disabled="true"]):hover:active,
|
||||
#nav-bar .toolbarbutton-1:hover:active > .toolbarbutton-menubutton-dropmarker:not([disabled="true"]),
|
||||
#nav-bar .toolbarbutton-1[open="true"] > .toolbarbutton-menubutton-dropmarker,
|
||||
#nav-bar .toolbarbutton-1:not([type="menu-button"]):not([disabled="true"]):hover:active,
|
||||
#nav-bar .toolbarbutton-1:not([type="menu-button"])[checked="true"],
|
||||
#nav-bar .toolbarbutton-1[open="true"] {
|
||||
@navbarLargeIcons@ .toolbarbutton-1 > .toolbarbutton-menubutton-button:not([disabled="true"]):hover:active,
|
||||
@navbarLargeIcons@ .toolbarbutton-1:hover:active > .toolbarbutton-menubutton-dropmarker:not([disabled="true"]),
|
||||
@navbarLargeIcons@ .toolbarbutton-1[open="true"] > .toolbarbutton-menubutton-dropmarker,
|
||||
@navbarLargeIcons@ .toolbarbutton-1:not([type="menu-button"]):not([disabled="true"]):hover:active,
|
||||
@navbarLargeIcons@ .toolbarbutton-1:not([type="menu-button"])[checked="true"],
|
||||
@navbarLargeIcons@ .toolbarbutton-1[open="true"] {
|
||||
background-color: transparent;
|
||||
border-color: rgba(0,0,0,.65) rgba(0,0,0,.55) rgba(0,0,0,.5);
|
||||
box-shadow: 0 0 6.5px rgba(0,0,0,.4) inset,
|
||||
@ -701,7 +762,7 @@ menuitem.bookmark-item {
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
#nav-bar .toolbarbutton-1[checked="true"]:not(:active):hover {
|
||||
@navbarLargeIcons@ .toolbarbutton-1[checked="true"]:not(:active):hover {
|
||||
background-color: rgba(90%,90%,90%,.4);
|
||||
-moz-transition: background-color .4s;
|
||||
}
|
||||
@ -711,8 +772,8 @@ menuitem.bookmark-item {
|
||||
-moz-margin-end: 0;
|
||||
}
|
||||
|
||||
#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-button > .toolbarbutton-icon,
|
||||
#nav-bar .toolbarbutton-1:not(:-moz-any(@primaryToolbarButtons@)) > .toolbarbutton-icon {
|
||||
@navbarLargeIcons@ .toolbarbutton-1 > .toolbarbutton-menubutton-button > .toolbarbutton-icon,
|
||||
@navbarLargeIcons@ .toolbarbutton-1:not(:-moz-any(@primaryToolbarButtons@)) > .toolbarbutton-icon {
|
||||
margin: 1px;
|
||||
}
|
||||
|
||||
@ -764,37 +825,31 @@ toolbar[mode="full"] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
|
||||
-moz-image-region: rect(0, 36px, 18px, 18px);
|
||||
}
|
||||
|
||||
#navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button {
|
||||
-moz-image-region: rect(18px, 20px, 38px, 0);
|
||||
}
|
||||
|
||||
#back-button:-moz-locale-dir(rtl) > .toolbarbutton-icon,
|
||||
#forward-button:-moz-locale-dir(rtl),
|
||||
#forward-button:-moz-locale-dir(rtl) > .toolbarbutton-text {
|
||||
-moz-transform: scaleX(-1);
|
||||
}
|
||||
|
||||
#nav-bar #back-button {
|
||||
-moz-margin-end: 0 !important;
|
||||
}
|
||||
|
||||
#nav-bar #forward-button {
|
||||
@navbarLargeIcons@ #forward-button {
|
||||
border-left-style: none;
|
||||
-moz-margin-start: 0 !important;
|
||||
}
|
||||
|
||||
#nav-bar #back-button:-moz-locale-dir(ltr) {
|
||||
@navbarLargeIcons@ #back-button:-moz-locale-dir(ltr) {
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
|
||||
#nav-bar #back-button:-moz-locale-dir(rtl),
|
||||
#nav-bar #forward-button {
|
||||
@navbarLargeIcons@ #back-button:-moz-locale-dir(rtl),
|
||||
@navbarLargeIcons@ #forward-button {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
|
||||
#navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button {
|
||||
@navbarLargeIcons@ #back-button {
|
||||
-moz-image-region: rect(18px, 20px, 38px, 0);
|
||||
-moz-margin-end: 0 !important;
|
||||
margin: -5px 0;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
@ -808,11 +863,11 @@ toolbar[mode="full"] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
#navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button:-moz-locale-dir(rtl) {
|
||||
@navbarLargeIcons@ #back-button:-moz-locale-dir(rtl) {
|
||||
border-radius: 10000px 0 0 10000px;
|
||||
}
|
||||
|
||||
#navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button > .toolbarbutton-icon {
|
||||
@navbarLargeIcons@ #back-button > .toolbarbutton-icon {
|
||||
border-radius: 10000px;
|
||||
padding: 5px;
|
||||
border: none;
|
||||
@ -825,7 +880,7 @@ toolbar[mode="full"] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
|
||||
0 1px 1px rgba(0,0,0,.3);
|
||||
}
|
||||
|
||||
#navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button:not([disabled="true"]):not([open="true"]):not(:active):hover > .toolbarbutton-icon {
|
||||
@navbarLargeIcons@ #back-button:not([disabled="true"]):not([open="true"]):not(:active):hover > .toolbarbutton-icon {
|
||||
box-shadow: 0 0 0 1px rgba(255,255,255,.3) inset,
|
||||
0 0 0 2px rgba(255,255,255,.1) inset,
|
||||
0 0 0 1px hsla(190,50%,40%,.3),
|
||||
@ -834,16 +889,16 @@ toolbar[mode="full"] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
|
||||
0 0 5px 1px hsl(190,90%,80%);
|
||||
}
|
||||
|
||||
#navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button:not([disabled="true"]):hover:active > .toolbarbutton-icon,
|
||||
#navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button[open="true"] > .toolbarbutton-icon {
|
||||
@navbarLargeIcons@ #back-button:not([disabled="true"]):hover:active > .toolbarbutton-icon,
|
||||
@navbarLargeIcons@ #back-button[open="true"] > .toolbarbutton-icon {
|
||||
box-shadow: 0 0 6.5px rgba(0,0,0,.4) inset,
|
||||
0 0 2px rgba(0,0,0,.4) inset,
|
||||
0 0 0 1px rgba(0,0,0,.65),
|
||||
0 2px 0 rgba(255,255,255,.4);
|
||||
}
|
||||
|
||||
#navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar[currentset*="unified-back-forward-button"],
|
||||
#navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar:not([currentset]) {
|
||||
@navbarLargeIcons@[currentset*="unified-back-forward-button"],
|
||||
@navbarLargeIcons@:not([currentset]) {
|
||||
padding-top: 3px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
@ -853,7 +908,7 @@ toolbar[mode="full"] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
#navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #forward-button {
|
||||
@navbarLargeIcons@ #forward-button {
|
||||
/*mask: url(keyhole-forward-mask.svg#mask); XXX: this regresses twinopen */
|
||||
mask: url(chrome://browser/content/browser.xul#winstripe-keyhole-forward-mask);
|
||||
-moz-margin-start: -6px !important;
|
||||
@ -861,7 +916,7 @@ toolbar[mode="full"] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
|
||||
padding-right: 3px;
|
||||
}
|
||||
|
||||
#navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #forward-button:not([disabled="true"]):not(:active):hover {
|
||||
@navbarLargeIcons@ #forward-button:not([disabled="true"]):not(:active):hover {
|
||||
/*mask: url(keyhole-forward-mask.svg#mask-hover);*/
|
||||
mask: url(chrome://browser/content/browser.xul#winstripe-keyhole-forward-mask-hover);
|
||||
/* Don't animate the box shadow, as the blur and spread radii affect the mask. */
|
||||
@ -895,6 +950,9 @@ toolbar[mode="full"] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
|
||||
#home-button.bookmark-item {
|
||||
list-style-image: url("chrome://browser/skin/Toolbar.png");
|
||||
}
|
||||
#home-button.bookmark-item:-moz-lwtheme-brighttext {
|
||||
list-style-image: url("chrome://browser/skin/Toolbar-inverted.png");
|
||||
}
|
||||
#home-button {
|
||||
-moz-image-region: rect(0, 90px, 18px, 72px);
|
||||
}
|
||||
@ -969,6 +1027,10 @@ toolbar[mode="full"] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
|
||||
list-style-image: url("chrome://browser/skin/Toolbar.png");
|
||||
}
|
||||
|
||||
#bookmarks-menu-button.bookmark-item:-moz-lwtheme-brighttext {
|
||||
list-style-image: url("chrome://browser/skin/Toolbar-inverted.png");
|
||||
}
|
||||
|
||||
#bookmarks-menu-button.toolbarbutton-1 {
|
||||
-moz-box-orient: horizontal;
|
||||
}
|
||||
|
@ -35,6 +35,7 @@ browser.jar:
|
||||
skin/classic/browser/reload-stop-go.png
|
||||
skin/classic/browser/Secure24.png (Secure24.png)
|
||||
skin/classic/browser/Toolbar.png (Toolbar.png)
|
||||
skin/classic/browser/Toolbar-inverted.png
|
||||
skin/classic/browser/Go-arrow.png (Go-arrow.png)
|
||||
* skin/classic/browser/searchbar.css (searchbar.css)
|
||||
skin/classic/browser/section_collapsed.png
|
||||
@ -96,7 +97,6 @@ browser.jar:
|
||||
skin/classic/browser/tabview/close.png (tabview/close.png)
|
||||
skin/classic/browser/tabview/edit-light.png (tabview/edit-light.png)
|
||||
skin/classic/browser/tabview/grain.png (tabview/grain.png)
|
||||
skin/classic/browser/tabview/new-tab.png (tabview/new-tab.png)
|
||||
skin/classic/browser/tabview/search.png (tabview/search.png)
|
||||
skin/classic/browser/tabview/stack-expander.png (tabview/stack-expander.png)
|
||||
skin/classic/browser/tabview/tabview.png (tabview/tabview.png)
|
||||
@ -149,6 +149,7 @@ browser.jar:
|
||||
skin/classic/aero/browser/reload-stop-go.png
|
||||
skin/classic/aero/browser/Secure24.png (Secure24-aero.png)
|
||||
skin/classic/aero/browser/Toolbar.png
|
||||
skin/classic/aero/browser/Toolbar-inverted.png
|
||||
skin/classic/aero/browser/Go-arrow.png (Go-arrow-aero.png)
|
||||
* skin/classic/aero/browser/searchbar.css (searchbar.css)
|
||||
skin/classic/aero/browser/section_collapsed.png
|
||||
@ -211,7 +212,6 @@ browser.jar:
|
||||
skin/classic/aero/browser/tabview/close.png (tabview/close.png)
|
||||
skin/classic/aero/browser/tabview/edit-light.png (tabview/edit-light.png)
|
||||
skin/classic/aero/browser/tabview/grain.png (tabview/grain.png)
|
||||
skin/classic/aero/browser/tabview/new-tab.png (tabview/new-tab.png)
|
||||
skin/classic/aero/browser/tabview/search.png (tabview/search.png)
|
||||
skin/classic/aero/browser/tabview/stack-expander.png (tabview/stack-expander.png)
|
||||
skin/classic/aero/browser/tabview/tabview.png (tabview/tabview.png)
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 466 B |
@ -204,7 +204,7 @@ html[dir=rtl] .tab.focus {
|
||||
----------------------------------*/
|
||||
|
||||
.groupItem {
|
||||
cursor: move;
|
||||
cursor: pointer;
|
||||
background-color: #E0EAF5;
|
||||
border-radius: 0.4em;
|
||||
box-shadow:
|
||||
@ -398,25 +398,6 @@ html[dir=rtl] .guideTrench {
|
||||
/* Other
|
||||
----------------------------------*/
|
||||
|
||||
.newTabButton {
|
||||
width: 16px;
|
||||
height: 15px;
|
||||
bottom: 10px;
|
||||
left: 10px;
|
||||
cursor: pointer;
|
||||
opacity: .3;
|
||||
background-image: url(chrome://browser/skin/tabview/new-tab.png);
|
||||
}
|
||||
|
||||
html[dir=rtl] .newTabButton {
|
||||
left: auto;
|
||||
right: 10px;
|
||||
}
|
||||
|
||||
.newTabButton:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.active {
|
||||
box-shadow: 5px 5px 3px rgba(0,0,0,.5);
|
||||
}
|
||||
@ -434,6 +415,7 @@ html[dir=rtl] .acceptsDrop {
|
||||
}
|
||||
|
||||
.titlebar {
|
||||
cursor: move;
|
||||
font-size: 12px;
|
||||
height: 18px;
|
||||
}
|
||||
|
2
build/autoconf/config.sub
vendored
2
build/autoconf/config.sub
vendored
@ -1433,7 +1433,7 @@ case $os in
|
||||
os=-dicos
|
||||
;;
|
||||
-android*)
|
||||
os=android
|
||||
os=-android
|
||||
;;
|
||||
-none)
|
||||
;;
|
||||
|
@ -96,6 +96,8 @@ class DeviceManagerADB(DeviceManager):
|
||||
# contains symbolic links, the links are pushed, rather than the linked
|
||||
# files; we push file-by-file to get around this limitation
|
||||
try:
|
||||
if (not self.dirExists(remoteDir)):
|
||||
self.mkDirs(remoteDir+"/x")
|
||||
for root, dirs, files in os.walk(localDir):
|
||||
relRoot = os.path.relpath(root, localDir)
|
||||
for file in files:
|
||||
|
@ -64,24 +64,11 @@ if __name__ == '__main__':
|
||||
from optparse import OptionParser
|
||||
automation = Automation()
|
||||
|
||||
parser = OptionParser(usage='OBJDIR=path/to/objdir python %prog [NUM_RUNS]')
|
||||
parser = OptionParser()
|
||||
addCommonOptions(parser)
|
||||
|
||||
options, args = parser.parse_args()
|
||||
|
||||
if not os.getenv('OBJDIR'):
|
||||
parser.error('Please specify the OBJDIR environment variable.')
|
||||
|
||||
if not args:
|
||||
num_runs = 1
|
||||
else:
|
||||
try:
|
||||
num_runs = int(args[0])
|
||||
except:
|
||||
parser.error('NUM_RUNS argument must be an integer.')
|
||||
if num_runs < 1:
|
||||
parser.error('NUM_RUNS must be greater than zero.')
|
||||
|
||||
debuggerInfo = getDebuggerInfo(".", options.debugger, options.debuggerArgs,
|
||||
options.debuggerInteractive)
|
||||
|
||||
@ -91,21 +78,16 @@ if __name__ == '__main__':
|
||||
t.start()
|
||||
|
||||
automation.setServerInfo("localhost", PORT)
|
||||
automation.initializeProfile(PROFILE_DIRECTORY)
|
||||
browserEnv = automation.environment()
|
||||
browserEnv["XPCOM_DEBUG_BREAK"] = "warn"
|
||||
browserEnv["MOZ_JAR_LOG_DIR"] = MOZ_JAR_LOG_DIR
|
||||
|
||||
url = "http://localhost:%d/index.html" % PORT
|
||||
appPath = os.path.join(SCRIPT_DIR, automation.DEFAULT_APP)
|
||||
|
||||
for i in range(0, num_runs):
|
||||
if num_runs != 1:
|
||||
print "Starting profiling run %d of %d" % (i + 1, num_runs)
|
||||
automation.initializeProfile(PROFILE_DIRECTORY)
|
||||
status = automation.runApp(url, browserEnv, appPath, PROFILE_DIRECTORY, {},
|
||||
debuggerInfo=debuggerInfo,
|
||||
# the profiling HTML doesn't output anything,
|
||||
# so let's just run this without a timeout
|
||||
timeout = None)
|
||||
if status != 0:
|
||||
sys.exit(status)
|
||||
status = automation.runApp(url, browserEnv, appPath, PROFILE_DIRECTORY, {},
|
||||
debuggerInfo=debuggerInfo,
|
||||
# the profiling HTML doesn't output anything,
|
||||
# so let's just run this without a timeout
|
||||
timeout = None)
|
||||
sys.exit(status)
|
||||
|
@ -91,7 +91,6 @@
|
||||
#include "nsIURIFixup.h"
|
||||
#include "nsCDefaultURIFixup.h"
|
||||
#include "nsIChromeRegistry.h"
|
||||
#include "nsPrintfCString.h"
|
||||
#include "nsIContentSecurityPolicy.h"
|
||||
#include "nsIAsyncVerifyRedirectCallback.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
@ -3325,41 +3324,6 @@ nsScriptSecurityManager::Observe(nsISupports* aObject, const char* aTopic,
|
||||
return rv;
|
||||
}
|
||||
|
||||
///////////////////////////////////
|
||||
// Default ObjectPrincipalFinder //
|
||||
///////////////////////////////////
|
||||
|
||||
// The default JSSecurityCallbacks::findObjectPrincipals is necessary since
|
||||
// scripts run (and ask for object principals) during startup before
|
||||
// nsJSRuntime::Init() has been called (which resets findObjectPrincipals).
|
||||
|
||||
// Defined NS_EXPORT for linkage with debug-only assert in xpcshell
|
||||
NS_EXPORT JSPrincipals *
|
||||
NS_DefaultObjectPrincipalFinder(JSContext *cx, JSObject *obj)
|
||||
{
|
||||
nsScriptSecurityManager *ssm = nsScriptSecurityManager::GetScriptSecurityManager();
|
||||
if (!ssm) {
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIPrincipal> principal;
|
||||
nsresult rv = ssm->GetObjectPrincipal(cx, obj, getter_AddRefs(principal));
|
||||
if (NS_FAILED(rv) || !principal) {
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
JSPrincipals *jsPrincipals = nsnull;
|
||||
principal->GetJSPrincipals(cx, &jsPrincipals);
|
||||
|
||||
// nsIPrincipal::GetJSPrincipals() returns a strong reference to the
|
||||
// JS principals, but the caller of this function expects a weak
|
||||
// reference. So we need to release here.
|
||||
|
||||
JSPRINCIPALS_DROP(cx, jsPrincipals);
|
||||
|
||||
return jsPrincipals;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////
|
||||
// Constructor, Destructor, Initialization //
|
||||
/////////////////////////////////////////////
|
||||
@ -3432,7 +3396,7 @@ nsresult nsScriptSecurityManager::Init()
|
||||
static JSSecurityCallbacks securityCallbacks = {
|
||||
CheckObjectAccess,
|
||||
NULL,
|
||||
NS_DefaultObjectPrincipalFinder,
|
||||
NULL,
|
||||
ContentSecurityPolicyPermitsJSAction
|
||||
};
|
||||
|
||||
|
@ -86,6 +86,8 @@ nsSystemPrincipal::Release()
|
||||
// Methods implementing nsIPrincipal //
|
||||
///////////////////////////////////////
|
||||
|
||||
#define SYSTEM_PRINCIPAL_SPEC "[System Principal]"
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSystemPrincipal::GetPreferences(char** aPrefName, char** aID,
|
||||
char** aSubjectName,
|
||||
@ -195,7 +197,7 @@ nsSystemPrincipal::GetURI(nsIURI** aURI)
|
||||
NS_IMETHODIMP
|
||||
nsSystemPrincipal::GetOrigin(char** aOrigin)
|
||||
{
|
||||
*aOrigin = ToNewCString(NS_LITERAL_CSTRING("[System Principal]"));
|
||||
*aOrigin = ToNewCString(NS_LITERAL_CSTRING(SYSTEM_PRINCIPAL_SPEC));
|
||||
return *aOrigin ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
@ -308,11 +310,6 @@ nsSystemPrincipal::nsSystemPrincipal()
|
||||
{
|
||||
}
|
||||
|
||||
// Don't rename the system principal!
|
||||
// The JS engine (NewCompartment) relies on this name.
|
||||
// XXX: bug 669123 will fix this hack.
|
||||
#define SYSTEM_PRINCIPAL_SPEC "[System Principal]"
|
||||
|
||||
nsresult
|
||||
nsSystemPrincipal::Init(JSPrincipals **jsprin)
|
||||
{
|
||||
|
@ -987,7 +987,10 @@ AC_SUBST(NSINSTALL_BIN)
|
||||
|
||||
MOZ_PATH_PROG(DOXYGEN, doxygen, :)
|
||||
MOZ_PATH_PROG(AUTOCONF, autoconf, :)
|
||||
MOZ_PATH_PROG(UNZIP, unzip, :)
|
||||
MOZ_PATH_PROGS(UNZIP, unzip)
|
||||
if test -z "$UNZIP" -o "$UNZIP" = ":"; then
|
||||
AC_MSG_ERROR([unzip not found in \$PATH])
|
||||
fi
|
||||
MOZ_PATH_PROGS(ZIP, zip)
|
||||
if test -z "$ZIP" -o "$ZIP" = ":"; then
|
||||
AC_MSG_ERROR([zip not found in \$PATH])
|
||||
|
@ -79,13 +79,13 @@ static fp_except_t oldmask = fpsetmask(~allmask);
|
||||
#include "mozilla/AutoRestore.h"
|
||||
#include "nsINode.h"
|
||||
#include "nsHashtable.h"
|
||||
#include "nsIDOMNode.h"
|
||||
|
||||
struct nsNativeKeyEvent; // Don't include nsINativeKeyBindings.h here: it will force strange compilation error!
|
||||
|
||||
class nsIDOMScriptObjectFactory;
|
||||
class nsIXPConnect;
|
||||
class nsIContent;
|
||||
class nsIDOMNode;
|
||||
class nsIDOMKeyEvent;
|
||||
class nsIDocument;
|
||||
class nsIDocumentObserver;
|
||||
@ -122,7 +122,6 @@ struct JSRuntime;
|
||||
class nsIUGenCategory;
|
||||
class nsIWidget;
|
||||
class nsIDragSession;
|
||||
class nsPIDOMWindow;
|
||||
class nsIPresShell;
|
||||
class nsIXPConnectJSObjectHolder;
|
||||
#ifdef MOZ_XTF
|
||||
|
@ -286,23 +286,29 @@ ThirdPartyUtil::IsThirdPartyChannel(nsIChannel* aChannel,
|
||||
ourWin->GetParent(getter_AddRefs(parentWin));
|
||||
NS_ENSURE_TRUE(parentWin, NS_ERROR_INVALID_ARG);
|
||||
|
||||
if (SameCOMIdentity(ourWin, parentWin)) {
|
||||
// Check whether this is the document channel for this window (representing
|
||||
// a load of a new page). This covers the case of a freshly kicked-off load
|
||||
// (e.g. the user typing something in the location bar, or clicking on a
|
||||
// bookmark), where the window's URI hasn't yet been set, and will be bogus.
|
||||
// This is a bit of a nasty hack, but we will hopefully flag these channels
|
||||
// better later.
|
||||
nsLoadFlags flags;
|
||||
rv = aChannel->GetLoadFlags(&flags);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
// Check whether this is the document channel for this window (representing a
|
||||
// load of a new page). In that situation we want to avoid comparing
|
||||
// channelURI to ourWin, since what's in ourWin right now will be replaced as
|
||||
// the channel loads. This covers the case of a freshly kicked-off load
|
||||
// (e.g. the user typing something in the location bar, or clicking on a
|
||||
// bookmark), where the window's URI hasn't yet been set, and will be bogus.
|
||||
// It also covers situations where a subframe is navigated to someting that
|
||||
// is same-origin with all its ancestors. This is a bit of a nasty hack, but
|
||||
// we will hopefully flag these channels better later.
|
||||
nsLoadFlags flags;
|
||||
rv = aChannel->GetLoadFlags(&flags);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (flags & nsIChannel::LOAD_DOCUMENT_URI) {
|
||||
if (flags & nsIChannel::LOAD_DOCUMENT_URI) {
|
||||
if (SameCOMIdentity(ourWin, parentWin)) {
|
||||
// We only need to compare aURI to the channel URI -- the window's will be
|
||||
// bogus. We already know the answer.
|
||||
*aResult = false;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Make sure to still compare to ourWin's ancestors
|
||||
ourWin = parentWin;
|
||||
}
|
||||
|
||||
// Check the window hierarchy. This covers most cases for an ordinary page
|
||||
|
@ -68,7 +68,6 @@ function ContentSecurityPolicy() {
|
||||
this._policy._allowInlineScripts = true;
|
||||
this._policy._allowEval = true;
|
||||
|
||||
this._requestHeaders = [];
|
||||
this._request = "";
|
||||
this._docRequest = null;
|
||||
CSPdebug("CSP POLICY INITED TO 'default-src *'");
|
||||
@ -211,13 +210,6 @@ ContentSecurityPolicy.prototype = {
|
||||
var reqVersion = internalChannel.getRequestVersion(reqMaj, reqMin);
|
||||
this._request += " HTTP/" + reqMaj.value + "." + reqMin.value;
|
||||
}
|
||||
|
||||
// grab the request headers
|
||||
var self = this;
|
||||
aChannel.visitRequestHeaders({
|
||||
visitHeader: function(aHeader, aValue) {
|
||||
self._requestHeaders.push(aHeader + ": " + aValue);
|
||||
}});
|
||||
},
|
||||
|
||||
/* ........ Methods .............. */
|
||||
@ -270,21 +262,13 @@ ContentSecurityPolicy.prototype = {
|
||||
// {
|
||||
// csp-report: {
|
||||
// request: "GET /index.html HTTP/1.1",
|
||||
// request-headers: "Host: example.com
|
||||
// User-Agent: ...
|
||||
// ...",
|
||||
// blocked-uri: "...",
|
||||
// violated-directive: "..."
|
||||
// }
|
||||
// }
|
||||
var strHeaders = "";
|
||||
for (let i in this._requestHeaders) {
|
||||
strHeaders += this._requestHeaders[i] + "\n";
|
||||
}
|
||||
var report = {
|
||||
'csp-report': {
|
||||
'request': this._request,
|
||||
'request-headers': strHeaders,
|
||||
'blocked-uri': (blockedUri instanceof Ci.nsIURI ?
|
||||
blockedUri.asciiSpec : blockedUri),
|
||||
'violated-directive': violatedDirective
|
||||
|
@ -56,7 +56,7 @@
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsWrapperCache.h"
|
||||
#include "nsCRT.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "nsHashKeys.h"
|
||||
|
||||
// Magic namespace id that means "match all namespaces". This is
|
||||
// negative so it won't collide with actual namespace constants.
|
||||
@ -74,6 +74,11 @@ typedef PRBool (*nsContentListMatchFunc)(nsIContent* aContent,
|
||||
typedef void (*nsContentListDestroyFunc)(void* aData);
|
||||
|
||||
class nsIDocument;
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
class Element;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class nsBaseContentList : public nsINodeList
|
||||
|
@ -79,6 +79,8 @@
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsContentCID.h"
|
||||
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
nsresult NS_NewDomSelection(nsISelection **aDomSelection);
|
||||
|
||||
static NS_DEFINE_CID(kCClipboardCID, NS_CLIPBOARD_CID);
|
||||
|
@ -1691,7 +1691,6 @@ NS_INTERFACE_TABLE_HEAD(nsDocument)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMEventTarget)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsISupportsWeakReference)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIRadioGroupContainer)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIRadioGroupContainer_MOZILLA_2_0_BRANCH)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIMutationObserver)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIApplicationCacheContainer)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMDocumentTouch)
|
||||
|
@ -490,7 +490,7 @@ class nsDocument : public nsIDocument,
|
||||
public nsIDOMDocumentXBL,
|
||||
public nsSupportsWeakReference,
|
||||
public nsIScriptObjectPrincipal,
|
||||
public nsIRadioGroupContainer_MOZILLA_2_0_BRANCH,
|
||||
public nsIRadioGroupContainer,
|
||||
public nsIApplicationCacheContainer,
|
||||
public nsStubMutationObserver,
|
||||
public nsIDOMDocumentTouch
|
||||
|
@ -82,6 +82,7 @@
|
||||
#include "nsTArray.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsStringBuffer.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
nsresult NS_NewDomSelection(nsISelection **aDomSelection);
|
||||
|
||||
|
@ -1628,8 +1628,6 @@ nsFrameLoader::GetWindowDimensions(nsRect& aRect)
|
||||
|
||||
nsCOMPtr<nsIDocShellTreeItem> parentAsItem(do_QueryInterface(parentAsWebNav));
|
||||
|
||||
NS_ASSERTION(mIsTopLevelContent, "Outer dimensions must be taken only from TopLevel content");
|
||||
|
||||
nsCOMPtr<nsIDocShellTreeOwner> parentOwner;
|
||||
if (NS_FAILED(parentAsItem->GetTreeOwner(getter_AddRefs(parentOwner))) ||
|
||||
!parentOwner) {
|
||||
|
@ -53,8 +53,8 @@
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsFrameMessageManager.h"
|
||||
#include "Layers.h"
|
||||
#include "nsIContent.h"
|
||||
|
||||
class nsIContent;
|
||||
class nsIURI;
|
||||
class nsSubDocumentFrame;
|
||||
class nsIView;
|
||||
|
@ -1226,24 +1226,20 @@ nsGenericElement::UpdateEditableState(PRBool aNotify)
|
||||
{
|
||||
nsIContent *parent = GetParent();
|
||||
|
||||
PRBool oldEditable = IsEditable();
|
||||
SetEditableFlag(parent && parent->HasFlag(NODE_IS_EDITABLE));
|
||||
PRBool newEditable = IsEditable();
|
||||
if (oldEditable != newEditable) {
|
||||
if (aNotify) {
|
||||
UpdateState(aNotify);
|
||||
if (aNotify) {
|
||||
UpdateState(aNotify);
|
||||
} else {
|
||||
// Avoid calling UpdateState in this very common case, because
|
||||
// this gets called for pretty much every single element on
|
||||
// insertion into the document and UpdateState can be slow for
|
||||
// some kinds of elements even when not notifying.
|
||||
if (IsEditable()) {
|
||||
RemoveStatesSilently(NS_EVENT_STATE_MOZ_READONLY);
|
||||
AddStatesSilently(NS_EVENT_STATE_MOZ_READWRITE);
|
||||
} else {
|
||||
// Avoid calling UpdateState in this very common case, because
|
||||
// this gets called for pretty much every single element on
|
||||
// insertion into the document and UpdateState can be slow for
|
||||
// some kinds of elements even when not notifying.
|
||||
if (oldEditable) {
|
||||
RemoveStatesSilently(NS_EVENT_STATE_MOZ_READWRITE);
|
||||
AddStatesSilently(NS_EVENT_STATE_MOZ_READONLY);
|
||||
} else {
|
||||
RemoveStatesSilently(NS_EVENT_STATE_MOZ_READONLY);
|
||||
AddStatesSilently(NS_EVENT_STATE_MOZ_READWRITE);
|
||||
}
|
||||
RemoveStatesSilently(NS_EVENT_STATE_MOZ_READWRITE);
|
||||
AddStatesSilently(NS_EVENT_STATE_MOZ_READONLY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -79,6 +79,7 @@
|
||||
#include "nsSVGEffects.h"
|
||||
|
||||
#include "mozAutoDocUpdate.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
#ifdef DEBUG_chb
|
||||
static void PrintReqURL(imgIRequest* req) {
|
||||
|
@ -52,6 +52,7 @@
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsString.h"
|
||||
#include "nsEventStates.h"
|
||||
|
||||
class nsIURI;
|
||||
class nsIDocument;
|
||||
|
@ -55,6 +55,8 @@
|
||||
#include NEW_H
|
||||
#include "nsFixedSizeAllocator.h"
|
||||
#include "prprf.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsGkAtoms.h"
|
||||
|
||||
static const size_t kNodeInfoPoolSizes[] = {
|
||||
sizeof(nsNodeInfo)
|
||||
|
@ -96,6 +96,7 @@
|
||||
#include "nsIContentSecurityPolicy.h"
|
||||
#include "nsIChannelPolicy.h"
|
||||
#include "nsChannelPolicy.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
static PRLogModuleInfo* gObjectLog = PR_NewLogModule("objlc");
|
||||
|
@ -47,6 +47,8 @@
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsIDOMNodeFilter.h"
|
||||
#include "nsDOMError.h"
|
||||
#include "nsINode.h"
|
||||
#include "nsIContent.h"
|
||||
|
||||
#include "nsContentUtils.h"
|
||||
|
||||
|
@ -1352,15 +1352,16 @@ nsWebSocket::Init(nsIPrincipal* aPrincipal,
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Don't allow https:// to open ws://
|
||||
nsCOMPtr<nsIURI> originURI;
|
||||
PRBool originHTTPS;
|
||||
if (!mSecure &&
|
||||
!Preferences::GetBool("network.websocket.allowInsecureFromHTTPS",
|
||||
PR_FALSE) &&
|
||||
NS_SUCCEEDED(NS_NewURI(getter_AddRefs(originURI), mUTF16Origin)) &&
|
||||
NS_SUCCEEDED(originURI->SchemeIs("https", &originHTTPS)) &&
|
||||
originHTTPS) {
|
||||
return NS_ERROR_DOM_SECURITY_ERR;
|
||||
PR_FALSE)) {
|
||||
// Confirmed we are opening plain ws:// and want to prevent this from a
|
||||
// secure context (e.g. https). Check the security context of the document
|
||||
// associated with this script, which is the same as associated with mOwner.
|
||||
nsCOMPtr<nsIDocument> originDoc =
|
||||
nsContentUtils::GetDocumentFromScriptContext(mScriptContext);
|
||||
if (originDoc && originDoc->GetSecurityInfo())
|
||||
return NS_ERROR_DOM_SECURITY_ERR;
|
||||
}
|
||||
|
||||
// sets the protocol
|
||||
|
@ -45,8 +45,8 @@ class nsIRadioVisitor;
|
||||
class nsIFormControl;
|
||||
|
||||
#define NS_IRADIOGROUPCONTAINER_IID \
|
||||
{ 0x06de7839, 0xd0db, 0x47d3, \
|
||||
{ 0x82, 0x90, 0x3c, 0xb8, 0x62, 0x2e, 0xd9, 0x66 } }
|
||||
{ 0x22924a01, 0x4360, 0x401b, \
|
||||
{ 0xb1, 0xd1, 0x56, 0x8d, 0xf5, 0xa3, 0xda, 0x71 } }
|
||||
|
||||
/**
|
||||
* A container that has multiple radio groups in it, defined by name.
|
||||
@ -132,19 +132,6 @@ public:
|
||||
NS_IMETHOD GetPositionInGroup(nsIDOMHTMLInputElement *aRadio,
|
||||
PRInt32 *aPositionIndex,
|
||||
PRInt32 *aItemsInGroup) = 0;
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsIRadioGroupContainer,
|
||||
NS_IRADIOGROUPCONTAINER_IID)
|
||||
|
||||
#define NS_IRADIOGROUPCONTAINER_MOZILLA_2_0_BRANCH_IID \
|
||||
{ 0xaa9ec446, 0xcdc7, 0x4030, \
|
||||
{ 0xab, 0x02, 0xda, 0x44, 0xee, 0xb1, 0x80, 0x0a } }
|
||||
|
||||
class nsIRadioGroupContainer_MOZILLA_2_0_BRANCH : public nsIRadioGroupContainer
|
||||
{
|
||||
public:
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IRADIOGROUPCONTAINER_MOZILLA_2_0_IID)
|
||||
|
||||
virtual PRUint32 GetRequiredRadioCount(const nsAString& aName) const = 0;
|
||||
virtual void RadioRequiredChanged(const nsAString& aName,
|
||||
@ -153,7 +140,7 @@ public:
|
||||
virtual void SetValueMissingState(const nsAString& aName, bool aValue) = 0;
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsIRadioGroupContainer_MOZILLA_2_0_BRANCH,
|
||||
NS_IRADIOGROUPCONTAINER_MOZILLA_2_0_BRANCH_IID)
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsIRadioGroupContainer,
|
||||
NS_IRADIOGROUPCONTAINER_IID)
|
||||
|
||||
#endif /* nsIRadioGroupContainer_h__ */
|
||||
|
@ -328,12 +328,11 @@ DOMCI_NODE_DATA(HTMLFormElement, nsHTMLFormElement)
|
||||
|
||||
// QueryInterface implementation for nsHTMLFormElement
|
||||
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLFormElement)
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE5(nsHTMLFormElement,
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE4(nsHTMLFormElement,
|
||||
nsIDOMHTMLFormElement,
|
||||
nsIForm,
|
||||
nsIWebProgressListener,
|
||||
nsIRadioGroupContainer,
|
||||
nsIRadioGroupContainer_MOZILLA_2_0_BRANCH)
|
||||
nsIRadioGroupContainer)
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLFormElement,
|
||||
nsGenericHTMLElement)
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLFormElement)
|
||||
|
@ -94,7 +94,7 @@ class nsHTMLFormElement : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLFormElement,
|
||||
public nsIWebProgressListener,
|
||||
public nsIForm,
|
||||
public nsIRadioGroupContainer_MOZILLA_2_0_BRANCH
|
||||
public nsIRadioGroupContainer
|
||||
{
|
||||
public:
|
||||
nsHTMLFormElement(already_AddRefed<nsINodeInfo> aNodeInfo);
|
||||
|
@ -883,9 +883,7 @@ nsHTMLInputElement::AfterSetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
||||
}
|
||||
|
||||
if (mType == NS_FORM_INPUT_RADIO && aName == nsGkAtoms::required) {
|
||||
nsIRadioGroupContainer* c = GetRadioGroupContainer();
|
||||
nsCOMPtr<nsIRadioGroupContainer_MOZILLA_2_0_BRANCH> container =
|
||||
do_QueryInterface(c);
|
||||
nsCOMPtr<nsIRadioGroupContainer> container = GetRadioGroupContainer();
|
||||
|
||||
if (container) {
|
||||
nsAutoString name;
|
||||
@ -3343,10 +3341,8 @@ nsHTMLInputElement::AddedToRadioGroup()
|
||||
|
||||
// We initialize the validity of the element to the validity of the group
|
||||
// because we assume UpdateValueMissingState() will be called after.
|
||||
nsCOMPtr<nsIRadioGroupContainer_MOZILLA_2_0_BRANCH> container2 =
|
||||
do_QueryInterface(container);
|
||||
SetValidityState(VALIDITY_STATE_VALUE_MISSING,
|
||||
container2->GetValueMissingState(name));
|
||||
container->GetValueMissingState(name));
|
||||
}
|
||||
}
|
||||
|
||||
@ -3733,9 +3729,7 @@ nsHTMLInputElement::UpdateValueMissingValidityStateForRadio(bool aIgnoreSelf)
|
||||
: HasAttr(kNameSpaceID_None, nsGkAtoms::required);
|
||||
bool valueMissing = false;
|
||||
|
||||
nsIRadioGroupContainer* c = GetRadioGroupContainer();
|
||||
nsCOMPtr<nsIRadioGroupContainer_MOZILLA_2_0_BRANCH> container =
|
||||
do_QueryInterface(c);
|
||||
nsCOMPtr<nsIRadioGroupContainer> container = GetRadioGroupContainer();
|
||||
|
||||
if (!container) {
|
||||
SetValidityState(VALIDITY_STATE_VALUE_MISSING, required && !selected);
|
||||
|
@ -643,7 +643,7 @@ nsHTMLSelectElement::GetSelectFrame()
|
||||
return select_frame;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsresult
|
||||
nsHTMLSelectElement::Add(nsIDOMHTMLElement* aElement,
|
||||
nsIDOMHTMLElement* aBefore)
|
||||
{
|
||||
@ -679,6 +679,44 @@ nsHTMLSelectElement::Add(nsIDOMHTMLElement* aElement,
|
||||
return parent->InsertBefore(aElement, aBefore, getter_AddRefs(added));
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLSelectElement::Add(nsIDOMHTMLElement* aElement,
|
||||
nsIVariant* aBefore)
|
||||
{
|
||||
PRUint16 dataType;
|
||||
nsresult rv = aBefore->GetDataType(&dataType);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// aBefore is omitted or null
|
||||
if (dataType == nsIDataType::VTYPE_EMPTY) {
|
||||
return Add(aElement);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsISupports> supports;
|
||||
nsCOMPtr<nsIDOMHTMLElement> beforeElement;
|
||||
|
||||
// whether aBefore is nsIDOMHTMLElement...
|
||||
if (NS_SUCCEEDED(aBefore->GetAsISupports(getter_AddRefs(supports)))) {
|
||||
beforeElement = do_QueryInterface(supports);
|
||||
|
||||
NS_ENSURE_TRUE(beforeElement, NS_ERROR_DOM_SYNTAX_ERR);
|
||||
return Add(aElement, beforeElement);
|
||||
}
|
||||
|
||||
// otherwise, whether aBefore is long
|
||||
PRInt32 index;
|
||||
NS_ENSURE_SUCCESS(aBefore->GetAsInt32(&index), NS_ERROR_DOM_SYNTAX_ERR);
|
||||
|
||||
// If item index is out of range, insert to last.
|
||||
// (since beforeElement becomes null, it is inserted to last)
|
||||
nsCOMPtr<nsIDOMNode> beforeNode;
|
||||
if (NS_SUCCEEDED(Item(index, getter_AddRefs(beforeNode)))) {
|
||||
beforeElement = do_QueryInterface(beforeNode);
|
||||
}
|
||||
|
||||
return Add(aElement, beforeElement);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLSelectElement::Remove(PRInt32 aIndex)
|
||||
{
|
||||
@ -2194,35 +2232,17 @@ nsHTMLOptionCollection::GetSelect(nsIDOMHTMLSelectElement **aReturn)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLOptionCollection::Add(nsIDOMHTMLOptionElement *aOption,
|
||||
PRInt32 aIndex, PRUint8 optional_argc)
|
||||
nsIVariant *aBefore)
|
||||
{
|
||||
if (!aOption) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
if (aIndex < -1) {
|
||||
return NS_ERROR_DOM_INDEX_SIZE_ERR;
|
||||
}
|
||||
|
||||
if (!mSelect) {
|
||||
return NS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
PRUint32 length;
|
||||
GetLength(&length);
|
||||
|
||||
if (optional_argc == 0 || aIndex == -1 || aIndex > (PRInt32)length) {
|
||||
// IE appends in these cases
|
||||
aIndex = length;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMNode> beforeNode;
|
||||
Item(aIndex, getter_AddRefs(beforeNode));
|
||||
|
||||
nsCOMPtr<nsIDOMHTMLOptionElement> beforeElement =
|
||||
do_QueryInterface(beforeNode);
|
||||
|
||||
return mSelect->Add(aOption, beforeElement);
|
||||
return mSelect->Add(aOption, aBefore);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -612,6 +612,11 @@ protected:
|
||||
return mSelectionHasChanged;
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert aElement before the node given by aBefore
|
||||
*/
|
||||
nsresult Add(nsIDOMHTMLElement* aElement, nsIDOMHTMLElement* aBefore = nsnull);
|
||||
|
||||
/** The options[] array */
|
||||
nsRefPtr<nsHTMLOptionCollection> mOptions;
|
||||
/** false if the parser is in the middle of adding children. */
|
||||
|
@ -934,7 +934,8 @@ nsTextEditorState::nsTextEditorState(nsITextControlElement* aOwningElement)
|
||||
mBoundFrame(nsnull),
|
||||
mTextListener(nsnull),
|
||||
mEditorInitialized(PR_FALSE),
|
||||
mInitializing(PR_FALSE)
|
||||
mInitializing(PR_FALSE),
|
||||
mValueTransferInProgress(PR_FALSE)
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsTextEditorState);
|
||||
}
|
||||
@ -1013,6 +1014,7 @@ public:
|
||||
, mOwnerContent(aOwnerContent)
|
||||
, mCurrentValue(aCurrentValue)
|
||||
{
|
||||
mState.mValueTransferInProgress = PR_TRUE;
|
||||
}
|
||||
|
||||
NS_IMETHOD Run() {
|
||||
@ -1024,6 +1026,8 @@ public:
|
||||
|
||||
mState.PrepareEditor(value);
|
||||
|
||||
mState.mValueTransferInProgress = PR_FALSE;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -1498,7 +1502,10 @@ nsTextEditorState::UnbindFromFrame(nsTextControlFrame* aFrame)
|
||||
mBoundFrame = nsnull;
|
||||
|
||||
// Now that we don't have a frame any more, store the value in the text buffer.
|
||||
SetValue(value, PR_FALSE);
|
||||
// The only case where we don't do this is if a value transfer is in progress.
|
||||
if (!mValueTransferInProgress) {
|
||||
SetValue(value, PR_FALSE);
|
||||
}
|
||||
|
||||
if (mRootNode && mMutationObserver) {
|
||||
mRootNode->RemoveMutationObserver(mMutationObserver);
|
||||
|
@ -255,6 +255,7 @@ private:
|
||||
PRBool mGuardSet;
|
||||
};
|
||||
friend class InitializationGuard;
|
||||
friend class PrepareEditorEvent;
|
||||
|
||||
nsITextControlElement* const mTextCtrlElement;
|
||||
nsRefPtr<nsTextInputSelectionImpl> mSelCon;
|
||||
@ -270,6 +271,7 @@ private:
|
||||
mutable nsString mCachedValue; // Caches non-hard-wrapped value on a multiline control.
|
||||
PRPackedBool mEditorInitialized;
|
||||
PRPackedBool mInitializing; // Whether we're in the process of initialization
|
||||
PRPackedBool mValueTransferInProgress; // Whether a value is being transferred to the frame
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -277,6 +277,7 @@ _TEST_FILES = \
|
||||
test_bug659743.xml \
|
||||
test_bug660663.html \
|
||||
test_bug664299.html \
|
||||
test_bug666200.html \
|
||||
test_bug666666.html \
|
||||
test_restore_from_parser_fragment.html \
|
||||
$(NULL)
|
||||
|
@ -20,6 +20,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=500885
|
||||
<script type="text/javascript">
|
||||
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
var Cu = Components.utils;
|
||||
var Ci = Components.interfaces;
|
||||
var Cr = Components.results;
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
function MockFilePicker() { };
|
||||
|
@ -29,6 +29,10 @@ SimpleTest.waitForExplicitFinish();
|
||||
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
|
||||
var Cu = Components.utils;
|
||||
var Ci = Components.interfaces;
|
||||
var Cr = Components.results;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
function simpleEnumerator(items)
|
||||
|
40
content/html/content/test/test_bug666200.html
Normal file
40
content/html/content/test/test_bug666200.html
Normal file
@ -0,0 +1,40 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=666200
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 666200</title>
|
||||
<script type="text/javascript" src="/MochiKit/packed.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=666200">Mozilla Bug 666200</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
/** Test for Bug 666200 **/
|
||||
var sel = document.createElement("select");
|
||||
var opt1 = new Option();
|
||||
var opt2 = new Option();
|
||||
var opt3 = new Option();
|
||||
var opt4 = new Option();
|
||||
opt1.value = 1;
|
||||
opt2.value = 2;
|
||||
opt3.value = 3;
|
||||
opt4.value = 4;
|
||||
sel.add(opt1);
|
||||
sel.add(opt2, 0);
|
||||
sel.add(opt3, 1000);
|
||||
sel.options.add(opt4, opt3);
|
||||
is(sel[0], opt2, "1st item should be 2");
|
||||
is(sel[1], opt1, "2nd item should be 1");
|
||||
is(sel[2], opt4, "3rd item should be 4");
|
||||
is(sel[3], opt3, "4th item should be 3");
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
@ -45,7 +45,6 @@
|
||||
#include "nsIViewManager.h"
|
||||
#include "nsITextToSubURI.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsPrintfCString.h"
|
||||
#include "nsIContentViewer.h"
|
||||
#include "nsIMarkupDocumentViewer.h"
|
||||
#include "nsIDocShell.h"
|
||||
|
@ -2946,7 +2946,7 @@ nsHTMLDocument::EditingStateChanged()
|
||||
|
||||
if (updateState) {
|
||||
nsAutoScriptBlocker scriptBlocker;
|
||||
NotifyEditableStateChange(this, this, !designMode);
|
||||
NotifyEditableStateChange(this, this, designMode);
|
||||
}
|
||||
|
||||
// Resync the editor's spellcheck state.
|
||||
|
@ -38,32 +38,7 @@
|
||||
#include "nsSMILInstanceTime.h"
|
||||
#include "nsSMILInterval.h"
|
||||
#include "nsSMILTimeValueSpec.h"
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Helper classes
|
||||
|
||||
namespace
|
||||
{
|
||||
// Utility class to set a PRPackedBool value to PR_TRUE whilst it is in scope.
|
||||
// Saves us having to remember to clear the flag at every possible return.
|
||||
class AutoBoolSetter
|
||||
{
|
||||
public:
|
||||
AutoBoolSetter(PRPackedBool& aValue)
|
||||
: mValue(aValue)
|
||||
{
|
||||
mValue = PR_TRUE;
|
||||
}
|
||||
|
||||
~AutoBoolSetter()
|
||||
{
|
||||
mValue = PR_FALSE;
|
||||
}
|
||||
|
||||
private:
|
||||
PRPackedBool& mValue;
|
||||
};
|
||||
}
|
||||
#include "mozilla/AutoRestore.h"
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Implementation
|
||||
@ -146,7 +121,8 @@ nsSMILInstanceTime::HandleChangedInterval(
|
||||
PRBool objectChanged = mCreator->DependsOnBegin() ? aBeginObjectChanged :
|
||||
aEndObjectChanged;
|
||||
|
||||
AutoBoolSetter setVisited(mVisited);
|
||||
mozilla::AutoRestore<PRPackedBool> setVisited(mVisited);
|
||||
mVisited = PR_TRUE;
|
||||
|
||||
nsRefPtr<nsSMILInstanceTime> deathGrip(this);
|
||||
mCreator->HandleChangedInstanceTime(*GetBaseTime(), aSrcContainer, *this,
|
||||
@ -224,7 +200,8 @@ nsSMILInstanceTime::IsDependentOn(const nsSMILInstanceTime& aOther) const
|
||||
return PR_TRUE;
|
||||
|
||||
// mVisited is mutable
|
||||
AutoBoolSetter setVisited(const_cast<nsSMILInstanceTime*>(this)->mVisited);
|
||||
mozilla::AutoRestore<PRPackedBool> setVisited(const_cast<nsSMILInstanceTime*>(this)->mVisited);
|
||||
const_cast<nsSMILInstanceTime*>(this)->mVisited = PR_TRUE;
|
||||
return myBaseTime->IsDependentOn(aOther);
|
||||
}
|
||||
|
||||
|
@ -45,6 +45,7 @@
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsCSSProps.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
// Callback function, for freeing string buffers stored in property table
|
||||
static void
|
||||
|
@ -104,6 +104,8 @@
|
||||
#include "nsDOMClassInfo.h"
|
||||
#include "nsJSUtils.h"
|
||||
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
// Helper classes
|
||||
|
||||
/***********************************************************************/
|
||||
|
@ -74,6 +74,7 @@
|
||||
|
||||
#include "nsIStyleRuleProcessor.h"
|
||||
#include "nsXBLResourceLoader.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
// Helper Classes =====================================================================
|
||||
|
||||
|
@ -89,6 +89,7 @@
|
||||
#endif
|
||||
#include "nsIDOMEventListener.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
|
@ -69,6 +69,7 @@
|
||||
#include "nsISelectionController.h"
|
||||
#include "nsGUIEvent.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
|
@ -54,6 +54,7 @@
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "nsAttrName.h"
|
||||
#include "nsTArray.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
const PRUint32 kUnknownIndex = PRUint32(-1);
|
||||
|
||||
|
@ -71,6 +71,7 @@
|
||||
#include "nsHTMLReflowState.h"
|
||||
#include "nsIObjectLoadingContent.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
// for event firing in context menus
|
||||
#include "nsPresContext.h"
|
||||
|
@ -655,11 +655,6 @@ protected:
|
||||
* @param aURI the URI of the overlay that failed to load
|
||||
*/
|
||||
void ReportMissingOverlay(nsIURI* aURI);
|
||||
|
||||
#if defined(DEBUG_waterson) || defined(DEBUG_hyatt)
|
||||
// timing
|
||||
nsTime mLoadStart;
|
||||
#endif
|
||||
|
||||
class CachedChromeStreamListener : public nsIStreamListener {
|
||||
protected:
|
||||
|
@ -457,7 +457,7 @@ nsresult
|
||||
nsXULPrototypeCache::GetInputStream(nsIURI* uri, nsIObjectInputStream** stream)
|
||||
{
|
||||
nsCAutoString spec(kXULCachePrefix);
|
||||
nsresult rv = NS_PathifyURI(uri, spec);
|
||||
nsresult rv = PathifyURI(uri, spec);
|
||||
if (NS_FAILED(rv))
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
@ -471,7 +471,7 @@ nsXULPrototypeCache::GetInputStream(nsIURI* uri, nsIObjectInputStream** stream)
|
||||
if (NS_FAILED(rv))
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
rv = NS_NewObjectInputStreamFromBuffer(buf, len, getter_AddRefs(ois));
|
||||
rv = NewObjectInputStreamFromBuffer(buf, len, getter_AddRefs(ois));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
buf.forget();
|
||||
|
||||
@ -501,9 +501,9 @@ nsXULPrototypeCache::GetOutputStream(nsIURI* uri, nsIObjectOutputStream** stream
|
||||
= do_QueryInterface(storageStream);
|
||||
objectOutput->SetOutputStream(outputStream);
|
||||
} else {
|
||||
rv = NS_NewObjectOutputWrappedStorageStream(getter_AddRefs(objectOutput),
|
||||
getter_AddRefs(storageStream),
|
||||
false);
|
||||
rv = NewObjectOutputWrappedStorageStream(getter_AddRefs(objectOutput),
|
||||
getter_AddRefs(storageStream),
|
||||
false);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
mOutputStreamTable.Put(uri, storageStream);
|
||||
}
|
||||
@ -528,12 +528,12 @@ nsXULPrototypeCache::FinishOutputStream(nsIURI* uri)
|
||||
|
||||
nsAutoArrayPtr<char> buf;
|
||||
PRUint32 len;
|
||||
rv = NS_NewBufferFromStorageStream(storageStream, getter_Transfers(buf),
|
||||
&len);
|
||||
rv = NewBufferFromStorageStream(storageStream, getter_Transfers(buf),
|
||||
&len);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCAutoString spec(kXULCachePrefix);
|
||||
rv = NS_PathifyURI(uri, spec);
|
||||
rv = PathifyURI(uri, spec);
|
||||
if (NS_FAILED(rv))
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
rv = gStartupCache->PutBuffer(spec.get(), buf, len);
|
||||
@ -553,7 +553,7 @@ nsXULPrototypeCache::HasData(nsIURI* uri, PRBool* exists)
|
||||
return NS_OK;
|
||||
}
|
||||
nsCAutoString spec(kXULCachePrefix);
|
||||
nsresult rv = NS_PathifyURI(uri, spec);
|
||||
nsresult rv = PathifyURI(uri, spec);
|
||||
if (NS_FAILED(rv)) {
|
||||
*exists = PR_FALSE;
|
||||
return NS_OK;
|
||||
@ -668,7 +668,7 @@ nsXULPrototypeCache::BeginCaching(nsIURI* aURI)
|
||||
rv = startupCache->GetBuffer(kXULCacheInfoKey, getter_Transfers(buf),
|
||||
&len);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
rv = NS_NewObjectInputStreamFromBuffer(buf, len, getter_AddRefs(objectInput));
|
||||
rv = NewObjectInputStreamFromBuffer(buf, len, getter_AddRefs(objectInput));
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
buf.forget();
|
||||
@ -692,9 +692,9 @@ nsXULPrototypeCache::BeginCaching(nsIURI* aURI)
|
||||
nsCOMPtr<nsIObjectOutputStream> objectOutput;
|
||||
nsCOMPtr<nsIInputStream> inputStream;
|
||||
nsCOMPtr<nsIStorageStream> storageStream;
|
||||
rv = NS_NewObjectOutputWrappedStorageStream(getter_AddRefs(objectOutput),
|
||||
getter_AddRefs(storageStream),
|
||||
false);
|
||||
rv = NewObjectOutputWrappedStorageStream(getter_AddRefs(objectOutput),
|
||||
getter_AddRefs(storageStream),
|
||||
false);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = objectOutput->WriteStringZ(locale.get());
|
||||
rv |= objectOutput->WriteStringZ(chromePath.get());
|
||||
|
@ -41,7 +41,6 @@
|
||||
#include "nsIAtom.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsXULContentUtils.h"
|
||||
#include "nsPrintfCString.h"
|
||||
#include "nsIXULTemplateResult.h"
|
||||
#include "nsIXULTemplateBuilder.h"
|
||||
#include "nsXULTemplateQueryProcessorRDF.h"
|
||||
|
@ -110,6 +110,7 @@
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/AutoRestore.h"
|
||||
|
||||
// we want to explore making the document own the load group
|
||||
// so we can associate the document URI with the load group.
|
||||
@ -10877,25 +10878,6 @@ nsDocShell::GetRootScrollFrame()
|
||||
return shell->GetRootScrollFrameAsScrollableExternal();
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
class nsDebugAutoBoolTrueSetter
|
||||
{
|
||||
public:
|
||||
nsDebugAutoBoolTrueSetter(PRPackedBool *aBool)
|
||||
: mBool(aBool)
|
||||
{
|
||||
*mBool = PR_TRUE;
|
||||
}
|
||||
|
||||
~nsDebugAutoBoolTrueSetter()
|
||||
{
|
||||
*mBool = PR_FALSE;
|
||||
}
|
||||
protected:
|
||||
PRPackedBool *mBool;
|
||||
};
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::EnsureScriptEnvironment()
|
||||
{
|
||||
@ -10915,7 +10897,8 @@ nsDocShell::EnsureScriptEnvironment()
|
||||
|
||||
// Yeah, this isn't re-entrant safe, but that's ok since if we
|
||||
// re-enter this method, we'll infinitely loop...
|
||||
nsDebugAutoBoolTrueSetter boolSetter(&mInEnsureScriptEnv);
|
||||
AutoRestore<PRPackedBool> boolSetter(mInEnsureScriptEnv);
|
||||
mInEnsureScriptEnv = PR_TRUE;
|
||||
#endif
|
||||
|
||||
nsCOMPtr<nsIDOMScriptObjectFactory> factory =
|
||||
|
@ -46,9 +46,9 @@
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsCOMArray.h"
|
||||
#include "TimeStamp.h"
|
||||
#include "nsIURI.h"
|
||||
|
||||
class nsDOMNavigationTimingClock;
|
||||
class nsIURI;
|
||||
class nsIDocument;
|
||||
|
||||
class nsDOMNavigationTiming
|
||||
|
@ -57,6 +57,7 @@
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
|
||||
#include "nsDOMJSUtils.h" // for GetScriptContextFromJSContext
|
||||
|
||||
|
@ -53,7 +53,7 @@
|
||||
|
||||
interface nsIDOMValidityState;
|
||||
|
||||
[scriptable, uuid(5aeb2480-cb21-4483-b9b3-0c914502eb81)]
|
||||
[scriptable, uuid(069bc0d8-d16d-406a-8555-2f84384c9b3b)]
|
||||
interface nsIDOMHTMLSelectElement : nsIDOMHTMLElement
|
||||
{
|
||||
attribute boolean autofocus;
|
||||
@ -69,8 +69,12 @@ interface nsIDOMHTMLSelectElement : nsIDOMHTMLElement
|
||||
attribute unsigned long length;
|
||||
nsIDOMNode item(in unsigned long index);
|
||||
nsIDOMNode namedItem(in DOMString name);
|
||||
// This add method implementation means the following
|
||||
// since IDL doesn't support overfload.
|
||||
// void add(in nsIDOMHTMLElement, [optional] in nsIDOMHTMLElement)
|
||||
// void add(in nsIDOMHTMLElement, in long)
|
||||
void add(in nsIDOMHTMLElement element,
|
||||
[optional] in nsIDOMHTMLElement before)
|
||||
[optional] in nsIVariant before)
|
||||
raises(DOMException);
|
||||
void remove(in long index);
|
||||
|
||||
|
@ -41,8 +41,9 @@
|
||||
|
||||
interface nsIDOMHTMLOptionElement;
|
||||
interface nsIDOMHTMLSelectElement;
|
||||
interface nsIVariant;
|
||||
|
||||
[scriptable, uuid(a4f2b279-8096-48ea-8a95-640c5a55b697)]
|
||||
[scriptable, uuid(03bd61d6-b851-465a-ab3f-99945f77cfa5)]
|
||||
interface nsIDOMNSHTMLOptionCollection : nsISupports
|
||||
{
|
||||
attribute long selectedIndex;
|
||||
@ -52,7 +53,12 @@ interface nsIDOMNSHTMLOptionCollection : nsISupports
|
||||
|
||||
[noscript] readonly attribute nsIDOMHTMLSelectElement select;
|
||||
|
||||
[optional_argc] void add(in nsIDOMHTMLOptionElement option,
|
||||
[optional] in long index);
|
||||
// This add method implementation means the following
|
||||
// since IDL doesn't support overfload.
|
||||
// void add(in nsIDOMHTMLOptionElement,
|
||||
// [optional] in nsIDOMHTMLOptionElement)
|
||||
// void add(in nsIDOMHTMLOptionElement, in long)
|
||||
void add(in nsIDOMHTMLOptionElement option,
|
||||
[optional] in nsIVariant before);
|
||||
void remove(in long index);
|
||||
};
|
||||
|
@ -104,6 +104,10 @@
|
||||
#define getpid _getpid
|
||||
#endif
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
#include "nsIAccessibilityService.h"
|
||||
#endif
|
||||
|
||||
using namespace mozilla::ipc;
|
||||
using namespace mozilla::net;
|
||||
using namespace mozilla::places;
|
||||
@ -734,6 +738,18 @@ ContentChild::RecvFlushMemory(const nsString& reason)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
ContentChild::RecvActivateA11y()
|
||||
{
|
||||
#ifdef ACCESSIBILITY
|
||||
// Start accessibility in content process if it's running in chrome
|
||||
// process.
|
||||
nsCOMPtr<nsIAccessibilityService> accService =
|
||||
do_GetService("@mozilla.org/accessibilityService;1");
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
nsString&
|
||||
ContentChild::GetIndexedDBPath()
|
||||
{
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user