Merge m-c to b2ginbound, a=merge

This commit is contained in:
Wes Kocher 2015-10-07 11:11:10 -07:00
commit 8f74e3e6b9
1402 changed files with 13074 additions and 9063 deletions

View File

@ -22,4 +22,4 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.
Bug 1210755 - Android build: Switch to Android 6.0 SDK / API 23
Bug 1193206 - Building with Android support library 23.0.1

View File

@ -14,6 +14,8 @@
#include "OuterDocAccessible.h"
#include "ProxyAccessible.h"
#include "RootAccessible.h"
#include "TableAccessible.h"
#include "TableCellAccessible.h"
#include "nsMai.h"
#include "nsMaiHyperlink.h"
#include "nsString.h"
@ -1570,3 +1572,118 @@ AccessibleWrap::FireAtkShowHideEvent(AccEvent* aEvent,
return NS_OK;
}
// static
void
AccessibleWrap::GetKeyBinding(Accessible* aAccessible, nsAString& aResult)
{
// Return all key bindings including access key and keyboard shortcut.
// Get access key.
nsAutoString keyBindingsStr;
KeyBinding keyBinding = aAccessible->AccessKey();
if (!keyBinding.IsEmpty()) {
keyBinding.AppendToString(keyBindingsStr, KeyBinding::eAtkFormat);
Accessible* parent = aAccessible->Parent();
roles::Role role = parent ? parent->Role() : roles::NOTHING;
if (role == roles::PARENT_MENUITEM || role == roles::MENUITEM ||
role == roles::RADIO_MENU_ITEM || role == roles::CHECK_MENU_ITEM) {
// It is submenu, expose keyboard shortcuts from menu hierarchy like
// "s;<Alt>f:s"
nsAutoString keysInHierarchyStr = keyBindingsStr;
do {
KeyBinding parentKeyBinding = parent->AccessKey();
if (!parentKeyBinding.IsEmpty()) {
nsAutoString str;
parentKeyBinding.ToString(str, KeyBinding::eAtkFormat);
str.Append(':');
keysInHierarchyStr.Insert(str, 0);
}
} while ((parent = parent->Parent()) && parent->Role() != roles::MENUBAR);
keyBindingsStr.Append(';');
keyBindingsStr.Append(keysInHierarchyStr);
}
} else {
// No access key, add ';' to point this.
keyBindingsStr.Append(';');
}
// Get keyboard shortcut.
keyBindingsStr.Append(';');
keyBinding = aAccessible->KeyboardShortcut();
if (!keyBinding.IsEmpty()) {
keyBinding.AppendToString(keyBindingsStr, KeyBinding::eAtkFormat);
}
aResult = keyBindingsStr;
}
// static
Accessible*
AccessibleWrap::GetColumnHeader(TableAccessible* aAccessible, int32_t aColIdx)
{
if (!aAccessible) {
return nullptr;
}
Accessible* cell = aAccessible->CellAt(0, aColIdx);
if (!cell) {
return nullptr;
}
// If the cell at the first row is column header then assume it is column
// header for all rows,
if (cell->Role() == roles::COLUMNHEADER) {
return cell;
}
// otherwise get column header for the data cell at the first row.
TableCellAccessible* tableCell = cell->AsTableCell();
if (!tableCell) {
return nullptr;
}
nsAutoTArray<Accessible*, 10> headerCells;
tableCell->ColHeaderCells(&headerCells);
if (headerCells.IsEmpty()) {
return nullptr;
}
return headerCells[0];
}
// static
Accessible*
AccessibleWrap::GetRowHeader(TableAccessible* aAccessible, int32_t aRowIdx)
{
if (!aAccessible) {
return nullptr;
}
Accessible* cell = aAccessible->CellAt(aRowIdx, 0);
if (!cell) {
return nullptr;
}
// If the cell at the first column is row header then assume it is row
// header for all columns,
if (cell->Role() == roles::ROWHEADER) {
return cell;
}
// otherwise get row header for the data cell at the first column.
TableCellAccessible* tableCell = cell->AsTableCell();
if (!tableCell) {
return nullptr;
}
nsAutoTArray<Accessible*, 10> headerCells;
tableCell->RowHeaderCells(&headerCells);
if (headerCells.IsEmpty()) {
return nullptr;
}
return headerCells[0];
}

View File

@ -69,6 +69,12 @@ public:
return returnedString.get();
}
static void GetKeyBinding(Accessible* aAccessible, nsAString& aResult);
static Accessible* GetColumnHeader(TableAccessible* aAccessible,
int32_t aColIdx);
static Accessible* GetRowHeader(TableAccessible* aAccessible,
int32_t aRowIdx);
protected:
nsresult FireAtkStateChangeEvent(AccEvent* aEvent, AtkObject *aObject);

View File

@ -10,7 +10,7 @@
#include "nsMai.h"
#include "Role.h"
#include "mozilla/Likely.h"
#include "ProxyAccessible.h"
#include "nsString.h"
using namespace mozilla::a11y;
@ -21,86 +21,69 @@ static gboolean
doActionCB(AtkAction *aAction, gint aActionIndex)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
return accWrap && accWrap->DoAction(aActionIndex);
if (accWrap) {
return accWrap->DoAction(aActionIndex);
}
ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aAction));
return proxy && proxy->DoAction(aActionIndex);
}
static gint
getActionCountCB(AtkAction *aAction)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
return accWrap ? accWrap->ActionCount() : 0;
if (accWrap) {
return accWrap->ActionCount();
}
ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aAction));
return proxy ? proxy->ActionCount() : 0;
}
static const gchar*
getActionDescriptionCB(AtkAction *aAction, gint aActionIndex)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
if (!accWrap)
return nullptr;
nsAutoString description;
accWrap->ActionDescriptionAt(aActionIndex, description);
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
if (accWrap) {
accWrap->ActionDescriptionAt(aActionIndex, description);
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aAction))) {
proxy->ActionDescriptionAt(aActionIndex, description);
} else {
return nullptr;
}
return AccessibleWrap::ReturnString(description);
}
static const gchar*
getActionNameCB(AtkAction *aAction, gint aActionIndex)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
if (!accWrap)
return nullptr;
nsAutoString autoStr;
accWrap->ActionNameAt(aActionIndex, autoStr);
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
if (accWrap) {
accWrap->ActionNameAt(aActionIndex, autoStr);
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aAction))) {
proxy->ActionNameAt(aActionIndex, autoStr);
} else {
return nullptr;
}
return AccessibleWrap::ReturnString(autoStr);
}
static const gchar*
getKeyBindingCB(AtkAction *aAction, gint aActionIndex)
{
AccessibleWrap* acc = GetAccessibleWrap(ATK_OBJECT(aAction));
if (!acc)
return nullptr;
// Return all key bindings including access key and keyboard shortcut.
nsAutoString keyBindingsStr;
// Get access key.
KeyBinding keyBinding = acc->AccessKey();
if (!keyBinding.IsEmpty()) {
keyBinding.AppendToString(keyBindingsStr, KeyBinding::eAtkFormat);
Accessible* parent = acc->Parent();
roles::Role role = parent ? parent->Role() : roles::NOTHING;
if (role == roles::PARENT_MENUITEM || role == roles::MENUITEM ||
role == roles::RADIO_MENU_ITEM || role == roles::CHECK_MENU_ITEM) {
// It is submenu, expose keyboard shortcuts from menu hierarchy like
// "s;<Alt>f:s"
nsAutoString keysInHierarchyStr = keyBindingsStr;
do {
KeyBinding parentKeyBinding = parent->AccessKey();
if (!parentKeyBinding.IsEmpty()) {
nsAutoString str;
parentKeyBinding.ToString(str, KeyBinding::eAtkFormat);
str.Append(':');
keysInHierarchyStr.Insert(str, 0);
}
} while ((parent = parent->Parent()) && parent->Role() != roles::MENUBAR);
keyBindingsStr.Append(';');
keyBindingsStr.Append(keysInHierarchyStr);
}
AccessibleWrap* acc = GetAccessibleWrap(ATK_OBJECT(aAction));
if (acc) {
AccessibleWrap::GetKeyBinding(acc, keyBindingsStr);
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aAction))) {
proxy->AtkKeyBinding(keyBindingsStr);
} else {
// No access key, add ';' to point this.
keyBindingsStr.Append(';');
}
// Get keyboard shortcut.
keyBindingsStr.Append(';');
keyBinding = acc->KeyboardShortcut();
if (!keyBinding.IsEmpty()) {
keyBinding.AppendToString(keyBindingsStr, KeyBinding::eAtkFormat);
return nullptr;
}
return AccessibleWrap::ReturnString(keyBindingsStr);

View File

@ -12,7 +12,7 @@
#include "TableAccessible.h"
#include "TableCellAccessible.h"
#include "nsMai.h"
#include "ProxyAccessible.h"
#include "nsArrayUtils.h"
#include "mozilla/Likely.h"
@ -23,17 +23,31 @@ extern "C" {
static AtkObject*
refAtCB(AtkTable* aTable, gint aRowIdx, gint aColIdx)
{
if (aRowIdx < 0 || aColIdx < 0) {
return nullptr;
}
AtkObject* cellAtkObj = nullptr;
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap || aRowIdx < 0 || aColIdx < 0)
return nullptr;
if (accWrap) {
Accessible* cell = accWrap->AsTable()->CellAt(aRowIdx, aColIdx);
if (!cell) {
return nullptr;
}
Accessible* cell = accWrap->AsTable()->CellAt(aRowIdx, aColIdx);
if (!cell)
return nullptr;
cellAtkObj = AccessibleWrap::GetAtkObject(cell);
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
ProxyAccessible* cell = proxy->TableCellAt(aRowIdx, aColIdx);
if (!cell) {
return nullptr;
}
AtkObject* cellAtkObj = AccessibleWrap::GetAtkObject(cell);
if (cellAtkObj)
cellAtkObj = GetWrapperFor(cell);
}
if (cellAtkObj) {
g_object_ref(cellAtkObj);
}
return cellAtkObj;
}
@ -41,93 +55,153 @@ refAtCB(AtkTable* aTable, gint aRowIdx, gint aColIdx)
static gint
getIndexAtCB(AtkTable* aTable, gint aRowIdx, gint aColIdx)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap || aRowIdx < 0 || aColIdx < 0)
if (aRowIdx < 0 || aColIdx < 0) {
return -1;
}
return static_cast<gint>(accWrap->AsTable()->CellIndexAt(aRowIdx, aColIdx));
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (accWrap) {
return static_cast<gint>(accWrap->AsTable()->CellIndexAt(aRowIdx, aColIdx));
}
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
return static_cast<gint>(proxy->TableCellIndexAt(aRowIdx, aColIdx));
}
return -1;
}
static gint
getColumnAtIndexCB(AtkTable *aTable, gint aIdx)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap || aIdx < 0)
if (aIdx < 0) {
return -1;
}
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (accWrap) {
return static_cast<gint>(accWrap->AsTable()->ColIndexAt(aIdx));
}
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
return static_cast<gint>(proxy->TableColumnIndexAt(aIdx));
}
return -1;
}
static gint
getRowAtIndexCB(AtkTable *aTable, gint aIdx)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap || aIdx < 0)
if (aIdx < 0) {
return -1;
}
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (accWrap) {
return static_cast<gint>(accWrap->AsTable()->RowIndexAt(aIdx));
}
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
return static_cast<gint>(proxy->TableRowIndexAt(aIdx));
}
return -1;
}
static gint
getColumnCountCB(AtkTable *aTable)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return -1;
if (accWrap) {
return static_cast<gint>(accWrap->AsTable()->ColCount());
}
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
return static_cast<gint>(proxy->TableColumnCount());
}
return -1;
}
static gint
getRowCountCB(AtkTable *aTable)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return -1;
if (accWrap) {
return static_cast<gint>(accWrap->AsTable()->RowCount());
}
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
return static_cast<gint>(proxy->TableRowCount());
}
return -1;
}
static gint
getColumnExtentAtCB(AtkTable *aTable, gint aRowIdx, gint aColIdx)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap || aRowIdx < 0 || aColIdx < 0)
if (aRowIdx < 0 || aColIdx < 0) {
return -1;
}
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (accWrap) {
return static_cast<gint>(accWrap->AsTable()->ColExtentAt(aRowIdx, aColIdx));
}
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
return static_cast<gint>(proxy->TableColumnExtentAt(aRowIdx, aColIdx));
}
return -1;
}
static gint
getRowExtentAtCB(AtkTable *aTable, gint aRowIdx, gint aColIdx)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return -1;
if (accWrap) {
return static_cast<gint>(accWrap->AsTable()->RowExtentAt(aRowIdx, aColIdx));
}
return static_cast<gint>(accWrap->AsTable()->RowExtentAt(aRowIdx, aColIdx));
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
return static_cast<gint>(proxy->TableRowExtentAt(aRowIdx, aColIdx));
}
return -1;
}
static AtkObject*
getCaptionCB(AtkTable* aTable)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return nullptr;
if (accWrap) {
Accessible* caption = accWrap->AsTable()->Caption();
return caption ? AccessibleWrap::GetAtkObject(caption) : nullptr;
}
Accessible* caption = accWrap->AsTable()->Caption();
return caption ? AccessibleWrap::GetAtkObject(caption) : nullptr;
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
ProxyAccessible* caption = proxy->TableCaption();
return caption ? GetWrapperFor(caption) : nullptr;
}
return nullptr;
}
static const gchar*
getColumnDescriptionCB(AtkTable *aTable, gint aColumn)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return nullptr;
nsAutoString autoStr;
accWrap->AsTable()->ColDescription(aColumn, autoStr);
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (accWrap) {
accWrap->AsTable()->ColDescription(aColumn, autoStr);
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
proxy->TableColumnDescription(aColumn, autoStr);
} else {
return nullptr;
}
return AccessibleWrap::ReturnString(autoStr);
}
@ -136,40 +210,32 @@ static AtkObject*
getColumnHeaderCB(AtkTable *aTable, gint aColIdx)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return nullptr;
if (accWrap) {
Accessible* header =
AccessibleWrap::GetColumnHeader(accWrap->AsTable(), aColIdx);
return header ? AccessibleWrap::GetAtkObject(header) : nullptr;
}
Accessible* cell = accWrap->AsTable()->CellAt(0, aColIdx);
if (!cell)
return nullptr;
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
ProxyAccessible* header = proxy->AtkTableColumnHeader(aColIdx);
return header ? GetWrapperFor(header) : nullptr;
}
// If the cell at the first row is column header then assume it is column
// header for all rows,
if (cell->Role() == roles::COLUMNHEADER)
return AccessibleWrap::GetAtkObject(cell);
// otherwise get column header for the data cell at the first row.
TableCellAccessible* tableCell = cell->AsTableCell();
if (!tableCell)
return nullptr;
nsAutoTArray<Accessible*, 10> headerCells;
tableCell->ColHeaderCells(&headerCells);
if (headerCells.IsEmpty())
return nullptr;
return AccessibleWrap::GetAtkObject(headerCells[0]);
return nullptr;
}
static const gchar*
getRowDescriptionCB(AtkTable *aTable, gint aRow)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return nullptr;
nsAutoString autoStr;
accWrap->AsTable()->RowDescription(aRow, autoStr);
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (accWrap) {
accWrap->AsTable()->RowDescription(aRow, autoStr);
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
proxy->TableRowDescription(aRow, autoStr);
} else {
return nullptr;
}
return AccessibleWrap::ReturnString(autoStr);
}
@ -178,29 +244,18 @@ static AtkObject*
getRowHeaderCB(AtkTable *aTable, gint aRowIdx)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return nullptr;
if (accWrap) {
Accessible* header =
AccessibleWrap::GetRowHeader(accWrap->AsTable(), aRowIdx);
return header ? AccessibleWrap::GetAtkObject(header) : nullptr;
}
Accessible* cell = accWrap->AsTable()->CellAt(aRowIdx, 0);
if (!cell)
return nullptr;
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
ProxyAccessible* header = proxy->AtkTableRowHeader(aRowIdx);
return header ? GetWrapperFor(header) : nullptr;
}
// If the cell at the first column is row header then assume it is row
// header for all columns,
if (cell->Role() == roles::ROWHEADER)
return AccessibleWrap::GetAtkObject(cell);
// otherwise get row header for the data cell at the first column.
TableCellAccessible* tableCell = cell->AsTableCell();
if (!tableCell)
return nullptr;
nsAutoTArray<Accessible*, 10> headerCells;
tableCell->RowHeaderCells(&headerCells);
if (headerCells.IsEmpty())
return nullptr;
return AccessibleWrap::GetAtkObject(headerCells[0]);
return nullptr;
}
static AtkObject*
@ -218,12 +273,16 @@ getSelectedColumnsCB(AtkTable *aTable, gint** aSelected)
{
*aSelected = nullptr;
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return 0;
nsAutoTArray<uint32_t, 10> cols;
accWrap->AsTable()->SelectedColIndices(&cols);
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (accWrap) {
accWrap->AsTable()->SelectedColIndices(&cols);
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
proxy->TableSelectedColumnIndices(&cols);
} else {
return 0;
}
if (cols.IsEmpty())
return 0;
@ -241,12 +300,15 @@ getSelectedColumnsCB(AtkTable *aTable, gint** aSelected)
static gint
getSelectedRowsCB(AtkTable *aTable, gint **aSelected)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return 0;
nsAutoTArray<uint32_t, 10> rows;
accWrap->AsTable()->SelectedRowIndices(&rows);
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (accWrap) {
accWrap->AsTable()->SelectedRowIndices(&rows);
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
proxy->TableSelectedRowIndices(&rows);
} else {
return 0;
}
gint* atkRows = g_new(gint, rows.Length());
if (!atkRows) {
@ -263,31 +325,40 @@ static gboolean
isColumnSelectedCB(AtkTable *aTable, gint aColIdx)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return FALSE;
if (accWrap) {
return static_cast<gboolean>(accWrap->AsTable()->IsColSelected(aColIdx));
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
return static_cast<gboolean>(proxy->TableColumnSelected(aColIdx));
}
return static_cast<gboolean>(accWrap->AsTable()->IsColSelected(aColIdx));
return FALSE;
}
static gboolean
isRowSelectedCB(AtkTable *aTable, gint aRowIdx)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return FALSE;
if (accWrap) {
return static_cast<gboolean>(accWrap->AsTable()->IsRowSelected(aRowIdx));
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
return static_cast<gboolean>(proxy->TableRowSelected(aRowIdx));
}
return static_cast<gboolean>(accWrap->AsTable()->IsRowSelected(aRowIdx));
return FALSE;
}
static gboolean
isCellSelectedCB(AtkTable *aTable, gint aRowIdx, gint aColIdx)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return FALSE;
if (accWrap) {
return static_cast<gboolean>(accWrap->AsTable()->
IsCellSelected(aRowIdx, aColIdx));
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
return static_cast<gboolean>(proxy->TableCellSelected(aRowIdx, aColIdx));
}
return FALSE;
}
}

View File

@ -17,6 +17,9 @@
#include "nsIPersistentProperties2.h"
#include "nsISimpleEnumerator.h"
#include "nsAccUtils.h"
#ifdef MOZ_ACCESSIBILITY_ATK
#include "AccessibleWrap.h"
#endif
namespace mozilla {
namespace a11y {
@ -1449,6 +1452,52 @@ DocAccessibleChild::RecvTableIsProbablyForLayout(const uint64_t& aID,
return true;
}
bool
DocAccessibleChild::RecvAtkTableColumnHeader(const uint64_t& aID,
const int32_t& aCol,
uint64_t* aHeader,
bool* aOk)
{
*aHeader = 0;
*aOk = false;
#ifdef MOZ_ACCESSIBILITY_ATK
TableAccessible* acc = IdToTableAccessible(aID);
if (acc) {
Accessible* header = AccessibleWrap::GetColumnHeader(acc, aCol);
if (header) {
*aHeader = reinterpret_cast<uint64_t>(header->UniqueID());
*aOk = true;
}
}
#endif
return true;
}
bool
DocAccessibleChild::RecvAtkTableRowHeader(const uint64_t& aID,
const int32_t& aRow,
uint64_t* aHeader,
bool* aOk)
{
*aHeader = 0;
*aOk = false;
#ifdef MOZ_ACCESSIBILITY_ATK
TableAccessible* acc = IdToTableAccessible(aID);
if (acc) {
Accessible* header = AccessibleWrap::GetRowHeader(acc, aRow);
if (header) {
*aHeader = reinterpret_cast<uint64_t>(header->UniqueID());
*aOk = true;
}
}
#endif
return true;
}
bool
DocAccessibleChild::RecvSelectedItems(const uint64_t& aID,
nsTArray<uint64_t>* aSelectedItemIDs)
@ -1655,6 +1704,19 @@ DocAccessibleChild::RecvKeyboardShortcut(const uint64_t& aID,
return true;
}
bool
DocAccessibleChild::RecvAtkKeyBinding(const uint64_t& aID,
nsString* aResult)
{
#ifdef MOZ_ACCESSIBILITY_ATK
Accessible* acc = IdToAccessible(aID);
if (acc) {
AccessibleWrap::GetKeyBinding(acc, *aResult);
}
#endif
return true;
}
bool
DocAccessibleChild::RecvCurValue(const uint64_t& aID,
double* aValue)

View File

@ -363,6 +363,14 @@ public:
const uint32_t& aRow) override;
virtual bool RecvTableIsProbablyForLayout(const uint64_t& aID,
bool* aForLayout) override;
virtual bool RecvAtkTableColumnHeader(const uint64_t& aID,
const int32_t& aCol,
uint64_t* aHeader,
bool* aOk) override;
virtual bool RecvAtkTableRowHeader(const uint64_t& aID,
const int32_t& aRow,
uint64_t* aHeader,
bool* aOk) override;
virtual bool RecvSelectedItems(const uint64_t& aID,
nsTArray<uint64_t>* aSelectedItemIDs) override;
@ -416,6 +424,9 @@ public:
uint32_t* aKey,
uint32_t* aModifierMask) override;
virtual bool RecvAtkKeyBinding(const uint64_t& aID,
nsString* aResult) override;
virtual bool RecvCurValue(const uint64_t& aID,
double* aValue) override;

View File

@ -202,6 +202,10 @@ child:
prio(high) sync TableUnselectColumn(uint64_t aID, uint32_t aCol);
prio(high) sync TableUnselectRow(uint64_t aID, uint32_t aRow);
prio(high) sync TableIsProbablyForLayout(uint64_t aID) returns(bool aForLayout);
prio(high) sync AtkTableColumnHeader(uint64_t aID, int32_t aCol)
returns(uint64_t aHeaderID, bool aOk);
prio(high) sync AtkTableRowHeader(uint64_t aID, int32_t aRow)
returns(uint64_t aHeaderID, bool aOk);
prio(high) sync SelectedItems(uint64_t aID) returns(uint64_t[] aSelectedItemIDs);
prio(high) sync SelectedItemCount(uint64_t aID) returns(uint32_t aCount);
@ -218,6 +222,7 @@ child:
prio(high) sync ActionNameAt(uint64_t aID, uint8_t aIndex) returns(nsString aName);
prio(high) sync AccessKey(uint64_t aID) returns(uint32_t aKey, uint32_t aModifierMask);
prio(high) sync KeyboardShortcut(uint64_t aID) returns(uint32_t aKey, uint32_t aModifierMask);
prio(high) sync AtkKeyBinding(uint64_t aID) returns(nsString aResult);
prio(high) sync CurValue(uint64_t aID) returns(double aValue);
prio(high) sync SetCurValue(uint64_t aID, double aValue) returns(bool aRetVal);

View File

@ -820,6 +820,24 @@ ProxyAccessible::TableIsProbablyForLayout()
return forLayout;
}
ProxyAccessible*
ProxyAccessible::AtkTableColumnHeader(int32_t aCol)
{
uint64_t headerID = 0;
bool ok = false;
unused << mDoc->SendAtkTableColumnHeader(mID, aCol, &headerID, &ok);
return ok ? mDoc->GetAccessible(headerID) : nullptr;
}
ProxyAccessible*
ProxyAccessible::AtkTableRowHeader(int32_t aRow)
{
uint64_t headerID = 0;
bool ok = false;
unused << mDoc->SendAtkTableRowHeader(mID, aRow, &headerID, &ok);
return ok ? mDoc->GetAccessible(headerID) : nullptr;
}
void
ProxyAccessible::SelectedItems(nsTArray<ProxyAccessible*>* aSelectedItems)
{
@ -934,6 +952,12 @@ ProxyAccessible::KeyboardShortcut()
return KeyBinding(key, modifierMask);
}
void
ProxyAccessible::AtkKeyBinding(nsString& aBinding)
{
unused << mDoc->SendAtkKeyBinding(mID, &aBinding);
}
double
ProxyAccessible::CurValue()
{

View File

@ -297,6 +297,8 @@ public:
void TableUnselectColumn(uint32_t aCol);
void TableUnselectRow(uint32_t aRow);
bool TableIsProbablyForLayout();
ProxyAccessible* AtkTableColumnHeader(int32_t aCol);
ProxyAccessible* AtkTableRowHeader(int32_t aRow);
void SelectedItems(nsTArray<ProxyAccessible*>* aSelectedItems);
uint32_t SelectedItemCount();
@ -313,6 +315,7 @@ public:
void ActionNameAt(uint8_t aIndex, nsString& aName);
KeyBinding AccessKey();
KeyBinding KeyboardShortcut();
void AtkKeyBinding(nsString& aBinding);
double CurValue();
bool SetCurValue(double aValue);

View File

@ -4,8 +4,8 @@
SimpleTest, getBoundsForDOMElm, Point, Utils */
/* exported loadJSON, eventMap */
const Ci = Components.interfaces;
const Cu = Components.utils;
var Ci = Components.interfaces;
var Cu = Components.utils;
Cu.import('resource://gre/modules/accessibility/Utils.jsm');
Cu.import('resource://gre/modules/Geometry.jsm');

View File

@ -1,4 +1,4 @@
const Cu = Components.utils;
var Cu = Components.utils;
const PREF_UTTERANCE_ORDER = "accessibility.accessfu.utterance";
Cu.import('resource://gre/modules/accessibility/Utils.jsm');

View File

@ -1,26 +1,26 @@
////////////////////////////////////////////////////////////////////////////////
// Constants
const RELATION_CONTROLLED_BY = nsIAccessibleRelation.RELATION_CONTROLLED_BY;
const RELATION_CONTROLLER_FOR = nsIAccessibleRelation.RELATION_CONTROLLER_FOR;
const RELATION_DEFAULT_BUTTON = nsIAccessibleRelation.RELATION_DEFAULT_BUTTON;
const RELATION_DESCRIBED_BY = nsIAccessibleRelation.RELATION_DESCRIBED_BY;
const RELATION_DESCRIPTION_FOR = nsIAccessibleRelation.RELATION_DESCRIPTION_FOR;
const RELATION_EMBEDDED_BY = nsIAccessibleRelation.RELATION_EMBEDDED_BY;
const RELATION_EMBEDS = nsIAccessibleRelation.RELATION_EMBEDS;
const RELATION_FLOWS_FROM = nsIAccessibleRelation.RELATION_FLOWS_FROM;
const RELATION_FLOWS_TO = nsIAccessibleRelation.RELATION_FLOWS_TO;
const RELATION_LABEL_FOR = nsIAccessibleRelation.RELATION_LABEL_FOR;
const RELATION_LABELLED_BY = nsIAccessibleRelation.RELATION_LABELLED_BY;
const RELATION_MEMBER_OF = nsIAccessibleRelation.RELATION_MEMBER_OF;
const RELATION_NODE_CHILD_OF = nsIAccessibleRelation.RELATION_NODE_CHILD_OF;
const RELATION_NODE_PARENT_OF = nsIAccessibleRelation.RELATION_NODE_PARENT_OF;
const RELATION_PARENT_WINDOW_OF = nsIAccessibleRelation.RELATION_PARENT_WINDOW_OF;
const RELATION_POPUP_FOR = nsIAccessibleRelation.RELATION_POPUP_FOR;
const RELATION_SUBWINDOW_OF = nsIAccessibleRelation.RELATION_SUBWINDOW_OF;
const RELATION_CONTAINING_DOCUMENT = nsIAccessibleRelation.RELATION_CONTAINING_DOCUMENT;
const RELATION_CONTAINING_TAB_PANE = nsIAccessibleRelation.RELATION_CONTAINING_TAB_PANE;
const RELATION_CONTAINING_APPLICATION = nsIAccessibleRelation.RELATION_CONTAINING_APPLICATION;
var RELATION_CONTROLLED_BY = nsIAccessibleRelation.RELATION_CONTROLLED_BY;
var RELATION_CONTROLLER_FOR = nsIAccessibleRelation.RELATION_CONTROLLER_FOR;
var RELATION_DEFAULT_BUTTON = nsIAccessibleRelation.RELATION_DEFAULT_BUTTON;
var RELATION_DESCRIBED_BY = nsIAccessibleRelation.RELATION_DESCRIBED_BY;
var RELATION_DESCRIPTION_FOR = nsIAccessibleRelation.RELATION_DESCRIPTION_FOR;
var RELATION_EMBEDDED_BY = nsIAccessibleRelation.RELATION_EMBEDDED_BY;
var RELATION_EMBEDS = nsIAccessibleRelation.RELATION_EMBEDS;
var RELATION_FLOWS_FROM = nsIAccessibleRelation.RELATION_FLOWS_FROM;
var RELATION_FLOWS_TO = nsIAccessibleRelation.RELATION_FLOWS_TO;
var RELATION_LABEL_FOR = nsIAccessibleRelation.RELATION_LABEL_FOR;
var RELATION_LABELLED_BY = nsIAccessibleRelation.RELATION_LABELLED_BY;
var RELATION_MEMBER_OF = nsIAccessibleRelation.RELATION_MEMBER_OF;
var RELATION_NODE_CHILD_OF = nsIAccessibleRelation.RELATION_NODE_CHILD_OF;
var RELATION_NODE_PARENT_OF = nsIAccessibleRelation.RELATION_NODE_PARENT_OF;
var RELATION_PARENT_WINDOW_OF = nsIAccessibleRelation.RELATION_PARENT_WINDOW_OF;
var RELATION_POPUP_FOR = nsIAccessibleRelation.RELATION_POPUP_FOR;
var RELATION_SUBWINDOW_OF = nsIAccessibleRelation.RELATION_SUBWINDOW_OF;
var RELATION_CONTAINING_DOCUMENT = nsIAccessibleRelation.RELATION_CONTAINING_DOCUMENT;
var RELATION_CONTAINING_TAB_PANE = nsIAccessibleRelation.RELATION_CONTAINING_TAB_PANE;
var RELATION_CONTAINING_APPLICATION = nsIAccessibleRelation.RELATION_CONTAINING_APPLICATION;
////////////////////////////////////////////////////////////////////////////////
// General

View File

@ -18,6 +18,7 @@
#include "nsIAccessibleTypes.h"
#include "mozilla/a11y/PDocAccessible.h"
#include "Relation.h"
#include "nsAccessibilityService.h"
#include "nsIPersistentProperties2.h"
#include "nsISimpleEnumerator.h"
@ -651,7 +652,27 @@ ia2Accessible::get_accessibleWithCaret(IUnknown** aAccessible,
*aAccessible = nullptr;
*aCaretOffset = -1;
return E_NOTIMPL;
AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
if (acc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
int32_t caretOffset = -1;
Accessible* accWithCaret = SelectionMgr()->AccessibleWithCaret(&caretOffset);
if (acc->Document() != accWithCaret->Document())
return S_FALSE;
Accessible* child = accWithCaret;
while (child != acc)
child = child->Parent();
if (!child)
return S_FALSE;
*aAccessible = static_cast<IAccessible2*>(
static_cast<AccessibleWrap*>(accWithCaret));
*aCaretOffset = caretOffset;
return S_OK;
A11Y_TRYBLOCK_END
}

View File

@ -5,7 +5,7 @@
var EXPORTED_SYMBOLS = ["Startup"];
const { utils: Cu, interfaces: Ci, classes: Cc } = Components;
var { utils: Cu, interfaces: Ci, classes: Cc } = Components;
const { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
const { defer } = Cu.import("resource://gre/modules/Promise.jsm", {}).Promise;

View File

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const Cu = Components.utils;
var Cu = Components.utils;
Cu.import("resource://gre/modules/Services.jsm");

View File

@ -6,4 +6,4 @@
const { utils: Cu } = Components;
const {require} = Cu.import(`${ROOT}/toolkit/require.js`, {});
const {Bootstrap} = require(`${ROOT}/sdk/addon/bootstrap.js`);
const {startup, shutdown, install, uninstall} = new Bootstrap();
var {startup, shutdown, install, uninstall} = new Bootstrap();

View File

@ -727,7 +727,7 @@ exports["test requestAnimationFrame"] = createProxyTest("", function (helper) {
exports["testGlobalScope"] = createProxyTest("", function (helper) {
helper.createWorker(
'let toplevelScope = true;' +
'var toplevelScope = true;' +
'assert(window.toplevelScope, "variables in toplevel scope are set to `window` object");' +
'assert(this.toplevelScope, "variables in toplevel scope are set to `this` object");' +
'done();'

View File

@ -8,10 +8,10 @@
window.performance.mark('gecko-settings-loadstart');
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
const Cr = Components.results;
var Cc = Components.classes;
var Ci = Components.interfaces;
var Cu = Components.utils;
var Cr = Components.results;
// The load order is important here SettingsRequestManager _must_ be loaded
// prior to using SettingsListener otherwise there is a race in acquiring the

View File

@ -1502,7 +1502,7 @@ const saveWindowGeometry = () => {
}
window.addEventListener("unload", saveWindowGeometry);
let baseWindow = window.QueryInterface(Ci.nsIInterfaceRequestor)
var baseWindow = window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem)
.treeOwner

View File

@ -6,7 +6,7 @@
"use strict";
const {utils: Cu} = Components;
var {utils: Cu} = Components;
Cu.import("resource://gre/modules/Services.jsm");
@ -14,7 +14,7 @@ function debug(aStr) {
// dump(" -*- ShellRemote.js: " + aStr + "\n");
}
let remoteShell = {
var remoteShell = {
get homeURL() {
let systemAppManifestURL = Services.io.newURI(this.systemAppManifestURL, null, null);

View File

@ -1,7 +1,7 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
var { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
const { Services } = Cu.import('resource://gre/modules/Services.jsm');
const { SystemAppProxy } = Cu.import('resource://gre/modules/SystemAppProxy.jsm');

View File

@ -15,11 +15,11 @@ function debug(aStr) {
// dump("MultiscreenHandler: " + aStr + "\n");
}
let window = Services.wm.getMostRecentWindow("navigator:browser");
var window = Services.wm.getMostRecentWindow("navigator:browser");
// Multi-screen support on b2g. The following implementation will open a new
// top-level window once we receive a display connected event.
let MultiscreenHandler = {
var MultiscreenHandler = {
topLevelWindows: new Map(),

View File

@ -4,8 +4,8 @@
'use strict';
const Cc = Components.classes;
const Ci = Components.interfaces;
var Cc = Components.classes;
var Ci = Components.interfaces;
// use ppmm to handle file-picker message.
var ppmm = Cc['@mozilla.org/parentprocessmessagemanager;1']

View File

@ -8,9 +8,9 @@ function debug(str) {
dump("CHROME PERMISSON HANDLER -- " + str + "\n");
}
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
var Cc = Components.classes;
var Ci = Components.interfaces;
var Cu = Components.utils;
const { Services } = Cu.import("resource://gre/modules/Services.jsm");
const { SystemAppProxy } = Cu.import("resource://gre/modules/SystemAppProxy.jsm");

View File

@ -8,7 +8,7 @@
dump('presentation_prompt_handler_chrome: ' + str + '\n');
}
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
var { classes: Cc, interfaces: Ci, utils: Cu } = Components;
const { XPCOMUtils } = Cu.import('resource://gre/modules/XPCOMUtils.jsm');
const { SystemAppProxy } = Cu.import('resource://gre/modules/SystemAppProxy.jsm');

View File

@ -4,7 +4,7 @@
'use strict';
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
var { classes: Cc, interfaces: Ci, utils: Cu } = Components;
const { XPCOMUtils } = Cu.import('resource://gre/modules/XPCOMUtils.jsm');
const { SystemAppProxy } = Cu.import('resource://gre/modules/SystemAppProxy.jsm');

View File

@ -1,5 +1,5 @@
const Cu = Components.utils;
const Ci = Components.interfaces;
var Cu = Components.utils;
var Ci = Components.interfaces;
Cu.importGlobalProperties(['File']);

View File

@ -1,4 +1,4 @@
const Cu = Components.utils;
var Cu = Components.utils;
const { Services } = Cu.import("resource://gre/modules/Services.jsm");

View File

@ -4,7 +4,7 @@
"use strict";
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/NetUtil.jsm");

View File

@ -1,8 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
const Ci = Components.interfaces;
const Cu = Components.utils;
var Ci = Components.interfaces;
var Cu = Components.utils;
// The following boilerplate makes sure that XPCOM calls
// that use the profile directory work.

View File

@ -14,9 +14,9 @@
"use strict";
const Cu = Components.utils;
const Ci = Components.interfaces;
const Cc = Components.classes;
var Cu = Components.utils;
var Ci = Components.interfaces;
var Cc = Components.classes;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/osfile.jsm");

View File

@ -3,7 +3,7 @@
"use strict";
const {utils: Cu} = Components;
var {utils: Cu} = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");

View File

@ -3,7 +3,7 @@
"use strict";
const {utils: Cu} = Components;
var {utils: Cu} = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");

View File

@ -4,7 +4,7 @@
"use strict";
const {results: Cr} = Components;
var {results: Cr} = Components;
// Trivial test just to make sure we have no syntax error
add_test(function test_ksm_ok() {

View File

@ -1,6 +1,6 @@
/* jshint moz: true */
const {utils: Cu, classes: Cc, interfaces: Ci} = Components;
var {utils: Cu, classes: Cc, interfaces: Ci} = Components;
function debug(msg) {
var timestamp = Date.now();

View File

@ -10,7 +10,7 @@
/* jshint -W097 */
"use strict";
const Cu = Components.utils;
var Cu = Components.utils;
Cu.import("resource://gre/modules/LogCapture.jsm");
Cu.import("resource://gre/modules/LogShake.jsm");

View File

@ -1,5 +1,5 @@
const Ci = Components.interfaces;
const Cu = Components.utils;
var Ci = Components.interfaces;
var Cu = Components.utils;
Cu.import("resource://gre/modules/Services.jsm");

View File

@ -1379,7 +1379,7 @@ pref("devtools.inspector.showAllAnonymousContent", false);
pref("devtools.inspector.mdnDocsTooltip.enabled", true);
// DevTools default color unit
pref("devtools.defaultColorUnit", "hex");
pref("devtools.defaultColorUnit", "authored");
// Enable the Responsive UI tool
pref("devtools.responsiveUI.no-reload-notification", false);

View File

@ -4,7 +4,7 @@
"use strict";
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/FxAccounts.jsm");

View File

@ -4,7 +4,7 @@
"use strict";
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://gre/modules/Preferences.jsm");
Cu.import("resource://gre/modules/Services.jsm");

View File

@ -198,8 +198,9 @@ var FullScreen = {
document.documentElement.setAttribute("inDOMFullscreen", true);
if (gFindBarInitialized)
gFindBar.close();
if (gFindBarInitialized) {
gFindBar.close(true);
}
// Exit DOM full-screen mode upon open, close, or change tab.
gBrowser.tabContainer.addEventListener("TabOpen", this.exitDomFullScreen);

View File

@ -3722,6 +3722,8 @@ const BrowserSearch = {
}
};
XPCOMUtils.defineConstant(this, "BrowserSearch", BrowserSearch);
function FillHistoryMenu(aParent) {
// Lazily add the hover listeners on first showing and never remove them
if (!aParent.hasStatusListener) {

View File

@ -2,7 +2,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/. */
const Cu = Components.utils;
var Cu = Components.utils;
Cu.import("resource://gre/modules/LoadContextInfo.jsm");
Cu.import("resource://gre/modules/Services.jsm");

View File

@ -3,11 +3,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
var Cc = Components.classes;
var Ci = Components.interfaces;
var Cu = Components.utils;
let {Sanitizer} = Cu.import("resource:///modules/Sanitizer.jsm", {});
var {Sanitizer} = Cu.import("resource:///modules/Sanitizer.jsm", {});
var gSanitizePromptDialog = {

View File

@ -6,7 +6,7 @@
/* This content script should work in any browser or iframe and should not
* depend on the frame being contained in tabbrowser. */
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
@ -85,6 +85,19 @@ SocialErrorListener = {
// Calling cancel() will raise some OnStateChange notifications by itself,
// so avoid doing that more than once
if (failure && aStatus != Components.results.NS_BINDING_ABORTED) {
// if tp is enabled and we get a failure, ignore failures (ie. STATE_STOP)
// on child resources since they *may* have been blocked. We don't have an
// easy way to know if a particular url is blocked by TP, only that
// something was.
if (docShell.hasTrackingContentBlocked) {
let frame = docShell.chromeEventHandler;
let src = frame.getAttribute("src");
if (aRequest && aRequest.name != src) {
Cu.reportError("SocialErrorListener ignoring blocked content error for " + aRequest.name);
return;
}
}
aRequest.cancel(Components.results.NS_BINDING_ABORTED);
this.setErrorPage();
}

View File

@ -2,7 +2,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/. */
const Cu = Components.utils;
var Cu = Components.utils;
Cu.import("resource://services-common/utils.js");
Cu.import("resource://services-sync/main.js");

View File

@ -2,9 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const Ci = Components.interfaces;
const Cc = Components.classes;
const Cu = Components.utils;
var Ci = Components.interfaces;
var Cc = Components.classes;
var Cu = Components.utils;
Cu.import("resource://services-sync/main.js");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");

View File

@ -2,8 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const Ci = Components.interfaces;
const Cc = Components.classes;
var Ci = Components.interfaces;
var Cc = Components.classes;
Components.utils.import("resource://services-sync/main.js");
Components.utils.import("resource://gre/modules/Services.jsm");

View File

@ -3,10 +3,10 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const Ci = Components.interfaces;
const Cc = Components.classes;
const Cr = Components.results;
const Cu = Components.utils;
var Ci = Components.interfaces;
var Cc = Components.classes;
var Cr = Components.results;
var Cu = Components.utils;
// page consts

View File

@ -1,6 +1,6 @@
"use strict";
let { TabCrashReporter } =
var { TabCrashReporter } =
Cu.import("resource:///modules/ContentCrashReporters.jsm");
const SERVER_URL = "http://example.com/browser/toolkit/crashreporter/test/browser/crashreport.sjs";

View File

@ -1,4 +1,4 @@
const Ci = Components.interfaces;
var Ci = Components.interfaces;
const gCompleteState = Ci.nsIWebProgressListener.STATE_STOP +
Ci.nsIWebProgressListener.STATE_IS_NETWORK;

View File

@ -1,7 +1,7 @@
// Bug 356571 - loadOneOrMoreURIs gives up if one of the URLs has an unknown protocol
const Cr = Components.results;
const Cm = Components.manager;
var Cr = Components.results;
var Cm = Components.manager;
// Set to true when docShell alerts for unknown protocol error
var didFail = false;

View File

@ -2,7 +2,7 @@
* http://creativecommons.org/publicdomain/zero/1.0/
*/
const {Ci: interfaces, Cc: classes} = Components;
var {Ci: interfaces, Cc: classes} = Components;
var Clipboard = Cc["@mozilla.org/widget/clipboard;1"].getService(Ci.nsIClipboard);
var HasFindClipboard = Clipboard.supportsFindClipboard();

View File

@ -1,37 +1,18 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
function waitForActive() {
if (!gBrowser.docShell.isActive) {
executeSoon(waitForActive);
return;
}
is(gBrowser.docShell.isActive, true, "Docshell should be active again");
finish();
}
function waitForInactive() {
if (gBrowser.docShell.isActive) {
executeSoon(waitForInactive);
return;
}
is(gBrowser.docShell.isActive, false, "Docshell should be inactive");
window.restore();
waitForActive();
}
function test() {
add_task(function *() {
registerCleanupFunction(function() {
window.restore();
});
waitForExplicitFinish();
is(gBrowser.docShell.isActive, true, "Docshell should be active");
function waitForActive() { return gBrowser.selectedTab.linkedBrowser.docShellIsActive; }
function waitForInactive() { return !gBrowser.selectedTab.linkedBrowser.docShellIsActive; }
yield promiseWaitForCondition(waitForActive);
is(gBrowser.selectedTab.linkedBrowser.docShellIsActive, true, "Docshell should be active");
window.minimize();
// XXX On Linux minimize/restore seem to be very very async, but
// our window.windowState changes sync.... so we can't rely on the
// latter correctly reflecting the state of the former. In
// particular, a restore() call before minimizing is done will not
// actually restore the window, but change the window state. As a
// result, just poll waiting for our expected isActive values.
waitForInactive();
}
yield promiseWaitForCondition(waitForInactive);
is(gBrowser.selectedTab.linkedBrowser.docShellIsActive, false, "Docshell should be Inactive");
window.restore();
yield promiseWaitForCondition(waitForActive);
is(gBrowser.selectedTab.linkedBrowser.docShellIsActive, true, "Docshell should be active again");
});

View File

@ -10,44 +10,25 @@
* the HTTP top level page to broken HTTPS.
*/
const gHttpTestRoot = "http://example.com/browser/browser/base/content/test/general/";
const gHttpTestUrl = "http://example.com/browser/browser/base/content/test/general/file_mixedContentFramesOnHttp.html";
var gTestBrowser = null;
function SecStateTestsCompleted() {
gBrowser.removeCurrentTab();
window.focus();
finish();
}
add_task(function *() {
yield new Promise(resolve => {
SpecialPowers.pushPrefEnv({
"set": [
["security.mixed_content.block_active_content", true],
["security.mixed_content.block_display_content", false]
]
}, resolve);
});
let url = gHttpTestUrl
yield BrowserTestUtils.withNewTab({gBrowser, url}, function*(){
gTestBrowser = gBrowser.selectedBrowser;
// check security state is insecure
isSecurityState("insecure");
assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: false, passiveLoaded: true});
});
});
function test() {
waitForExplicitFinish();
SpecialPowers.pushPrefEnv({"set": [
["security.mixed_content.block_active_content", true],
["security.mixed_content.block_display_content", false]
]}, SecStateTests);
}
function SecStateTests() {
let url = gHttpTestRoot + "file_mixedContentFramesOnHttp.html";
gBrowser.selectedTab = gBrowser.addTab();
gTestBrowser = gBrowser.selectedBrowser;
whenLoaded(gTestBrowser, SecStateTest1);
gTestBrowser.contentWindow.location = url;
}
// The http page loads an https frame with an http image.
function SecStateTest1() {
// check security state is insecure
isSecurityState("insecure");
assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: false, passiveLoaded: true});
SecStateTestsCompleted();
}
function whenLoaded(aElement, aCallback) {
aElement.addEventListener("load", function onLoad() {
aElement.removeEventListener("load", onLoad, true);
executeSoon(aCallback);
}, true);
}

View File

@ -14,67 +14,36 @@ const gHttpTestRoot2 = "http://example.net/browser/browser/base/content/test/gen
const gHttpsTestRoot2 = "https://test2.example.com/browser/browser/base/content/test/general/";
var gTestBrowser = null;
function SecStateTestsCompleted() {
gBrowser.removeCurrentTab();
window.focus();
finish();
}
function test() {
waitForExplicitFinish();
SpecialPowers.pushPrefEnv({"set": [["security.mixed_content.block_active_content", true],
["security.mixed_content.block_display_content", false]]}, SecStateTests);
}
function SecStateTests() {
gBrowser.selectedTab = gBrowser.addTab();
gTestBrowser = gBrowser.selectedBrowser;
whenLoaded(gTestBrowser, SecStateTest1A);
add_task(function *() {
let url = gHttpTestRoot1 + "file_mixedContentFromOnunload.html";
gTestBrowser.contentWindow.location = url;
}
// Navigation from an http page to a https page with no mixed content
// The http page loads an http image on unload
function SecStateTest1A() {
whenLoaded(gTestBrowser, SecStateTest1B);
let url = gHttpsTestRoot1 + "file_mixedContentFromOnunload_test1.html";
gTestBrowser.contentWindow.location = url;
}
function SecStateTest1B() {
yield BrowserTestUtils.withNewTab({gBrowser, url}, function*(){
yield new Promise(resolve => {
SpecialPowers.pushPrefEnv({
"set": [
["security.mixed_content.block_active_content", true],
["security.mixed_content.block_display_content", false]
]
}, resolve);
});
gTestBrowser = gBrowser.selectedBrowser;
// Navigation from an http page to a https page with no mixed content
// The http page loads an http image on unload
url = gHttpsTestRoot1 + "file_mixedContentFromOnunload_test1.html";
yield BrowserTestUtils.loadURI(gTestBrowser, url);
yield BrowserTestUtils.browserLoaded(gTestBrowser);
// check security state. Since current url is https and doesn't have any
// mixed content resources, we expect it to be secure.
isSecurityState("secure");
assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: false, passiveLoaded: false});
whenLoaded(gTestBrowser, SecStateTest2A);
// change locations and proceed with the second test
let url = gHttpTestRoot2 + "file_mixedContentFromOnunload.html";
gTestBrowser.contentWindow.location = url;
}
// Navigation from an http page to a https page that has mixed display content
// The https page loads an http image on unload
function SecStateTest2A() {
whenLoaded(gTestBrowser, SecStateTest2B);
let url = gHttpsTestRoot2 + "file_mixedContentFromOnunload_test2.html";
gTestBrowser.contentWindow.location = url;
}
function SecStateTest2B() {
// Navigation from an http page to a https page that has mixed display content
// The https page loads an http image on unload
url = gHttpTestRoot2 + "file_mixedContentFromOnunload.html";
yield BrowserTestUtils.loadURI(gTestBrowser, url);
yield BrowserTestUtils.browserLoaded(gTestBrowser);
url = gHttpsTestRoot2 + "file_mixedContentFromOnunload_test2.html";
yield BrowserTestUtils.loadURI(gTestBrowser, url);
yield BrowserTestUtils.browserLoaded(gTestBrowser);
isSecurityState("broken");
assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: false, passiveLoaded: true});
SecStateTestsCompleted();
}
function whenLoaded(aElement, aCallback) {
aElement.addEventListener("load", function onLoad() {
aElement.removeEventListener("load", onLoad, true);
executeSoon(aCallback);
}, true);
}
});
});

View File

@ -3,16 +3,16 @@ var scrollbox = tabstrip._scrollbox;
var originalSmoothScroll = tabstrip.smoothScroll;
var tabs = gBrowser.tabs;
let rect = ele => ele.getBoundingClientRect();
let width = ele => rect(ele).width;
let left = ele => rect(ele).left;
let right = ele => rect(ele).right;
let isLeft = (ele, msg) => is(left(ele) + tabstrip._tabMarginLeft, left(scrollbox), msg);
let isRight = (ele, msg) => is(right(ele) - tabstrip._tabMarginRight, right(scrollbox), msg);
let elementFromPoint = x => tabstrip._elementFromPoint(x);
let nextLeftElement = () => elementFromPoint(left(scrollbox) - 1);
let nextRightElement = () => elementFromPoint(right(scrollbox) + 1);
let firstScrollable = () => tabs[gBrowser._numPinnedTabs];
var rect = ele => ele.getBoundingClientRect();
var width = ele => rect(ele).width;
var left = ele => rect(ele).left;
var right = ele => rect(ele).right;
var isLeft = (ele, msg) => is(left(ele) + tabstrip._tabMarginLeft, left(scrollbox), msg);
var isRight = (ele, msg) => is(right(ele) - tabstrip._tabMarginRight, right(scrollbox), msg);
var elementFromPoint = x => tabstrip._elementFromPoint(x);
var nextLeftElement = () => elementFromPoint(left(scrollbox) - 1);
var nextRightElement = () => elementFromPoint(right(scrollbox) + 1);
var firstScrollable = () => tabs[gBrowser._numPinnedTabs];
function test() {
requestLongerTimeout(2);

View File

@ -2,7 +2,7 @@
* Test the Permissions section in the Control Center.
*/
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
const PERMISSIONS_PAGE = "http://example.com/browser/browser/base/content/test/general/permissions.html";
var {SitePermissions} = Cu.import("resource:///modules/SitePermissions.jsm", {});

View File

@ -18,7 +18,7 @@
*/
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
let {LoadContextInfo} = Cu.import("resource://gre/modules/LoadContextInfo.jsm", {});
var {LoadContextInfo} = Cu.import("resource://gre/modules/LoadContextInfo.jsm", {});
XPCOMUtils.defineLazyModuleGetter(this, "FormHistory",
"resource://gre/modules/FormHistory.jsm");
@ -29,10 +29,10 @@ XPCOMUtils.defineLazyModuleGetter(this, "Timer",
XPCOMUtils.defineLazyModuleGetter(this, "PlacesTestUtils",
"resource://testing-common/PlacesTestUtils.jsm");
let tempScope = {};
var tempScope = {};
Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader)
.loadSubScript("chrome://browser/content/sanitize.js", tempScope);
let Sanitizer = tempScope.Sanitizer;
var Sanitizer = tempScope.Sanitizer;
const kMsecPerMin = 60 * 1000;
const kUsecPerMin = 60 * 1000000;
@ -675,8 +675,8 @@ add_task(function* test_offline_apps_permissions() {
return wh.promiseClosed;
});
let now_mSec = Date.now();
let now_uSec = now_mSec * 1000;
var now_mSec = Date.now();
var now_uSec = now_mSec * 1000;
///////////////////////////////////////////////////////////////////////////////

View File

@ -7,7 +7,7 @@
* See also Bugs 1175327, 1043801, 1178985
*/
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
const PREF = "privacy.trackingprotection.enabled";
const PB_PREF = "privacy.trackingprotection.pbmode.enabled";
const BENIGN_PAGE = "http://tracking.example.org/browser/browser/base/content/test/general/benignPage.html";

View File

@ -4,7 +4,7 @@
* See also Bugs 1175327, 1043801, 1178985.
*/
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
const PREF = "privacy.trackingprotection.enabled";
const PB_PREF = "privacy.trackingprotection.pbmode.enabled";
const BENIGN_PAGE = "http://tracking.example.org/browser/browser/base/content/test/general/benignPage.html";

View File

@ -4,7 +4,7 @@
* See also Bug 1175858.
*/
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
const PREF = "privacy.trackingprotection.enabled";
const PB_PREF = "privacy.trackingprotection.pbmode.enabled";
const BENIGN_PAGE = "http://tracking.example.org/browser/browser/base/content/test/general/benignPage.html";

View File

@ -2,7 +2,7 @@
* Test telemetry for Tracking Protection
*/
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
const PREF = "privacy.trackingprotection.enabled";
const BENIGN_PAGE = "http://tracking.example.org/browser/browser/base/content/test/general/benignPage.html";
const TRACKING_PAGE = "http://tracking.example.org/browser/browser/base/content/test/general/trackingPage.html";

View File

@ -5,7 +5,7 @@
// This file is loaded as a "content script" for browser_aboutAccounts tests
"use strict";
const {interfaces: Ci, utils: Cu} = Components;
var {interfaces: Ci, utils: Cu} = Components;
addEventListener("load", function load(event) {
if (event.target != content.document) {

View File

@ -1,4 +1,4 @@
const TEST_PINGS = [
var TEST_PINGS = [
{
type: "test-telemetryArchive-1",
payload: { foo: "bar" },

View File

@ -1,7 +1,7 @@
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
const Cm = Components.manager;
var Cc = Components.classes;
var Ci = Components.interfaces;
var Cu = Components.utils;
var Cm = Components.manager;
const kBlocklistServiceUUID = "{66354bc9-7ed1-4692-ae1d-8da97d6b205e}";
const kBlocklistServiceContractID = "@mozilla.org/extensions/blocklist;1";

View File

@ -2,8 +2,8 @@ var gTestRoot = getRootDirectory(gTestPath).replace("chrome://mochitests/content
var gTestBrowser = null;
var gConsoleErrors = 0;
const Cc = Components.classes;
const Ci = Components.interfaces;
var Cc = Components.classes;
var Ci = Components.interfaces;
add_task(function* () {
registerCleanupFunction(function () {

View File

@ -1594,9 +1594,11 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
document.getElementById("addon-progress-notification-progresstext");
</field>
<field name="DownloadUtils" readonly="true">
let utils = {};
Components.utils.import("resource://gre/modules/DownloadUtils.jsm", utils);
utils.DownloadUtils;
{
let utils = {};
Components.utils.import("resource://gre/modules/DownloadUtils.jsm", utils);
utils.DownloadUtils;
}
</field>
<method name="destroy">
@ -2676,11 +2678,13 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
]]></destructor>
<field name="_panel" readonly="true"><![CDATA[
let node = this.parentNode;
while(node && node.localName != "panel") {
node = node.parentNode;
{
let node = this.parentNode;
while(node && node.localName != "panel") {
node = node.parentNode;
}
node;
}
node;
]]></field>
<field name="_promomessage" readonly="true">
document.getAnonymousElementByAttribute(this, "anonid", "promo-message");

View File

@ -2,7 +2,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/. */
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource:///modules/webrtcUI.jsm");

View File

@ -510,6 +510,8 @@ const PanelUI = {
},
};
XPCOMUtils.defineConstant(this, "PanelUI", PanelUI);
/**
* Gets the currently selected locale for display.
* @return the selected locale or "en-US" if none is selected

View File

@ -9,17 +9,18 @@ add_task(function*() {
defaultArea: CustomizableUI.AREA_NAVBAR
});
const kPrefCustomizationState = "browser.uiCustomization.state";
let bsPass = Cu.import("resource:///modules/CustomizableUI.jsm", {});
ok(bsPass.gSeenWidgets.has(BUTTONID), "Widget should be seen after createWidget is called.");
CustomizableUI.reset();
ok(bsPass.gSeenWidgets.has(BUTTONID), "Widget should still be seen after reset.");
ok(!Services.prefs.prefHasUserValue(bsPass.kPrefCustomizationState), "Pref shouldn't be set right now, because that'd break undo.");
ok(!Services.prefs.prefHasUserValue(kPrefCustomizationState), "Pref shouldn't be set right now, because that'd break undo.");
CustomizableUI.addWidgetToArea(BUTTONID, CustomizableUI.AREA_NAVBAR);
gCustomizeMode.removeFromArea(document.getElementById(BUTTONID));
let hasUserValue = Services.prefs.prefHasUserValue(bsPass.kPrefCustomizationState);
let hasUserValue = Services.prefs.prefHasUserValue(kPrefCustomizationState);
ok(hasUserValue, "Pref should be set right now.");
if (hasUserValue) {
let seenArray = JSON.parse(Services.prefs.getCharPref(bsPass.kPrefCustomizationState)).seen;
let seenArray = JSON.parse(Services.prefs.getCharPref(kPrefCustomizationState)).seen;
isnot(seenArray.indexOf(BUTTONID), -1, "Widget should be in saved 'seen' list.");
}
});

View File

@ -2,8 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const Cc = Components.classes;
const Ci = Components.interfaces;
var Cc = Components.classes;
var Ci = Components.interfaces;
var gProfD = do_get_profile();
var gDirSvc = Cc["@mozilla.org/file/directory_service;1"].

View File

@ -4,10 +4,10 @@
this.EXPORTED_SYMBOLS = [ "DistributionCustomizer" ];
const Ci = Components.interfaces;
const Cc = Components.classes;
const Cr = Components.results;
const Cu = Components.utils;
var Ci = Components.interfaces;
var Cc = Components.classes;
var Cr = Components.results;
var Cu = Components.utils;
const DISTRIBUTION_CUSTOMIZATION_COMPLETE_TOPIC =
"distribution-customization-complete";

View File

@ -580,6 +580,8 @@ const DownloadsPanel = {
},
};
XPCOMUtils.defineConstant(this, "DownloadsPanel", DownloadsPanel);
////////////////////////////////////////////////////////////////////////////////
//// DownloadsOverlayLoader
@ -658,6 +660,8 @@ const DownloadsOverlayLoader = {
},
};
XPCOMUtils.defineConstant(this, "DownloadsOverlayLoader", DownloadsOverlayLoader);
////////////////////////////////////////////////////////////////////////////////
//// DownloadsView
@ -1004,6 +1008,8 @@ const DownloadsView = {
},
}
XPCOMUtils.defineConstant(this, "DownloadsView", DownloadsView);
////////////////////////////////////////////////////////////////////////////////
//// DownloadsViewItem
@ -1142,6 +1148,8 @@ const DownloadsViewController = {
}
};
XPCOMUtils.defineConstant(this, "DownloadsViewController", DownloadsViewController);
////////////////////////////////////////////////////////////////////////////////
//// DownloadsViewItemController
@ -1488,7 +1496,9 @@ const DownloadsSummary = {
delete this._detailsNode;
return this._detailsNode = node;
}
}
};
XPCOMUtils.defineConstant(this, "DownloadsSummary", DownloadsSummary);
////////////////////////////////////////////////////////////////////////////////
//// DownloadsFooter
@ -1542,3 +1552,5 @@ const DownloadsFooter = {
return this._footerNode = node;
}
};
XPCOMUtils.defineConstant(this, "DownloadsFooter", DownloadsFooter);

View File

@ -577,3 +577,8 @@ const DownloadsIndicatorView = {
},
};
Object.defineProperty(this, "DownloadsIndicatorView", {
value: DownloadsIndicatorView,
enumerable: true,
writable: false
});

View File

@ -10,9 +10,9 @@
////////////////////////////////////////////////////////////////////////////////
//// Globals
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
const Cr = Components.results;
var Cc = Components.classes;
var Ci = Components.interfaces;
var Cu = Components.utils;
var Cr = Components.results;
Cu.import("resource:///modules/DownloadsCommon.jsm");

View File

@ -17,7 +17,7 @@ var browserActionMap = new WeakMap();
// WeakMap[Extension -> docshell]
// This map is a cache of the windowless browser that's used to render ImageData
// for the browser_action icon.
let imageRendererMap = new WeakMap();
var imageRendererMap = new WeakMap();
function browserActionOf(extension)
{

View File

@ -3,7 +3,7 @@ Cu.import("resource://gre/modules/MatchPattern.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
let {
var {
EventManager,
contextMenuItems,
runSafe
@ -13,13 +13,13 @@ let {
// Map[Extension -> Map[ID -> MenuItem]]
// Note: we want to enumerate all the menu items so
// this cannot be a weak map.
let contextMenuMap = new Map();
var contextMenuMap = new Map();
// Not really used yet, will be used for event pages.
let onClickedCallbacksMap = new WeakMap();
var onClickedCallbacksMap = new WeakMap();
// If id is not specified for an item we use an integer.
let nextID = 0;
var nextID = 0;
function contextMenuObserver(subject, topic, data) {
subject = subject.wrappedJSObject;
@ -34,7 +34,7 @@ function contextMenuObserver(subject, topic, data) {
// For remote processes there is a gContextMenuContentData where all
// the important info is stored from the child process. We get
// this data in |contentData|.
let menuBuilder = {
var menuBuilder = {
build: function(contextData) {
// TODO: icons should be set for items
let xulMenu = contextData.menu;
@ -338,7 +338,7 @@ MenuItem.prototype = {
},
};
let extCount = 0;
var extCount = 0;
extensions.on("startup", (type, extension) => {
contextMenuMap.set(extension, new Map());
if (++extCount == 1) {

View File

@ -1,4 +1,4 @@
let {CustomizableUI} = Cu.import("resource:///modules/CustomizableUI.jsm");
var {CustomizableUI} = Cu.import("resource:///modules/CustomizableUI.jsm");
function makeWidgetId(id)
{

View File

@ -1,5 +1,5 @@
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cr = Components.results;
var Cc = Components.classes;
var Ci = Components.interfaces;
var Cr = Components.results;
var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);

View File

@ -1,4 +1,4 @@
const Cu = Components.utils;
var Cu = Components.utils;
Cu.import("resource://gre/modules/Services.jsm");
function run_test() {

View File

@ -269,6 +269,7 @@ html[dir="rtl"] .conversation-toolbar-btn-box.btn-edit-entry {
}
.call-action-group > .invite-button {
cursor: pointer;
margin: 0 4px;
position: relative;
}
@ -703,22 +704,17 @@ html[dir="rtl"] .room-conversation-wrapper header a {
z-index: 1010;
display: flex;
flex-flow: column nowrap;
justify-content: flex-start;
justify-content: center;
align-items: stretch;
}
.room-invitation-content {
flex: 1 1 auto;
display: flex;
flex-flow: column nowrap;
justify-content: center;
align-items: center;
}
.room-invitation-overlay .btn-group {
padding: 0 0 10rem;
}
.share-service-dropdown {
color: #000;
text-align: start;

View File

@ -17,6 +17,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm
this.EXPORTED_SYMBOLS = ["LoopRoomsCache"];
const LOOP_ROOMS_CACHE_FILENAME = "loopRoomsCache.json";
XPCOMUtils.defineConstant(this, "LOOP_ROOMS_CACHE_FILENAME", LOOP_ROOMS_CACHE_FILENAME);
/**
* RoomsCache is a cache for saving simple rooms data to the disk in case we

View File

@ -112,6 +112,14 @@ this.EXPORTED_SYMBOLS = ["MozLoopService", "LOOP_SESSION_TYPE",
"TWO_WAY_MEDIA_CONN_LENGTH", "SHARING_STATE_CHANGE", "SHARING_ROOM_URL",
"ROOM_CREATE", "ROOM_DELETE", "ROOM_CONTEXT_ADD"];
XPCOMUtils.defineConstant(this, "LOOP_SESSION_TYPE", LOOP_SESSION_TYPE);
XPCOMUtils.defineConstant(this, "TWO_WAY_MEDIA_CONN_LENGTH", TWO_WAY_MEDIA_CONN_LENGTH);
XPCOMUtils.defineConstant(this, "SHARING_STATE_CHANGE", SHARING_STATE_CHANGE);
XPCOMUtils.defineConstant(this, "SHARING_ROOM_URL", SHARING_ROOM_URL);
XPCOMUtils.defineConstant(this, "ROOM_CREATE", ROOM_CREATE);
XPCOMUtils.defineConstant(this, "ROOM_DELETE", ROOM_DELETE);
XPCOMUtils.defineConstant(this, "ROOM_CONTEXT_ADD", ROOM_CONTEXT_ADD);
XPCOMUtils.defineLazyModuleGetter(this, "injectLoopAPI",
"resource:///modules/loop/MozLoopAPI.jsm");

View File

@ -3,7 +3,7 @@
"use strict";
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
// Initialize this before the imports, as some of them need it.
do_get_profile();

View File

@ -32,7 +32,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "WindowsRegistry",
Cu.importGlobalProperties(["URL"]);
let CtypesKernelHelpers = MSMigrationUtils.CtypesKernelHelpers;
var CtypesKernelHelpers = MSMigrationUtils.CtypesKernelHelpers;
////////////////////////////////////////////////////////////////////////////////
//// Resources

View File

@ -2,9 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
var Cc = Components.classes;
var Ci = Components.interfaces;
var Cu = Components.utils;
const kIMig = Ci.nsIBrowserProfileMigrator;
const kIPStartup = Ci.nsIProfileStartup;

View File

@ -1,4 +1,4 @@
const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
var { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
Cu.importGlobalProperties([ "URL" ]);

View File

@ -3,10 +3,10 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const Ci = Components.interfaces;
const Cc = Components.classes;
const Cr = Components.results;
const Cu = Components.utils;
var Ci = Components.interfaces;
var Cc = Components.classes;
var Cr = Components.results;
var Cu = Components.utils;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/LoadContextInfo.jsm");

View File

@ -8,7 +8,7 @@ const TRACK_SUFFIX = "-track-digest256";
const TRACKING_TABLE_PREF = "urlclassifier.trackingTable";
const LISTS_PREF_BRANCH = "browser.safebrowsing.provider.mozilla.lists.";
let gBlocklistManager = {
var gBlocklistManager = {
_type: "",
_blockLists: [],
_brandShortName : null,

View File

@ -4,10 +4,10 @@
"use strict";
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
const Cr = Components.results;
var Cc = Components.classes;
var Ci = Components.interfaces;
var Cu = Components.utils;
var Cr = Components.results;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");

View File

@ -5,7 +5,7 @@
"use strict";
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");

View File

@ -2,7 +2,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/. */
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm");

View File

@ -4,7 +4,7 @@
"use strict";
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");

View File

@ -1,10 +1,6 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
var Imports = {};
Cu.import("resource:///modules/sessionstore/SessionSaver.jsm", Imports);
var {SessionSaver} = Imports;
add_task(function cleanup() {
info("Forgetting closed tabs");
while (ss.getClosedTabCount(window)) {

View File

@ -1,6 +1,6 @@
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cr = Components.results;
var Cc = Components.classes;
var Ci = Components.interfaces;
var Cr = Components.results;
const GCONF_BG_COLOR_KEY = "/desktop/gnome/background/primary_color";

View File

@ -4,10 +4,10 @@
"use strict";
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
const Cr = Components.results;
var Cc = Components.classes;
var Ci = Components.interfaces;
var Cu = Components.utils;
var Cr = Components.results;
Cu.import("resource:///modules/tabview/utils.jsm");
Cu.import("resource://gre/modules/AppConstants.jsm");

View File

@ -3,7 +3,7 @@
"use strict";
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
XPCOMUtils.defineLazyModuleGetter(this, "fxAccounts",
"resource://gre/modules/FxAccounts.jsm");

View File

@ -3,7 +3,7 @@
"use strict";
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
var gTestTab;
var gContentAPI;

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