Merge mozilla-central to tracemonkey.

This commit is contained in:
Robert Sayre 2010-07-30 21:57:41 -07:00
Родитель 8499db8199 8662f7a74d
Коммит 802a358676
493 изменённых файлов: 16649 добавлений и 6876 удалений

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

@ -48,7 +48,6 @@
#include "nsIDOMHTMLInputElement.h"
#include "nsIDOMNSHTMLElement.h"
#include "nsIDOMNSEditableElement.h"
#include "nsIDOMNSHTMLButtonElement.h"
#include "nsIDOMHTMLFormElement.h"
#include "nsIDOMHTMLLegendElement.h"
#include "nsIDOMHTMLTextAreaElement.h"

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

@ -371,7 +371,18 @@ var TestPilotXulWindow = {
}
} else {
if (task.status == TaskConstants.STATUS_MISSED) {
// TODO use Sean's icon for missed studies
// Icon for missed studies
let hbox = document.createElement("hbox");
newRow.setAttribute("class", "tp-opted-out");
statusVbox.appendChild(this.makeSpacer());
statusVbox.appendChild(hbox);
this.addLabel(
statusVbox,
this._stringBundle.getString("testpilot.studiesWindow.missedStudy"));
statusVbox.appendChild(this.makeSpacer());
hbox.appendChild(this.makeSpacer());
this.addImg(hbox, "study-missed");
hbox.appendChild(this.makeSpacer());
} else {
this.addThanksMessage(statusVbox);
numFinishedStudies ++;

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

@ -100,6 +100,13 @@ image.study-canceled {
margin-right: 8px;
}
image.study-missed {
list-style-image: url("chrome://testpilot/skin/status-missed.png");
height: 32px;
width: 64px;
margin-right: 8px;
}
image.new-study {
list-style-image: url("chrome://testpilot/skin/tp-study-48x48.png");
height: 48px;

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

@ -4,7 +4,7 @@
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>testpilot@labs.mozilla.com</em:id>
<em:version>1.0</em:version>
<em:version>1.0.1</em:version>
<em:type>2</em:type>
<!-- Target Application this extension can install into,
@ -13,7 +13,7 @@
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>3.5</em:minVersion>
<em:maxVersion>4.0b2</em:maxVersion>
<em:maxVersion>4.0b3</em:maxVersion>
</Description>
</em:targetApplication>

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

@ -130,8 +130,9 @@ JarStore.prototype = {
saveJarFile: function( filename, rawData, expectedHash ) {
console.info("Saving a JAR file as " + filename + " hash = " + expectedHash);
// rawData is a string of binary data representing a jar file
let jarFile;
try {
let jarFile = this._baseDir.clone();
jarFile = this._baseDir.clone();
// filename may have directories in it; use just the last part
jarFile.append(filename.split("/").pop());
@ -139,29 +140,32 @@ JarStore.prototype = {
if (jarFile.exists()) {
jarFile.remove(false);
}
// From https://developer.mozilla.org/en/Code_snippets/File_I%2f%2fO#Getting_special_files
jarFile.create( Ci.nsIFile.NORMAL_FILE_TYPE, 600);
let stream = Cc["@mozilla.org/network/safe-file-output-stream;1"].
createInstance(Ci.nsIFileOutputStream);
stream.init(jarFile, 0x04 | 0x08 | 0x20, 0600, 0); // readwrite, create, truncate
stream.write(rawData, rawData.length);
if (stream instanceof Ci.nsISafeOutputStream) {
stream.finish();
} else {
stream.close();
}
// Verify hash; if it's good, index and set last modified time.
// If not good, remove it.
if (this._verifyJar(jarFile, expectedHash)) {
this._indexJar(jarFile);
this._lastModified[jarFile.leafName] = jarFile.lastModifiedTime;
} else {
console.warn("Bad JAR file, doesn't match hash: " + expectedHash);
jarFile.remove(false);
}
// From https://developer.mozilla.org/en/Code_snippets/File_I%2f%2fO#Getting_special_files
jarFile.create( Ci.nsIFile.NORMAL_FILE_TYPE, 0600);
let stream = Cc["@mozilla.org/network/safe-file-output-stream;1"].
createInstance(Ci.nsIFileOutputStream);
stream.init(jarFile, 0x04 | 0x08 | 0x20, 0600, 0); // readwrite, create, truncate
stream.write(rawData, rawData.length);
if (stream instanceof Ci.nsISafeOutputStream) {
stream.finish();
} else {
stream.close();
}
// Verify hash; if it's good, index and set last modified time.
// If not good, remove it.
if (this._verifyJar(jarFile, expectedHash)) {
this._indexJar(jarFile);
this._lastModified[jarFile.leafName] = jarFile.lastModifiedTime;
} else {
console.warn("Bad JAR file, doesn't match hash: " + expectedHash);
jarFile.remove(false);
}
} catch(e) {
console.warn("Error in saving jar file: " + e);
// Remove any partially saved file
if (jarFile.exists()) {
jarFile.remove(false);
}
}
},

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

@ -247,7 +247,179 @@ exports.RemoteExperimentLoader.prototype = {
return studiesToLoad;
},
_executeFreshIndexFile: function(data, callback) {
try {
data = JSON.parse(data);
} catch (e) {
this._logger.warn("Error parsing index.json: " + e );
callback(false);
return;
}
// Cache study results and legacy studies.
this._studyResults = data.results;
this._legacyStudies = data.legacy;
/* Go through each record indicated in index.json for our locale;
* download the specified .jar file (replacing any version on disk)
*/
let jarFiles = this.getLocalizedStudyInfo(data.new_experiments);
let numFilesToDload = jarFiles.length;
let self = this;
for each (let j in jarFiles) {
let filename = j.jarfile;
let hash = j.hash;
if (j.studyfile) {
this._experimentFileNames.push(j.studyfile);
}
this._logger.trace("I'm gonna go try to get the code for " + filename);
let modDate = this._jarStore.getFileModifiedDate(filename);
this._fileGetter(resolveUrl(this._baseUrl, filename),
function onDone(code) {
// code will be non-null if there is actually new code to download.
if (code) {
self._logger.info("Downloaded jar file " + filename);
self._jarStore.saveJarFile(filename, code, hash);
self._logger.trace("Saved code for: " + filename);
} else {
self._logger.info("Nothing to download for " + filename);
}
numFilesToDload--;
if (numFilesToDload == 0) {
self._logger.trace("Calling callback.");
callback(true);
}
}, modDate);
}
},
_executeCachedIndexFile: function(data) {
/* Working with a cached index file = follow its instructions except
* don't try to download anything - just work with the jar files already
* on disk. There's a lot of shared code between this and _executeFreshIndexFile;
* refactor?*/
try {
data = JSON.parse(data);
} catch (e) {
this._logger.warn("Error parsing index.json: " + e );
return false;
}
// Read study results and legacy studies from index.
this._studyResults = data.results;
this._legacyStudies = data.legacy;
// Read names of experiment modules from index.
let jarFiles = this.getLocalizedStudyInfo(data.new_experiments);
for each (let j in jarFiles) {
let filename = j.jarfile;
let hash = j.hash;
if (j.studyfile) {
this._experimentFileNames.push(j.studyfile);
}
}
return true;
},
// TODO a bad thing that can go wrong: If we have a net connection but the index file
// has not changed, we currently don't try to download anything...
// Another bad thing: If there's a jar download that's corrupt or unreadable or has
// the wrong permissions or something, we need to kill it and download a new one.
// WTF every jar file I'm downloading appears as 0 bytes with __x__x___ permissions!
_cachedIndexNsiFile: null,
get cachedIndexNsiFile() {
if (!this._cachedIndexNsiFile) {
try {
let file = Cc["@mozilla.org/file/directory_service;1"].
getService(Ci.nsIProperties).
get("ProfD", Ci.nsIFile);
file.append("TestPilotExperimentFiles"); // TODO this name should go in pref?
// Make sure there's a directory with this name; delete any non-directory
// file that's in the way.
if (file.exists() && !file.isDirectory()) {
file.remove(false);
}
if (!file.exists()) {
file.create(Ci.nsIFile.DIRECTORY_TYPE, 0777);
}
file.append("index.json");
this._cachedIndexNsiFile = file;
} catch(e) {
console.warn("Error creating directory for cached index file: " + e);
}
}
return this._cachedIndexNsiFile;
},
_cacheIndexFile: function(data) {
// write data to disk as basedir/index.json
try {
let file = this.cachedIndexNsiFile;
if (file == null) {
console.warn("Can't cache index file because directory does not exist.");
return;
}
if (file.exists()) {
file.remove(false);
}
file.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0666);
// file is nsIFile, data is a string
let foStream = Cc["@mozilla.org/network/file-output-stream;1"].
createInstance(Ci.nsIFileOutputStream);
foStream.init(file, 0x02 | 0x08 | 0x20, 0666, 0);
// write, create, truncate
let converter = Cc["@mozilla.org/intl/converter-output-stream;1"].
createInstance(Ci.nsIConverterOutputStream);
converter.init(foStream, "UTF-8", 0, 0);
converter.writeString(data);
converter.close(); // this closes foStream too
} catch(e) {
console.warn("Error cacheing index file: " + e);
}
},
// https://developer.mozilla.org/en/Table_Of_Errors
_loadCachedIndexFile: function() {
// If basedir/index.json exists, read it and return its data
// Otherwise, return false
let file = this.cachedIndexNsiFile;
if (file == null) {
console.warn("Can't load cached index file because directory does not exist.");
return false;
}
if (file.exists()) {
try {
let data = "";
let fstream = Cc["@mozilla.org/network/file-input-stream;1"].
createInstance(Ci.nsIFileInputStream);
let cstream = Cc["@mozilla.org/intl/converter-input-stream;1"].
createInstance(Ci.nsIConverterInputStream);
fstream.init(file, -1, 0, 0);
cstream.init(fstream, "UTF-8", 0, 0);
let str = {};
while (cstream.readString(4096, str) != 0) {
data += str.value;
}
cstream.close(); // this closes fstream too
return data;
} catch(e) {
console.warn("Error occured in reading cached index file: " + e);
return false;
}
} else {
console.warn("Trying to load cached index file but it does not exist.");
return false;
}
},
checkForUpdates: function(callback) {
// Check for surveys and studies. Entry point for all download and execution of
// remote code.
/* Callback will be called with true or false
* to let us know whether there are any updates, so that client code can
* restart any experiment whose code has changed. */
@ -260,60 +432,31 @@ exports.RemoteExperimentLoader.prototype = {
this._logger.info("Unloading everything to prepare to check for updates.");
this._refreshLoader();
// Check for surveys and studies
let modDate = 0;
if (this.cachedIndexNsiFile) {
if (this.cachedIndexNsiFile.exists()) {
modDate = this.cachedIndexNsiFile.lastModifiedTime;
}
}
let url = resolveUrl(self._baseUrl, indexFileName);
self._fileGetter(url, function onDone(data) {
if (data) {
try {
data = JSON.parse(data);
} catch (e) {
self._logger.warn("Error parsing index.json: " + e );
callback(false);
return;
}
// Cache study results and legacy studies.
self._studyResults = data.results;
self._legacyStudies = data.legacy;
/* Go through each record indicated in index.json for our locale;
* download the specified .jar file (replacing any version on disk)
*/
let jarFiles = self.getLocalizedStudyInfo(data.new_experiments);
let numFilesToDload = jarFiles.length;
for each (let j in jarFiles) {
let filename = j.jarfile;
let hash = j.hash;
if (j.studyfile) {
self._experimentFileNames.push(j.studyfile);
}
self._logger.trace("I'm gonna go try to get the code for " + filename);
let modDate = self._jarStore.getFileModifiedDate(filename);
self._fileGetter(resolveUrl(self._baseUrl, filename),
function onDone(code) {
// code will be non-null if there is actually new code to download.
if (code) {
self._logger.info("Downloaded jar file " + filename);
self._jarStore.saveJarFile(filename, code, hash);
self._logger.trace("Saved code for: " + filename);
} else {
self._logger.info("Nothing to download for " + filename);
}
numFilesToDload--;
if (numFilesToDload == 0) {
self._logger.trace("Calling callback.");
callback(true);
}
}, modDate);
}
self._executeFreshIndexFile(data, callback);
// cache index file contents so we can read them later if we can't get online.
self._cacheIndexFile(data);
} else {
self._logger.warn("Could not download index.json from test pilot server.");
callback(false);
self._logger.info("Could not download index.json, using cached version.");
let data = self._loadCachedIndexFile();
if (data) {
let success = self._executeCachedIndexFile(data);
callback(success);
} else {
self._logger.warn("Could not download index.json and no cached version.");
// TODO Should display an error message to the user in this case.
callback(false);
}
}
});
}, modDate);
},
getExperiments: function() {
@ -346,18 +489,6 @@ exports.RemoteExperimentLoader.prototype = {
// TODO purge the pref store of anybody who has one.
// TODO i realized that right now there is no way for experiments
// on disk to get loaded if the index file is not accessible for
// any reason. getExperiments needs to be able to return names of
// experiment modules on disk even if connection to server fails. But
// we can't just load everything; some modules in the jar are not
// experiments. Right now the information as to which modules are
// experiments lives ONLY in index.json. What if we put it into the .jar
// file itself somehow? Like calling one of the files "study.js". Or
// "survey.js" Hey, that would be neat - one .jar file containing both
// the study.js and the survey.js. Or there could be a mini-manifest in the
// jar telling which files are experiments.
// TODO Also, if user has a study id foo that is not expired yet, and
// a LegacyStudy appears with the same id, they should keep their "real"
// version of id foo and not load the LegacyStudy version.

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

@ -289,12 +289,38 @@ function testRemotelyLoadTabsExperiment() {
// (~/testpilot/website/testcases/tab-open-close/tabs_experiment.js)
}
function testRemoteLoaderIndexCache() {
var Cuddlefish = {};
Cu.import("resource://testpilot/modules/lib/cuddlefish.js",
Cuddlefish);
let cfl = new Cuddlefish.Loader({rootPaths: ["resource://testpilot/modules/",
"resource://testpilot/modules/lib/"]});
let remoteLoaderModule = cfl.require("remote-experiment-loader");
let getFileFunc = function(url, callback) {
callback(null);
};
let stubLogger = {
getLogger: function() { return {trace: function() {},
warn: function() {},
info: function() {},
debug: function() {}};}
};
let remoteLoader = new remoteLoaderModule.RemoteExperimentLoader(stubLogger, getFileFunc);
let data = "Foo bar baz quux";
remoteLoader._cacheIndexFile(data);
cheapAssertEqual(remoteLoader._loadCachedIndexFile(), data);
}
function runAllTests() {
testTheDataStore();
testFirefoxVersionCheck();
testStringSanitizer();
//testTheCuddlefishPreferencesFilesystem();
//testRemoteLoader();
testRemoteLoaderIndexCache();
dump("TESTING COMPLETE. " + testsPassed + " out of " + testsRun +
" tests passed.");
}

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

@ -54,6 +54,7 @@ tabbrowser {
.tabbrowser-tab[pinned] {
position: fixed;
display: block; /* position:fixed already does this (bug 579776), but let's be explicit */
}
.tabbrowser-tab[pinned] > .tab-text {

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

@ -643,9 +643,12 @@ const gXPInstallObserver = {
const anchorID = "addons-notification-icon";
var messageString, action;
var brandShortName = brandBundle.getString("brandShortName");
var host = installInfo.originatingURI ? installInfo.originatingURI.host : browser.currentURI.host;
var notificationID = aTopic;
// Make notifications persist a minimum of 30 seconds
var options = {
timeout: Date.now() + 30000
};
switch (aTopic) {
case "addon-install-blocked":
@ -666,8 +669,7 @@ const gXPInstallObserver = {
buttons = [];
}
else {
messageString = gNavigatorBundle.getFormattedString("xpinstallDisabledMessage",
[brandShortName, host]);
messageString = gNavigatorBundle.getString("xpinstallDisabledMessage");
action = {
label: gNavigatorBundle.getString("xpinstallDisabledButton"),
@ -683,7 +685,7 @@ const gXPInstallObserver = {
return;
messageString = gNavigatorBundle.getFormattedString("xpinstallPromptWarning",
[brandShortName, host]);
[brandShortName, installInfo.originatingURI.host]);
action = {
label: gNavigatorBundle.getString("xpinstallPromptAllowButton"),
@ -695,12 +697,18 @@ const gXPInstallObserver = {
}
PopupNotifications.show(browser, notificationID, messageString, anchorID,
action);
action, null, options);
break;
case "addon-install-failed":
// TODO This isn't terribly ideal for the multiple failure case
installInfo.installs.forEach(function(aInstall) {
var error = "addonError";
var host = (installInfo.originatingURI instanceof Ci.nsIStandardURL) &&
installInfo.originatingURI.host;
if (!host)
host = (aInstall.sourceURI instanceof Ci.nsIStandardURL) &&
aInstall.sourceURI.host;
var error = (host || aInstall.error == 0) ? "addonError" : "addonLocalError";
if (aInstall.error != 0)
error += aInstall.error;
else if (aInstall.addon.blocklistState == Ci.nsIBlocklistService.STATE_BLOCKED)
@ -710,12 +718,13 @@ const gXPInstallObserver = {
messageString = gNavigatorBundle.getString(error);
messageString = messageString.replace("#1", aInstall.name);
messageString = messageString.replace("#2", host);
if (host)
messageString = messageString.replace("#2", host);
messageString = messageString.replace("#3", brandShortName);
messageString = messageString.replace("#4", Services.appinfo.version);
PopupNotifications.show(browser, notificationID, messageString, anchorID,
action);
action, null, options);
});
break;
case "addon-install-complete":
@ -767,7 +776,7 @@ const gXPInstallObserver = {
messageString = messageString.replace("#3", brandShortName);
PopupNotifications.show(browser, notificationID, messageString, anchorID,
action);
action, null, options);
break;
}
}
@ -3091,7 +3100,8 @@ const DOMLinkHandler = {
type = type.replace(/^\s+|\s*(?:;.*)?$/g, "");
if (type == "application/opensearchdescription+xml" && link.title &&
/^(?:https?|ftp):/i.test(link.href)) {
/^(?:https?|ftp):/i.test(link.href) &&
!gPrivateBrowsingUI.privateBrowsingEnabled) {
var engine = { title: link.title, href: link.href };
BrowserSearch.addEngine(engine, link.ownerDocument);
searchAdded = true;
@ -7030,7 +7040,7 @@ var gIdentityHandler = {
this._identityIconLabel.crop = icon_country_label ? "end" : "center";
this._identityIconLabel.parentNode.style.direction = icon_labels_dir;
// Hide completely if the organization label is empty
this._identityIconLabel.parentNode.hidden = icon_label ? false : true;
this._identityIconLabel.parentNode.collapsed = icon_label ? false : true;
},
/**
@ -7765,13 +7775,11 @@ var TabContextMenu = {
menuItems[i].disabled = disabled;
// Session store
// XXXzeniko should't we just disable this item as we disable
// the tabbrowser-multiple items above - for consistency?
document.getElementById("context_undoCloseTab").hidden =
document.getElementById("context_undoCloseTab").disabled =
Cc["@mozilla.org/browser/sessionstore;1"].
getService(Ci.nsISessionStore).
getClosedTabCount(window) == 0;
// Only one of pin/unpin should be visible
document.getElementById("context_pinTab").hidden = this.contextTab.pinned;
document.getElementById("context_unpinTab").hidden = !this.contextTab.pinned;

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

@ -34,6 +34,7 @@
# Ehsan Akhgari <ehsan.akhgari@gmail.com>
# Robert Strong <robert.bugzilla@gmail.com>
# Rob Campbell <rcampbell@mozilla.com>
# Patrick Walton <pcwalton@mozilla.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
@ -140,7 +141,7 @@
<menuitem id="context_undoCloseTab"
label="&undoCloseTab.label;"
accesskey="&undoCloseTab.accesskey;"
command="History:UndoCloseTab"/>
observes="History:UndoCloseTab"/>
<menuitem id="context_closeTab" label="&closeTab.label;" accesskey="&closeTab.accesskey;"
oncommand="gBrowser.removeTab(TabContextMenu.contextTab);"/>
</menupopup>
@ -229,7 +230,9 @@
ignorekeys="true"
noautofocus="true"
noautohide="true"
level="top">
level="top"
titlebar="normal"
label="&inspectPanelTitle.label;">
<toolbar id="inspector-toolbar"
nowindowdrag="true">
<toolbarbutton id="inspector-inspect-toolbutton"
@ -279,11 +282,9 @@
ignorekeys="true"
noautofocus="true"
noautohide="true"
level="top">
<toolbar id="inspector-style-toolbar"
nowindowdrag="true">
<label>&inspectStylePanelTitle.label;</label>
</toolbar>
level="top"
titlebar="normal"
label="&inspectStylePanelTitle.label;">
<listbox id="inspector-style-listbox" flex="1"/>
<hbox align="end">
<spacer flex="1" />
@ -324,7 +325,12 @@
</menupopup>
<menupopup id="contentAreaContextMenu"
onpopupshowing="if (event.target != this) return true; updateEditUIVisibility(); gContextMenu = new nsContextMenu(this, window.getBrowser()); return gContextMenu.shouldDisplay;"
onpopupshowing="if (event.target != this)
return true;
gContextMenu = new nsContextMenu(this, gBrowser);
if (gContextMenu.shouldDisplay)
updateEditUIVisibility();
return gContextMenu.shouldDisplay;"
onpopuphiding="if (event.target == this) { gContextMenu = null; updateEditUIVisibility(); }">
#include browser-context.inc
</menupopup>
@ -490,6 +496,22 @@
</menupopup>
</menu>
<menuseparator/>
<menu id="appmenu_developer"
label="&developerMenu.label;">
<menupopup id="appmenu_developer_popup">
<menuitem id="appmenu_pageSource"
label="&pageSourceCmd.label;"
command="View:PageSource"/>
<menuseparator/>
<menuitem id="appmenu_pageInspect"
label="&inspectMenu.label;"
command="Tools:Inspect"/>
<menuitem id="appmenu_webConsole"
label="&webConsoleCmd.label;"
oncommand="HUDConsoleUI.toggleHUD();"/>
</menupopup>
</menu>
<menuseparator/>
<menu id="appmenu_customize"
label="&appMenuCustomize.label;">
<menupopup id="appmenu_customizeMenu"

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

@ -23,6 +23,7 @@
*
* Contributor(s):
* Rob Campbell <rcampbell@mozilla.com> (original author)
* Mihai Șucan <mihai.sucan@gmail.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
@ -260,7 +261,8 @@ PanelHighlighter.prototype = {
// Get midpoint of diagonal line.
let midpoint = this.midPoint(a, b);
return this.win.document.elementFromPoint(midpoint.x, midpoint.y);
return InspectorUI.elementFromPoint(this.win.document, midpoint.x,
midpoint.y);
},
/**
@ -312,8 +314,8 @@ PanelHighlighter.prototype = {
return;
}
let browserRect = this.browser.getBoundingClientRect();
let element = this.win.document.elementFromPoint(aEvent.clientX -
browserRect.left, aEvent.clientY - browserRect.top);
let element = InspectorUI.elementFromPoint(this.win.document,
aEvent.clientX - browserRect.left, aEvent.clientY - browserRect.top);
if (element && element != this.node) {
InspectorUI.inspectNode(element);
}
@ -857,8 +859,8 @@ var InspectorUI = {
}
break;
case "mousemove":
let element = this.win.document.elementFromPoint(event.clientX,
event.clientY);
let element = this.elementFromPoint(event.target.ownerDocument,
event.clientX, event.clientY);
if (element && element != this.node) {
this.inspectNode(element);
}
@ -931,6 +933,35 @@ var InspectorUI = {
this.updateStylePanel(aNode);
},
/**
* Find an element from the given coordinates. This method descends through
* frames to find the element the user clicked inside frames.
*
* @param DOMDocument aDocument the document to look into.
* @param integer aX
* @param integer aY
* @returns Node|null the element node found at the given coordinates.
*/
elementFromPoint: function IUI_elementFromPoint(aDocument, aX, aY)
{
let node = aDocument.elementFromPoint(aX, aY);
if (node && node.contentDocument) {
switch (node.nodeName.toLowerCase()) {
case "iframe":
let rect = node.getBoundingClientRect();
aX -= rect.left;
aY -= rect.top;
case "frame":
let subnode = this.elementFromPoint(node.contentDocument, aX, aY);
if (subnode) {
node = subnode;
}
}
}
return node;
},
///////////////////////////////////////////////////////////////////////////
//// Utility functions

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

@ -61,56 +61,26 @@
# ***** END LICENSE BLOCK *****
function nsContextMenu(aXulMenu, aBrowser) {
this.target = null;
this.browser = null;
this.menu = null;
this.isFrameImage = false;
this.onTextInput = false;
this.onKeywordField = false;
this.onImage = false;
this.onLoadedImage = false;
this.onCompletedImage = false;
this.onCanvas = false;
this.onVideo = false;
this.onAudio = false;
this.onLink = false;
this.onMailtoLink = false;
this.onSaveableLink = false;
this.onMathML = false;
this.link = false;
this.linkURL = "";
this.linkURI = null;
this.linkProtocol = null;
this.inFrame = false;
this.hasBGImage = false;
this.isTextSelected = false;
this.isContentSelected = false;
this.shouldDisplay = true;
this.isDesignMode = false;
this.onEditableArea = false;
this.ellipsis = "\u2026";
try {
this.ellipsis = gPrefService.getComplexValue("intl.ellipsis",
Ci.nsIPrefLocalizedString).data;
} catch (e) { }
// Initialize new menu.
this.initMenu(aXulMenu, aBrowser);
this.shouldDisplay = true;
this.initMenu(aBrowser);
}
// Prototype for nsContextMenu "class."
nsContextMenu.prototype = {
// Initialize context menu.
initMenu: function CM_initMenu(aPopup, aBrowser) {
this.menu = aPopup;
this.browser = aBrowser;
this.isFrameImage = document.getElementById("isFrameImage");
initMenu: function CM_initMenu(aBrowser) {
// Get contextual info.
this.setTarget(document.popupNode, document.popupRangeParent,
document.popupRangeOffset);
if (!this.shouldDisplay)
return;
this.browser = aBrowser;
this.isFrameImage = document.getElementById("isFrameImage");
this.ellipsis = "\u2026";
try {
this.ellipsis = gPrefService.getComplexValue("intl.ellipsis",
Ci.nsIPrefLocalizedString).data;
} catch (e) { }
this.isTextSelected = this.isTextSelection();
this.isContentSelected = this.isContentSelection();
@ -348,10 +318,11 @@ nsContextMenu.prototype = {
// suggestion list
this.showItem("spell-suggestions-separator", onMisspelling);
if (onMisspelling) {
var menu = document.getElementById("contentAreaContextMenu");
var suggestionsSeparator =
document.getElementById("spell-add-to-dictionary");
var numsug = InlineSpellCheckerUI.addSuggestionsToMenu(menu, suggestionsSeparator, 5);
var numsug =
InlineSpellCheckerUI.addSuggestionsToMenu(suggestionsSeparator.parentNode,
suggestionsSeparator, 5);
this.showItem("spell-no-suggestions", numsug == 0);
}
else
@ -452,6 +423,7 @@ nsContextMenu.prototype = {
if (aNode.namespaceURI == xulNS ||
this.isTargetAFormControl(aNode)) {
this.shouldDisplay = false;
return;
}
// Initialize contextual info.
@ -466,6 +438,9 @@ nsContextMenu.prototype = {
this.onKeywordField = false;
this.mediaURL = "";
this.onLink = false;
this.onMailtoLink = false;
this.onSaveableLink = false;
this.link = null;
this.linkURL = "";
this.linkURI = null;
this.linkProtocol = "";
@ -473,7 +448,8 @@ nsContextMenu.prototype = {
this.inFrame = false;
this.hasBGImage = false;
this.bgImageURL = "";
this.onEditableArea = false;
this.onEditableArea = false;
this.isDesignMode = false;
// Clear any old spellchecking items from the menu, this used to
// be in the menu hiding code but wasn't getting called in all

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

@ -1459,18 +1459,31 @@
// update first-tab/last-tab/beforeselected/afterselected attributes
this.selectedTab._selected = true;
// Removing the panel requires fixing up selectedPanel immediately
// (see below), which would be hindered by the potentially expensive
// browser removal. So we remove the browser and the panel in two
// steps.
var panel = browser.parentNode;
// This will unload the document. An unload handler could remove
// dependant tabs, so it's important that the tabbrowser is now in
// a consistent state (tab removed, tab positions updated, etc.).
// Also, it's important that another tab has been selected before
// the panel is removed; otherwise, a random sibling panel can flash.
this.mPanelContainer.removeChild(browser.parentNode);
panel.removeChild(browser);
// As the panel is removed, the removal of a dependent document can
// As the browser is removed, the removal of a dependent document can
// cause the whole window to close. So at this point, it's possible
// that the binding is destructed.
if (this.mTabBox)
this.mTabBox.selectedPanel = this.getBrowserForTab(this.mCurrentTab).parentNode;
if (this.mTabBox) {
let selectedPanel = this.mTabBox.selectedPanel;
this.mPanelContainer.removeChild(panel);
// Under the hood, a selectedIndex attribute controls which panel
// is displayed. Removing a panel A which precedes the selected
// panel B makes selectedIndex point to the panel next to B. We
// need to explicitly preserve B as the selected panel.
this.mTabBox.selectedPanel = selectedPanel;
}
if (aCloseWindow)
this._windowIsClosing = closeWindow(true);
@ -2874,11 +2887,6 @@
else
newMargin = rect.right - tabRect.right;
}
// ensure we never place the drop indicator beyond our limits
if (newMargin < minMargin)
newMargin = minMargin;
else if (newMargin > maxMargin)
newMargin = maxMargin;
}
ind.collapsed = false;

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

@ -137,6 +137,7 @@ _BROWSER_FILES = \
browser_bug562649.js \
browser_bug563588.js \
browser_bug577121.js \
browser_bug580956.js \
browser_contextSearchTabPosition.js \
browser_ctrlTab.js \
browser_discovery.js \
@ -147,6 +148,7 @@ _BROWSER_FILES = \
browser_inspector_treeSelection.js \
browser_inspector_highlighter.js \
browser_inspector_stylePanel.js \
browser_inspector_iframeTest.js \
browser_pageInfo.js \
browser_page_style_menu.js \
browser_pinnedTabs.js \

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

@ -3,8 +3,13 @@
*/
const TESTROOT = "http://example.com/browser/toolkit/mozapps/extensions/test/xpinstall/";
const TESTROOT2 = "http://example.org/browser/toolkit/mozapps/extensions/test/xpinstall/";
const CHROMEROOT = "chrome://mochikit/content/browser/toolkit/mozapps/extensions/test/xpinstall/";
const XPINSTALL_URL = "chrome://mozapps/content/xpinstall/xpinstallConfirm.xul";
var gApp = document.getElementById("bundle_brand").getString("brandShortName");
var gVersion = Services.appinfo.version;
function wait_for_notification(aCallback) {
PopupNotifications.panel.addEventListener("popupshown", function() {
PopupNotifications.panel.removeEventListener("popupshown", arguments.callee, false);
@ -56,6 +61,10 @@ function test_blocked_install() {
let notification = aPanel.childNodes[0];
is(notification.id, "addon-install-blocked", "Should have seen the install blocked");
is(notification.button.label, "Allow", "Should have seen the right button");
is(notification.getAttribute("label"),
gApp + " prevented this site (example.com) from asking you to install " +
"software on your computer.",
"Should have seen the right message");
// Click on Allow
EventUtils.synthesizeMouse(notification.button, 20, 10, {});
@ -69,6 +78,9 @@ function test_blocked_install() {
let notification = aPanel.childNodes[0];
is(notification.id, "addon-install-complete", "Should have seen the install complete");
is(notification.button.label, "Restart Now", "Should have seen the right button");
is(notification.getAttribute("label"),
"XPI Test will be installed after you restart " + gApp + ".",
"Should have seen the right message");
AddonManager.getAllInstalls(function(aInstalls) {
is(aInstalls.length, 1, "Should be one pending install");
@ -101,6 +113,9 @@ function test_whitelisted_install() {
let notification = aPanel.childNodes[0];
is(notification.id, "addon-install-complete", "Should have seen the install complete");
is(notification.button.label, "Restart Now", "Should have seen the right button");
is(notification.getAttribute("label"),
"XPI Test will be installed after you restart " + gApp + ".",
"Should have seen the right message");
AddonManager.getAllInstalls(function(aInstalls) {
is(aInstalls.length, 1, "Should be one pending install");
@ -128,6 +143,10 @@ function test_failed_download() {
wait_for_notification(function(aPanel) {
let notification = aPanel.childNodes[0];
is(notification.id, "addon-install-failed", "Should have seen the install fail");
is(notification.getAttribute("label"),
"The add-on could not be downloaded because of a connection failure " +
"on example.com.",
"Should have seen the right message");
gBrowser.removeTab(gBrowser.selectedTab);
Services.perms.remove("example.com", "install");
@ -149,6 +168,10 @@ function test_corrupt_file() {
wait_for_notification(function(aPanel) {
let notification = aPanel.childNodes[0];
is(notification.id, "addon-install-failed", "Should have seen the install fail");
is(notification.getAttribute("label"),
"The add-on downloaded from example.com could not be installed " +
"because it appears to be corrupt.",
"Should have seen the right message");
gBrowser.removeTab(gBrowser.selectedTab);
Services.perms.remove("example.com", "install");
@ -170,6 +193,10 @@ function test_incompatible() {
wait_for_notification(function(aPanel) {
let notification = aPanel.childNodes[0];
is(notification.id, "addon-install-failed", "Should have seen the install fail");
is(notification.getAttribute("label"),
"XPI Test could not be installed because it is not compatible with " +
gApp + " " + gVersion + ".",
"Should have seen the right message");
gBrowser.removeTab(gBrowser.selectedTab);
Services.perms.remove("example.com", "install");
@ -196,6 +223,9 @@ function test_restartless() {
let notification = aPanel.childNodes[0];
is(notification.id, "addon-install-complete", "Should have seen the install complete");
is(notification.button.label, "Open Add-ons Manager", "Should have seen the right button");
is(notification.getAttribute("label"),
"XPI Test has been installed successfully.",
"Should have seen the right message");
AddonManager.getAllInstalls(function(aInstalls) {
is(aInstalls.length, 0, "Should be no pending installs");
@ -232,6 +262,9 @@ function test_multiple() {
let notification = aPanel.childNodes[0];
is(notification.id, "addon-install-complete", "Should have seen the install complete");
is(notification.button.label, "Restart Now", "Should have seen the right button");
is(notification.getAttribute("label"),
"2 add-ons will be installed after you restart " + gApp + ".",
"Should have seen the right message");
AddonManager.getAllInstalls(function(aInstalls) {
is(aInstalls.length, 1, "Should be one pending install");
@ -247,6 +280,132 @@ function test_multiple() {
});
});
});
},
function test_url() {
gBrowser.selectedTab = gBrowser.addTab();
gBrowser.loadURI(TESTROOT + "unsigned.xpi");
// Wait for the install confirmation dialog
wait_for_install_dialog(function(aWindow) {
aWindow.document.documentElement.acceptDialog();
// Wait for the complete notification
wait_for_notification(function(aPanel) {
let notification = aPanel.childNodes[0];
is(notification.id, "addon-install-complete", "Should have seen the install complete");
is(notification.button.label, "Restart Now", "Should have seen the right button");
is(notification.getAttribute("label"),
"XPI Test will be installed after you restart " + gApp + ".",
"Should have seen the right message");
AddonManager.getAllInstalls(function(aInstalls) {
is(aInstalls.length, 1, "Should be one pending install");
aInstalls[0].cancel();
gBrowser.removeTab(gBrowser.selectedTab);
runNextTest();
});
});
});
},
function test_localfile() {
var cr = Components.classes["@mozilla.org/chrome/chrome-registry;1"]
.getService(Components.interfaces.nsIChromeRegistry);
var path = cr.convertChromeURL(makeURI(CHROMEROOT + "corrupt.xpi")).spec;
gBrowser.selectedTab = gBrowser.addTab();
gBrowser.loadURI(path);
// Wait for the complete notification
wait_for_notification(function(aPanel) {
let notification = aPanel.childNodes[0];
is(notification.id, "addon-install-failed", "Should have seen the install fail");
is(notification.getAttribute("label"),
"This add-on could not be installed because it appears to be corrupt.",
"Should have seen the right message");
gBrowser.removeTab(gBrowser.selectedTab);
runNextTest();
});
},
function test_wronghost() {
gBrowser.selectedTab = gBrowser.addTab();
gBrowser.addEventListener("load", function() {
if (gBrowser.currentURI.spec != TESTROOT2 + "enabled.html")
return;
gBrowser.removeEventListener("load", arguments.callee, true);
gBrowser.loadURI(TESTROOT + "corrupt.xpi");
// Wait for the complete notification
wait_for_notification(function(aPanel) {
let notification = aPanel.childNodes[0];
is(notification.id, "addon-install-failed", "Should have seen the install fail");
is(notification.getAttribute("label"),
"The add-on downloaded from example.com could not be installed " +
"because it appears to be corrupt.",
"Should have seen the right message");
gBrowser.removeTab(gBrowser.selectedTab);
runNextTest();
});
}, true);
gBrowser.loadURI(TESTROOT2 + "enabled.html");
},
function test_reload() {
var pm = Services.perms;
pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
var triggers = encodeURIComponent(JSON.stringify({
"Unsigned XPI": "unsigned.xpi"
}));
gBrowser.selectedTab = gBrowser.addTab();
gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
// Wait for the install confirmation dialog
wait_for_install_dialog(function(aWindow) {
aWindow.document.documentElement.acceptDialog();
// Wait for the complete notification
wait_for_notification(function(aPanel) {
let notification = aPanel.childNodes[0];
is(notification.id, "addon-install-complete", "Should have seen the install complete");
is(notification.button.label, "Restart Now", "Should have seen the right button");
is(notification.getAttribute("label"),
"XPI Test will be installed after you restart " + gApp + ".",
"Should have seen the right message");
function test_fail() {
ok(false, "Reloading should not have hidden the notification");
}
PopupNotifications.panel.addEventListener("popuphiding", test_fail, false);
gBrowser.addEventListener("load", function() {
if (gBrowser.currentURI.spec != TESTROOT2 + "enabled.html")
return;
gBrowser.removeEventListener("load", arguments.callee, true);
PopupNotifications.panel.removeEventListener("popuphiding", test_fail, false);
AddonManager.getAllInstalls(function(aInstalls) {
is(aInstalls.length, 1, "Should be one pending install");
aInstalls[0].cancel();
gBrowser.removeTab(gBrowser.selectedTab);
Services.perms.remove("example.com", "install");
runNextTest();
});
}, true);
gBrowser.loadURI(TESTROOT2 + "enabled.html");
});
});
}
];
@ -255,16 +414,21 @@ function runNextTest() {
is(aInstalls.length, 0, "Should be no active installs");
if (TESTS.length == 0) {
Services.prefs.setBoolPref("extensions.logging.enabled", false);
finish();
return;
}
info("Running " + TESTS[0].name);
TESTS.shift()();
});
}
};
function test() {
waitForExplicitFinish();
Services.prefs.setBoolPref("extensions.logging.enabled", true);
runNextTest();
}

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

@ -0,0 +1,27 @@
function numClosedTabs()
Cc["@mozilla.org/browser/sessionstore;1"].
getService(Ci.nsISessionStore).
getClosedTabCount(window);
function isUndoCloseEnabled() {
document.popupNode = gBrowser.tabs[0];
TabContextMenu.updateContextMenu(document.getElementById("tabContextMenu"));
return !document.getElementById("context_undoCloseTab").disabled;
}
function test() {
waitForExplicitFinish();
gPrefService.setIntPref("browser.sessionstore.max_tabs_undo", 0);
gPrefService.clearUserPref("browser.sessionstore.max_tabs_undo");
is(numClosedTabs(), 0, "There should be 0 closed tabs.");
ok(!isUndoCloseEnabled(), "Undo Close Tab should be disabled.");
var tab = gBrowser.addTab("http://mochi.test:8888/");
var browser = gBrowser.getBrowserForTab(tab);
browser.addEventListener("load", function() {
gBrowser.removeTab(tab);
ok(isUndoCloseEnabled(), "Undo Close Tab should be enabled.");
finish();
}, true);
}

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

@ -0,0 +1,145 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Inspector iframe Tests.
*
* The Initial Developer of the Original Code is
* The Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Rob Campbell <rcampbell@mozilla.com>
* Mihai Șucan <mihai.sucan@gmail.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
let doc;
let div1;
let div2;
let iframe1;
let iframe2;
function createDocument()
{
doc.title = "Inspector iframe Tests";
iframe1 = doc.createElement('iframe');
iframe1.addEventListener("load", function () {
iframe1.removeEventListener("load", arguments.callee, false);
div1 = iframe1.contentDocument.createElement('div');
div1.textContent = 'little div';
iframe1.contentDocument.body.appendChild(div1);
iframe2 = iframe1.contentDocument.createElement('iframe');
iframe2.addEventListener('load', function () {
iframe2.removeEventListener("load", arguments.callee, false);
div2 = iframe2.contentDocument.createElement('div');
div2.textContent = 'nested div';
iframe2.contentDocument.body.appendChild(div2);
setupIframeTests();
}, false);
iframe2.src = 'data:text/html,nested iframe';
iframe1.contentDocument.body.appendChild(iframe2);
}, false);
iframe1.src = 'data:text/html,little iframe';
doc.body.appendChild(iframe1);
}
function setupIframeTests()
{
document.addEventListener("popupshown", runIframeTests, false);
InspectorUI.toggleInspectorUI();
}
function runIframeTests(evt)
{
if (evt.target.id != "inspector-panel")
return true;
document.removeEventListener("popupshown", runIframeTests, false);
document.addEventListener("popupshown", performTestComparisons1, false);
EventUtils.synthesizeMouse(div1, 2, 2, {type: "mousemove"},
iframe1.contentWindow);
}
function performTestComparisons1(evt)
{
if (evt.target.id != "highlighter-panel")
return true;
document.removeEventListener("popupshown", performTestComparisons1, false);
is(InspectorUI.treeView.selectedNode, div1, "selection matches div1 node");
is(InspectorUI.highlighter.highlitNode, div1, "highlighter matches selection");
document.addEventListener("popupshown", performTestComparisons2, false);
EventUtils.synthesizeMouse(div2, 2, 2, {type: "mousemove"},
iframe2.contentWindow);
}
function performTestComparisons2(evt)
{
if (evt.target.id != "highlighter-panel")
return true;
document.removeEventListener("popupshown", performTestComparisons2, false);
is(InspectorUI.treeView.selectedNode, div2, "selection matches div2 node");
is(InspectorUI.highlighter.highlitNode, div2, "highlighter matches selection");
executeSoon(finishUp);
}
function finishUp() {
InspectorUI.closeInspectorUI();
gBrowser.removeCurrentTab();
finish();
}
function test()
{
waitForExplicitFinish();
gBrowser.selectedTab = gBrowser.addTab();
gBrowser.selectedBrowser.addEventListener("load", function() {
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
doc = content.document;
waitForFocus(createDocument, content);
}, true);
content.location = "data:text/html,iframe tests for inspector";
}

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

@ -344,6 +344,80 @@ var tests = [
this.notification.remove();
}
},
// Test that persistence allows the notification to persist across reloads
{ // Test #12
run: function () {
this.oldSelectedTab = gBrowser.selectedTab;
gBrowser.selectedTab = gBrowser.addTab("about:blank");
let self = this;
loadURI("http://example.com/", function() {
self.notifyObj = new basicNotification();
self.notifyObj.options = {
persistence: 2
};
self.notification = showNotification(self.notifyObj);
});
},
onShown: function (popup) {
this.complete = false;
let self = this;
loadURI("http://example.org/", function() {
loadURI("http://example.com/", function() {
// Next load will hide the notification
self.complete = true;
loadURI("http://example.org/");
});
});
},
onHidden: function (popup) {
ok(this.complete, "Should only have hidden the notification after 3 page loads");
this.notification.remove();
gBrowser.removeTab(gBrowser.selectedTab);
gBrowser.selectedTab = this.oldSelectedTab;
}
},
// Test that a timeout allows the notification to persist across reloads
{ // Test #13
run: function () {
this.oldSelectedTab = gBrowser.selectedTab;
gBrowser.selectedTab = gBrowser.addTab("about:blank");
let self = this;
loadURI("http://example.com/", function() {
self.notifyObj = new basicNotification();
// Set a timeout of 10 minutes that should never be hit
self.notifyObj.options = {
timeout: Date.now() + 600000
};
self.notification = showNotification(self.notifyObj);
});
},
onShown: function (popup) {
this.complete = false;
let self = this;
loadURI("http://example.org/", function() {
loadURI("http://example.com/", function() {
// Next load will hide the notification
self.notification.options.timeout = Date.now() - 1;
self.complete = true;
loadURI("http://example.org/");
});
});
},
onHidden: function (popup) {
ok(this.complete, "Should only have hidden the notification after the timeout was passed");
this.notification.remove();
gBrowser.removeTab(gBrowser.selectedTab);
gBrowser.selectedTab = this.oldSelectedTab;
}
},
];
function showNotification(notifyObj) {
@ -352,7 +426,8 @@ function showNotification(notifyObj) {
notifyObj.message,
notifyObj.anchorID,
notifyObj.mainAction,
notifyObj.secondaryActions);
notifyObj.secondaryActions,
notifyObj.options);
}
function checkPopup(popup, notificationObj) {
@ -409,6 +484,19 @@ function triggerSecondaryCommand(popup, index) {
EventUtils.synthesizeKey("VK_DOWN", { altKey: (navigator.platform.indexOf("Mac") == -1) });
}
function loadURI(uri, callback) {
gBrowser.addEventListener("load", function() {
// Ignore the about:blank load
if (gBrowser.currentURI.spec != uri)
return;
gBrowser.removeEventListener("load", arguments.callee, true);
callback();
}, true);
gBrowser.loadURI(uri);
}
function dismissNotification(popup) {
info("[Test #" + gTestIndex + "] dismissing notification");
executeSoon(function () {

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

@ -60,8 +60,27 @@ var gTabsPane = {
* browser.tabs.warnOnOpen
* - true if the user should be warned if he attempts to open a lot of tabs at
* once (e.g. a large folder of bookmarks), false otherwise
* browser.taskbar.previews.enable
* - true if tabs are to be shown in the Windows 7 taskbar
*/
#ifdef XP_WIN
/**
* Initialize any platform-specific UI.
*/
init: function () {
const Cc = Components.classes;
const Ci = Components.interfaces;
try {
let sysInfo = Cc["@mozilla.org/system-info;1"].
getService(Ci.nsIPropertyBag2);
let ver = parseFloat(sysInfo.getProperty("version"));
let showTabsInTaskbar = document.getElementById("showTabsInTaskbar");
showTabsInTaskbar.hidden = ver < 6.1;
} catch (ex) {}
},
#endif
/**
* Determines where a link which opens a new window will open.
*

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

@ -50,6 +50,9 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="paneTabs"
#ifdef XP_WIN
onpaneload="gTabsPane.init();"
#endif
helpTopic="prefs-tabs">
<preferences id="tabsPreferences">
@ -58,6 +61,9 @@
<preference id="browser.tabs.loadInBackground" name="browser.tabs.loadInBackground" type="bool" inverted="true"/>
<preference id="browser.tabs.warnOnClose" name="browser.tabs.warnOnClose" type="bool"/>
<preference id="browser.tabs.warnOnOpen" name="browser.tabs.warnOnOpen" type="bool"/>
#ifdef XP_WIN
<preference id="browser.taskbar.previews.enable" name="browser.taskbar.previews.enable" type="bool"/>
#endif
</preferences>
<script type="application/javascript" src="chrome://browser/content/preferences/tabs.js"/>
@ -82,6 +88,11 @@
<checkbox id="switchToNewTabs" label="&switchToNewTabs.label;"
accesskey="&switchToNewTabs.accesskey;"
preference="browser.tabs.loadInBackground"/>
#ifdef XP_WIN
<checkbox id="showTabsInTaskbar" label="&showTabsInTaskbar.label;"
accesskey="&showTabsInTaskbar.accesskey;"
preference="browser.taskbar.previews.enable"/>
#endif
</vbox>
</prefpane>

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

@ -46,7 +46,8 @@ include $(topsrcdir)/config/rules.mk
_BROWSER_TEST_FILES = \
browser_console_clear.js \
browser_privatebrowsing_beforeunload.js \
browser_privatebrowsing_beforeunload_enter.js \
browser_privatebrowsing_beforeunload_exit.js \
browser_privatebrowsing_certexceptionsui.js \
browser_privatebrowsing_commandline_toggle.js \
browser_privatebrowsing_cookieacceptdialog.js \

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

@ -98,65 +98,13 @@ function test() {
"Incorrect page displayed after private browsing transition");
is(acceptDialog, 0, "Two confirm dialogs should have been accepted");
gBrowser.selectedBrowser.addEventListener("load", function() {
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
gBrowser.selectedTab = gBrowser.addTab();
gBrowser.selectedBrowser.addEventListener("load", function() {
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
confirmCalls = 0;
rejectDialog = 1;
pb.privateBrowsingEnabled = false;
ok(pb.privateBrowsingEnabled, "Private browsing mode should not have been deactivated");
is(confirmCalls, 1, "Only one confirm box should be shown");
is(gBrowser.tabs.length, 2,
"No tabs should be closed because private browsing mode transition was canceled");
is(gBrowser.getBrowserForTab(gBrowser.tabContainer.firstChild).currentURI.spec, TEST_PAGE_1,
"The first tab should be the same one we opened");
is(gBrowser.getBrowserForTab(gBrowser.tabContainer.lastChild).currentURI.spec, TEST_PAGE_2,
"The last tab should be the same one we opened");
is(rejectDialog, 0, "Only one confirm dialog should have been rejected");
confirmCalls = 0;
acceptDialog = 2;
pb.privateBrowsingEnabled = false;
ok(!pb.privateBrowsingEnabled, "Private browsing mode should have been deactivated");
is(confirmCalls, 2, "Only two confirm boxes should be shown");
is(gBrowser.tabs.length, 3,
"Incorrect number of tabs after transition into private browsing");
let loads = 0;
function waitForLoad(event) {
gBrowser.removeEventListener("load", arguments.callee, true);
if (++loads != 3)
return;
is(gBrowser.getBrowserForTab(gBrowser.tabContainer.firstChild).currentURI.spec, "about:blank",
"The first tab should be a blank tab");
is(gBrowser.getBrowserForTab(gBrowser.tabContainer.firstChild.nextSibling).currentURI.spec, TEST_PAGE_1,
"The middle tab should be the same one we opened");
is(gBrowser.getBrowserForTab(gBrowser.tabContainer.lastChild).currentURI.spec, TEST_PAGE_2,
"The last tab should be the same one we opened");
is(acceptDialog, 0, "Two confirm dialogs should have been accepted");
is(acceptDialog, 0, "Two prompts should have been raised");
acceptDialog = 2;
gBrowser.removeTab(gBrowser.tabContainer.lastChild);
gBrowser.removeTab(gBrowser.tabContainer.lastChild);
Services.obs.removeObserver(promptObserver, "common-dialog-loaded", false);
finish();
}
for (let i = 0; i < gBrowser.browsers.length; ++i)
gBrowser.browsers[i].addEventListener("load", waitForLoad, true);
}, true);
gBrowser.selectedBrowser.loadURI(TEST_PAGE_2);
}, true);
gBrowser.selectedBrowser.loadURI(TEST_PAGE_1);
gBrowser.addTab();
gBrowser.removeTab(gBrowser.selectedTab);
Services.prefs.setBoolPref("browser.privatebrowsing.keep_current_session", true);
pb.privateBrowsingEnabled = false;
Services.prefs.clearUserPref("browser.privatebrowsing.keep_current_session");
Services.obs.removeObserver(promptObserver, "common-dialog-loaded", false);
finish();
}, true);
}, true);
browser2.loadURI(TEST_PAGE_2);

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

@ -0,0 +1,124 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Private Browsing Tests.
*
* The Initial Developer of the Original Code is
* Nochum Sossonko.
* Portions created by the Initial Developer are Copyright (C) 2009
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Nochum Sossonko <highmind63@gmail.com> (Original Author)
* Ehsan Akhgari <ehsan@mozilla.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
// This test makes sure that cancelling the unloading of a page with a beforeunload
// handler prevents the private browsing mode transition.
function test() {
const TEST_PAGE_1 = "data:text/html,<body%20onbeforeunload='return%20false;'>first</body>";
const TEST_PAGE_2 = "data:text/html,<body%20onbeforeunload='return%20false;'>second</body>";
let pb = Cc["@mozilla.org/privatebrowsing;1"]
.getService(Ci.nsIPrivateBrowsingService);
let rejectDialog = 0;
let acceptDialog = 0;
let confirmCalls = 0;
function promptObserver(aSubject, aTopic, aData) {
let dialogWin = aSubject.QueryInterface(Ci.nsIDOMWindow);
confirmCalls++;
if (acceptDialog-- > 0)
dialogWin.document.documentElement.getButton("accept").click();
else if (rejectDialog-- > 0)
dialogWin.document.documentElement.getButton("cancel").click();
}
Services.obs.addObserver(promptObserver, "common-dialog-loaded", false);
pb.privateBrowsingEnabled = true;
waitForExplicitFinish();
let browser1 = gBrowser.getBrowserForTab(gBrowser.addTab());
browser1.addEventListener("load", function() {
browser1.removeEventListener("load", arguments.callee, true);
let browser2 = gBrowser.getBrowserForTab(gBrowser.addTab());
browser2.addEventListener("load", function() {
browser2.removeEventListener("load", arguments.callee, true);
confirmCalls = 0;
rejectDialog = 1;
pb.privateBrowsingEnabled = false;
ok(pb.privateBrowsingEnabled, "Private browsing mode should not have been deactivated");
is(confirmCalls, 1, "Only one confirm box should be shown");
is(gBrowser.tabs.length, 3,
"No tabs should be closed because private browsing mode transition was canceled");
is(gBrowser.getBrowserForTab(gBrowser.tabContainer.firstChild).currentURI.spec, "about:privatebrowsing",
"The first tab should be the same one we opened");
is(gBrowser.getBrowserForTab(gBrowser.tabContainer.lastChild).currentURI.spec, TEST_PAGE_2,
"The last tab should be the same one we opened");
is(rejectDialog, 0, "Only one confirm dialog should have been rejected");
confirmCalls = 0;
acceptDialog = 2;
pb.privateBrowsingEnabled = false;
ok(!pb.privateBrowsingEnabled, "Private browsing mode should have been deactivated");
is(confirmCalls, 2, "Only two confirm boxes should be shown");
is(gBrowser.tabs.length, 3,
"Incorrect number of tabs after transition into private browsing");
let loads = 0;
function waitForLoad(event) {
gBrowser.removeEventListener("load", arguments.callee, true);
if (++loads != 3)
return;
is(gBrowser.getBrowserForTab(gBrowser.tabContainer.firstChild).currentURI.spec, "about:blank",
"The first tab should be a blank tab");
is(gBrowser.getBrowserForTab(gBrowser.tabContainer.firstChild.nextSibling).currentURI.spec, TEST_PAGE_1,
"The middle tab should be the same one we opened");
is(gBrowser.getBrowserForTab(gBrowser.tabContainer.lastChild).currentURI.spec, TEST_PAGE_2,
"The last tab should be the same one we opened");
is(acceptDialog, 0, "Two confirm dialogs should have been accepted");
is(acceptDialog, 0, "Two prompts should have been raised");
acceptDialog = 2;
gBrowser.removeTab(gBrowser.tabContainer.lastChild);
gBrowser.removeTab(gBrowser.tabContainer.lastChild);
Services.obs.removeObserver(promptObserver, "common-dialog-loaded", false);
finish();
}
for (let i = 0; i < gBrowser.browsers.length; ++i)
gBrowser.browsers[i].addEventListener("load", waitForLoad, true);
}, true);
browser2.loadURI(TEST_PAGE_2);
}, true);
browser1.loadURI(TEST_PAGE_1);
}

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

@ -40,6 +40,7 @@
function test() {
// initialization
waitForExplicitFinish();
gPrefService.setBoolPref("browser.privatebrowsing.keep_current_session", true);
let pb = Cc["@mozilla.org/privatebrowsing;1"].
getService(Ci.nsIPrivateBrowsingService);
@ -68,6 +69,24 @@ function test() {
is(searchBar.textbox.editor.transactionManager.numberOfUndoItems, 1,
"leaving the private browsing mode should only leave 1 item in the undo list of the searchbar control");
// cleanup
gPrefService.clearUserPref("browser.privatebrowsing.keep_current_session");
// enter private browsing mode
pb.privateBrowsingEnabled = true;
const TEST_URL =
"data:text/html,<head><link rel=search type='application/opensearchdescription+xml' href='http://foo.bar' title=dummy></head>";
gBrowser.selectedTab = gBrowser.addTab(TEST_URL);
gBrowser.selectedBrowser.addEventListener("load", function(e) {
e.currentTarget.removeEventListener("load", arguments.callee, true);
var browser = gBrowser.selectedBrowser;
is(typeof browser.engines, "undefined",
"An engine should not be discovered in private browsing mode");
gBrowser.removeTab(gBrowser.selectedTab);
pb.privateBrowsingEnabled = false;
// cleanup
gPrefService.clearUserPref("browser.privatebrowsing.keep_current_session");
finish();
}, true);
}

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

@ -65,10 +65,6 @@ MOZ_NONLOCALIZED_PKG_LIST = \
MOZ_LOCALIZED_PKG_LIST = $(AB_CD)
MOZ_OPTIONAL_PKG_LIST = \
adt \
$(NULL)
DEFINES += -DAB_CD=$(AB_CD) -DMOZ_APP_NAME=$(MOZ_APP_NAME) -DPREF_DIR=$(PREF_DIR)
ifdef MOZ_ENABLE_GNOME_COMPONENT
DEFINES += -DMOZ_ENABLE_GNOME_COMPONENT=1

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

@ -405,122 +405,7 @@
@BINPATH@/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/icon.png
@BINPATH@/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/preview.png
#if MOZ_UPDATE_CHANNEL == beta
@BINPATH@/extensions/testpilot@labs.mozilla.com/chrome.manifest
@BINPATH@/extensions/testpilot@labs.mozilla.com/components/TestPilot.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/all-studies-window.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/all-studies-window.xul
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/browser.css
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/browser.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/debug.html
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/experiment-page.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/feedback-browser.xul
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/flot/jquery.colorhelpers.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/flot/jquery.colorhelpers.min.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/flot/jquery.flot.crosshair.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/flot/jquery.flot.crosshair.min.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/flot/jquery.flot.image.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/flot/jquery.flot.image.min.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/flot/jquery.flot.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/flot/jquery.flot.min.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/flot/jquery.flot.navigate.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/flot/jquery.flot.navigate.min.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/flot/jquery.flot.selection.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/flot/jquery.flot.selection.min.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/flot/jquery.flot.stack.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/flot/jquery.flot.stack.min.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/flot/jquery.flot.threshold.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/flot/jquery.flot.threshold.min.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/flot/jquery.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/flot/jquery.min.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/raw-data-dialog.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/raw-data-dialog.xul
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/screen.css
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/status-quit.html
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/status.html
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/survey-generator.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/take-survey.html
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/tp-browser.xul
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/welcome-page.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/welcome.html
@BINPATH@/extensions/testpilot@labs.mozilla.com/content/window-utils.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/defaults/preferences/preferences.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/install.rdf
@BINPATH@/extensions/testpilot@labs.mozilla.com/instrument/chrome.manifest
@BINPATH@/extensions/testpilot@labs.mozilla.com/instrument/install.rdf
@BINPATH@/extensions/testpilot@labs.mozilla.com/instrument/instrument.jsm
@BINPATH@/extensions/testpilot@labs.mozilla.com/instrument/instrument.xul
@BINPATH@/extensions/testpilot@labs.mozilla.com/modules/dbutils.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/modules/experiment_data_store.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/modules/extension-update.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/modules/feedback.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/modules/jar-code-store.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/modules/lib/cuddlefish.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/modules/lib/memory.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/modules/lib/observer-service.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/modules/lib/plain-text-console.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/modules/lib/preferences-service.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/modules/lib/securable-module.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/modules/lib/timer.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/modules/lib/traceback.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/modules/lib/unit-test.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/modules/lib/unload.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/modules/lib/url.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/modules/log4moz.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/modules/metadata.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/modules/Observers.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/modules/remote-experiment-loader.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/modules/setup.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/modules/string_sanitizer.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/modules/tasks.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/badge-default.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/bg.jpg
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/css/screen-standalone.css
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/dino_32x32.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/images/bg-status.jpg
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/images/callout.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/images/callout_continue.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/images/data1.jpg
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/images/data2.jpg
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/images/home_comments.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/images/home_computer.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/images/home_continue.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/images/home_quit.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/images/home_results.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/images/home_twitter.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/images/home_upcoming.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/logo.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/mozilla-logo.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/status-completed.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/status-ejected.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/status-missed.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/testpilot_16x16.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/testPilot_200x200.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/testpilot_32x32.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/tp-completedstudies-32x32.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/tp-currentstudies-32x32.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/tp-generic-32x32.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/tp-learned-32x32.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/tp-results-48x48.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/tp-settings-32x32.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/tp-study-48x48.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/all/tp-submit-48x48.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/linux/close_button.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/linux/feedback-frown-16x16.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/linux/feedback-smile-16x16.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/linux/feedback.css
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/mac/close_button.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/mac/feedback-frown-16x16.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/mac/feedback-smile-16x16.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/mac/feedback.css
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/mac/notification-tail-down.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/mac/notification-tail-up.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/win/close_button.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/win/feedback-frown-16x16.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/win/feedback-smile-16x16.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/win/feedback.css
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/win/notification-tail-down.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/skin/win/notification-tail-up.png
@BINPATH@/extensions/testpilot@labs.mozilla.com/tests/test_data_store.js
@BINPATH@/extensions/testpilot@labs.mozilla.com/*
#endif
@BINPATH@/chrome/toolkit.jar
@BINPATH@/chrome/toolkit.manifest

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

@ -58,6 +58,7 @@ components/nsInterfaceInfoToIDL.js
components/nsScriptableIO.js
components/nsUrlClassifierTable.js
components/nsXmlRpcClient.js
components/pluginGlue.js
components/sidebar.xpt
components/xmlextras.xpt
components/xpcom.xpt
@ -707,6 +708,7 @@ xpicleanup@BIN_SUFFIX@
extensions/inspector@mozilla.org/chrome/chromelist.txt
init.d/README
libwidget.rsrc
plugin-container
plugins/Default Plugin.plugin/Contents/Info.plist
plugins/Default Plugin.plugin/Contents/MacOS/Default Plugin
plugins/Default Plugin.plugin/Contents/PkgInfo

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

@ -54,25 +54,15 @@ DEFINES += -DAPP_VERSION=$(APP_VERSION)
PRE_RELEASE_SUFFIX := $(shell $(PYTHON) $(topsrcdir)/config/printprereleasesuffix.py $(APP_VERSION))
DEFINES += -DPRE_RELEASE_SUFFIX="$(PRE_RELEASE_SUFFIX)"
# All script and locale files used by the Unicode version of NSIS need to be
# converted from UTF-8 to UTF-16LE
INSTALLER_FILES_CONV = \
INSTALLER_FILES = \
app.tag \
nsis/installer.nsi \
nsis/uninstaller.nsi \
nsis/shared.nsh \
$(NULL)
INSTALLER_FILES = \
app.tag \
$(NULL)
# All script and locale files used by the Unicode version of NSIS need to be
# converted from UTF-8 to UTF-16LE
BRANDING_FILES_CONV = \
branding.nsi \
$(NULL)
BRANDING_FILES = \
branding.nsi \
wizHeader.bmp \
wizHeaderRTL.bmp \
wizWatermark.bmp \
@ -95,47 +85,23 @@ installer::
# included for mar file generation.
uninstaller::
$(RM) -rf $(CONFIG_DIR) && mkdir $(CONFIG_DIR)
for i in $(INSTALLER_FILES_CONV); do \
iconv -f UTF-8 -t UTF-16LE $(srcdir)/$$i | \
cat $(MOZILLA_DIR)/toolkit/mozapps/installer/windows/nsis/utf16-le-bom.bin - > \
$(CONFIG_DIR)/`basename $$i`; \
done
$(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR)
for i in $(BRANDING_FILES_CONV); do \
iconv -f UTF-8 -t UTF-16LE $(DIST)/branding/$$i | \
cat $(MOZILLA_DIR)/toolkit/mozapps/installer/windows/nsis/utf16-le-bom.bin - > \
$(CONFIG_DIR)/$$i; \
done
$(INSTALL) $(addprefix $(DIST)/branding/,$(BRANDING_FILES)) $(CONFIG_DIR)
$(PYTHON) $(topsrcdir)/config/Preprocessor.py -Fsubstitution $(DEFINES) $(ACDEFINES) \
$(srcdir)/nsis/defines.nsi.in | iconv -f UTF-8 -t UTF-16LE | \
cat $(MOZILLA_DIR)/toolkit/mozapps/installer/windows/nsis/utf16-le-bom.bin - > \
$(CONFIG_DIR)/defines.nsi
$(PERL) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.pl \
$(topsrcdir) $(call EXPAND_LOCALE_SRCDIR,browser/locales)/installer $(AB_CD) \
$(CONFIG_DIR)
$(srcdir)/nsis/defines.nsi.in > $(CONFIG_DIR)/defines.nsi
$(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
--preprocess-locale $(topsrcdir) \
$(call EXPAND_LOCALE_SRCDIR,browser/locales)/installer $(AB_CD) $(CONFIG_DIR)
$(CONFIG_DIR)/setup.exe::
$(RM) -rf $(CONFIG_DIR) && mkdir $(CONFIG_DIR)
for i in $(INSTALLER_FILES_CONV); do \
iconv -f UTF-8 -t UTF-16LE $(srcdir)/$$i | \
cat $(MOZILLA_DIR)/toolkit/mozapps/installer/windows/nsis/utf16-le-bom.bin - > \
$(CONFIG_DIR)/`basename $$i`; \
done
$(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR)
for i in $(BRANDING_FILES_CONV); do \
iconv -f UTF-8 -t UTF-16LE $(DIST)/branding/$$i | \
cat $(MOZILLA_DIR)/toolkit/mozapps/installer/windows/nsis/utf16-le-bom.bin - > \
$(CONFIG_DIR)/$$i; \
done
$(INSTALL) $(addprefix $(DIST)/branding/,$(BRANDING_FILES)) $(CONFIG_DIR)
$(PYTHON) $(topsrcdir)/config/Preprocessor.py -Fsubstitution $(DEFINES) $(ACDEFINES) \
$(srcdir)/nsis/defines.nsi.in | iconv -f UTF-8 -t UTF-16LE | \
cat $(MOZILLA_DIR)/toolkit/mozapps/installer/windows/nsis/utf16-le-bom.bin - > \
$(CONFIG_DIR)/defines.nsi
$(PERL) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.pl \
$(topsrcdir) $(call EXPAND_LOCALE_SRCDIR,browser/locales)/installer $(AB_CD) \
$(CONFIG_DIR)
$(srcdir)/nsis/defines.nsi.in > $(CONFIG_DIR)/defines.nsi
$(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
--preprocess-locale $(topsrcdir) \
$(call EXPAND_LOCALE_SRCDIR,browser/locales)/installer $(AB_CD) $(CONFIG_DIR)
include $(topsrcdir)/config/rules.mk
include $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/makensis.mk

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

@ -175,6 +175,7 @@
<!ENTITY inspectMenu.accesskey "T">
<!ENTITY inspectMenu.commandkey "I">
<!ENTITY inspectPanelTitle.label "HTML">
<!ENTITY inspectButton.label "Inspect">
<!ENTITY inspectButton.accesskey "I">
<!ENTITY inspectNextButton.label "Next">
@ -256,6 +257,8 @@
<!ENTITY appMenuSidebars.label "Sidebars">
<!ENTITY appMenuHelp.label "Help">
<!ENTITY developerMenu.label "Developer">
<!ENTITY openCmd.commandkey "l">
<!ENTITY urlbar.placeholder "Go to a Web Site">
<!ENTITY urlbar.accesskey "d">

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

@ -44,13 +44,20 @@ addonInstallRestartButton.accesskey=R
addonInstallManage=Open Add-ons Manager
addonInstallManage.accesskey=O
# LOCALIZATION NOTE (addonError-1, addonError-2, addonError-3, addonError-4, addonErrorIncompatible, addonErrorBlocklisted):
# LOCALIZATION NOTE (addonError-1, addonError-2, addonError-3, addonError-4):
# #1 is the add-on name, #2 is the host name, #3 is the application name
# #4 is the application version
addonError-1=The add-on could not be downloaded because of a connection failure on #2.
addonError-2=The add-on from #2 could not be installed because it does not match the add-on #3 expected.
addonError-3=The add-on downloaded from #2 could not be installed because it appears to be corrupt.
addonError-4=#1 could not be installed because #3 cannot modify the needed file.
# LOCALIZATION NOTE (addonLocalError-1, addonLocalError-2, addonLocalError-3, addonLocalError-4, addonErrorIncompatible, addonErrorBlocklisted):
# #1 is the add-on name, #3 is the application name, #4 is the application version
addonLocalError-1=This add-on could not be installed because of a filesystem error.
addonLocalError-2=This add-on could not be installed because it does not match the add-on #3 expected.
addonLocalError-3=This add-on could not be installed because it appears to be corrupt.
addonLocalError-4=#1 could not be installed because #3 cannot modify the needed file.
addonErrorIncompatible=#1 could not be installed because it is not compatible with #3 #4.
addonErrorBlocklisted=#1 could not be installed because it has a high risk of causing stability or security problems.

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

@ -12,3 +12,6 @@
<!ENTITY switchToNewTabs.label "When I open a link in a new tab, switch to it immediately">
<!ENTITY switchToNewTabs.accesskey "s">
<!ENTITY showTabsInTaskbar.label "Show tab previews in the Windows taskbar">
<!ENTITY showTabsInTaskbar.accesskey "k">

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

@ -15,6 +15,7 @@ testpilot.studiesWindow.unableToReachServer = Unable to reach Mozilla; please tr
testpilot.studiesWindow.thanksForContributing = Thanks for contributing!
testpilot.studiesWindow.finishedOn = Finished on %S
testpilot.studiesWindow.canceledStudy = (You canceled this study)
testpilot.studiesWindow.missedStudy = (You missed this study)
testpilot.studiesWindow.willStart = Will start on %S
testpilot.studiesWindow.gatheringData = Currently gathering data.
testpilot.studiesWindow.willFinish = Will finish on %S

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

@ -3,7 +3,8 @@ def test(mod, path, entity = None):
# ignore anyhting but Firefox
if mod not in ("netwerk", "dom", "toolkit", "security/manager",
"browser", "extensions/reporter", "extensions/spellcheck",
"other-licenses/branding/firefox"):
"other-licenses/branding/firefox",
"services/sync"):
return False
if mod != "browser" and mod != "extensions/spellcheck":
# we only have exceptions for browser and extensions/spellcheck

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

@ -60,20 +60,12 @@
-moz-padding-start: 2px;
}
.expander-up {
list-style-image: url("chrome://global/skin/arrow/arrow-up.gif");
.expander-up > .button-box {
-moz-appearance: button-arrow-up;
}
.expander-down {
list-style-image: url("chrome://global/skin/arrow/arrow-dn.gif");
}
.expander-down:hover:active {
list-style-image: url("chrome://global/skin/arrow/arrow-dn-hov.gif");
}
.expander-up:hover:active {
list-style-image: url("chrome://global/skin/arrow/arrow-up-hov.gif");
.expander-down > .button-box {
-moz-appearance: button-arrow-down;
}
#editBookmarkPanelContent {

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

@ -1362,10 +1362,7 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
width: 16px;
height: 16px;
list-style-image: url("chrome://global/skin/tree/item.png");
}
.tabbrowser-tab[pinned] > .tab-icon-image {
margin-top: 2px;
vertical-align: middle; /* for pinned tabs - those are display:block */
}
.tabbrowser-tab[busy] > .tab-icon-image {

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

@ -108,10 +108,8 @@
background-image: @toolbarbuttonInactiveBackgroundImage@;
}
#placesToolbar > toolbarbutton[disabled="true"] > .toolbarbutton-icon,
#placesToolbar > toolbarbutton > .toolbarbutton-icon:-moz-window-inactive,
#placesToolbar > toolbarbutton > .toolbarbutton-menu-dropmarker:-moz-window-inactive {
opacity: 0.5; /* remove the second and third selector when we support click-through (bug 392188) */
#placesToolbar > toolbarbutton[disabled="true"] > .toolbarbutton-icon {
opacity: 0.5;
}
#placesToolbar > toolbarbutton > .toolbarbutton-icon {
@ -175,12 +173,6 @@
-moz-image-region: rect(0px, 80px, 16px, 64px);
}
/* Search field */
#searchFilter:-moz-window-inactive {
opacity: 0.7; /* remove this when we support click-through (bug 392188) */
}
/* Root View */
#placesView {
border-top: 1px solid ThreeDDarkShadow;

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

@ -60,7 +60,6 @@ _DEFAULT_WEB_SERVER = "127.0.0.1"
_DEFAULT_HTTP_PORT = 8888
_DEFAULT_SSL_PORT = 4443
_DEFAULT_WEBSOCKET_PORT = 9988
_DEFAULT_WEBSOCKET_PROXY_PORT = 7777
#expand _DIST_BIN = __XPC_BIN_PATH__
#expand _IS_WIN32 = len("__WIN32__") != 0
@ -155,7 +154,6 @@ class Automation(object):
DEFAULT_HTTP_PORT = _DEFAULT_HTTP_PORT
DEFAULT_SSL_PORT = _DEFAULT_SSL_PORT
DEFAULT_WEBSOCKET_PORT = _DEFAULT_WEBSOCKET_PORT
DEFAULT_WEBSOCKET_PROXY_PORT = _DEFAULT_WEBSOCKET_PROXY_PORT
def __init__(self):
self.log = _log
@ -165,13 +163,11 @@ class Automation(object):
webServer = _DEFAULT_WEB_SERVER,
httpPort = _DEFAULT_HTTP_PORT,
sslPort = _DEFAULT_SSL_PORT,
webSocketPort = _DEFAULT_WEBSOCKET_PORT,
webSocketProxyPort = _DEFAULT_WEBSOCKET_PROXY_PORT):
webSocketPort = _DEFAULT_WEBSOCKET_PORT):
self.webServer = webServer
self.httpPort = httpPort
self.sslPort = sslPort
self.webSocketPort = webSocketPort
self.webSocketProxyPort = webSocketProxyPort
@property
def __all__(self):
@ -406,16 +402,13 @@ function FindProxyForURL(url, host)
return 'DIRECT';
if (isHttp)
return 'PROXY %(remote)s:%(httpport)s';
if (isHttps)
if (isHttps || isWebSocket)
return 'PROXY %(remote)s:%(sslport)s';
if (isWebSocket)
return 'PROXY %(remote)s:%(websocketproxyport)s';
return 'DIRECT';
}""" % { "origins": origins,
"remote": self.webServer,
"httpport":self.httpPort,
"sslport": self.sslPort,
"websocketproxyport": self.webSocketProxyPort }
"sslport": self.sslPort }
pacURL = "".join(pacURL.splitlines())
part += """
@ -462,8 +455,7 @@ user_pref("camino.use_system_proxy_settings", false); // Camino-only, harmless t
sslTunnelConfig.write("httpproxy:1\n")
sslTunnelConfig.write("certdbdir:%s\n" % certPath)
sslTunnelConfig.write("forward:127.0.0.1:%s\n" % self.httpPort)
sslTunnelConfig.write("proxy:%s:%s:%s\n" %
(self.webSocketProxyPort, self.webServer, self.webSocketPort))
sslTunnelConfig.write("websocketserver:%s:%s\n" % (self.webServer, self.webSocketPort))
sslTunnelConfig.write("listen:*:%s:pgo server certificate\n" % self.sslPort)
# Configure automatic certificate and bind custom certificates, client authentication

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

@ -109,10 +109,7 @@ class Expression:
rv = None
word_len = re.match('[0-9]*', self.content).end()
if word_len:
if self.content[0] == '0':
value = int(self.content[:word_len], 8)
else:
value = int(self.content[:word_len])
value = int(self.content[:word_len])
rv = Expression.__ASTLeaf('int', value)
else:
word_len = re.match('\w*', self.content).end()

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

@ -182,10 +182,7 @@ class Preprocessor:
# strip escaped string values
vals[1] = vals[1][1:-1]
elif numberValue.match(vals[1]):
if vals[1][0] == '0':
vals[1] = int(vals[1], 8)
else:
vals[1] = int(vals[1])
vals[1] = int(vals[1])
self.context[vals[0]] = vals[1]
def handleU(option, opt, value, parser):
del self.context[value]
@ -247,10 +244,7 @@ class Preprocessor:
if m.group('value'):
val = m.group('value')
try:
if val[0] == '0':
val = int(val, 8)
else:
val = int(val)
val = int(val)
except:
pass
self.context[m.group('name')] = val

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

@ -448,5 +448,47 @@ octal value is not equal
self.pp.do_include(f)
self.assertEqual(self.pp.out.getvalue(), "octal value is equal\n")
def test_value_quoted_expansion(self):
"""
Quoted values on the commandline don't currently have quotes stripped.
Pike says this is for compat reasons.
"""
f = NamedIO("value_quoted_expansion.in", """#filter substitution
@FOO@
""")
self.pp.handleCommandLine(['-DFOO="ABCD"'])
self.pp.do_include(f)
self.assertEqual(self.pp.out.getvalue(), '"ABCD"\n')
def test_octal_value_quoted_expansion(self):
f = NamedIO("value_quoted_expansion.in", """#filter substitution
@FOO@
""")
self.pp.handleCommandLine(['-DFOO="0100"'])
self.pp.do_include(f)
self.assertEqual(self.pp.out.getvalue(), '"0100"\n')
def test_number_value_not_equals_quoted_defines(self):
f = NamedIO("number_value_not_equals_quoted_defines.in", """#if FOO == 1000
number value is equal
#else
number value is not equal
#endif
""")
self.pp.handleCommandLine(['-DFOO="1000"'])
self.pp.do_include(f)
self.assertEqual(self.pp.out.getvalue(), "number value is not equal\n")
def test_octal_value_not_equals_quoted_defines(self):
f = NamedIO("octal_value_not_equals_quoted_defines.in", """#if FOO == 0100
octal value is equal
#else
octal value is not equal
#endif
""")
self.pp.handleCommandLine(['-DFOO="0100"'])
self.pp.do_include(f)
self.assertEqual(self.pp.out.getvalue(), "octal value is not equal\n")
if __name__ == '__main__':
unittest.main()

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

@ -6442,13 +6442,6 @@ if test -n "$MOZ_INSTALLER" -a "$OS_ARCH" = "WINNT"; then
fi
AC_MSG_RESULT([yes])
MAKENSISU="${CYGWIN_WRAPPER} $MAKENSISU"
# The Windows build for NSIS requires the iconv command line utility to
# convert the charset of the locale files.
MOZ_PATH_PROGS(HOST_ICONV, $HOST_ICONV "iconv", "")
if test -z "$HOST_ICONV"; then
AC_MSG_ERROR([To build the installer iconv is required in your path. To build without the installer reconfigure using --disable-installer.])
fi
fi
AC_SUBST(MOZ_INSTALLER)
@ -6896,6 +6889,14 @@ if test $MOZ_PLATFORM_MAEMO; then
fi
fi
if test $MOZ_PLATFORM_MAEMO = 6; then
PKG_CHECK_MODULES(LIBCONTENTACTION, contentaction-0.1, _LIB_FOUND=1, _LIB_FOUND=)
MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBCONTENTACTION_LIBS"
MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBCONTENTACTION_CFLAGS"
if test -z "$_LIB_FOUND"; then
AC_MSG_ERROR([libcontentaction is required when build for Maemo])
fi
fi
if test "$MOZ_PLATFORM_MAEMO" -gt 5; then
MOZ_THUMB2=1

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

@ -65,7 +65,6 @@ nsIRange.h \
nsIRangeUtils.h \
nsIScriptElement.h \
nsIStyleSheetLinkingElement.h \
nsIPrivateDOMImplementation.h \
nsIContentSerializer.h \
nsIHTMLToTextSink.h \
nsIXPathEvaluatorInternal.h \

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

@ -111,7 +111,6 @@ class nsIRunnable;
class nsIInterfaceRequestor;
template<class E> class nsCOMArray;
struct JSRuntime;
class nsICaseConversion;
class nsIUGenCategory;
class nsIWidget;
class nsIDragSession;
@ -615,11 +614,6 @@ public:
{
return sWordBreaker;
}
static nsICaseConversion* GetCaseConv()
{
return sCaseConv;
}
static nsIUGenCategory* GetGenCat()
{
@ -1741,7 +1735,6 @@ private:
static nsILineBreaker* sLineBreaker;
static nsIWordBreaker* sWordBreaker;
static nsICaseConversion* sCaseConv;
static nsIUGenCategory* sGenCat;
// Holds pointers to nsISupports* that should be released at shutdown

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

@ -98,7 +98,8 @@ public:
{
return !((0x0030 <= u && u <= 0x0039) ||
(0x0041 <= u && u <= 0x005A) ||
(0x0061 <= u && u <= 0x007A));
(0x0061 <= u && u <= 0x007A) ||
(0x000a == u));
}
static inline PRBool IsComplexChar(PRUnichar u)

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

@ -176,8 +176,8 @@ private:
Notification::Clear(); mFrom = nsnull; mTo = nsnull;
}
protected:
nsCOMPtr<Element> mFrom;
nsCOMPtr<Element> mTo;
nsRefPtr<Element> mFrom;
nsRefPtr<Element> mTo;
};
friend class ChangeNotification;
@ -206,7 +206,7 @@ private:
nsCOMPtr<nsIAtom> mWatchID;
nsCOMPtr<nsIDocument> mWatchDocument;
nsCOMPtr<Element> mElement;
nsRefPtr<Element> mElement;
nsRefPtr<Notification> mPendingNotification;
};

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

@ -146,7 +146,6 @@ static NS_DEFINE_CID(kXTFServiceCID, NS_XTFSERVICE_CID);
#include "nsIMEStateManager.h"
#include "nsContentErrors.h"
#include "nsUnicharUtilCIID.h"
#include "nsICaseConversion.h"
#include "nsCompressedCharMap.h"
#include "nsINativeKeyBindings.h"
#include "nsIDOMNSUIEvent.h"
@ -241,7 +240,6 @@ nsIContentPolicy *nsContentUtils::sContentPolicyService;
PRBool nsContentUtils::sTriedToGetContentPolicy = PR_FALSE;
nsILineBreaker *nsContentUtils::sLineBreaker;
nsIWordBreaker *nsContentUtils::sWordBreaker;
nsICaseConversion *nsContentUtils::sCaseConv;
nsIUGenCategory *nsContentUtils::sGenCat;
nsTArray<nsISupports**> *nsContentUtils::sPtrsToPtrsToRelease;
nsIScriptRuntime *nsContentUtils::sScriptRuntimes[NS_STID_ARRAY_UBOUND];
@ -403,9 +401,6 @@ nsContentUtils::Init()
rv = CallGetService(NS_WBRK_CONTRACTID, &sWordBreaker);
NS_ENSURE_SUCCESS(rv, rv);
rv = CallGetService(NS_UNICHARUTIL_CONTRACTID, &sCaseConv);
NS_ENSURE_SUCCESS(rv, rv);
rv = CallGetService(NS_UNICHARCATEGORY_CONTRACTID, &sGenCat);
NS_ENSURE_SUCCESS(rv, rv);
@ -1083,7 +1078,6 @@ nsContentUtils::Shutdown()
NS_IF_RELEASE(sIOService);
NS_IF_RELEASE(sLineBreaker);
NS_IF_RELEASE(sWordBreaker);
NS_IF_RELEASE(sCaseConv);
NS_IF_RELEASE(sGenCat);
#ifdef MOZ_XTF
NS_IF_RELEASE(sXTFService);

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

@ -118,7 +118,6 @@
#include "nsIScriptSecurityManager.h"
#include "nsIPrincipal.h"
#include "nsIPrivateDOMImplementation.h"
#include "nsIDOMWindowInternal.h"
#include "nsPIDOMWindow.h"
@ -1224,8 +1223,7 @@ nsDOMStyleSheetSetList::GetSets(nsTArray<nsString>& aStyleSets)
// =
// ==================================================================
class nsDOMImplementation : public nsIDOMDOMImplementation,
public nsIPrivateDOMImplementation
class nsDOMImplementation : public nsIDOMDOMImplementation
{
public:
nsDOMImplementation(nsIScriptGlobalObject* aScriptObject,
@ -1239,10 +1237,6 @@ public:
// nsIDOMDOMImplementation
NS_DECL_NSIDOMDOMIMPLEMENTATION
// nsIPrivateDOMImplementation
NS_IMETHOD Init(nsIURI* aDocumentURI, nsIURI* aBaseURI,
nsIPrincipal* aPrincipal);
protected:
nsWeakPtr mScriptObject;
nsCOMPtr<nsIURI> mDocumentURI;
@ -1284,7 +1278,6 @@ DOMCI_DATA(DOMImplementation, nsDOMImplementation)
// QueryInterface implementation for nsDOMImplementation
NS_INTERFACE_MAP_BEGIN(nsDOMImplementation)
NS_INTERFACE_MAP_ENTRY(nsIDOMDOMImplementation)
NS_INTERFACE_MAP_ENTRY(nsIPrivateDOMImplementation)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMDOMImplementation)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(DOMImplementation)
NS_INTERFACE_MAP_END
@ -1371,18 +1364,6 @@ nsDOMImplementation::CreateDocument(const nsAString& aNamespaceURI,
scriptHandlingObject, aReturn);
}
NS_IMETHODIMP
nsDOMImplementation::Init(nsIURI* aDocumentURI, nsIURI* aBaseURI,
nsIPrincipal* aPrincipal)
{
// Note: can't require that the args be non-null, since at least one
// caller (XMLHttpRequest) doesn't have decent args to pass in.
mDocumentURI = aDocumentURI;
mBaseURI = aBaseURI;
mPrincipal = aPrincipal;
return NS_OK;
}
// ==================================================================
// =
// ==================================================================

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

@ -2960,13 +2960,8 @@ nsGenericElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
UpdateEditableState();
// Now recurse into our kids
PRUint32 i;
// Don't call GetChildCount() here since that'll make XUL generate
// template children, which we're not in a consistent enough state for.
// Additionally, there's not really a need to generate the children here.
for (i = 0; i < mAttrsAndChildren.ChildCount(); ++i) {
// The child can remove itself from the parent in BindToTree.
nsCOMPtr<nsIContent> child = mAttrsAndChildren.ChildAt(i);
for (nsIContent* child = GetFirstChild(); child;
child = child->GetNextSibling()) {
rv = child->BindToTree(aDocument, this, aBindingParent,
aCompileEventHandlers);
NS_ENSURE_SUCCESS(rv, rv);

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

@ -377,6 +377,7 @@ GK_ATOM(fixedList, "Fixed-list")
GK_ATOM(flags, "flags")
GK_ATOM(flex, "flex")
GK_ATOM(flexgroup, "flexgroup")
GK_ATOM(floating, "floating")
GK_ATOM(floatList, "Float-list")
GK_ATOM(floor, "floor")
GK_ATOM(focus, "focus")

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

@ -50,8 +50,6 @@
#include "nsWeakReference.h"
#include "nsIDocument.h"
#include "nsIDOMDocument.h"
#include "nsIDOMDOMImplementation.h"
#include "nsIPrivateDOMImplementation.h"
#include "nsIScriptSecurityManager.h"
#include "nsContentUtils.h"
#include "nsThreadUtils.h"

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

@ -252,6 +252,7 @@ WebGLContext::SetDimensions(PRInt32 width, PRInt32 height)
// everything's good, we're done here
mWidth = width;
mHeight = height;
mResetLayer = PR_TRUE;
return NS_OK;
}
@ -319,11 +320,7 @@ WebGLContext::SetDimensions(PRInt32 width, PRInt32 height)
gl->fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, gl->GetOffscreenFBO());
gl->fViewport(0, 0, mWidth, mHeight);
gl->fClearColor(0.0f, 0.0f, 0.0f, 0.0f);
#ifdef USE_GLES2
gl->fClearDepthf(1.0f);
#else
gl->fClearDepth(1.0f);
#endif
gl->fClearStencil(0);
gl->fClear(LOCAL_GL_COLOR_BUFFER_BIT | LOCAL_GL_DEPTH_BUFFER_BIT | LOCAL_GL_STENCIL_BUFFER_BIT);

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

@ -526,11 +526,7 @@ WebGLContext::Clear(PRUint32 mask)
GL_SAME_METHOD_4(ClearColor, ClearColor, WebGLfloat, WebGLfloat, WebGLfloat, WebGLfloat)
#ifdef USE_GLES2
GL_SAME_METHOD_1(ClearDepthf, ClearDepth, WebGLfloat)
#else
GL_SAME_METHOD_1(ClearDepth, ClearDepth, WebGLfloat)
#endif
GL_SAME_METHOD_1(ClearStencil, ClearStencil, WebGLint)
@ -834,11 +830,7 @@ WebGLContext::DepthFunc(WebGLenum func)
GL_SAME_METHOD_1(DepthMask, DepthMask, WebGLboolean)
#ifdef USE_GLES2
GL_SAME_METHOD_2(DepthRangef, DepthRange, WebGLfloat, WebGLfloat)
#else
GL_SAME_METHOD_2(DepthRange, DepthRange, WebGLfloat, WebGLfloat)
#endif
NS_IMETHODIMP
WebGLContext::DisableVertexAttribArray(WebGLuint index)
@ -1342,18 +1334,18 @@ WebGLContext::GetParameter(PRUint32 pname, nsIVariant **retval)
case LOCAL_GL_MAX_VARYING_VECTORS:
{
#ifdef USE_GLES2
if (gl->IsGLES2()) {
GLint i = 0;
gl->fGetIntegerv(pname, &i);
wrval->SetAsInt32(i);
#else
} else {
// since this pname is absent from desktop OpenGL, we have to implement it by hand.
// The formula below comes from the public_webgl list, "problematic GetParameter pnames" thread
GLint i = 0, j = 0;
gl->fGetIntegerv(LOCAL_GL_MAX_VERTEX_OUTPUT_COMPONENTS, &i);
gl->fGetIntegerv(LOCAL_GL_MAX_FRAGMENT_INPUT_COMPONENTS, &j);
wrval->SetAsInt32(PR_MIN(i,j)/4);
#endif
}
}
break;
@ -2919,12 +2911,12 @@ WebGLContext::CompileShader(nsIWebGLShader *sobj)
resources.maxFragmentUniformVectors = mGLMaxFragmentUniformVectors;
resources.maxDrawBuffers = 1;
compiler = ShConstructCompiler(lang, debugFlags);
compiler = ShConstructCompiler(lang, EShSpecWebGL, &resources);
nsDependentCString src(shader->Source());
const char *s = src.get();
if (!ShCompile(compiler, &s, 1, EShOptNone, &resources, debugFlags)) {
if (!ShCompile(compiler, &s, 1, EShOptSimple, debugFlags)) {
shader->SetTranslationFailure(nsDependentCString(ShGetInfoLog(compiler)));
ShDestruct(compiler);
return NS_OK;

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

@ -407,20 +407,27 @@ WebGLContext::InitAndValidateGL()
gl->fGetIntegerv(LOCAL_GL_MAX_TEXTURE_IMAGE_UNITS, (GLint*) &mGLMaxTextureImageUnits);
gl->fGetIntegerv(LOCAL_GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, (GLint*) &mGLMaxVertexTextureImageUnits);
#ifdef USE_GLES2
gl->fGetIntegerv(LOCAL_GL_MAX_FRAGMENT_UNIFORM_VECTORS, (GLint*) &mGLMaxFragmentUniformVectors);
gl->fGetIntegerv(LOCAL_GL_MAX_VERTEX_UNIFORM_VECTORS, (GLint*) &mGLMaxVertexUniformVectors);
gl->fGetIntegerv(LOCAL_GL_MAX_VARYING_VECTORS, (GLint*) &mGLMaxVaryingVectors);
#else
gl->fGetIntegerv(LOCAL_GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, (GLint*) &mGLMaxFragmentUniformVectors);
mGLMaxFragmentUniformVectors /= 4;
gl->fGetIntegerv(LOCAL_GL_MAX_VERTEX_UNIFORM_COMPONENTS, (GLint*) &mGLMaxVertexUniformVectors);
mGLMaxVertexUniformVectors /= 4;
gl->fGetIntegerv(LOCAL_GL_MAX_VARYING_FLOATS, (GLint*) &mGLMaxVaryingVectors);
mGLMaxVaryingVectors /= 4;
#endif
if (gl->IsGLES2()) {
gl->fGetIntegerv(LOCAL_GL_MAX_FRAGMENT_UNIFORM_VECTORS, (GLint*) &mGLMaxFragmentUniformVectors);
gl->fGetIntegerv(LOCAL_GL_MAX_VERTEX_UNIFORM_VECTORS, (GLint*) &mGLMaxVertexUniformVectors);
gl->fGetIntegerv(LOCAL_GL_MAX_VARYING_VECTORS, (GLint*) &mGLMaxVaryingVectors);
} else {
gl->fGetIntegerv(LOCAL_GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, (GLint*) &mGLMaxFragmentUniformVectors);
mGLMaxFragmentUniformVectors /= 4;
gl->fGetIntegerv(LOCAL_GL_MAX_VERTEX_UNIFORM_COMPONENTS, (GLint*) &mGLMaxVertexUniformVectors);
mGLMaxVertexUniformVectors /= 4;
gl->fGetIntegerv(LOCAL_GL_MAX_VARYING_FLOATS, (GLint*) &mGLMaxVaryingVectors);
mGLMaxVaryingVectors /= 4;
}
#if 0
// Leaving this code in here, even though it's ifdef'd out, for
// when we support more than 1 color attachment.
gl->fGetIntegerv(LOCAL_GL_MAX_COLOR_ATTACHMENTS, (GLint*) &val);
#else
// Always 1 for GLES2
val = 1;
#endif
mFramebufferColorAttachments.SetLength(val);
#if defined(DEBUG_vladimir) && defined(USE_GLES2)
@ -431,11 +438,11 @@ WebGLContext::InitAndValidateGL()
fprintf(stderr, "GL_IMPLEMENTATION_COLOR_READ_TYPE: 0x%04x\n", val);
#endif
#ifndef USE_GLES2
// gl_PointSize is always available in ES2 GLSL, but has to be
// specifically enabled on desktop GLSL.
gl->fEnable(LOCAL_GL_VERTEX_PROGRAM_POINT_SIZE);
#endif
if (!gl->IsGLES2()) {
// gl_PointSize is always available in ES2 GLSL, but has to be
// specifically enabled on desktop GLSL.
gl->fEnable(LOCAL_GL_VERTEX_PROGRAM_POINT_SIZE);
}
#if !defined(USE_GLES2) && defined(USE_ANGLE)
// initialize shader translator

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

@ -3519,11 +3519,16 @@ nsCanvasRenderingContext2D::DrawImage(nsIDOMElement *imgElt, float a1,
mThebes->SetPattern(pattern);
DirtyAllStyles();
mThebes->Clip(clip);
/* Direct2D isn't very good at clipping so use Fill() when we can */
if (CurrentState().globalAlpha == 1.0f && mThebes->CurrentOperator() == gfxContext::OPERATOR_OVER) {
mThebes->Rectangle(clip);
mThebes->Fill();
} else {
/* we need to use to clip instead of fill for globalAlpha */
mThebes->Clip(clip);
mThebes->Paint(CurrentState().globalAlpha);
}
dirty = mThebes->UserToDevice(clip);
mThebes->Paint(CurrentState().globalAlpha);
}
#if 1

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

@ -53,10 +53,10 @@ class imgIContainer;
/*
* Event state manager interface.
*/
// {C224A806-A99F-4056-85C2-3B1970F94DB2}
// {92EDD580-062E-4471-ADEB-68329B0EC2E4}
#define NS_IEVENTSTATEMANAGER_IID \
{ 0xc224a806, 0xa99f, 0x4056, \
{ 0x85, 0xc2, 0x3b, 0x19, 0x70, 0xf9, 0x4d, 0xb2 } }
{ 0x92edd580, 0x062e, 0x4471, \
{ 0xad, 0xeb, 0x68, 0x32, 0x9b, 0x0e, 0xc2, 0xe4 } }
#define NS_EVENT_NEEDS_FRAME(event) (!NS_IS_ACTIVATION_EVENT(event))
@ -212,9 +212,9 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIEventStateManager, NS_IEVENTSTATEMANAGER_IID)
// Handler for the content has crashed
#define NS_EVENT_STATE_HANDLER_CRASHED \
0x08000000
(1 << 28)
// content has focus and should show a ring
#define NS_EVENT_STATE_FOCUSRING 0x10000000
#define NS_EVENT_STATE_FOCUSRING (1 << 29)
#endif // nsIEventStateManager_h__

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

@ -66,7 +66,7 @@
#include "nsIDOMHTMLAnchorElement.h"
#include "nsIDOMHTMLInputElement.h"
#include "nsIDOMNSHTMLInputElement.h"
#include "nsIDOMNSHTMLLabelElement.h"
#include "nsIDOMHTMLLabelElement.h"
#include "nsIDOMHTMLSelectElement.h"
#include "nsIDOMHTMLTextAreaElement.h"
#include "nsIDOMHTMLAreaElement.h"
@ -4019,7 +4019,7 @@ nsEventStateManager::GetEventTargetContent(nsEvent* aEvent,
static already_AddRefed<nsIContent>
GetLabelTarget(nsIContent* aLabel)
{
nsCOMPtr<nsIDOMNSHTMLLabelElement> label = do_QueryInterface(aLabel);
nsCOMPtr<nsIDOMHTMLLabelElement> label = do_QueryInterface(aLabel);
if (!label)
return nsnull;

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

@ -77,6 +77,7 @@ public:
JSObject* aObj, PRUint32 argc, jsval* argv);
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
virtual nsresult SetAcceptHeader(nsIHttpChannel* aChannel);
virtual nsXPCClassInfo* GetClassInfo();
};

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

@ -42,6 +42,7 @@
#include "nsGenericHTMLElement.h"
#include "nsMediaDecoder.h"
#include "nsIChannel.h"
#include "nsIHttpChannel.h"
#include "nsThreadUtils.h"
#include "nsIDOMRange.h"
#include "nsCycleCollectionParticipant.h"
@ -306,6 +307,13 @@ public:
PRBool GetPlayedOrSeeked() const { return mHasPlayedOrSeeked; }
nsresult CopyInnerTo(nsGenericElement* aDest) const;
/**
* Sets the Accept header on the HTTP channel to the required
* video or audio MIME types.
*/
virtual nsresult SetAcceptHeader(nsIHttpChannel* aChannel) = 0;
protected:
class MediaLoadListener;
class LoadNextSourceEvent;

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

@ -80,6 +80,8 @@ public:
// If there is no video frame, returns the given default size.
nsIntSize GetVideoSize(nsIntSize defaultSize);
virtual nsresult SetAcceptHeader(nsIHttpChannel* aChannel);
virtual nsXPCClassInfo* GetClassInfo();
};

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

@ -0,0 +1,28 @@
<!DOCTYPE html>
<style>
div { background: green; border: solid blue; width: 100px; height: 100px; }
</style>
<table border=1 width=50%>
<tr>
<td><div></div>left
</table>
<table border=1 width=50%>
<tr>
<td><div></div>justify
</table>
<table border=1 width=50%>
<tr>
<td style="text-align: -moz-right;"><div></div>right
</table>
<table border=1 width=50%>
<tr>
<td style="text-align: -moz-center;"><div></div>center
</table>
<table border=1 width=50%>
<tr>
<td style="text-align: -moz-center;"><div></div>middle
</table>
<table border=1 width=50%>
<tr>
<td style="text-align: center;"><div></div>absmiddle
</table>

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

@ -0,0 +1,28 @@
<!DOCTYPE html>
<style>
div { background: green; border: solid blue; width: 100px; height: 100px; }
</style>
<table border=1 width=50%>
<tr>
<td align=left><div></div>left
</table>
<table border=1 width=50%>
<tr>
<td align=justify><div></div>justify
</table>
<table border=1 width=50%>
<tr>
<td align=right><div></div>right
</table>
<table border=1 width=50%>
<tr>
<td align=center><div></div>center
</table>
<table border=1 width=50%>
<tr>
<td align=middle><div></div>middle
</table>
<table border=1 width=50%>
<tr>
<td align=absmiddle><div></div>absmiddle
</table>

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

@ -0,0 +1,27 @@
<style>
div { background: green; border: solid blue; width: 100px; height: 100px; }
</style>
<table border=1 width=50%>
<tr>
<td><div></div>left
</table>
<table border=1 width=50%>
<tr>
<td><div></div>justify
</table>
<table border=1 width=50%>
<tr>
<td style="text-align: -moz-right;"><div></div>right
</table>
<table border=1 width=50%>
<tr>
<td style="text-align: -moz-center;"><div></div>center
</table>
<table border=1 width=50%>
<tr>
<td style="text-align: -moz-center;"><div></div>middle
</table>
<table border=1 width=50%>
<tr>
<td style="text-align: center;"><div></div>absmiddle
</table>

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

@ -0,0 +1,27 @@
<style>
div { background: green; border: solid blue; width: 100px; height: 100px; }
</style>
<table border=1 width=50%>
<tr>
<td align=left><div></div>left
</table>
<table border=1 width=50%>
<tr>
<td align=justify><div></div>justify
</table>
<table border=1 width=50%>
<tr>
<td align=right><div></div>right
</table>
<table border=1 width=50%>
<tr>
<td align=center><div></div>center
</table>
<table border=1 width=50%>
<tr>
<td align=middle><div></div>middle
</table>
<table border=1 width=50%>
<tr>
<td align=absmiddle><div></div>absmiddle
</table>

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

@ -11,5 +11,7 @@
== 485377.html 485377-ref.html
== 557840.html 557840-ref.html
== 560059-video-dimensions.html 560059-video-dimensions-ref.html
== 573322-quirks.html 573322-quirks-ref.html
== 573322-no-quirks.html 573322-no-quirks-ref.html
== href-attr-change-restyles.html href-attr-change-restyles-ref.html
== figure.html figure-ref.html

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

@ -238,7 +238,7 @@ class nsGenericHTMLElementTearoff : public nsIDOMNSHTMLElement,
nsIDOMNSHTMLElement)
private:
nsCOMPtr<nsGenericHTMLElement> mElement;
nsRefPtr<nsGenericHTMLElement> mElement;
};
NS_IMPL_CYCLE_COLLECTION_1(nsGenericHTMLElementTearoff, mElement)
@ -1541,39 +1541,22 @@ nsGenericHTMLElement::ParseTableHAlignValue(const nsAString& aString,
//----------------------------------------
// These tables are used for TD,TH,TR, etc (but not TABLE)
// This table is used for td, th, tr, col, thead, tbody and tfoot.
static const nsAttrValue::EnumTable kTableCellHAlignTable[] = {
{ "left", NS_STYLE_TEXT_ALIGN_MOZ_LEFT },
{ "right", NS_STYLE_TEXT_ALIGN_MOZ_RIGHT },
{ "center", NS_STYLE_TEXT_ALIGN_MOZ_CENTER },
{ "char", NS_STYLE_TEXT_ALIGN_CHAR },
{ "justify",NS_STYLE_TEXT_ALIGN_JUSTIFY },
{ 0 }
};
static const nsAttrValue::EnumTable kCompatTableCellHAlignTable[] = {
{ "left", NS_STYLE_TEXT_ALIGN_MOZ_LEFT },
{ "right", NS_STYLE_TEXT_ALIGN_MOZ_RIGHT },
{ "center", NS_STYLE_TEXT_ALIGN_MOZ_CENTER },
{ "char", NS_STYLE_TEXT_ALIGN_CHAR },
{ "justify",NS_STYLE_TEXT_ALIGN_JUSTIFY },
// The following are non-standard but necessary for Nav4 compatibility
{ "middle", NS_STYLE_TEXT_ALIGN_MOZ_CENTER },
// allow center and absmiddle to map to NS_STYLE_TEXT_ALIGN_CENTER and
// NS_STYLE_TEXT_ALIGN_CENTER to map to center by using the following order
{ "center", NS_STYLE_TEXT_ALIGN_CENTER },
{ "absmiddle", NS_STYLE_TEXT_ALIGN_CENTER },
{ 0 }
};
PRBool
nsGenericHTMLElement::ParseTableCellHAlignValue(const nsAString& aString,
nsAttrValue& aResult) const
nsAttrValue& aResult)
{
if (InNavQuirksMode(GetOwnerDoc())) {
return aResult.ParseEnumValue(aString, kCompatTableCellHAlignTable, PR_FALSE);
}
return aResult.ParseEnumValue(aString, kTableCellHAlignTable, PR_FALSE);
}

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

@ -273,8 +273,8 @@ public:
* @param aResult the resulting HTMLValue
* @return whether the value was parsed
*/
PRBool ParseTableCellHAlignValue(const nsAString& aString,
nsAttrValue& aResult) const;
static PRBool ParseTableCellHAlignValue(const nsAString& aString,
nsAttrValue& aResult);
/**
* Convert a table valign string to value (left/right/center/char/justify/

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

@ -50,17 +50,11 @@
#include "nsPresContext.h"
#include "nsIEventStateManager.h"
// For GetText().
#include "nsIContentIterator.h"
#include "nsIDOMText.h"
#include "nsHTMLDNSPrefetch.h"
#include "Link.h"
using namespace mozilla::dom;
nsresult NS_NewPreContentIterator(nsIContentIterator** aInstancePtrResult);
class nsHTMLAnchorElement : public nsGenericHTMLElement,
public nsIDOMHTMLAnchorElement,
public nsIDOMNSHTMLAnchorElement2,
@ -68,6 +62,9 @@ class nsHTMLAnchorElement : public nsGenericHTMLElement,
public Link
{
public:
using nsGenericElement::GetText;
using nsGenericElement::SetText;
nsHTMLAnchorElement(already_AddRefed<nsINodeInfo> aNodeInfo);
virtual ~nsHTMLAnchorElement();
@ -369,38 +366,16 @@ IMPL_URI_PART(Hash)
NS_IMETHODIMP
nsHTMLAnchorElement::GetText(nsAString& aText)
{
aText.Truncate();
// Since this is a Netscape 4 proprietary attribute, we have to implement
// the same behavior. Basically it is returning the last text node of
// of the anchor. Returns an empty string if there is no text node.
// The nsIContentIterator does exactly what we want, if we start the
// iteration from the end.
nsCOMPtr<nsIContentIterator> iter;
nsresult rv = NS_NewPreContentIterator(getter_AddRefs(iter));
NS_ENSURE_SUCCESS(rv, rv);
// Initialize the content iterator with the children of the anchor
iter->Init(this);
// Last() positions the iterator to the last child of the anchor,
// starting at the deepest level of children, just like NS4 does.
iter->Last();
while (!iter->IsDone()) {
nsCOMPtr<nsIDOMText> textNode(do_QueryInterface(iter->GetCurrentNode()));
if(textNode) {
// The current node is a text node. Get its value and break the loop.
textNode->GetData(aText);
break;
}
iter->Prev();
}
nsContentUtils::GetNodeTextContent(this, PR_TRUE, aText);
return NS_OK;
}
NS_IMETHODIMP
nsHTMLAnchorElement::SetText(const nsAString& aText)
{
return nsContentUtils::SetNodeTextContent(this, aText, PR_FALSE);
}
NS_IMETHODIMP
nsHTMLAnchorElement::ToString(nsAString& aSource)
{

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

@ -36,7 +36,6 @@
*
* ***** END LICENSE BLOCK ***** */
#include "nsIDOMHTMLAreaElement.h"
#include "nsIDOMNSHTMLAreaElement2.h"
#include "nsIDOMEventTarget.h"
#include "nsGenericHTMLElement.h"
#include "nsILink.h"
@ -53,7 +52,6 @@ using namespace mozilla::dom;
class nsHTMLAreaElement : public nsGenericHTMLElement,
public nsIDOMHTMLAreaElement,
public nsIDOMNSHTMLAreaElement2,
public nsILink,
public Link
{
@ -76,12 +74,6 @@ public:
// nsIDOMHTMLAreaElement
NS_DECL_NSIDOMHTMLAREAELEMENT
// nsIDOMNSHTMLAreaElement
NS_DECL_NSIDOMNSHTMLAREAELEMENT
// nsIDOMNSHTMLAreaElement2
NS_DECL_NSIDOMNSHTMLAREAELEMENT2
// nsILink
NS_IMETHOD LinkAdded() { return NS_OK; }
NS_IMETHOD LinkRemoved() { return NS_OK; }
@ -136,10 +128,8 @@ DOMCI_NODE_DATA(HTMLAreaElement, nsHTMLAreaElement)
// QueryInterface implementation for nsHTMLAreaElement
NS_INTERFACE_TABLE_HEAD(nsHTMLAreaElement)
NS_HTML_CONTENT_INTERFACE_TABLE5(nsHTMLAreaElement,
NS_HTML_CONTENT_INTERFACE_TABLE3(nsHTMLAreaElement,
nsIDOMHTMLAreaElement,
nsIDOMNSHTMLAreaElement,
nsIDOMNSHTMLAreaElement2,
nsILink,
Link)
NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLAreaElement,

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

@ -146,3 +146,27 @@ nsHTMLAudioElement::Initialize(nsISupports* aOwner, JSContext* aContext,
return NS_OK;
}
nsresult nsHTMLAudioElement::SetAcceptHeader(nsIHttpChannel* aChannel)
{
nsCAutoString value(
#ifdef MOZ_WEBM
"audio/webm,"
#endif
#ifdef MOZ_OGG
"audio/ogg,"
#endif
#ifdef MOZ_WAVE
"audio/wav,"
#endif
"audio/*;q=0.9,"
#ifdef MOZ_OGG
"application/ogg;q=0.7,"
#endif
"video/*;q=0.6,*/*;q=0.5");
return aChannel->SetRequestHeader(NS_LITERAL_CSTRING("Accept"),
value,
PR_FALSE);
}

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

@ -35,7 +35,6 @@
*
* ***** END LICENSE BLOCK ***** */
#include "nsIDOMHTMLButtonElement.h"
#include "nsIDOMNSHTMLButtonElement.h"
#include "nsIDOMHTMLFormElement.h"
#include "nsIDOMEventTarget.h"
#include "nsGenericHTMLElement.h"
@ -77,8 +76,7 @@ static const nsAttrValue::EnumTable kButtonTypeTable[] = {
static const nsAttrValue::EnumTable* kButtonDefaultType = &kButtonTypeTable[2];
class nsHTMLButtonElement : public nsGenericHTMLFormElement,
public nsIDOMHTMLButtonElement,
public nsIDOMNSHTMLButtonElement
public nsIDOMHTMLButtonElement
{
public:
nsHTMLButtonElement(already_AddRefed<nsINodeInfo> aNodeInfo);
@ -99,16 +97,6 @@ public:
// nsIDOMHTMLButtonElement
NS_DECL_NSIDOMHTMLBUTTONELEMENT
// nsIDOMNSHTMLButtonElement
// Can't just use the macro, since it shares GetType with
// nsIDOMHTMLButtonElement
NS_IMETHOD Blur();
NS_IMETHOD Focus();
NS_IMETHOD Click();
NS_IMETHOD SetType(const nsAString& aType);
NS_IMETHOD GetAutofocus(PRBool* aAutofocus);
NS_IMETHOD SetAutofocus(PRBool aAutofocus);
// overriden nsIFormControl methods
NS_IMETHOD_(PRUint32) GetType() const { return mType; }
NS_IMETHOD Reset();
@ -187,9 +175,8 @@ DOMCI_NODE_DATA(HTMLButtonElement, nsHTMLButtonElement)
// QueryInterface implementation for nsHTMLButtonElement
NS_INTERFACE_TABLE_HEAD(nsHTMLButtonElement)
NS_HTML_CONTENT_INTERFACE_TABLE2(nsHTMLButtonElement,
nsIDOMHTMLButtonElement,
nsIDOMNSHTMLButtonElement)
NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLButtonElement,
nsIDOMHTMLButtonElement)
NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLButtonElement,
nsGenericHTMLFormElement)
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLButtonElement)

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

@ -36,7 +36,6 @@
* ***** END LICENSE BLOCK ***** */
#include "nsCOMPtr.h"
#include "nsIDOMHTMLLabelElement.h"
#include "nsIDOMNSHTMLLabelElement.h"
#include "nsIDOMHTMLFormElement.h"
#include "nsIDOMEventTarget.h"
#include "nsGenericHTMLElement.h"
@ -54,8 +53,7 @@
#include "nsFocusManager.h"
class nsHTMLLabelElement : public nsGenericHTMLFormElement,
public nsIDOMHTMLLabelElement,
public nsIDOMNSHTMLLabelElement
public nsIDOMHTMLLabelElement
{
public:
nsHTMLLabelElement(already_AddRefed<nsINodeInfo> aNodeInfo);
@ -76,9 +74,6 @@ public:
// nsIDOMHTMLLabelElement
NS_DECL_NSIDOMHTMLLABELELEMENT
// nsIDOMNSHTMLLabelElement
NS_DECL_NSIDOMNSHTMLLABELELEMENT
// nsIFormControl
NS_IMETHOD_(PRUint32) GetType() const { return NS_FORM_LABEL; }
NS_IMETHOD Reset();
@ -146,9 +141,8 @@ DOMCI_NODE_DATA(HTMLLabelElement, nsHTMLLabelElement)
// QueryInterface implementation for nsHTMLLabelElement
NS_INTERFACE_TABLE_HEAD(nsHTMLLabelElement)
NS_HTML_CONTENT_INTERFACE_TABLE2(nsHTMLLabelElement,
nsIDOMHTMLLabelElement,
nsIDOMNSHTMLLabelElement)
NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLLabelElement,
nsIDOMHTMLLabelElement)
NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLLabelElement,
nsGenericHTMLFormElement)
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLLabelElement)

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

@ -739,6 +739,9 @@ nsresult nsHTMLMediaElement::LoadResource(nsIURI* aURI)
hc->SetRequestHeader(NS_LITERAL_CSTRING("Range"),
NS_LITERAL_CSTRING("bytes=0-"),
PR_FALSE);
// Send Accept header for video and audio types only (Bug 489071)
SetAcceptHeader(hc);
}
rv = mChannel->AsyncOpen(listener, nsnull);

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

@ -38,7 +38,6 @@
*
* ***** END LICENSE BLOCK ***** */
#include "nsIDOMNSHTMLOptionElement.h"
#include "nsHTMLOptionElement.h"
#include "nsIDOMHTMLOptGroupElement.h"
#include "nsIDOMHTMLFormElement.h"
@ -117,9 +116,8 @@ DOMCI_NODE_DATA(HTMLOptionElement, nsHTMLOptionElement)
// QueryInterface implementation for nsHTMLOptionElement
NS_INTERFACE_TABLE_HEAD(nsHTMLOptionElement)
NS_HTML_CONTENT_INTERFACE_TABLE3(nsHTMLOptionElement,
NS_HTML_CONTENT_INTERFACE_TABLE2(nsHTMLOptionElement,
nsIDOMHTMLOptionElement,
nsIDOMNSHTMLOptionElement,
nsIJSNativeInitializer)
NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLOptionElement,
nsGenericHTMLElement)

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

@ -43,12 +43,10 @@
#include "nsGenericHTMLElement.h"
#include "nsIDOMHTMLOptionElement.h"
#include "nsIDOMNSHTMLOptionElement.h"
#include "nsIJSNativeInitializer.h"
class nsHTMLOptionElement : public nsGenericHTMLElement,
public nsIDOMHTMLOptionElement,
public nsIDOMNSHTMLOptionElement,
public nsIJSNativeInitializer
{
public:
@ -78,9 +76,6 @@ public:
// nsIDOMHTMLOptionElement
NS_DECL_NSIDOMHTMLOPTIONELEMENT
// nsIDOMNSHTMLOptionElement
NS_IMETHOD SetText(const nsAString & aText);
// nsIJSNativeInitializer
NS_IMETHOD Initialize(nsISupports* aOwner, JSContext* aContext,
JSObject *aObj, PRUint32 argc, jsval *argv);

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

@ -36,7 +36,6 @@
*
* ***** END LICENSE BLOCK ***** */
#include "nsIDOMHTMLScriptElement.h"
#include "nsIDOMNSHTMLScriptElement.h"
#include "nsIDOMEventTarget.h"
#include "nsGenericHTMLElement.h"
#include "nsGkAtoms.h"
@ -305,7 +304,6 @@ nsHTMLScriptEventHandler::Invoke(nsISupports *aTargetObject,
class nsHTMLScriptElement : public nsGenericHTMLElement,
public nsIDOMHTMLScriptElement,
public nsIDOMNSHTMLScriptElement,
public nsScriptElement
{
public:
@ -326,7 +324,6 @@ public:
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
NS_DECL_NSIDOMHTMLSCRIPTELEMENT
NS_DECL_NSIDOMNSHTMLSCRIPTELEMENT
// nsIScriptElement
virtual void GetScriptType(nsAString& type);
@ -383,11 +380,10 @@ DOMCI_NODE_DATA(HTMLScriptElement, nsHTMLScriptElement)
// QueryInterface implementation for nsHTMLScriptElement
NS_INTERFACE_TABLE_HEAD(nsHTMLScriptElement)
NS_HTML_CONTENT_INTERFACE_TABLE5(nsHTMLScriptElement,
NS_HTML_CONTENT_INTERFACE_TABLE4(nsHTMLScriptElement,
nsIDOMHTMLScriptElement,
nsIScriptLoaderObserver,
nsIScriptElement,
nsIDOMNSHTMLScriptElement,
nsIMutationObserver)
NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLScriptElement,
nsGenericHTMLElement)

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

@ -181,9 +181,8 @@ DOMCI_NODE_DATA(HTMLSelectElement, nsHTMLSelectElement)
// QueryInterface implementation for nsHTMLSelectElement
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLSelectElement)
NS_HTML_CONTENT_INTERFACE_TABLE3(nsHTMLSelectElement,
NS_HTML_CONTENT_INTERFACE_TABLE2(nsHTMLSelectElement,
nsIDOMHTMLSelectElement,
nsIDOMNSHTMLSelectElement,
nsISelectElement)
NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLSelectElement,
nsGenericHTMLFormElement)
@ -797,8 +796,8 @@ nsHTMLSelectElement::GetOptionIndex(nsIDOMHTMLOptionElement* aOption,
PRInt32 aStartIndex, PRBool aForward,
PRInt32* aIndex)
{
nsCOMPtr<Element> option = do_QueryInterface(aOption);
return mOptions->GetOptionIndex(option, aStartIndex, aForward, aIndex);
nsCOMPtr<nsINode> option = do_QueryInterface(aOption);
return mOptions->GetOptionIndex(option->AsElement(), aStartIndex, aForward, aIndex);
}
PRBool

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

@ -45,7 +45,6 @@
#include "nsGenericHTMLElement.h"
#include "nsISelectElement.h"
#include "nsIDOMHTMLSelectElement.h"
#include "nsIDOMNSHTMLSelectElement.h"
#include "nsIDOMHTMLFormElement.h"
#include "nsIDOMHTMLOptionElement.h"
#include "nsIDOMHTMLOptionsCollection.h"
@ -237,7 +236,6 @@ private:
*/
class nsHTMLSelectElement : public nsGenericHTMLFormElement,
public nsIDOMHTMLSelectElement,
public nsIDOMNSHTMLSelectElement,
public nsISelectElement
{
public:
@ -260,9 +258,6 @@ public:
// nsIDOMHTMLSelectElement
NS_DECL_NSIDOMHTMLSELECTELEMENT
// nsIDOMNSHTMLSelectElement
NS_DECL_NSIDOMNSHTMLSELECTELEMENT
// nsIContent
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor);

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

@ -160,4 +160,24 @@ nsHTMLVideoElement::GetAttributeMappingFunction() const
return &MapAttributesIntoRule;
}
nsresult nsHTMLVideoElement::SetAcceptHeader(nsIHttpChannel* aChannel)
{
nsCAutoString value(
#ifdef MOZ_WEBM
"video/webm,"
#endif
#ifdef MOZ_OGG
"video/ogg,"
#endif
"video/*;q=0.9,"
#ifdef MOZ_OGG
"application/ogg;q=0.7,"
#endif
"audio/*;q=0.6,*/*;q=0.5");
return aChannel->SetRequestHeader(NS_LITERAL_CSTRING("Accept"),
value,
PR_FALSE);
}
NS_IMPL_URI_ATTR(nsHTMLVideoElement, Poster, poster)

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

@ -144,6 +144,7 @@ _TEST_FILES = test_bug589.html \
test_bug347174_xslp.html \
347174transformable.xml \
347174transform.xsl \
test_a_text.html \
test_anchor_href_cache_invalidation.html \
test_bug481335.xhtml \
test_bug500885.html \

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

@ -0,0 +1,45 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test for a.text</title>
<script src="/MochiKit/packed.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
<link rel="help" href="http://www.whatwg.org/html/#dom-a-text"/>
</head>
<body>
<div id="content">
<a href="a">a b c</a>
<a href="b">a <!--b--> c</a>
<a href="c">a <b>b</b> c</a>
</div>
<pre id="test">
<script>
var d = document.getElementById("content")
.appendChild(document.createElement("a"));
d.href = "d";
d.appendChild(document.createTextNode("a "));
d.appendChild(document.createTextNode("b "));
d.appendChild(document.createTextNode("c "));
var expected = ["a b c", "a c", "a b c", "a b c "];
var list = document.getElementById("content").getElementsByTagName("a");
for (var i = 0, il = list.length; i < il; ++i) {
is(list[i].text, list[i].textContent);
is(list[i].text, expected[i]);
list[i].text = "x";
is(list[i].text, "x");
is(list[i].textContent, "x");
is(list[i].firstChild.data, "x");
is(list[i].childNodes.length, 1);
list[i].textContent = "y";
is(list[i].text, "y");
is(list[i].textContent, "y");
is(list[i].firstChild.data, "y");
is(list[i].childNodes.length, 1);
}
</script>
</pre>
</body>
</html>

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

@ -117,7 +117,7 @@ HTML_TAG("abbr", ""); // HTMLElement
HTML_TAG("acronym", ""); // HTMLElement
HTML_TAG("address", ""); // HTMLElement
HTML_TAG("applet", "Applet", [], objectIfaces);
HTML_TAG("area", "Area", [ "nsIDOMNSHTMLAreaElement2" ]);
HTML_TAG("area", "Area");
HTML_TAG("article", ""); // HTMLElement
HTML_TAG("aside", ""); // HTMLElement
HTML_TAG("b", ""); // HTMLElement

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

@ -468,6 +468,14 @@ void nsMediaChannelStream::SetupChannelHeaders()
rangeString.AppendInt(mOffset);
rangeString.Append("-");
hc->SetRequestHeader(NS_LITERAL_CSTRING("Range"), rangeString, PR_FALSE);
// Send Accept header for video and audio types only (Bug 489071)
NS_ASSERTION(NS_IsMainThread(), "Don't call on non-main thread");
nsHTMLMediaElement* element = mDecoder->GetMediaElement();
if (!element) {
return;
}
element->SetAcceptHeader(hc);
} else {
NS_ASSERTION(mOffset == 0, "Don't know how to seek on this channel type");
}

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

@ -393,6 +393,7 @@ protected:
// if possible. Main thread only.
nsresult OpenChannel(nsIStreamListener** aStreamListener);
nsresult RecreateChannel();
// Add headers to HTTP request. Main thread only.
void SetupChannelHeaders();
// Closes the channel. Main thread only.
void CloseChannel();

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

@ -2439,7 +2439,7 @@ nsXULDocument::PrepareToWalk()
// Do one-time initialization if we're preparing to walk the
// master document's prototype.
nsCOMPtr<Element> root;
nsRefPtr<Element> root;
if (mState == eState_Master) {
// Add the root element
@ -2930,7 +2930,7 @@ nsXULDocument::ResumeWalk()
nsXULPrototypeElement* protoele =
static_cast<nsXULPrototypeElement*>(childproto);
nsCOMPtr<Element> child;
nsRefPtr<Element> child;
if (!processingOverlayHookupNodes) {
rv = CreateElementFromPrototype(protoele,
@ -3680,7 +3680,7 @@ nsXULDocument::CreateElementFromPrototype(nsXULPrototypeElement* aPrototype,
}
#endif
nsCOMPtr<Element> result;
nsRefPtr<Element> result;
if (aPrototype->mNodeInfo->NamespaceEquals(kNameSpaceID_XUL)) {
// If it's a XUL element, it'll be lightweight until somebody
@ -3728,7 +3728,7 @@ nsXULDocument::CreateOverlayElement(nsXULPrototypeElement* aPrototype,
{
nsresult rv;
nsCOMPtr<Element> element;
nsRefPtr<Element> element;
rv = CreateElementFromPrototype(aPrototype, getter_AddRefs(element));
if (NS_FAILED(rv)) return rv;

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

@ -492,7 +492,7 @@ protected:
{
protected:
nsXULDocument* mDocument; // [WEAK]
nsCOMPtr<mozilla::dom::Element> mObservesElement; // [OWNER]
nsRefPtr<mozilla::dom::Element> mObservesElement; // [OWNER]
PRBool mResolved;
public:

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

@ -90,6 +90,7 @@
#include "nsILocale.h"
#include "nsILocaleService.h"
#include "nsIConsoleService.h"
#include "nsEscape.h"
static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
@ -335,6 +336,20 @@ nsXULContentUtils::MakeElementURI(nsIDocument* aDocument,
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIURL> mutableURL(do_QueryInterface(docURIClone));
if (!mutableURL) {
nsCString uri;
rv = docURL->GetSpec(aURI);
NS_ENSURE_SUCCESS(rv, rv);
nsCAutoString ref;
NS_EscapeURL(NS_ConvertUTF16toUTF8(aElementID), esc_FilePath | esc_AlwaysCopy, ref);
aURI.Append('#');
aURI.Append(ref);
return NS_OK;
}
NS_ENSURE_TRUE(mutableURL, NS_ERROR_NOT_AVAILABLE);
rv = mutableURL->SetRef(NS_ConvertUTF16toUTF8(aElementID));
@ -381,6 +396,19 @@ nsXULContentUtils::MakeElementID(nsIDocument* aDocument,
url->GetRef(ref);
CopyUTF8toUTF16(ref, aElementID);
} else {
const char* start = aURI.BeginReading();
const char* end = aURI.EndReading();
const char* chr = end;
while (--chr >= start) {
if (*chr == '#') {
nsDependentCSubstring ref = Substring(chr + 1, end);
nsCAutoString unescaped;
CopyUTF8toUTF16(NS_UnescapeURL(ref, esc_FilePath, unescaped), aElementID);
return NS_OK;
}
}
aElementID.Truncate();
}

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

@ -64,7 +64,6 @@
#include "nsIDOMNode.h"
#include "nsIDOMDocument.h"
#include "nsIDOMXMLDocument.h"
#include "nsIPrivateDOMImplementation.h"
#include "nsIDOMXULElement.h"
#include "nsIDocument.h"
#include "nsBindingManager.h"

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

@ -52,7 +52,7 @@ namespace mozilla {
}
#define IHISTORY_IID \
{0x6f736049, 0x6370, 0x4376, {0xb7, 0x17, 0xfa, 0xfc, 0x0b, 0x4f, 0xd0, 0xf1}}
{0x6f733924, 0x6321, 0x4384, {0x01, 0xee, 0x8e, 0x7d, 0xfb, 0xde, 0xe7, 0xa8}}
class IHistory : public nsISupports
{
@ -71,7 +71,7 @@ public:
* UnregisterVisitedCallback.
*
* @pre aURI must not be null.
* @pre aLink must not be null.
* @pre aLink may be null only in the MOZ_IPC parent process.
*
* @param aURI
* The URI to check.

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

@ -177,7 +177,7 @@ function xpcGetFramesByName(name) {
function xpcCleanupWindows() {
xpcEnumerateContentWindows(function(win) {
if (win.location.protocol == "data:")
if (win.location && win.location.protocol == "data:")
win.close();
});
}

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

@ -154,7 +154,6 @@
// HTMLOptionsCollection includes
#include "nsIDOMHTMLOptionElement.h"
#include "nsIDOMNSHTMLOptionElement.h"
#include "nsIDOMHTMLOptionsCollection.h"
#include "nsIDOMNSHTMLOptionCollectn.h"
@ -254,12 +253,10 @@
#include "nsIDOMNSHTMLAnchorElement2.h"
#include "nsIDOMHTMLAppletElement.h"
#include "nsIDOMHTMLAreaElement.h"
#include "nsIDOMNSHTMLAreaElement2.h"
#include "nsIDOMHTMLBRElement.h"
#include "nsIDOMHTMLBaseElement.h"
#include "nsIDOMHTMLBodyElement.h"
#include "nsIDOMHTMLButtonElement.h"
#include "nsIDOMNSHTMLButtonElement.h"
#include "nsIDOMHTMLCanvasElement.h"
#include "nsIDOMHTMLDListElement.h"
#include "nsIDOMHTMLDirectoryElement.h"
@ -284,7 +281,6 @@
#include "nsIDOMHTMLIsIndexElement.h"
#include "nsIDOMHTMLLIElement.h"
#include "nsIDOMHTMLLabelElement.h"
#include "nsIDOMNSHTMLLabelElement.h"
#include "nsIDOMHTMLLegendElement.h"
#include "nsIDOMHTMLLinkElement.h"
#include "nsIDOMHTMLMapElement.h"
@ -300,8 +296,6 @@
#include "nsIDOMHTMLPreElement.h"
#include "nsIDOMHTMLQuoteElement.h"
#include "nsIDOMHTMLScriptElement.h"
#include "nsIDOMNSHTMLScriptElement.h"
#include "nsIDOMNSHTMLSelectElement.h"
#include "nsIDOMHTMLStyleElement.h"
#include "nsIDOMHTMLTableCaptionElem.h"
#include "nsIDOMHTMLTableCellElement.h"
@ -2442,8 +2436,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_BEGIN(HTMLAreaElement, nsIDOMHTMLAreaElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLAreaElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSHTMLAreaElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSHTMLAreaElement2)
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
@ -2464,7 +2456,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_BEGIN(HTMLButtonElement, nsIDOMHTMLButtonElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLButtonElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSHTMLButtonElement)
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
@ -2582,7 +2573,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_BEGIN(HTMLLabelElement, nsIDOMHTMLLabelElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLLabelElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSHTMLLabelElement)
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
@ -2631,9 +2621,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(HTMLOptionElement, nsIDOMHTMLOptionElement)
// Order is significant. nsIDOMNSHTMLOptionElement.text shdaows
// nsIDOMHTMLOptionElement.text, which is readonly.
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSHTMLOptionElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLOptionElement)
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
@ -2665,13 +2652,11 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_BEGIN(HTMLScriptElement, nsIDOMHTMLScriptElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLScriptElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSHTMLScriptElement)
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(HTMLSelectElement, nsIDOMHTMLSelectElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLSelectElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSHTMLSelectElement)
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
DOM_CLASSINFO_MAP_END

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

@ -1074,6 +1074,18 @@ nsDOMWindowUtils::SendQueryContentEvent(PRUint32 aType,
return NS_ERROR_DOM_SECURITY_ERR;
}
NS_ENSURE_TRUE(mWindow, NS_ERROR_FAILURE);
nsIDocShell *docShell = mWindow->GetDocShell();
NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE);
nsCOMPtr<nsIPresShell> presShell;
docShell->GetPresShell(getter_AddRefs(presShell));
NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
nsPresContext* presContext = presShell->GetPresContext();
NS_ENSURE_TRUE(presContext, NS_ERROR_FAILURE);
// get the widget to send the event to
nsCOMPtr<nsIWidget> widget = GetWidget();
if (!widget) {
@ -1097,7 +1109,7 @@ nsDOMWindowUtils::SendQueryContentEvent(PRUint32 aType,
nsQueryContentEvent dummyEvent(PR_TRUE, NS_QUERY_CONTENT_STATE, widget);
InitEvent(dummyEvent, &pt);
nsIFrame* popupFrame =
nsLayoutUtils::GetPopupFrameForEventCoordinates(&dummyEvent);
nsLayoutUtils::GetPopupFrameForEventCoordinates(presContext->GetRootPresContext(), &dummyEvent);
nsIntRect widgetBounds;
nsresult rv = widget->GetClientBounds(widgetBounds);

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

@ -96,6 +96,7 @@
finishTest();
yield;
}
SimpleTest.requestLongerTimeout(5); // see bug 580875
</script>
<script type="text/javascript;version=1.7" src="helpers.js"></script>

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

@ -118,9 +118,6 @@ XPIDLSRCS = \
nsIDOMHTMLCanvasElement.idl \
nsIDOMNSHTMLAnchorElement.idl \
nsIDOMNSHTMLAnchorElement2.idl \
nsIDOMNSHTMLAreaElement.idl \
nsIDOMNSHTMLAreaElement2.idl \
nsIDOMNSHTMLButtonElement.idl \
nsIDOMNSHTMLDocument.idl \
nsIDOMNSHTMLElement.idl \
nsIDOMNSHTMLFormElement.idl \
@ -128,12 +125,8 @@ XPIDLSRCS = \
nsIDOMNSHTMLHRElement.idl \
nsIDOMNSHTMLImageElement.idl \
nsIDOMNSHTMLInputElement.idl \
nsIDOMNSHTMLLabelElement.idl \
nsIDOMNSHTMLOptionCollectn.idl \
nsIDOMNSHTMLOptionElement.idl \
nsIDOMNSHTMLSelectElement.idl \
nsIDOMNSHTMLTextAreaElement.idl \
nsIDOMNSHTMLScriptElement.idl \
$(NULL)
include $(topsrcdir)/config/rules.mk

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

@ -47,15 +47,30 @@
* http://www.w3.org/TR/DOM-Level-2-HTML/
*/
[scriptable, uuid(a6cf90b0-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(fca7d30d-c834-470d-9bb2-25eddfedd86b)]
interface nsIDOMHTMLAreaElement : nsIDOMHTMLElement
{
attribute DOMString accessKey;
attribute DOMString alt;
attribute DOMString coords;
attribute DOMString href;
attribute boolean noHref;
attribute DOMString shape;
attribute long tabIndex;
attribute DOMString href;
attribute DOMString target;
attribute DOMString ping;
// URL decomposition IDL attributes
attribute DOMString protocol;
attribute DOMString host;
attribute DOMString hostname;
attribute DOMString port;
attribute DOMString pathname;
attribute DOMString search;
attribute DOMString hash;
attribute DOMString accessKey;
attribute long tabIndex;
attribute boolean noHref;
DOMString toString();
};

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

@ -47,17 +47,22 @@
* http://www.w3.org/TR/DOM-Level-2-HTML/
*/
[scriptable, uuid(a6cf9095-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(dfed25e8-07e8-41a9-8f9e-9fbf59c539ea)]
interface nsIDOMHTMLButtonElement : nsIDOMHTMLElement
{
readonly attribute nsIDOMHTMLFormElement form;
attribute DOMString accessKey;
attribute boolean autofocus;
attribute boolean disabled;
readonly attribute nsIDOMHTMLFormElement form;
attribute DOMString name;
attribute long tabIndex;
// The scriptable version of type is writable and lives on
// nsIDOMNSHTMLButtonElement (have to do it this way because this
// interface is frozen and we don't want to break binary compat).
[noscript] readonly attribute DOMString type;
attribute DOMString type;
attribute DOMString value;
attribute DOMString accessKey;
attribute long tabIndex;
void blur();
void focus();
void click();
};

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

@ -47,10 +47,12 @@
* http://www.w3.org/TR/DOM-Level-2-HTML/
*/
[scriptable, uuid(a6cf9096-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(8a207452-e725-4a9e-beb6-9e0c0a65012c)]
interface nsIDOMHTMLLabelElement : nsIDOMHTMLElement
{
readonly attribute nsIDOMHTMLFormElement form;
attribute DOMString accessKey;
attribute DOMString htmlFor;
readonly attribute nsIDOMHTMLElement control;
attribute DOMString accessKey;
};

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

@ -47,17 +47,16 @@
* http://www.w3.org/TR/DOM-Level-2-HTML/
*/
[scriptable, uuid(a6cf9092-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(611d00f5-1eb8-4571-b995-2a2019d2d11c)]
interface nsIDOMHTMLOptionElement : nsIDOMHTMLElement
{
readonly attribute nsIDOMHTMLFormElement form;
// Modified in DOM Level 2:
attribute boolean defaultSelected;
readonly attribute DOMString text;
// Modified in DOM Level 2:
readonly attribute long index;
attribute boolean disabled;
readonly attribute nsIDOMHTMLFormElement form;
attribute DOMString label;
attribute boolean defaultSelected;
attribute boolean selected;
attribute DOMString value;
attribute DOMString text;
readonly attribute long index;
};

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

@ -47,14 +47,16 @@
* http://www.w3.org/TR/DOM-Level-2-HTML/
*/
[scriptable, uuid(a6cf90b1-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(4af8568c-375c-42fd-a82f-b25a7c03fc3e)]
interface nsIDOMHTMLScriptElement : nsIDOMHTMLElement
{
attribute DOMString src;
attribute boolean async;
attribute boolean defer;
attribute DOMString type;
attribute DOMString charset;
attribute DOMString text;
attribute DOMString htmlFor;
attribute DOMString event;
attribute DOMString charset;
attribute boolean defer;
attribute DOMString src;
attribute DOMString type;
};

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

@ -48,28 +48,31 @@
* http://www.w3.org/TR/DOM-Level-2-HTML/
*/
[scriptable, uuid(a6cf9090-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(110a4b15-e0a2-48d7-8e59-d8d94ef510ad)]
interface nsIDOMHTMLSelectElement : nsIDOMHTMLElement
{
readonly attribute DOMString type;
attribute long selectedIndex;
attribute DOMString value;
// Modified in DOM Level 2:
attribute unsigned long length;
// raises(DOMException) on setting
attribute boolean autofocus;
attribute boolean disabled;
readonly attribute nsIDOMHTMLFormElement form;
attribute boolean multiple;
attribute DOMString name;
attribute long size;
readonly attribute DOMString type;
readonly attribute nsIDOMHTMLFormElement form;
// Modified in DOM Level 2:
readonly attribute nsIDOMHTMLOptionsCollection options;
attribute boolean disabled;
attribute boolean multiple;
attribute DOMString name;
attribute long size;
attribute long tabIndex;
attribute unsigned long length;
nsIDOMNode item(in unsigned long index);
nsIDOMNode namedItem(in DOMString name);
void add(in nsIDOMHTMLElement element,
in nsIDOMHTMLElement before)
raises(DOMException);
raises(DOMException);
void remove(in long index);
attribute long selectedIndex;
attribute DOMString value;
attribute long tabIndex;
void blur();
void focus();
};

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

@ -39,7 +39,7 @@
#include "domstubs.idl"
[scriptable, uuid(a6cf911c-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(24c39afa-44f7-4cd4-9e63-0504a581a081)]
interface nsIDOMNSHTMLAnchorElement : nsISupports
{
attribute DOMString protocol;
@ -49,7 +49,12 @@ interface nsIDOMNSHTMLAnchorElement : nsISupports
attribute DOMString search;
attribute DOMString port;
attribute DOMString hash;
readonly attribute DOMString text;
/**
* An alias for the textContent attribute.
*/
[Null(Stringify)]
attribute DOMString text;
DOMString toString();
};

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