Merge mozilla-inbound and mozilla-central.

This commit is contained in:
L. David Baron 2012-12-22 00:05:00 -05:00
commit 1615a907dd
613 changed files with 57521 additions and 23043 deletions

View File

@ -6,6 +6,7 @@
#include "InterfaceInitFuncs.h"
#include "Accessible-inl.h"
#include "AccessibleWrap.h"
#include "DocAccessible.h"
#include "nsMai.h"

View File

@ -6,6 +6,7 @@
#include "InterfaceInitFuncs.h"
#include "Accessible-inl.h"
#include "HyperTextAccessible.h"
#include "nsMai.h"

View File

@ -6,6 +6,7 @@
#include "InterfaceInitFuncs.h"
#include "Accessible-inl.h"
#include "HyperTextAccessible.h"
#include "nsMai.h"
#include "nsMaiHyperlink.h"

View File

@ -6,6 +6,7 @@
#include "InterfaceInitFuncs.h"
#include "Accessible-inl.h"
#include "AccessibleWrap.h"
#include "nsMai.h"
#include "mozilla/Likely.h"

View File

@ -6,6 +6,7 @@
#include "InterfaceInitFuncs.h"
#include "Accessible-inl.h"
#include "HyperTextAccessible.h"
#include "nsMai.h"

View File

@ -5,7 +5,7 @@
#include "AccIterator.h"
#include "nsAccessibilityService.h"
#include "Accessible.h"
#include "Accessible-inl.h"
#include "mozilla/dom/Element.h"
#include "nsBindingManager.h"

View File

@ -9,6 +9,7 @@
#define _nsARIAMap_H_
#include "ARIAStateMap.h"
#include "mozilla/a11y/AccTypes.h"
#include "mozilla/a11y/Role.h"
#include "nsIAtom.h"
@ -149,6 +150,12 @@ struct nsRoleMapEntry
bool Is(nsIAtom* aARIARole) const
{ return *roleAtom == aARIARole; }
/**
* Return true if ARIA role has the given accessible type.
*/
bool IsOfType(mozilla::a11y::AccGenericType aType) const
{ return accTypes & aType; }
/**
* Return ARIA role.
*/

View File

@ -31,12 +31,11 @@ Accessible::ARIARole()
return ARIATransformRole(mRoleMapEntry->role);
}
inline void
Accessible::SetRoleMapEntry(nsRoleMapEntry* aRoleMapEntry)
inline bool
Accessible::HasGenericType(AccGenericType aType) const
{
mRoleMapEntry = aRoleMapEntry;
if (mRoleMapEntry)
mGenericTypes |= mRoleMapEntry->accTypes;
return (mGenericTypes & aType) ||
(mRoleMapEntry && mRoleMapEntry->IsOfType(aType));
}
inline bool

View File

@ -304,7 +304,8 @@ public:
/**
* Set the ARIA role map entry for a new accessible.
*/
void SetRoleMapEntry(nsRoleMapEntry* aRoleMapEntry);
void SetRoleMapEntry(nsRoleMapEntry* aRoleMapEntry)
{ mRoleMapEntry = aRoleMapEntry; }
/**
* Update the children cache.
@ -468,17 +469,17 @@ public:
bool IsApplication() const { return mType == eApplicationType; }
bool IsAutoComplete() const { return mGenericTypes & eAutoComplete; }
bool IsAutoComplete() const { return HasGenericType(eAutoComplete); }
bool IsAutoCompletePopup() const
{ return mGenericTypes & eAutoCompletePopup; }
{ return HasGenericType(eAutoCompletePopup); }
bool IsCombobox() const { return mGenericTypes & eCombobox; }
bool IsCombobox() const { return HasGenericType(eCombobox); }
bool IsDoc() const { return mGenericTypes & eDocument; }
bool IsDoc() const { return HasGenericType(eDocument); }
DocAccessible* AsDoc();
bool IsHyperText() const { return mGenericTypes & eHyperText; }
bool IsHyperText() const { return HasGenericType(eHyperText); }
HyperTextAccessible* AsHyperText();
bool IsHTMLFileInput() const { return mType == eHTMLFileInputType; }
@ -494,11 +495,11 @@ public:
bool IsImageMap() const { return mType == eImageMapType; }
HTMLImageMapAccessible* AsImageMap();
bool IsList() const { return mGenericTypes & eList; }
bool IsList() const { return HasGenericType(eList); }
bool IsListControl() const { return mGenericTypes & eListControl; }
bool IsListControl() const { return HasGenericType(eListControl); }
bool IsMenuButton() const { return mGenericTypes & eMenuButton; }
bool IsMenuButton() const { return HasGenericType(eMenuButton); }
bool IsMenuPopup() const { return mType == eMenuPopupType; }
@ -507,14 +508,14 @@ public:
bool IsRoot() const { return mType == eRootType; }
a11y::RootAccessible* AsRoot();
bool IsSelect() const { return mGenericTypes & eSelect; }
bool IsSelect() const { return HasGenericType(eSelect); }
bool IsTable() const { return mGenericTypes & eTable; }
bool IsTable() const { return HasGenericType(eTable); }
virtual TableAccessible* AsTable() { return nullptr; }
virtual TableCellAccessible* AsTableCell() { return nullptr; }
bool IsTableRow() const { return mGenericTypes & eTableRow; }
bool IsTableRow() const { return HasGenericType(eTableRow); }
bool IsTextLeaf() const { return mType == eTextLeafType; }
TextLeafAccessible* AsTextLeaf();
@ -524,6 +525,11 @@ public:
bool IsXULTree() const { return mType == eXULTreeType; }
XULTreeAccessible* AsXULTree();
/**
* Return true if the accessible belongs to the given accessible type.
*/
bool HasGenericType(AccGenericType aType) const;
//////////////////////////////////////////////////////////////////////////////
// ActionAccessible

View File

@ -5,6 +5,7 @@
#include "OuterDocAccessible.h"
#include "Accessible-inl.h"
#include "nsAccUtils.h"
#include "DocAccessible.h"
#include "Role.h"

View File

@ -69,9 +69,6 @@ this.TouchAdapter = {
target.addEventListener('mousemove', this, true, true);
target.addEventListener('mouseenter', this, true, true);
target.addEventListener('mouseleave', this, true, true);
target.addEventListener('mousedown', this, true, true);
target.addEventListener('mouseup', this, true, true);
target.addEventListener('click', this, true, true);
target.addEventListener('touchend', this, true, true);
target.addEventListener('touchmove', this, true, true);
@ -97,9 +94,6 @@ this.TouchAdapter = {
target.removeEventListener('mousemove', this, true, true);
target.removeEventListener('mouseenter', this, true, true);
target.removeEventListener('mouseleave', this, true, true);
target.removeEventListener('mousedown', this, true, true);
target.removeEventListener('mouseup', this, true, true);
target.removeEventListener('click', this, true, true);
target.removeEventListener('touchend', this, true, true);
target.removeEventListener('touchmove', this, true, true);
@ -128,7 +122,9 @@ this.TouchAdapter = {
for (var i = 0; i < changedTouches.length; i++) {
let touch = changedTouches[i];
let touchPoint = new TouchPoint(touch, timeStamp, this._dpi);
this._touchPoints[touch.identifier || this.HOVER_ID] = touchPoint;
let identifier = (touch.identifier == undefined) ?
this.HOVER_ID : touch.identifier;
this._touchPoints[identifier] = touchPoint;
this._lastExploreTime = timeStamp + this.SWIPE_MAX_DURATION;
}
this._dwellTimeout = this.chromeWin.setTimeout(
@ -140,7 +136,9 @@ this.TouchAdapter = {
case 'touchmove':
for (var i = 0; i < changedTouches.length; i++) {
let touch = changedTouches[i];
let touchPoint = this._touchPoints[touch.identifier || this.HOVER_ID];
let identifier = (touch.identifier == undefined) ?
this.HOVER_ID : touch.identifier;
let touchPoint = this._touchPoints[identifier];
if (touchPoint)
touchPoint.update(touch, timeStamp);
}
@ -153,7 +151,9 @@ this.TouchAdapter = {
case 'touchend':
for (var i = 0; i < changedTouches.length; i++) {
let touch = changedTouches[i];
let touchPoint = this._touchPoints[touch.identifier || this.HOVER_ID];
let identifier = (touch.identifier == undefined) ?
this.HOVER_ID : touch.identifier;
let touchPoint = this._touchPoints[identifier];
if (touchPoint) {
touchPoint.update(touch, timeStamp);
touchPoint.finish();

View File

@ -7,6 +7,7 @@
#import "mozHTMLAccessible.h"
#import "Accessible-inl.h"
#import "HyperTextAccessible.h"
#import "nsCocoaUtils.h"

View File

@ -3,7 +3,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "Accessible-inl.h"
#include "AccessibleWrap.h"
#include "TextLeafAccessible.h"

View File

@ -5,6 +5,7 @@
#include "XULAlertAccessible.h"
#include "Accessible-inl.h"
#include "Role.h"
#include "States.h"

View File

@ -6,6 +6,7 @@
#include "XULTreeAccessible.h"
#include "Accessible-inl.h"
#include "DocAccessible-inl.h"
#include "nsAccCache.h"
#include "nsAccUtils.h"

View File

@ -615,3 +615,6 @@ pref("memory.free_dirty_pages", true);
// UAProfile settings
pref("wap.UAProf.url", "");
pref("wap.UAProf.tagname", "x-wap-profile");
// Wait up to this much milliseconds when orientation changed
pref("layers.orientation.sync.timeout", 1000);

View File

@ -741,10 +741,16 @@ var AlertsHelper = {
uid, name, null);
},
receiveMessage: function alert_receiveMessage(message) {
let data = message.data;
receiveMessage: function alert_receiveMessage(aMessage) {
if (!aMessage.target.assertPermission("desktop-notification")) {
Cu.reportError("Desktop-notification message " + aMessage.name +
" from a content process with no desktop-notification privileges.");
return null;
}
let data = aMessage.data;
let listener = {
mm: message.target,
mm: aMessage.target,
title: data.title,
text: data.text,
manifestURL: data.manifestURL,

View File

@ -120,6 +120,9 @@ ContentPermissionPrompt.prototype = {
let principal = request.principal;
let isApp = principal.appStatus != Ci.nsIPrincipal.APP_STATUS_NOT_INSTALLED;
let remember = principal.appStatus == Ci.nsIPrincipal.APP_STATUS_PRIVILEGED
? true
: request.remember;
let details = {
type: "permission-prompt",
@ -127,7 +130,7 @@ ContentPermissionPrompt.prototype = {
id: requestId,
origin: principal.origin,
isApp: isApp,
remember: request.remember
remember: remember
};
this._permission = access;

View File

@ -440,7 +440,7 @@ var PlacesCommandHook = {
* @param aLeftPaneRoot
* The query to select in the organizer window - options
* are: History, AllBookmarks, BookmarksMenu, BookmarksToolbar,
* UnfiledBookmarks and Tags.
* UnfiledBookmarks, Tags and Downloads.
*/
showPlacesOrganizer: function PCH_showPlacesOrganizer(aLeftPaneRoot) {
var organizer = Services.wm.getMostRecentWindow("Places:Organizer");

View File

@ -351,12 +351,10 @@
<key id="sharePage" key="&sharePageCmd.commandkey;" command="Social:SharePage" modifiers="accel,shift"/>
<key id="focusChatBar" key="&social.chatBar.commandkey;" command="Social:FocusChat" modifiers="accel,shift"/>
# don't use |command="Browser:Stop"|, ESC is being used to freeze animated gifs,
# even if the stop button and menuitem are disabled (see Bug 284140)
<key id="key_stop" keycode="VK_ESCAPE" oncommand="BrowserStop();"/>
<key id="key_stop" keycode="VK_ESCAPE" command="Browser:Stop"/>
#ifdef XP_MACOSX
<key id="key_stop_mac" modifiers="accel" key="&stopCmd.macCommandKey;" oncommand="BrowserStop();"/>
<key id="key_stop_mac" modifiers="accel" key="&stopCmd.macCommandKey;" command="Browser:Stop"/>
#endif
<key id="key_gotoHistory"

View File

@ -1762,7 +1762,8 @@ function HandleAppCommandEvent(evt) {
BrowserReloadSkipCache();
break;
case "Stop":
BrowserStop();
if (XULBrowserWindow.stopCommand.getAttribute("disabled") != "true")
BrowserStop();
break;
case "Search":
BrowserSearch.webSearch();

View File

@ -44,7 +44,6 @@
windowtype="navigator:browser"
macanimationtype="document"
screenX="4" screenY="4"
browsingmode="normal"
fullscreenbutton="true"
persist="screenX screenY width height sizemode">
@ -444,6 +443,27 @@
<label class="tooltip-label" value="&backForwardButtonMenu.tooltip;"/>
#endif
</tooltip>
<popupnotification id="webRTC-shareDevices-notification" hidden="true">
<popupnotificationcontent id="webRTC-selectCamera" orient="vertical">
<separator class="thin"/>
<label value="&getUserMedia.selectCamera.label;"
accesskey="&getUserMedia.selectCamera.accesskey;"
control="webRTC-selectCamera-menulist"/>
<menulist id="webRTC-selectCamera-menulist">
<menupopup id="webRTC-selectCamera-menupopup"/>
</menulist>
</popupnotificationcontent>
<popupnotificationcontent id="webRTC-selectMicrophone" orient="vertical">
<separator class="thin"/>
<label value="&getUserMedia.selectMicrophone.label;"
accesskey="&getUserMedia.selectMicrophone.accesskey;"
control="webRTC-selectMicrophone-menulist"/>
<menulist id="webRTC-selectMicrophone-menulist">
<menupopup id="webRTC-selectMicrophone-menupopup"/>
</menulist>
</popupnotificationcontent>
</popupnotification>
</popupset>
#ifdef CAN_DRAW_IN_TITLEBAR

View File

@ -88,11 +88,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=377611
var feeds = [];
for each (var aFeed in discovered) {
for (var aFeed of discovered) {
feeds[aFeed.href] = true;
}
for each (var aLink in document.getElementsByTagName("link")) {
for (var aLink of document.getElementsByTagName("link")) {
// ignore real stylesheets, and anything without an href property
if (aLink.type != "text/css" && aLink.href) {
if (/bogus/i.test(aLink.title)) {

View File

@ -12,7 +12,6 @@ include $(DEPTH)/config/autoconf.mk
_BROWSER_FILES = \
head.js \
browser_social.js \
browser_social_toolbar.js \
browser_social_shareButton.js \
browser_social_sidebar.js \
@ -30,6 +29,12 @@ _BROWSER_FILES = \
social_worker.js \
$(NULL)
ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING
_BROWSER_FILES += \
browser_social.js \
$(NULL)
endif
include $(topsrcdir)/config/rules.mk
libs:: $(_BROWSER_FILES)

View File

@ -16,6 +16,7 @@ Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/NetUtil.jsm");
Cu.import("resource://gre/modules/DownloadUtils.jsm");
Cu.import("resource:///modules/DownloadsCommon.jsm");
Cu.import("resource://gre/modules/PlacesUtils.jsm");
const nsIDM = Ci.nsIDownloadManager;
@ -29,6 +30,8 @@ const DOWNLOAD_VIEW_SUPPORTED_COMMANDS =
"downloadsCmd_open", "downloadsCmd_show", "downloadsCmd_retry",
"downloadsCmd_openReferrer"];
const NOT_AVAILABLE = Number.MAX_VALUE;
function GetFileForFileURI(aFileURI)
Cc["@mozilla.org/network/protocol;1?name=file"]
.getService(Ci.nsIFileProtocolHandler)
@ -60,14 +63,18 @@ function GetFileForFileURI(aFileURI)
* The data item of a the session download. Required if aPlacesNode is not set
* @param [optional] aPlacesNode
* The places node for a past download. Required if aDataItem is not set.
* @param [optional] aAnnotations
* Map containing annotations values, to speed up the initial loading.
*/
function DownloadElementShell(aDataItem, aPlacesNode) {
function DownloadElementShell(aDataItem, aPlacesNode, aAnnotations) {
this._element = document.createElement("richlistitem");
this._element._shell = this;
this._element.classList.add("download");
this._element.classList.add("download-state");
if (aAnnotations)
this._annotations = aAnnotations;
if (aDataItem)
this.dataItem = aDataItem;
if (aPlacesNode)
@ -79,10 +86,11 @@ DownloadElementShell.prototype = {
get element() this._element,
// The data item for the download
_dataItem: null,
get dataItem() this._dataItem,
set dataItem(aValue) {
if (this._dataItem = aValue) {
if ((this._dataItem = aValue)) {
this._wasDone = this._dataItem.done;
this._wasInProgress = this._dataItem.inProgress;
}
@ -95,10 +103,15 @@ DownloadElementShell.prototype = {
return aValue;
},
_placesNode: null,
get placesNode() this._placesNode,
set placesNode(aNode) {
if (this._placesNode != aNode) {
this._annotations = new Map();
// Preserve the annotations map if this is the first loading and we got
// cached values.
if (this._placesNode || !this._annotations) {
this._annotations = new Map();
}
this._placesNode = aNode;
if (!this._dataItem && this._placesNode) {
this._wasInProgress = false;
@ -136,21 +149,30 @@ DownloadElementShell.prototype = {
// Helper for getting a places annotation set for the download.
_getAnnotation: function DES__getAnnotation(aAnnotation, aDefaultValue) {
if (this._annotations.has(aAnnotation))
return this._annotations.get(aAnnotation);
let value;
try {
value = PlacesUtils.annotations.getPageAnnotation(
this._downloadURIObj, aAnnotation);
if (this._annotations.has(aAnnotation))
value = this._annotations.get(aAnnotation);
// If the value is cached, or we know it doesn't exist, avoid a database
// lookup.
if (value === undefined) {
try {
value = PlacesUtils.annotations.getPageAnnotation(
this._downloadURIObj, aAnnotation);
}
catch(ex) {
value = NOT_AVAILABLE;
}
}
catch(ex) {
if (value === NOT_AVAILABLE) {
if (aDefaultValue === undefined) {
throw new Error("Could not get required annotation '" + aAnnotation +
"' for download with url '" + this.downloadURI + "'");
}
value = aDefaultValue;
}
this._annotations.set(aAnnotation, value);
return value;
},
@ -427,6 +449,7 @@ DownloadElementShell.prototype = {
case "downloadsCmd_cancel":
return this._dataItem != null;
}
return false;
},
_getTargetFileOrPartFileIfExists: function DES__getTargetFileOrPartFileIfExists() {
@ -522,6 +545,7 @@ DownloadElementShell.prototype = {
case nsIDM.DOWNLOAD_BLOCKED_POLICY:
return "downloadsCmd_openReferrer";
}
return "";
}
let command = getDefaultCommandForState(this._state);
if (this.isCommandEnabled(command))
@ -583,6 +607,38 @@ DownloadsPlacesView.prototype = {
}
},
_getAnnotationsFor: function DPV_getAnnotationsFor(aURI) {
if (!this._cachedAnnotations) {
this._cachedAnnotations = new Map();
for (let name of [ DESTINATION_FILE_URI_ANNO,
DESTINATION_FILE_NAME_ANNO,
DOWNLOAD_STATE_ANNO ]) {
let results = PlacesUtils.annotations.getAnnotationsWithName(name);
for (let result of results) {
let url = result.uri.spec;
if (!this._cachedAnnotations.has(url))
this._cachedAnnotations.set(url, new Map());
let m = this._cachedAnnotations.get(url);
m.set(result.annotationName, result.annotationValue);
}
}
}
let annotations = this._cachedAnnotations.get(aURI);
if (!annotations) {
// There are no annotations for this entry, that means it is quite old.
// Make up a fake annotations entry with default values.
annotations = new Map();
annotations.set(DESTINATION_FILE_URI_ANNO, NOT_AVAILABLE);
annotations.set(DESTINATION_FILE_NAME_ANNO, NOT_AVAILABLE);
}
// The state annotation has been added recently, so it's likely missing.
if (!annotations.has(DOWNLOAD_STATE_ANNO)) {
annotations.set(DOWNLOAD_STATE_ANNO, NOT_AVAILABLE);
}
return annotations;
},
/**
* Given a data item for a session download, or a places node for a past
* download, updates the view as necessary.
@ -611,7 +667,8 @@ DownloadsPlacesView.prototype = {
* to the richlistbox at the end.
*/
_addDownloadData:
function DPV_addDownload(aDataItem, aPlacesNode, aNewest = false, aDocumentFragment = null) {
function DPV_addDownloadData(aDataItem, aPlacesNode, aNewest = false,
aDocumentFragment = null) {
let downloadURI = aPlacesNode ? aPlacesNode.uri : aDataItem.uri;
let shellsForURI = this._downloadElementsShellsForURI.get(downloadURI, null);
if (!shellsForURI) {
@ -657,9 +714,9 @@ DownloadsPlacesView.prototype = {
}
if (shouldCreateShell) {
let shell = new DownloadElementShell(aDataItem, aPlacesNode);
let shell = new DownloadElementShell(aDataItem, aPlacesNode,
this._getAnnotationsFor(downloadURI));
newOrUpdatedShell = shell;
element = shell.element;
shellsForURI.add(shell);
if (aDataItem)
this._viewItemsForDataItems.set(aDataItem, shell);
@ -762,8 +819,8 @@ DownloadsPlacesView.prototype = {
}
},
_place: "",
get place() this._place,
set place(val) {
// Don't reload everything if we don't have to.
if (this._place == val) {
@ -786,6 +843,7 @@ DownloadsPlacesView.prototype = {
return val;
},
_result: null,
get result() this._result,
set result(val) {
if (this._result == val)
@ -1022,6 +1080,7 @@ DownloadsPlacesView.prototype = {
// Set the state attribute so that only the appropriate items are displayed.
let contextMenu = document.getElementById("downloadsContextMenu");
contextMenu.setAttribute("state", element._shell._state);
return true;
},
onKeyPress: function DPV_onKeyPress(aEvent) {

View File

@ -21,13 +21,14 @@
<richlistbox id="downloadsRichListBox"/>
<commandset id="downloadCommands"/>
<menupopup id="downloadsContextMenu"/>
3. Make sure your window also has the editMenuOverlay overlay applied,
3. Make sure your window has the editMenuOverlay overlay applied,
because the view implements cmd_copy and cmd_delete.
4. To initialize the view
4. Make sure your window has the globalOverlay.js script loaded.
5. To initialize the view
let view = new DownloadsPlacesView(document.getElementById("downloadsRichListBox"));
// This is what the Places Library uses. It could be tweaked a bit as long as the
// transition-type is set correctly
view.places = "place:transition=7&sort=4";
view.place = "place:transition=7&sort=4";
-->
<overlay id="downloadsViewOverlay"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

View File

@ -0,0 +1,10 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
let ContentAreaDownloadsView = {
init: function CADV_init() {
let view = new DownloadsPlacesView(document.getElementById("downloadsRichListBox"));
view.place = "place:transition=7&sort=4";
}
};

View File

@ -0,0 +1,32 @@
<?xml version="1.0"?>
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
<?xml-stylesheet href="chrome://global/skin/"?>
<?xul-overlay href="chrome://browser/content/downloads/allDownloadsViewOverlay.xul"?>
<?xul-overlay href="chrome://global/content/editMenuOverlay.xul"?>
<window id="contentAreaDownloadsView"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="ContentAreaDownloadsView.init();">
<script type="application/javascript"
src="chrome://global/content/globalOverlay.js"/>
<script type="application/javascript"
src="chrome://browser/content/downloads/contentAreaDownloadsView.js"/>
<commandset id="editMenuCommands"/>
<keyset id="editMenuKeys">
#ifdef XP_MACOSX
<key id="key_delete2" keycode="VK_BACK" command="cmd_delete"/>
#endif
</keyset>
<richlistbox id="downloadsRichListBox"/>
<commandset id="downloadCommands"/>
<menupopup id="downloadsContextMenu"/>
</window>

View File

@ -41,5 +41,5 @@ richlistitem.download button {
.download-state:not( [state="1"] /* Finished */)
.downloadShow
{
visibility: hidden;
display: none;
}

View File

@ -84,17 +84,17 @@
crop="end"
xbl:inherits="value=status,tooltiptext=statusTip"/>
</xul:vbox>
<xul:stack>
<xul:button class="downloadButton downloadCancel"
command="downloadsCmd_cancel"
tooltiptext="&cmd.cancel.label;"/>
<xul:button class="downloadButton downloadRetry"
command="downloadsCmd_retry"
tooltiptext="&cmd.retry.label;"/>
<xul:button class="downloadButton downloadShow"
command="downloadsCmd_show"
tooltiptext="&cmd.show.label;"/>
</xul:stack>
<xul:button class="downloadButton downloadCancel"
oncommand="goDoCommand('downloadsCmd_cancel')"
tooltiptext="&cmd.cancel.label;"/>
<xul:button class="downloadButton downloadRetry"
oncommand="goDoCommand('downloadsCmd_retry')"
tooltiptext="&cmd.retry.label;"/>
<xul:button class="downloadButton downloadShow"
oncommand="goDoCommand('downloadsCmd_show')"
tooltiptext="&cmd.show.label;"/>
</content>
</binding>
</bindings>

View File

@ -13,3 +13,5 @@ browser.jar:
* content/browser/downloads/allDownloadsViewOverlay.xul (content/allDownloadsViewOverlay.xul)
content/browser/downloads/allDownloadsViewOverlay.js (content/allDownloadsViewOverlay.js)
content/browser/downloads/allDownloadsViewOverlay.css (content/allDownloadsViewOverlay.css)
* content/browser/downloads/contentAreaDownloadsView.xul (content/contentAreaDownloadsView.xul)
content/browser/downloads/contentAreaDownloadsView.js (content/contentAreaDownloadsView.js)

View File

@ -30,6 +30,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "DownloadsCommon",
XPCOMUtils.defineLazyServiceGetter(this, "gBrowserGlue",
"@mozilla.org/browser/browserglue;1",
"nsIBrowserGlue");
XPCOMUtils.defineLazyModuleGetter(this, "RecentWindow",
"resource:///modules/RecentWindow.jsm");
////////////////////////////////////////////////////////////////////////////////
//// DownloadsUI
@ -72,25 +74,29 @@ DownloadsUI.prototype = {
let browserWin = gBrowserGlue.getMostRecentBrowserWindow();
if (!browserWin || browserWin.windowState == kMinimized) {
this._toolkitUI.show(aWindowContext, aID, aReason);
this._showDownloadManagerUI(aWindowContext, aID, aReason);
}
else {
// If the indicator is visible, then new download notifications are
// already handled by the panel service.
browserWin.DownloadsButton.checkIsVisible(function(isVisible) {
if (!isVisible) {
this._toolkitUI.show(aWindowContext, aID, aReason);
this._showDownloadManagerUI(aWindowContext, aID, aReason);
}
}.bind(this));
}
} else {
this._toolkitUI.show(aWindowContext, aID, aReason);
this._showDownloadManagerUI(aWindowContext, aID, aReason);
}
},
get visible()
{
return this._toolkitUI.visible;
// If we're still using the toolkit downloads manager, delegate the call
// to it. Otherwise, return true for now, until we decide on how we want
// to indicate that a new download has started if a browser window is
// not available or minimized.
return DownloadsCommon.useToolkitUI ? this._toolkitUI.visible : true;
},
getAttention: function DUI_getAttention()
@ -98,6 +104,54 @@ DownloadsUI.prototype = {
if (DownloadsCommon.useToolkitUI) {
this._toolkitUI.getAttention();
}
},
/**
* Helper function that opens the right download manager UI. Either the
* new Downloads View in Places, or the toolkit download window if the
* Places Downloads View is not enabled.
*/
_showDownloadManagerUI:
function DUI_showDownloadManagerUI(aWindowContext, aID, aReason)
{
// First, determine if the Places Downloads view is preffed on.
let usePlacesView = false;
try {
usePlacesView =
Services.prefs.getBoolPref("browser.library.useNewDownloadsView");
} catch(e) {}
if (!usePlacesView) {
// If we got here, then the browser.library.useNewDownloadsView pref
// either didn't exist or was false, so just show the toolkit downloads
// manager.
this._toolkitUI.show(aWindowContext, aID, aReason);
return;
}
let organizer = Services.wm.getMostRecentWindow("Places:Organizer");
if (!organizer) {
let parentWindow = aWindowContext;
// If we weren't given a window context, try to find a browser window
// to use as our parent - and if that doesn't work, error out and give
// up.
if (!parentWindow) {
parentWindow = RecentWindow.getMostRecentBrowserWindow();
if (!parentWindow) {
Components.utils
.reportError("Couldn't find a browser window to open " +
"the Places Downloads View from.");
return;
}
}
parentWindow.openDialog("chrome://browser/content/places/places.xul",
"", "chrome,toolbar=yes,dialog=no,resizable",
"Downloads");
}
else {
organizer.PlacesOrganizer.selectLeftPaneQuery("Downloads");
organizer.focus();
}
}
};

View File

@ -141,8 +141,11 @@ PlacesController.prototype = {
case "placesCmd_delete":
return this._hasRemovableSelection(false);
case "placesCmd_deleteDataHost":
return this._hasRemovableSelection(false) &&
!PlacesUIUtils.privateBrowsing.privateBrowsingEnabled;
return this._hasRemovableSelection(false)
#ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING
&& !PlacesUIUtils.privateBrowsing.privateBrowsingEnabled
#endif
;
case "placesCmd_moveBookmarks":
return this._hasRemovableSelection(true);
case "cmd_copy":
@ -601,8 +604,12 @@ PlacesController.prototype = {
// We allow pasting into tag containers, so special case that.
var hideIfNoIP = item.getAttribute("hideifnoinsertionpoint") == "true" &&
noIp && !(ip && ip.isTag && item.id == "placesContext_paste");
#ifdef MOZ_PER_WINDOW_PRIVATE_BROWSING
var hideIfPB = false;
#else
var hideIfPB = item.getAttribute("hideifprivatebrowsing") == "true" &&
PlacesUIUtils.privateBrowsing.privateBrowsingEnabled;
#endif
item.hidden = hideIfNoIP || hideIfPB ||
!this._shouldShowMenuItem(item, metadata);

View File

@ -15,7 +15,7 @@ browser.jar:
content/browser/places/placesOverlay.xul (content/placesOverlay.xul)
* content/browser/places/menu.xml (content/menu.xml)
content/browser/places/tree.xml (content/tree.xml)
content/browser/places/controller.js (content/controller.js)
* content/browser/places/controller.js (content/controller.js)
content/browser/places/treeView.js (content/treeView.js)
* content/browser/places/browserPlacesViews.js (content/browserPlacesViews.js)
# keep the Places version of the history sidebar at history/history-panel.xul

View File

@ -15,7 +15,7 @@ EXTRA_COMPONENTS = \
PlacesProtocolHandler.js \
$(NULL)
EXTRA_JS_MODULES = \
EXTRA_PP_JS_MODULES = \
PlacesUIUtils.jsm \
$(NULL)

View File

@ -1009,9 +1009,11 @@ XPCOMUtils.defineLazyGetter(PlacesUIUtils, "ellipsis", function() {
Ci.nsIPrefLocalizedString).data;
});
#ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING
XPCOMUtils.defineLazyServiceGetter(PlacesUIUtils, "privateBrowsing",
"@mozilla.org/privatebrowsing;1",
"nsIPrivateBrowsingService");
#endif
XPCOMUtils.defineLazyServiceGetter(this, "URIFixup",
"@mozilla.org/docshell/urifixup;1",

View File

@ -13,9 +13,10 @@ include $(topsrcdir)/config/config.mk
EXTRA_COMPONENTS = \
nsSessionStore.manifest \
nsSessionStore.js \
nsSessionStartup.js \
$(NULL)
EXTRA_PP_COMPONENTS := nsSessionStartup.js
JS_MODULES_PATH := $(FINAL_TARGET)/modules/sessionstore
EXTRA_JS_MODULES := \

View File

@ -73,11 +73,15 @@ SessionStartup.prototype = {
init: function sss_init() {
debug("init starting");
// do not need to initialize anything in auto-started private browsing sessions
if (PrivateBrowsingUtils.permanentPrivateBrowsing)
return;
#ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING
let pbs = Cc["@mozilla.org/privatebrowsing;1"].
getService(Ci.nsIPrivateBrowsingService);
if (PrivateBrowsingUtils.permanentPrivateBrowsing ||
pbs.lastChangedByCommandLine)
if (pbs.lastChangedByCommandLine)
return;
#endif
// Session state is unknown until we read the file.
this._sessionType = null;
_SessionFile.read().then(

View File

@ -7,9 +7,6 @@ function test() {
waitForExplicitFinish();
let pb = Cc["@mozilla.org/privatebrowsing;1"].
getService(Ci.nsIPrivateBrowsingService);
// set the pref to 1 greater than it currently is so we have room for an extra
// closed window
let closedWindowCount = ss.getClosedWindowCount();

View File

@ -623,3 +623,8 @@ just addresses the organization to follow, e.g. "This site is run by " -->
<!ENTITY social.chatBar.commandkey "c">
<!ENTITY social.chatBar.label "Focus chats">
<!ENTITY social.chatBar.accesskey "c">
<!ENTITY getUserMedia.selectCamera.label "Camera to share:">
<!ENTITY getUserMedia.selectCamera.accesskey "C">
<!ENTITY getUserMedia.selectMicrophone.label "Microphone to share:">
<!ENTITY getUserMedia.selectMicrophone.accesskey "M">

View File

@ -442,17 +442,15 @@ identity.loggedIn.signOut.label = Sign Out
identity.loggedIn.signOut.accessKey = O
# LOCALIZATION NOTE (getUserMedia.shareCamera.message, getUserMedia.shareMicrophone.message, getUserMedia.shareCameraAndMicrophone.message): %S is the website origin (e.g. www.mozilla.org)
# LOCALIZATION NOTE (getUserMedia.shareMicrophone.message, getUserMedia.shareSpecificMicrophone.label): %S is the website origin (e.g. www.mozilla.org)
# LOCALIZATION NOTE (getUserMedia.shareMicrophone.message): %S is the website origin (e.g. www.mozilla.org)
# LOCALIZATION NOTE (getUserMedia.shareSelectedDevices.label):
# Semi-colon list of plural forms. See:
# http://developer.mozilla.org/en/docs/Localization_and_Plurals
# The number of devices can be either one or two.
getUserMedia.shareCamera.message = Would you like to share your camera with %S?
getUserMedia.shareCamera.label = Share Camera
getUserMedia.shareCamera.accesskey = S
getUserMedia.shareSpecificCamera.label = Share Camera: %S
getUserMedia.shareMicrophone.message = Would you like to share your microphone with %S?
getUserMedia.shareMicrophone.label = Share Microphone
getUserMedia.shareMicrophone.accesskey = S
getUserMedia.shareSpecificMicrophone.label = Share Microphone: %S
getUserMedia.shareCameraAndMicrophone.message = Would you like to share your camera and microphone with %S?
getUserMedia.shareCameraAndMicrophone.label = Share Camera and Microphone
getUserMedia.shareCameraAndMicrophone.accesskey = S
getUserMedia.shareSelectedDevices.label = Share Selected Device;Share Selected Devices
getUserMedia.shareSelectedDevices.accesskey = S
getUserMedia.denyRequest.label = Don't Share
getUserMedia.denyRequest.accesskey = D

View File

@ -7,9 +7,11 @@
this.EXPORTED_SYMBOLS = ["webrtcUI"];
const Cu = Components.utils;
const Cc = Components.classes;
const Ci = Components.interfaces;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/PluralForm.jsm");
this.webrtcUI = {
init: function () {
@ -72,47 +74,58 @@ function prompt(aBrowser, aCallID, aAudioRequested, aVideoRequested, aDevices) {
return;
let host = aBrowser.contentDocument.documentURIObject.asciiHost;
let chromeWin = aBrowser.ownerDocument.defaultView;
let chromeDoc = aBrowser.ownerDocument;
let chromeWin = chromeDoc.defaultView;
let stringBundle = chromeWin.gNavigatorBundle;
let message = stringBundle.getFormattedString("getUserMedia." + requestType + ".message",
[ host ]);
function listDevices(menupopup, devices) {
while (menupopup.lastChild)
menupopup.removeChild(menupopup.lastChild);
let deviceIndex = 0;
for (let device of devices) {
let menuitem = chromeDoc.createElement("menuitem");
menuitem.setAttribute("value", deviceIndex);
menuitem.setAttribute("label", device.name);
menuitem.setAttribute("tooltiptext", device.name);
menupopup.appendChild(menuitem);
deviceIndex++;
}
}
chromeDoc.getElementById("webRTC-selectCamera").hidden = !videoDevices.length;
chromeDoc.getElementById("webRTC-selectMicrophone").hidden = !audioDevices.length;
listDevices(chromeDoc.getElementById("webRTC-selectCamera-menupopup"), videoDevices);
listDevices(chromeDoc.getElementById("webRTC-selectMicrophone-menupopup"), audioDevices);
let mainAction = {
label: stringBundle.getString("getUserMedia." + requestType + ".label"),
accessKey: stringBundle.getString("getUserMedia." + requestType + ".accesskey"),
label: PluralForm.get(requestType == "shareCameraAndMicrophone" ? 2 : 1,
stringBundle.getString("getUserMedia.shareSelectedDevices.label")),
accessKey: stringBundle.getString("getUserMedia.shareSelectedDevices.accesskey"),
callback: function () {
Services.obs.notifyObservers(null, "getUserMedia:response:allow", aCallID);
let allowedDevices = Cc["@mozilla.org/supports-array;1"]
.createInstance(Ci.nsISupportsArray);
if (videoDevices.length) {
let videoDeviceIndex = chromeDoc.getElementById("webRTC-selectCamera-menulist").value;
allowedDevices.AppendElement(videoDevices[videoDeviceIndex]);
}
if (audioDevices.length) {
let audioDeviceIndex = chromeDoc.getElementById("webRTC-selectMicrophone-menulist").value;
allowedDevices.AppendElement(audioDevices[audioDeviceIndex]);
}
Services.obs.notifyObservers(allowedDevices, "getUserMedia:response:allow", aCallID);
}
};
let secondaryActions = [];
let selectableDevices = videoDevices.length ? videoDevices : audioDevices;
if (selectableDevices.length > 1) {
let selectableDeviceNumber = 0;
for (let device of selectableDevices) {
// See bug 449811 for why we do this
let actual_device = device;
selectableDeviceNumber++;
secondaryActions.push({
label: stringBundle.getFormattedString(
device.type == "audio" ?
"getUserMedia.shareSpecificMicrophone.label" :
"getUserMedia.shareSpecificCamera.label",
[ device.name ]),
accessKey: selectableDeviceNumber,
callback: function () {
Services.obs.notifyObservers(actual_device, "getUserMedia:response:allow", aCallID);
}
});
}
}
secondaryActions.push({
let secondaryActions = [{
label: stringBundle.getString("getUserMedia.denyRequest.label"),
accessKey: stringBundle.getString("getUserMedia.denyRequest.accesskey"),
callback: function () {
Services.obs.notifyObservers(null, "getUserMedia:response:deny", aCallID);
}
});
}];
let options = {
};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@ -173,13 +173,13 @@ richlistitem[type="download"][state="1"]:hover {
-moz-image-region: rect(32px, 48px, 48px, 32px);
}
richlistitem[type="download"][state="1"]:hover > stack > .downloadButton.downloadShow {
richlistitem[type="download"][state="1"]:hover > .downloadButton.downloadShow {
-moz-image-region: rect(48px, 16px, 64px, 0px);
}
richlistitem[type="download"][state="1"]:hover > stack > .downloadButton.downloadShow:hover {
richlistitem[type="download"][state="1"]:hover > .downloadButton.downloadShow:hover {
-moz-image-region: rect(48px, 32px, 64px, 16px);
}
richlistitem[type="download"][state="1"]:hover > stack > .downloadButton.downloadShow:active {
richlistitem[type="download"][state="1"]:hover > .downloadButton.downloadShow:active {
-moz-image-region: rect(48px, 48px, 64px, 32px);
}

View File

@ -0,0 +1,35 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
%define WINSTRIPE_AERO
%include allDownloadsViewOverlay.css
%undef WINSTRIPE_AERO
@media (-moz-windows-default-theme) {
/*
-moz-appearance: menuitem is almost right, but the hover effect is not
transparent and is lighter than desired.
Copied from the autocomplete richlistbox styling in
toolkit/themes/winstripe/global/autocomplete.css
This styling should be kept in sync with the style from the above file.
*/
#downloadsRichListBox > richlistitem.download[selected] {
color: inherit;
background-color: transparent;
/* four gradients for the bevel highlights on each edge, one for blue background */
background-image:
-moz-linear-gradient(to bottom, rgba(255,255,255,0.9) 3px, rgba(255,255,255,0) 3px),
-moz-linear-gradient(to right, rgba(255,255,255,0.5) 3px, rgba(255,255,255,0) 3px),
-moz-linear-gradient(to left, rgba(255,255,255,0.5) 3px, rgba(255,255,255,0) 3px),
-moz-linear-gradient(to top, rgba(255,255,255,0.4) 3px, rgba(255,255,255,0) 3px),
-moz-linear-gradient(to bottom, rgba(163,196,247,0.3), rgba(122,180,246,0.3));
background-clip: content-box;
border-radius: 6px;
outline: 1px solid rgb(124,163,206);
-moz-outline-radius: 3px;
outline-offset: -2px;
}
}

View File

@ -2,100 +2,23 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
/*** Panel and outer controls ***/
#downloadsPanel > .panel-arrowcontainer > .panel-arrowcontent {
padding: 0;
}
#downloadsListBox {
background-color: transparent;
padding: 4px;
color: inherit;
}
#downloadsPanel:not([hasdownloads]) > #downloadsListBox {
display: none;
}
#downloadsHistory {
background: transparent;
color: -moz-nativehyperlinktext;
cursor: pointer;
}
#downloadsHistory > .button-box {
margin: 1em;
}
@media (-moz-windows-default-theme) {
#downloadsPanel[hasdownloads] > #downloadsFooter {
%ifdef WINSTRIPE_AERO
background-color: #f1f5fb;
%else
background-color: hsla(216,45%,88%,.98);
%endif
box-shadow: 0px 1px 2px rgb(204,214,234) inset;
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
}
}
/*** Downloads Summary and List items ***/
#downloadsSummary,
richlistitem[type="download"] {
height: 7em;
-moz-padding-end: 0;
color: inherit;
}
#downloadsSummary {
padding: 8px 38px 8px 12px;
cursor: pointer;
-moz-user-focus: normal;
}
#downloadsSummary:-moz-focusring {
outline: 1px -moz-dialogtext dotted;
outline-offset: -5px;
}
#downloadsSummary > .downloadTypeIcon {
height: 24px;
width: 24px;
list-style-image: url("chrome://mozapps/skin/downloads/downloadIcon.png");
}
#downloadsSummaryDescription {
color: -moz-nativehyperlinktext;
}
richlistitem[type="download"] {
#downloadsRichListBox {
-moz-appearance: none;
margin: 0;
border-top: 1px solid hsla(0,0%,100%,.3);
border-bottom: 1px solid hsla(220,18%,51%,.25);
background: transparent;
padding: 8px;
}
richlistitem[type="download"]:first-child {
border-top: 1px solid transparent;
}
@media (-moz-windows-default-theme) {
richlistitem[type="download"]:last-child {
border-bottom: 1px solid transparent;
}
}
#downloadsListBox:-moz-focusring > richlistitem[type="download"][selected] {
outline: 1px -moz-dialogtext dotted;
outline-offset: -1px;
#downloadsRichListBox > richlistitem.download {
height: 6em;
%ifndef WINSTRIPE_AERO
padding: 5px 8px;
%endif
}
.downloadTypeIcon {
-moz-margin-end: 8px;
%ifdef WINSTRIPE_AERO
-moz-margin-start: 8px;
%endif
/* Prevent flickering when changing states. */
min-height: 32px;
min-width: 32px;
@ -106,214 +29,37 @@ richlistitem[type="download"]:first-child {
}
.downloadTarget {
margin-bottom: 6px;
margin-bottom: 3px;
cursor: inherit;
}
.downloadDetails {
opacity: 0.6;
font-size: 90%;
opacity: 0.7;
font-size: 95%;
cursor: inherit;
}
.downloadButton {
-moz-appearance: none;
background: transparent;
min-width: 0;
min-height: 0;
margin: 3px;
border: none;
background: transparent;
padding: 5px;
list-style-image: url("chrome://browser/skin/downloads/buttons.png");
}
.downloadButton > .button-box {
padding: 0;
}
/*** Highlighted list items ***/
richlistitem[type="download"][state="1"]:hover {
border-radius: 3px;
border-top: 1px solid hsla(0,0%,100%,.2);
border-bottom: 1px solid hsla(0,0%,0%,.2);
background-color: Highlight;
color: HighlightText;
cursor: pointer;
}
/*** Button icons ***/
/*** Button icons ***/
.downloadButton.downloadCancel {
-moz-image-region: rect(0px, 16px, 16px, 0px);
}
.downloadButton.downloadCancel:hover {
-moz-image-region: rect(0px, 32px, 16px, 16px);
}
.downloadButton.downloadCancel:active {
-moz-image-region: rect(0px, 48px, 16px, 32px);
}
.downloadButton.downloadShow {
-moz-image-region: rect(16px, 16px, 32px, 0px);
}
.downloadButton.downloadShow:hover {
-moz-image-region: rect(16px, 32px, 32px, 16px);
}
.downloadButton.downloadShow:active {
-moz-image-region: rect(16px, 48px, 32px, 32px);
}
.downloadButton.downloadRetry {
-moz-image-region: rect(32px, 16px, 48px, 0px);
}
.downloadButton.downloadRetry:hover {
-moz-image-region: rect(32px, 32px, 48px, 16px);
}
.downloadButton.downloadRetry:active {
-moz-image-region: rect(32px, 48px, 48px, 32px);
}
%ifdef WINSTRIPE_AERO
@media not all and (-moz-windows-default-theme) {
%endif
richlistitem[type="download"][state="1"]:hover > stack > .downloadButton.downloadShow {
-moz-image-region: rect(48px, 16px, 64px, 0px);
}
richlistitem[type="download"][state="1"]:hover > stack > .downloadButton.downloadShow:hover {
-moz-image-region: rect(48px, 32px, 64px, 16px);
}
richlistitem[type="download"][state="1"]:hover > stack > .downloadButton.downloadShow:active {
-moz-image-region: rect(48px, 48px, 64px, 32px);
}
%ifdef WINSTRIPE_AERO
}
%endif
/*** Status and progress indicator ***/
#downloads-indicator-anchor {
/* Makes the outermost stack element positioned, so that its contents are
rendered over the main browser window in the Z order. This is required by
the animated event notification. */
position: relative;
}
/*** Main indicator icon ***/
#downloads-indicator-icon {
background: -moz-image-rect(url("chrome://browser/skin/Toolbar.png"),
0, 108, 18, 90) center no-repeat;
min-width: 18px;
min-height: 18px;
}
#downloads-indicator-icon:-moz-lwtheme-brighttext {
background: -moz-image-rect(url("chrome://browser/skin/Toolbar-inverted.png"),
0, 108, 18, 90) center no-repeat;
}
#downloads-indicator[attention] > #downloads-indicator-anchor > #downloads-indicator-icon {
background-image: url("chrome://browser/skin/downloads/download-glow.png");
}
#downloads-indicator:not([counter]) > #downloads-indicator-anchor > #downloads-indicator-progress-area > #downloads-indicator-counter {
background: -moz-image-rect(url("chrome://browser/skin/Toolbar.png"),
0, 108, 18, 90) center no-repeat;
background-size: 12px;
}
#downloads-indicator:not([counter])[attention] > #downloads-indicator-anchor > #downloads-indicator-progress-area > #downloads-indicator-counter {
background-image: url("chrome://browser/skin/downloads/download-glow.png");
}
/*** Event notification ***/
#downloads-indicator-notification {
opacity: 0;
background: url("chrome://browser/skin/downloads/download-notification.png")
center no-repeat;
background-size: 16px;
}
@keyframes downloadsIndicatorNotificationRight {
from { opacity: 0; transform: translate(-128px, 128px) scale(8); }
20% { opacity: .85; animation-timing-function: ease-out; }
to { opacity: 0; transform: translate(0) scale(1); }
}
@keyframes downloadsIndicatorNotificationLeft {
from { opacity: 0; transform: translate(128px, 128px) scale(8); }
20% { opacity: .85; animation-timing-function: ease-out; }
to { opacity: 0; transform: translate(0) scale(1); }
}
#downloads-indicator[notification] > #downloads-indicator-anchor > #downloads-indicator-notification {
animation-name: downloadsIndicatorNotificationRight;
animation-duration: 1s;
}
#downloads-indicator[notification]:-moz-locale-dir(rtl) > #downloads-indicator-anchor > #downloads-indicator-notification {
animation-name: downloadsIndicatorNotificationLeft;
}
/*** Progress bar and text ***/
#downloads-indicator-counter {
height: 9px;
margin: -3px 0px 0px 0px;
color: hsl(0,0%,30%);
text-shadow: hsla(0,0%,100%,.5) 0 1px;
font-size: 9px;
line-height: 9px;
text-align: center;
}
#downloads-indicator-counter:-moz-lwtheme-brighttext {
color: white;
text-shadow: 0 0 1px rgba(0,0,0,.7),
0 1px 1.5px rgba(0,0,0,.5);
}
#downloads-indicator-progress {
width: 16px;
height: 5px;
min-width: 0;
min-height: 0;
margin-top: 1px;
margin-bottom: 2px;
border-radius: 2px;
box-shadow: 0 1px 0 hsla(0,0%,100%,.4);
}
#downloads-indicator-progress > .progress-bar {
-moz-appearance: none;
min-width: 0;
min-height: 0;
background-color: rgb(90, 201, 66);
background-image: linear-gradient(transparent 1px, rgba(255, 255, 255, 0.4) 1px, rgba(255, 255, 255, 0.4) 2px, transparent 2px);
border: 1px solid;
border-color: rgba(0,43,86,.6) rgba(0,43,86,.4) rgba(0,43,86,.4);
border-radius: 2px 0 0 2px;
}
#downloads-indicator-progress > .progress-remainder {
-moz-appearance: none;
min-width: 0;
min-height: 0;
background-image: linear-gradient(#505050, #575757);
border: 1px solid;
border-color: hsla(0,0%,0%,.6) hsla(0,0%,0%,.4) hsla(0,0%,0%,.4);
-moz-border-start: none;
border-radius: 0 2px 2px 0;
}
#downloads-indicator[paused] > #downloads-indicator-anchor > #downloads-indicator-progress-area > #downloads-indicator-progress > .progress-bar {
background-color: rgb(220, 230, 81);
}
#downloads-indicator[paused] > #downloads-indicator-anchor > #downloads-indicator-progress-area > #downloads-indicator-progress > .progress-remainder {
background-image: linear-gradient(#4b5000, #515700);
}

View File

@ -278,7 +278,7 @@ browser.jar:
skin/classic/aero/browser/downloads/download-glow.png (downloads/download-glow.png)
skin/classic/aero/browser/downloads/download-notification.png (downloads/download-notification.png)
* skin/classic/aero/browser/downloads/downloads.css (downloads/downloads-aero.css)
skin/classic/aero/browser/downloads/allDownloadsViewOverlay.css (downloads/allDownloadsViewOverlay.css)
* skin/classic/aero/browser/downloads/allDownloadsViewOverlay.css (downloads/allDownloadsViewOverlay-aero.css)
skin/classic/aero/browser/feeds/feedIcon.png (feeds/feedIcon-aero.png)
skin/classic/aero/browser/feeds/feedIcon16.png (feeds/feedIcon16-aero.png)
skin/classic/aero/browser/feeds/audioFeedIcon.png (feeds/feedIcon-aero.png)

View File

@ -57,12 +57,6 @@ APP_INI_DEPS += $(DEPTH)/config/buildid
DEFINES += -DGRE_MILESTONE=$(GRE_MILESTONE) -DAPP_BUILDID=$(APP_BUILDID)
# Set a flag that can be used in pref files to disable features if
# we are not building for Aurora or Nightly.
ifeq (,$(findstring a,$(GRE_MILESTONE)))
PREF_PPFLAGS += -DRELEASE_BUILD
endif
DEFINES += -DMOZ_APP_VERSION="$(MOZ_APP_VERSION)"
APP_INI_DEPS += $(DEPTH)/config/autoconf.mk

View File

@ -450,6 +450,8 @@ user_pref("extensions.getAddons.get.url", "http://%(server)s/extensions-dummy/re
user_pref("extensions.getAddons.getWithPerformance.url", "http://%(server)s/extensions-dummy/repositoryGetWithPerformanceURL");
user_pref("extensions.getAddons.search.browseURL", "http://%(server)s/extensions-dummy/repositoryBrowseURL");
user_pref("extensions.getAddons.search.url", "http://%(server)s/extensions-dummy/repositorySearchURL");
// Make sure that opening the plugins check page won't hit the network
user_pref("plugins.update.url", "http://%(server)s/plugins-dummy/updateCheckURL");
// Make enablePrivilege continue to work for test code. :-(
user_pref("security.turn_off_all_security_so_that_viruses_can_take_over_this_computer", true);

View File

@ -56,11 +56,7 @@ xpcshell-tests:
xpcshell-tests-remote: DM_TRANS?=adb
xpcshell-tests-remote:
$(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
-I$(topsrcdir)/build \
-I$(topsrcdir)/build/mobile \
-I$(topsrcdir)/testing/mozbase/mozdevice/mozdevice \
$(topsrcdir)/testing/xpcshell/remotexpcshelltests.py \
$(PYTHON) -u $(topsrcdir)/testing/xpcshell/remotexpcshelltests.py \
--symbols-path=$(DIST)/crashreporter-symbols \
--build-info-json=$(DEPTH)/mozinfo.json \
--testing-modules-dir=$(DEPTH)/_tests/modules \

View File

@ -3995,7 +3995,7 @@ MOZ_ARG_WITH_BOOL(system-nss,
_USE_SYSTEM_NSS=1 )
if test -n "$_USE_SYSTEM_NSS"; then
AM_PATH_NSS(3.14.1, [MOZ_NATIVE_NSS=1], [AC_MSG_ERROR([you don't have NSS installed or your version is too old])])
AM_PATH_NSS(3.14.2, [MOZ_NATIVE_NSS=1], [AC_MSG_ERROR([you don't have NSS installed or your version is too old])])
fi
if test -n "$MOZ_NATIVE_NSS"; then
@ -8713,14 +8713,12 @@ AC_SUBST(MOZ_TELEMETRY_DISPLAY_REV)
if test "$MOZ_TELEMETRY_REPORTING"; then
AC_DEFINE(MOZ_TELEMETRY_REPORTING)
# Those lines will remain commented until we are ready to enable
# telemetry by default on Nightly & Aurora channels.
#
# Enable Telemetry by default for nightly and aurora channels
# if test "$MOZ_UPDATE_CHANNEL" = "nightly" -o \
# "$MOZ_UPDATE_CHANNEL" = "aurora"; then
# AC_DEFINE(MOZ_TELEMETRY_ON_BY_DEFAULT)
# fi
if test "$MOZ_UPDATE_CHANNEL" = "nightly" -o \
"$MOZ_UPDATE_CHANNEL" = "aurora"; then
AC_DEFINE(MOZ_TELEMETRY_ON_BY_DEFAULT)
fi
fi
dnl win32 options

View File

@ -224,7 +224,7 @@ interface nsISelectionController : nsISelectionDisplay
*/
void scrollPage(in boolean forward);
/** ScrolLine will scroll line up or down dependent on the boolean
/** ScrollLine will scroll line up or down dependent on the boolean
* @param aForward scroll forward or backwards in selection
*/
void scrollLine(in boolean forward);

View File

@ -200,6 +200,7 @@ LOCAL_INCLUDES += \
-I$(topsrcdir)/layout/svg \
-I$(topsrcdir)/layout/xul/base/src \
-I$(topsrcdir)/netwerk/base/src \
-I$(topsrcdir)/js/xpconnect/wrappers \
$(NULL)
DEFINES += -D_IMPL_NS_LAYOUT

View File

@ -1296,6 +1296,7 @@ GK_ATOM(markerUnits, "markerUnits")
GK_ATOM(markerWidth, "markerWidth")
GK_ATOM(mask, "mask")
GK_ATOM(maskContentUnits, "maskContentUnits")
GK_ATOM(mask_type, "mask-type")
GK_ATOM(maskUnits, "maskUnits")
GK_ATOM(matrix, "matrix")
GK_ATOM(metadata, "metadata")

View File

@ -102,6 +102,7 @@
#include "nsCSSParser.h"
#include "nsHTMLLegendElement.h"
#include "nsWrapperCacheInlines.h"
#include "WrapperFactory.h"
using namespace mozilla;
using namespace mozilla::dom;
@ -2352,7 +2353,18 @@ nsINode::WrapObject(JSContext *aCx, JSObject *aScope, bool *aTriedToWrap)
return nullptr;
}
return WrapNode(aCx, aScope, aTriedToWrap);
JSObject* obj = WrapNode(aCx, aScope, aTriedToWrap);
if (obj && ChromeOnlyAccess()) {
// Create a new wrapper and cache it.
JSAutoCompartment ac(aCx, obj);
JSObject* wrapper = xpc::WrapperFactory::WrapSOWObject(aCx, obj);
if (!wrapper) {
ClearWrapper();
return nullptr;
}
dom::SetSystemOnlyWrapper(obj, this, *wrapper);
}
return obj;
}
bool

View File

@ -30,6 +30,7 @@
#include "nsWrapperCacheInlines.h"
#include "nsObjectLoadingContent.h"
#include "nsDOMMutationObserver.h"
#include "mozilla/dom/BindingUtils.h"
using namespace mozilla::dom;
@ -400,7 +401,9 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, bool aClone, bool aDeep,
nsresult rv;
JSObject *wrapper;
if (aCx && (wrapper = aNode->GetWrapper())) {
bool isDOMBinding;
if (aCx && (wrapper = aNode->GetWrapper()) &&
!(isDOMBinding = IsDOMObject(wrapper))) {
rv = xpc_MorphSlimWrapper(aCx, aNode);
NS_ENSURE_SUCCESS(rv, rv);
}
@ -525,15 +528,19 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, bool aClone, bool aDeep,
}
if (aCx && wrapper) {
nsIXPConnect *xpc = nsContentUtils::XPConnect();
if (xpc) {
rv = xpc->ReparentWrappedNativeIfFound(aCx, wrapper, aNewScope, aNode);
if (NS_FAILED(rv)) {
aNode->mNodeInfo.swap(nodeInfo);
return rv;
if (isDOMBinding) {
rv = ReparentWrapper(aCx, wrapper);
} else {
nsIXPConnect *xpc = nsContentUtils::XPConnect();
if (xpc) {
rv = xpc->ReparentWrappedNativeIfFound(aCx, wrapper, aNewScope, aNode);
}
}
if (NS_FAILED(rv)) {
aNode->mNodeInfo.swap(nodeInfo);
return rv;
}
}
}

View File

@ -25,7 +25,7 @@ window.addEventListener("message", function(e) {
};
var xhr = new XMLHttpRequest();
for each(type in ["load", "abort", "error", "loadstart", "loadend"]) {
for (type of ["load", "abort", "error", "loadstart", "loadend"]) {
xhr.addEventListener(type, function(e) {
res.events.push(e.type);
}, false);

View File

@ -14,7 +14,7 @@ window.addEventListener("message", function(e) {\n\
};\n\
\n\
var xhr = new XMLHttpRequest();\n\
for each(type in ["load", "abort", "error", "loadstart", "loadend"]) {\n\
for (type of ["load", "abort", "error", "loadstart", "loadend"]) {\n\
xhr.addEventListener(type, function(e) {\n\
res.events.push(e.type);\n\
}, false);\n\

View File

@ -572,7 +572,7 @@ function runTest() {
tests = [];
}
for each(test in tests) {
for (test of tests) {
var req = {
url: baseURL + "allowOrigin=" + escape(test.origin || origin),
method: test.method,
@ -787,7 +787,7 @@ function runTest() {
tests = [];
}
for each(test in tests) {
for (test of tests) {
req = {
url: baseURL + "allowOrigin=" + escape(test.origin || origin),
method: test.method,
@ -1112,7 +1112,7 @@ function runTest() {
tests = [];
}
for each(test in tests) {
for (test of tests) {
req = {
url: test.hops[0].server + basePath + "hop=1&hops=" +
escape(test.hops.toSource()),

View File

@ -432,7 +432,7 @@ function runTest() {
setStateURL = baseURL + "setState=";
var unique = Date.now();
for each (test in tests) {
for (test of tests) {
if (test.newTest) {
unique++;
continue;

View File

@ -64,7 +64,7 @@ function runTest() {
basePath = "/tests/content/base/test/file_CrossSiteXHR_server.sjs?"
baseURL = "http://mochi.test:8888" + basePath;
for each(originEntry in origins) {
for (originEntry of origins) {
origin = originEntry.origin || originEntry.server;
loader.src = originEntry.file ||
@ -113,7 +113,7 @@ function runTest() {
failTests = failTests.filter(function(v) { return v != origin });
}
for each(allowOrigin in passTests) {
for (allowOrigin of passTests) {
req = {
url: baseURL +
"allowOrigin=" + escape(allowOrigin) +
@ -136,7 +136,7 @@ function runTest() {
"wrong responseText in test for " + allowOrigin);
}
for each(allowOrigin in failTests) {
for (allowOrigin of failTests) {
req = {
url: baseURL + "allowOrigin=" + escape(allowOrigin),
method: "GET",

View File

@ -213,7 +213,7 @@ for (var i = 0; i < testDOMFiles.length; i++) {
}
try {
for each(test in tests) {
for (test of tests) {
xhr = new XMLHttpRequest;
xhr.open("POST", "file_XHRSendData.sjs", !!test.resType);
if (test.contentType)

View File

@ -52,11 +52,11 @@ function checkPrincipal() {
addLoadEvent(function() {
checkPrincipal();
for each (var i in [ "one", "two", "three", "four" ]) {
for (var i of [ "one", "two", "three", "four" ]) {
doPrincipalTest(i);
}
for each (i in [ "five", "six" ]) {
for (i of [ "five", "six" ]) {
doContentTest(i);
}

View File

@ -30,7 +30,7 @@ var body = [
isupports_string
];
for each (var i in body) {
for (var i of body) {
var xhr = new XMLHttpRequest();
xhr.open("POST", url, true);
if (i == isupports_string)

View File

@ -25,7 +25,7 @@ addLoadEvent(function() {
const scriptContainers = ["div", "iframe", "noframes", "noembed"];
for (var i = 0; i < scriptContainers.length; ++i) {
for each (var func in scriptCreationFuncs) {
for (var func of scriptCreationFuncs) {
var cont = scriptContainers[i];
var node = document.createElement(cont);
document.body.appendChild(node);

View File

@ -12,7 +12,7 @@
function test_method(context, method, arity) {
function testParams(existingParams, depth) {
for each (var arg in stringArgs) {
for (var arg of stringArgs) {
var code = "context[method](" + existingParams + arg + ")";
try {
eval(code);

View File

@ -36,7 +36,7 @@ addLoadEvent(function() {
/** @see test_bug336682.js */
MAX_STATE = 4;
for each(var event in ["online", "offline"]) {
for (var event of ["online", "offline"]) {
document.body.addEventListener(
event,
makeHandler("document.body.addEventListener('%1', ..., false)",

View File

@ -77,7 +77,7 @@ function sendTouchEvent(windowUtils, aType, aEvent, aModifiers) {
var ids = [], xs=[], ys=[], rxs = [], rys = [],
rotations = [], forces = [];
for each (var touchType in ["touches", "changedTouches", "targetTouches"]) {
for (var touchType of ["touches", "changedTouches", "targetTouches"]) {
for (var i = 0; i < aEvent[touchType].length; i++) {
if (ids.indexOf(aEvent[touchType][i].identifier) == -1) {
ids.push(aEvent[touchType][i].identifier);

View File

@ -72,7 +72,7 @@ function sendTouchEvent(windowUtils, aType, aEvent, aModifiers) {
var ids = [], xs=[], ys=[], rxs = [], rys = [],
rotations = [], forces = [];
for each (var touchType in ["touches", "changedTouches", "targetTouches"]) {
for (var touchType of ["touches", "changedTouches", "targetTouches"]) {
for (var i = 0; i < aEvent[touchType].length; i++) {
if (ids.indexOf(aEvent[touchType][i].identifier) == -1) {
ids.push(aEvent[touchType][i].identifier);

View File

@ -7,7 +7,7 @@
var body = document.body;
var elements = ["input", "textarea", "select", "button"];
for each (var e in elements) {
for (var e of elements) {
var el = document.createElement(e);
el.autofocus = true;
body.appendChild(el);

View File

@ -9,6 +9,7 @@
#include "nsGenericHTMLElement.h"
#include "nsStyleConsts.h"
#include "nsMappedAttributes.h"
#include "mozilla/dom/HTMLDivElementBinding.h"
using namespace mozilla;
using namespace mozilla::dom;
@ -19,6 +20,7 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(Div)
nsHTMLDivElement::nsHTMLDivElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
SetIsDOMBinding();
}
nsHTMLDivElement::~nsHTMLDivElement()
@ -40,6 +42,11 @@ NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLDivElement)
NS_IMPL_ELEMENT_CLONE(nsHTMLDivElement)
JSObject*
nsHTMLDivElement::WrapNode(JSContext *aCx, JSObject *aScope, bool *aTriedToWrap)
{
return dom::HTMLDivElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
}
bool
nsHTMLDivElement::ParseAttribute(int32_t aNamespaceID,

View File

@ -8,8 +8,8 @@
#include "nsGenericHTMLElement.h"
#include "nsIDOMHTMLDivElement.h"
class nsHTMLDivElement : public nsGenericHTMLElement,
public nsIDOMHTMLDivElement
class nsHTMLDivElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLDivElement
{
public:
nsHTMLDivElement(already_AddRefed<nsINodeInfo> aNodeInfo);
@ -61,6 +61,10 @@ public:
virtual nsXPCClassInfo* GetClassInfo();
virtual nsIDOMNode* AsDOMNode() { return this; }
protected:
virtual JSObject* WrapNode(JSContext *aCx, JSObject *aScope,
bool *aTriedToWrap) MOZ_OVERRIDE;
};
#endif /* nsHTMLDivElement_h___ */

View File

@ -7,6 +7,7 @@
#include "nsIDOMHTMLElement.h"
#include "nsContentUtils.h"
#include "mozilla/dom/HTMLElementBinding.h"
using namespace mozilla;
using namespace mozilla::dom;
@ -38,6 +39,10 @@ public:
virtual nsXPCClassInfo* GetClassInfo();
virtual nsIDOMNode* AsDOMNode() { return this; }
protected:
virtual JSObject* WrapNode(JSContext *aCx, JSObject *aScope,
bool *aTriedToWrap) MOZ_OVERRIDE;
};
// Here, we expand 'NS_IMPL_NS_NEW_HTML_ELEMENT()' by hand.
@ -52,6 +57,7 @@ NS_NewHTMLElement(already_AddRefed<nsINodeInfo> aNodeInfo,
nsHTMLElement::nsHTMLElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
SetIsDOMBinding();
}
nsHTMLElement::~nsHTMLElement()
@ -90,3 +96,8 @@ nsHTMLElement::GetInnerHTML(nsAString& aInnerHTML, ErrorResult& aError)
nsGenericHTMLElement::GetInnerHTML(aInnerHTML, aError);
}
JSObject*
nsHTMLElement::WrapNode(JSContext *aCx, JSObject *aScope, bool *aTriedToWrap)
{
return dom::HTMLElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
}

5
content/html/content/src/nsHTMLMediaElement.cpp Normal file → Executable file
View File

@ -3564,8 +3564,9 @@ void nsHTMLMediaElement::UpdateAudioChannelPlayingState()
// The nsHTMLMediaElement is registered to the AudioChannelService only on B2G.
#ifdef MOZ_B2G
bool playingThroughTheAudioChannel =
(mReadyState >= nsIDOMHTMLMediaElement::HAVE_FUTURE_DATA &&
IsPotentiallyPlaying());
(mReadyState >= nsIDOMHTMLMediaElement::HAVE_CURRENT_DATA &&
!mPaused &&
!IsPlaybackEnded());
if (playingThroughTheAudioChannel != mPlayingThroughTheAudioChannel) {
mPlayingThroughTheAudioChannel = playingThroughTheAudioChannel;

View File

@ -4,12 +4,20 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsHTMLUnknownElement.h"
#include "mozilla/dom/HTMLElementBinding.h"
using namespace mozilla::dom;
NS_IMPL_ADDREF_INHERITED(nsHTMLUnknownElement, Element)
NS_IMPL_RELEASE_INHERITED(nsHTMLUnknownElement, Element)
JSObject*
nsHTMLUnknownElement::WrapNode(JSContext *aCx, JSObject *aScope,
bool *aTriedToWrap)
{
return HTMLUnknownElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
}
NS_IMPL_NS_NEW_HTML_ELEMENT(Unknown)
DOMCI_NODE_DATA(HTMLUnknownElement, nsHTMLUnknownElement)

View File

@ -8,13 +8,14 @@
#include "nsGenericHTMLElement.h"
#include "nsIDOMHTMLUnknownElement.h"
class nsHTMLUnknownElement : public nsGenericHTMLElement
, public nsIDOMHTMLUnknownElement
class nsHTMLUnknownElement MOZ_FINAL : public nsGenericHTMLElement
, public nsIDOMHTMLUnknownElement
{
public:
nsHTMLUnknownElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
SetIsDOMBinding();
if (NodeInfo()->Equals(nsGkAtoms::bdi)) {
SetHasDirAuto();
}
@ -37,6 +38,10 @@ public:
virtual nsXPCClassInfo* GetClassInfo();
virtual nsIDOMNode* AsDOMNode() { return this; }
protected:
virtual JSObject* WrapNode(JSContext *aCx, JSObject *aScope,
bool *aTriedToWrap) MOZ_OVERRIDE;
};
#endif /* nsHTMLUnknownElement_h___ */

View File

@ -407,7 +407,7 @@ var todoElements = [
['keygen', 'Keygen'],
];
for each(var e in todoElements) {
for (var e of todoElements) {
var node = document.createElement(e[0]);
var nodeString = HTMLElement.prototype.toString.apply(node);
nodeString = nodeString.replace(/Element[\] ].*/, "Element");
@ -415,22 +415,22 @@ for each(var e in todoElements) {
e[0] + " should not be implemented");
}
for each(var name in elementNames) {
for (var name of elementNames) {
var elements = [
document.createElement(name),
document.createElement(name),
];
for each(var func in functions) {
for (var func of functions) {
// Clean-up.
while (content.firstChild) {
content.removeChild(content.firstChild);
}
for each(form in forms) {
for (form of forms) {
content.appendChild(form);
form.removeAttribute('id');
}
for each(e in elements) {
for (e of elements) {
content.appendChild(e);
e.removeAttribute('form');
is(e.form, null, "The element should not have a form owner");
@ -459,7 +459,7 @@ for each(var name in elementNames) {
}
// Cleaning-up.
for each(e in elements) {
for (e of elements) {
e.parentNode.removeChild(e);
e = null;
}

View File

@ -144,7 +144,7 @@ legalCharacters += "0123456789";
legalCharacters += "!#$%&'*+-/=?^_`{|}~.";
// Add all username legal characters individually to the list.
for each (c in legalCharacters) {
for (c of legalCharacters) {
values.push([c + "@bar.com", true]);
}
// Add the concatenation of all legal characters too.
@ -152,7 +152,7 @@ values.push([legalCharacters + "@bar.com", true]);
// Add username illegal characters, the same way.
var illegalCharacters = "()<>[]:;@\\, \t";
for each (c in illegalCharacters) {
for (c of illegalCharacters) {
values.push([illegalCharacters + "@bar.com", false]);
}
@ -164,7 +164,7 @@ legalCharacters += "0123456789";
legalCharacters += "-";
// Add domain legal characters (except '.' because it's special).
for each (c in legalCharacters) {
for (c of legalCharacters) {
values.push(["foo@foo.bar" + c, true]);
}
// Add the concatenation of all legal characters too.
@ -172,7 +172,7 @@ values.push(["foo@bar.com" + legalCharacters, true]);
// Add domain illegal characters.
illegalCharacters = "()<>[]:;@\\,!#$%&'*+/=?^_`{|}~ \t";
for each (c in illegalCharacters) {
for (c of illegalCharacters) {
values.push(['foo@foo.ba' + c + 'r', false]);
}

View File

@ -235,7 +235,7 @@ var tests = [ test1, test2, test3, test4, test5, test6, test7, test8, test9,
test0();
for each (var test in tests) {
for (var test of tests) {
var content = document.getElementById('content');
// Clean-up.

View File

@ -107,7 +107,7 @@ addLoadEvent(function () {
SpecialPowers.pushPrefEnv({'set': [["dom.experimental_forms", true]]}, function() {
input.type = "number";
for each (data in validData) {
for (data of validData) {
input.value = "";
SpecialPowers.focus(input);
sendString(data);
@ -115,7 +115,7 @@ addLoadEvent(function () {
is(input.value, data, "valid user input should not be sanitized");
}
for each (data in invalidData) {
for (data of invalidData) {
input.value = "";
SpecialPowers.focus(input);
sendString(data);

View File

@ -79,7 +79,7 @@ function checkValidity(aElement, aValidity, aApply, aRangeApply)
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({'set': [["dom.experimental_forms", true]]}, function() {
for each (var data in types) {
for (var data of types) {
input.type = data[0];
var apply = data[1];

View File

@ -86,7 +86,7 @@ function checkValueAttribute()
var element = document.createElement('meter');
for each(var test in tests) {
for (var test of tests) {
if (test[2]) {
element.setAttribute('max', test[2]);
}
@ -118,7 +118,7 @@ function checkMinAttribute()
var element = document.createElement('meter');
for each(var test in tests) {
for (var test of tests) {
checkAttribute(element, 'min', test[0], test[1]);
}
}
@ -144,7 +144,7 @@ function checkMaxAttribute()
var element = document.createElement('meter');
for each(var test in tests) {
for (var test of tests) {
if (test[2]) {
element.setAttribute('min', test[2]);
}
@ -181,7 +181,7 @@ function checkLowAttribute()
var element = document.createElement('meter');
for each(var test in tests) {
for (var test of tests) {
if (test[2]) {
element.setAttribute('min', test[2]);
}
@ -222,7 +222,7 @@ function checkHighAttribute()
var element = document.createElement('meter');
for each(var test in tests) {
for (var test of tests) {
if (test[2]) {
element.setAttribute('min', test[2]);
}
@ -263,7 +263,7 @@ function checkOptimumAttribute()
var element = document.createElement('meter');
for each(var test in tests) {
for (var test of tests) {
if (test[2]) {
element.setAttribute('min', test[2]);
}

View File

@ -79,7 +79,7 @@ function checkValidity(aElement, aValidity, aApply, aRangeApply)
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({'set': [["dom.experimental_forms", true]]}, function() {
for each (var data in types) {
for (var data of types) {
input.type = data[0];
var apply = data[1];

View File

@ -105,19 +105,19 @@ function checkMozIsTextFieldValueTodo(aInput, aResult)
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({'set': [["dom.experimental_forms", true]]}, function() {
// Check if the method is defined for the correct elements.
for each (data in gElementTestData) {
for (data of gElementTestData) {
checkMozIsTextFieldDefined(data[0], data[1]);
}
// Check if the method returns the correct value.
var input = document.createElement('input');
for each (data in gInputTestData) {
for (data of gInputTestData) {
input.type = data[0];
checkMozIsTextFieldValue(input, data[1]);
}
// Check for the todo's.
for each (data in gInputTodoData) {
for (data of gInputTodoData) {
input.type = data[0];
checkMozIsTextFieldValueTodo(input, data[1]);
}

View File

@ -268,18 +268,18 @@ var invalidTypes = Array('checkbox', 'radio', 'file', 'number');
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({'set': [["dom.experimental_forms", true]]}, function() {
for each (type in validTypes) {
for (type of validTypes) {
input.type = type;
completeValidityCheck(input, false);
checkPatternValidity(input);
}
for each (type in barredTypes) {
for (type of barredTypes) {
input.type = type;
completeValidityCheck(input, true, true);
}
for each (type in invalidTypes) {
for (type of invalidTypes) {
input.type = type;
completeValidityCheck(input, true);
}

View File

@ -85,7 +85,7 @@ function checkValueAttribute()
var element = document.createElement('progress');
for each(var test in tests) {
for (var test of tests) {
if (test[2]) {
element.setAttribute('max', test[2]);
}
@ -114,7 +114,7 @@ function checkMaxAttribute()
var element = document.createElement('progress');
for each(var test in tests) {
for (var test of tests) {
checkAttribute(element, 'max', test[0], test[1]);
}
}
@ -165,7 +165,7 @@ function checkPositionAttribute()
var element = document.createElement('progress');
for each(var test in tests) {
for (var test of tests) {
checkPositionValue(element, test[0], test[1], test[2], test[3]);
}
}
@ -206,7 +206,7 @@ function checkIndeterminatePseudoClass()
var element = document.createElement('progress');
for each(var test in tests) {
for (var test of tests) {
checkIndeterminate(element, test[0], test[1], test[2]);
}
}

View File

@ -358,14 +358,14 @@ checkTextareaRequiredValidity();
// First of all, checks for types that make the element barred from
// constraint validation.
var typeBarredFromConstraintValidation = ["hidden", "button", "reset", "submit", "image"];
for each (type in typeRequireNotApply) {
for (type of typeBarredFromConstraintValidation) {
checkInputRequiredNotApply(type, true);
}
// Then, checks for the types which do not use the required attribute.
// TODO: check 'color' and 'range' when they will be implemented.
var typeRequireNotApply = [];
for each (type in typeRequireNotApply) {
for (type of typeRequireNotApply) {
checkInputRequiredNotApply(type, false);
}
@ -375,7 +375,7 @@ for each (type in typeRequireNotApply) {
var typeRequireApply = ["text", "password", "search", "tel", "email", "url",
"number"];
for each (type in typeRequireApply) {
for (type of typeRequireApply) {
checkInputRequiredValidity(type);
}

View File

@ -76,7 +76,7 @@ function checkValidity(aElement, aValidity, aApply, aData)
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({'set': [["dom.experimental_forms", true]]}, function() {
for each (var data in types) {
for (var data of types) {
var input = getFreshElement(data[0]);
var apply = data[1];

View File

@ -66,7 +66,7 @@ function checkAvailability()
var element = document.createElement("input");
element.setAttribute('value', '0');
for each (data in testData) {
for (data of testData) {
var exceptionCaught = false;
element.type = data[0];
try {
@ -85,7 +85,7 @@ function checkAvailability()
is(exceptionCaught, !data[1], "stepUp() availability is not correct");
}
for each (data in todoList) {
for (data of todoList) {
var exceptionCaught = false;
element.type = data[0];
try {
@ -180,7 +180,7 @@ function checkStepDownForNumber()
[ '1', '2', null, null, null, '-1', false ],
];
for each (var data in testData) {
for (var data of testData) {
var element = document.createElement("input");
element.type = 'number';
@ -290,7 +290,7 @@ function checkStepUpForNumber()
[ '1', '2', null, null, null, '3', false ],
];
for each (var data in testData) {
for (var data of testData) {
var element = document.createElement("input");
element.type = 'number';

View File

@ -60,7 +60,7 @@ function checkAvailability()
];
for each (data in testData) {
for (data of testData) {
var exceptionCatched = false;
element.type = data[0];
try {
@ -81,7 +81,7 @@ function checkAvailability()
" availability is not correct");
}
for each (data in todoList) {
for (data of todoList) {
var exceptionCatched = false;
element.type = data[0];
try {
@ -124,7 +124,7 @@ function checkGet()
];
element.type = "number";
for each (data in testData) {
for (data of testData) {
element.value = data[0];
if (data[1] != null) {
is(element.valueAsNumber, data[1], "valueAsNumber should return the " +
@ -153,7 +153,7 @@ function checkSet()
];
element.type = "number";
for each (data in testData) {
for (data of testData) {
element.valueAsNumber = data[0];
if (data[1] != null) {
is(element.value, data[1],

View File

@ -156,7 +156,7 @@ function reflectUnsignedInt(aParameters)
var values = [ 1, 3, 42, 2147483647 ];
for each (var value in values) {
for (var value of values) {
element[attr] = value;
is(element[attr], value, "." + attr + " should be equals " + value);
is(element.getAttribute(attr), value,
@ -188,7 +188,7 @@ function reflectUnsignedInt(aParameters)
[ 3147483647, 3147483647 ],
];
for each (var values in nonValidValues) {
for (var values of nonValidValues) {
element[attr] = values[0];
is(element.getAttribute(attr), values[1],
"@" + attr + " should be equals to " + values[1]);
@ -196,7 +196,7 @@ function reflectUnsignedInt(aParameters)
"." + attr + " should be equals to " + defaultValue);
}
for each (var values in nonValidValues) {
for (var values of nonValidValues) {
element.setAttribute(attr, values[0]);
is(element.getAttribute(attr), values[0],
"@" + attr + " should be equals to " + values[0]);

View File

@ -75,7 +75,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=274626
"textarea_enabled", "textarea_disabled", "select_enabled",
"select_disabled", "fieldset_enabled", "fieldset_disabled"];
for each(id in controls) {
for (id of controls) {
var ctrl = document.getElementById(id);
ctrl.addEventListener('mousemove', HandlesMouseMove, false);
ctrl.handlesMouseMove = false;

View File

@ -41,8 +41,7 @@ function HTML_TAG(aTagName, aImplClass) {
// inherit from them do.
interfacesNonClassinfo[aTagName] =
[ "nsIDOMNode",
"nsIDOMElement",
"nsISupportsWeakReference" ];
"nsIDOMElement" ];
var interfaceName = "nsIDOM" + getClassName(aTagName);
if (interfaceName in SpecialPowers.Ci) { // no nsIDOMHTMLSpanElement
@ -78,7 +77,7 @@ const objectIfaces = [
];
var objectIfaces2 = [];
for each (var iface in objectIfaces) {
for (var iface of objectIfaces) {
objectIfaces2.push(iface);
}
objectIfaces2.push("nsIImageLoadingContent");
@ -227,7 +226,7 @@ function tagName(aTag) {
return "<" + aTag + ">";
}
for each (var tag in allTags) {
for (var tag of allTags) {
var node = document.createElement(tag);
// Have to use the proto's toString(), since HTMLAnchorElement and company
@ -249,7 +248,7 @@ for each (var tag in allTags) {
tagName(tag) + " is an instance of nsIDOMHTMLUnknownElement");
// Check that each node QIs to all the things we expect it to QI to
for each (var iface in interfaces[tag].concat(interfacesNonClassinfo[tag])) {
for (var iface of interfaces[tag].concat(interfacesNonClassinfo[tag])) {
is(iface in SpecialPowers.Ci, true,
iface + " not in Components.interfaces");
is(node instanceof SpecialPowers.Ci[iface], true,
@ -265,14 +264,14 @@ for each (var tag in allTags) {
map(function(id) { return SpecialPowers.Components.interfacesByID[id].toString(); });
// Make sure that we know about all the things classinfo claims
for each (var classInfoInterface in classInfoInterfaces) {
for (var classInfoInterface of classInfoInterfaces) {
isnot(interfaces[tag].indexOf(classInfoInterface), -1,
"Should know about " + tagName(tag) + " implementing " +
classInfoInterface);
}
// And make sure classinfo claims all the things we know about
for each (iface in interfaces[tag]) {
for (iface of interfaces[tag]) {
isnot(classInfoInterfaces.indexOf(iface), -1,
"Classinfo for " + tagName(tag) + " should claim to implement " +
iface);

View File

@ -433,7 +433,7 @@ function testElements(parent, tags, shouldBeFocusable)
focusable = focusableInContentEditable;
}
for each (var tag in tags) {
for (var tag of tags) {
parent.ownerDocument.body.focus();
if (focusableElementsTODO.indexOf(tag) > -1) {

View File

@ -36,7 +36,7 @@ function setFileInputs () {
SpecialPowers.wrap(singleFileInput).mozSetFileNameArray([f.path], 1);
var input2FileNames = [];
for each (file in input2Files) {
for (file of input2Files) {
f = createFileWithData(file.name, file.body);
input2FileNames.push(f.path);
}

View File

@ -89,7 +89,7 @@ function checkSanitizing(element)
"1.234567898765432",
];
for each (value in testData) {
for (value of testData) {
element.setAttribute('value', value);
is(element.value, sanitizeValue(type, value),
"The value has not been correctly sanitized for type=" + type);
@ -133,7 +133,7 @@ function checkSanitizing(element)
var pref = SpecialPowers.getBoolPref("dom.experimental_forms");
SpecialPowers.setBoolPref("dom.experimental_forms", true);
for each (type in inputTypes) {
for (type of inputTypes) {
var form = document.forms[0];
var element = document.createElement("input");
element.style.display = "none";
@ -155,7 +155,7 @@ for each (type in inputTypes) {
form.removeChild(element);
}
for each (type in todoTypes) {
for (type of todoTypes) {
// The only meaning of this is to have a failure when new types are introduced
// so we will know we have to write the tests here.
var form = document.forms[0];

View File

@ -162,7 +162,7 @@ function test1()
gHandled = 0;
// Initialize children without click expected.
for each(var name in elementsPreventingClick) {
for (var name of elementsPreventingClick) {
var element = document.createElement(name);
fieldset2.appendChild(element);
element.addEventListener("click", clickShouldNotHappenHandler, false);
@ -170,7 +170,7 @@ function test1()
}
// Initialize children with click expected.
for each(var name in elementsWithClick) {
for (var name of elementsWithClick) {
var element = document.createElement(name);
fieldset2.appendChild(element);
element.addEventListener("click", clickShouldHappenHandler, false);
@ -185,7 +185,7 @@ function test2()
fieldset2.disabled = true;
// Initialize children without click expected.
for each(var name in elementsPreventingClick) {
for (var name of elementsPreventingClick) {
var element = document.createElement(name);
fieldset2.appendChild(element);
element.addEventListener("click", clickShouldNotHappenHandler2, false);
@ -193,7 +193,7 @@ function test2()
}
// Initialize children with click expected.
for each(var name in elementsWithClick) {
for (var name of elementsWithClick) {
var element = document.createElement(name);
fieldset2.appendChild(element);
element.addEventListener("click", clickShouldHappenHandler2, false);
@ -208,7 +208,7 @@ function test3()
fieldset2.disabled = false;
// All elements should accept the click.
for each(var name in elementsPreventingClick) {
for (var name of elementsPreventingClick) {
var element = document.createElement(name);
fieldset2.appendChild(element);
element.addEventListener("click", clickShouldHappenHandler3, false);
@ -216,7 +216,7 @@ function test3()
}
// Initialize children with click expected.
for each(var name in elementsWithClick) {
for (var name of elementsWithClick) {
var element = document.createElement(name);
fieldset2.appendChild(element);
element.addEventListener("click", clickShouldHappenHandler3, false);
@ -233,7 +233,7 @@ function test4()
fieldset2.appendChild(legendA);
// All elements should accept the click.
for each(var name in elementsPreventingClick) {
for (var name of elementsPreventingClick) {
var element = document.createElement(name);
legendA.appendChild(element);
element.addEventListener("click", clickShouldHappenHandler4, false);
@ -241,7 +241,7 @@ function test4()
}
// Initialize children with click expected.
for each(var name in elementsWithClick) {
for (var name of elementsWithClick) {
var element = document.createElement(name);
legendA.appendChild(element);
element.addEventListener("click", clickShouldHappenHandler4, false);
@ -255,7 +255,7 @@ function test5()
fieldset2.insertBefore(legendB, legendA);
// Initialize children without click expected.
for each(var name in elementsPreventingClick) {
for (var name of elementsPreventingClick) {
var element = document.createElement(name);
legendA.appendChild(element);
element.addEventListener("click", clickShouldNotHappenHandler5, false);
@ -263,7 +263,7 @@ function test5()
}
// Initialize children with click expected.
for each(var name in elementsWithClick) {
for (var name of elementsWithClick) {
var element = document.createElement(name);
legendA.appendChild(element);
element.addEventListener("click", clickShouldHappenHandler5, false);
@ -282,7 +282,7 @@ function test6()
legendA.appendChild(fieldset2);
// All elements should accept the click.
for each(var name in elementsPreventingClick) {
for (var name of elementsPreventingClick) {
var element = document.createElement(name);
fieldset2.appendChild(element);
element.addEventListener("click", clickShouldHappenHandler6, false);
@ -290,7 +290,7 @@ function test6()
}
// Initialize children with click expected.
for each(var name in elementsWithClick) {
for (var name of elementsWithClick) {
var element = document.createElement(name);
fieldset2.appendChild(element);
element.addEventListener("click", clickShouldHappenHandler6, false);
@ -308,7 +308,7 @@ function test7()
fieldset2.appendChild(legendA);
// All elements should accept the click.
for each(var name in elementsPreventingClick) {
for (var name of elementsPreventingClick) {
var element = document.createElement(name);
legendA.appendChild(element);
element.addEventListener("click", clickShouldNotHappenHandler7, false);
@ -316,7 +316,7 @@ function test7()
}
// Initialize children with click expected.
for each(var name in elementsWithClick) {
for (var name of elementsWithClick) {
var element = document.createElement(name);
legendA.appendChild(element);
element.addEventListener("click", clickShouldHappenHandler7, false);
@ -335,7 +335,7 @@ function test8()
fieldset2.appendChild(legendB);
// All elements should accept the click.
for each(var name in elementsPreventingClick) {
for (var name of elementsPreventingClick) {
var element = document.createElement(name);
legendB.appendChild(element);
element.addEventListener("click", clickShouldHappenHandler8, false);
@ -343,7 +343,7 @@ function test8()
}
// Initialize children with click expected.
for each(var name in elementsWithClick) {
for (var name of elementsWithClick) {
var element = document.createElement(name);
legendB.appendChild(element);
element.addEventListener("click", clickShouldHappenHandler8, false);

View File

@ -38,7 +38,7 @@ function checkDisabledPseudoClass(aElement, aDisabled)
var disabledElements = document.querySelectorAll(":disabled");
var found = false;
for each(var e in disabledElements) {
for (var e of disabledElements) {
if (aElement == e) {
found = true;
break;
@ -55,7 +55,7 @@ function checkEnabledPseudoClass(aElement, aEnabled)
var enabledElements = document.querySelectorAll(":enabled");
var found = false;
for each(var e in enabledElements) {
for (var e of enabledElements) {
if (aElement == e) {
found = true;
break;
@ -141,7 +141,7 @@ content.appendChild(fieldset1);
fieldset1.appendChild(fieldset2);
fieldset2.disabled = true;
for each(var data in elements) {
for (var data of elements) {
var element = document.createElement(data);
if (data[4]) {

Some files were not shown because too many files have changed in this diff Show More