Merge from mozilla-central.

This commit is contained in:
David Anderson 2012-09-06 18:28:59 -07:00
commit 6c5722e35b
799 changed files with 14436 additions and 10061 deletions

View File

@ -11,6 +11,7 @@
#include "InterfaceInitFuncs.h"
#include "nsAccUtils.h"
#include "nsIAccessibleRelation.h"
#include "nsIAccessibleTable.h"
#include "RootAccessible.h"
#include "nsIAccessibleValue.h"
#include "nsMai.h"

View File

@ -60,7 +60,7 @@ FocusManager::IsFocused(const Accessible* aAccessible) const
DocAccessible* doc =
GetAccService()->GetDocAccessible(focusedNode->OwnerDoc());
return aAccessible ==
(doc ? doc->GetAccessibleOrContainer(focusedNode) : nullptr);
(doc ? doc->GetAccessibleOrContainer(focusedNode) : nullptr);
}
}
return false;

View File

@ -23,7 +23,7 @@
#include "nsWhitespaceTokenizer.h"
#include "nsComponentManagerUtils.h"
namespace dom = mozilla::dom;
using namespace mozilla;
using namespace mozilla::a11y;
void
@ -480,61 +480,3 @@ nsAccUtils::MustPrune(Accessible* aAccessible)
role == roles::PROGRESSBAR ||
role == roles::SEPARATOR;
}
nsresult
nsAccUtils::GetHeaderCellsFor(nsIAccessibleTable *aTable,
nsIAccessibleTableCell *aCell,
int32_t aRowOrColHeaderCells, nsIArray **aCells)
{
nsresult rv = NS_OK;
nsCOMPtr<nsIMutableArray> cells = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
int32_t rowIdx = -1;
rv = aCell->GetRowIndex(&rowIdx);
NS_ENSURE_SUCCESS(rv, rv);
int32_t colIdx = -1;
rv = aCell->GetColumnIndex(&colIdx);
NS_ENSURE_SUCCESS(rv, rv);
bool moveToLeft = aRowOrColHeaderCells == eRowHeaderCells;
// Move to the left or top to find row header cells or column header cells.
int32_t index = (moveToLeft ? colIdx : rowIdx) - 1;
for (; index >= 0; index--) {
int32_t curRowIdx = moveToLeft ? rowIdx : index;
int32_t curColIdx = moveToLeft ? index : colIdx;
nsCOMPtr<nsIAccessible> cell;
rv = aTable->GetCellAt(curRowIdx, curColIdx, getter_AddRefs(cell));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIAccessibleTableCell> tableCellAcc =
do_QueryInterface(cell);
// GetCellAt should always return an nsIAccessibleTableCell (XXX Bug 587529)
NS_ENSURE_STATE(tableCellAcc);
int32_t origIdx = 1;
if (moveToLeft)
rv = tableCellAcc->GetColumnIndex(&origIdx);
else
rv = tableCellAcc->GetRowIndex(&origIdx);
NS_ENSURE_SUCCESS(rv, rv);
if (origIdx == index) {
// Append original header cells only.
uint32_t role = Role(cell);
bool isHeader = moveToLeft ?
role == nsIAccessibleRole::ROLE_ROWHEADER :
role == nsIAccessibleRole::ROLE_COLUMNHEADER;
if (isHeader)
cells->AppendElement(cell, false);
}
}
NS_ADDREF(*aCells = cells);
return NS_OK;
}

View File

@ -9,7 +9,6 @@
#include "nsIAccessible.h"
#include "nsIAccessibleRole.h"
#include "nsIAccessibleText.h"
#include "nsIAccessibleTable.h"
#include "nsAccessibilityService.h"
#include "nsCoreUtils.h"
@ -293,32 +292,6 @@ public:
* to platform accessibility APIs, should the children be pruned off?
*/
static bool MustPrune(Accessible* aAccessible);
/**
* Search hint enum constants. Used by GetHeaderCellsFor() method.
*/
enum {
// search for row header cells, left direction
eRowHeaderCells,
// search for column header cells, top direction
eColumnHeaderCells
};
/**
* Return an array of row or column header cells for the given cell.
*
* @param aTable [in] table accessible
* @param aCell [in] cell accessible within the given table to
* get header cells
* @param aRowOrColHeaderCells [in] specifies whether column or row header
* cells are returned (see enum constants
* above)
* @param aCells [out] array of header cell accessibles
*/
static nsresult GetHeaderCellsFor(nsIAccessibleTable *aTable,
nsIAccessibleTableCell *aCell,
int32_t aRowOrColHeaderCells,
nsIArray **aCells);
};
#endif

View File

@ -1610,12 +1610,9 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
return accessible;
}
if (tag == nsGkAtoms::dt ||
(tag == nsGkAtoms::li &&
aFrame->GetType() != nsGkAtoms::blockFrame)) {
// Normally for li, it is created by the list item frame (in nsBlockFrame)
// which knows about the bullet frame; however, in this case the list item
// must have been styled using display: foo
if (tag == nsGkAtoms::dt || tag == nsGkAtoms::li) {
// Create list item accessible unconditionally by tag name. nsBlockFrame
// creates the list item accessible for other elements styled as list items.
Accessible* accessible = new HTMLLIAccessible(aContent, aDoc);
NS_IF_ADDREF(accessible);
return accessible;

View File

@ -545,141 +545,47 @@ NS_IMPL_ISUPPORTS_INHERITED1(ARIAGridCellAccessible,
////////////////////////////////////////////////////////////////////////////////
// nsIAccessibleTableCell
NS_IMETHODIMP
ARIAGridCellAccessible::GetTable(nsIAccessibleTable** aTable)
TableAccessible*
ARIAGridCellAccessible::Table() const
{
NS_ENSURE_ARG_POINTER(aTable);
*aTable = nullptr;
Accessible* table = TableFor(Row());
if (table)
CallQueryInterface(table, aTable);
return NS_OK;
return table ? table->AsTable() : nullptr;
}
NS_IMETHODIMP
ARIAGridCellAccessible::GetColumnIndex(int32_t* aColumnIndex)
uint32_t
ARIAGridCellAccessible::ColIdx() const
{
NS_ENSURE_ARG_POINTER(aColumnIndex);
*aColumnIndex = -1;
if (IsDefunct())
return NS_ERROR_FAILURE;
Accessible* row = Parent();
Accessible* row = Row();
if (!row)
return NS_OK;
*aColumnIndex = 0;
return 0;
int32_t indexInRow = IndexInParent();
uint32_t colIdx = 0;
for (int32_t idx = 0; idx < indexInRow; idx++) {
Accessible* cell = row->GetChildAt(idx);
roles::Role role = cell->Role();
if (role == roles::GRID_CELL || role == roles::ROWHEADER ||
role == roles::COLUMNHEADER)
(*aColumnIndex)++;
colIdx++;
}
return NS_OK;
return colIdx;
}
NS_IMETHODIMP
ARIAGridCellAccessible::GetRowIndex(int32_t* aRowIndex)
uint32_t
ARIAGridCellAccessible::RowIdx() const
{
NS_ENSURE_ARG_POINTER(aRowIndex);
*aRowIndex = -1;
if (IsDefunct())
return NS_ERROR_FAILURE;
*aRowIndex = RowIndexFor(Row());
return NS_OK;
return RowIndexFor(Row());
}
NS_IMETHODIMP
ARIAGridCellAccessible::GetColumnExtent(int32_t* aExtentCount)
bool
ARIAGridCellAccessible::Selected()
{
NS_ENSURE_ARG_POINTER(aExtentCount);
*aExtentCount = 0;
Accessible* row = Row();
if (!row)
return false;
if (IsDefunct())
return NS_ERROR_FAILURE;
*aExtentCount = 1;
return NS_OK;
}
NS_IMETHODIMP
ARIAGridCellAccessible::GetRowExtent(int32_t* aExtentCount)
{
NS_ENSURE_ARG_POINTER(aExtentCount);
*aExtentCount = 0;
if (IsDefunct())
return NS_ERROR_FAILURE;
*aExtentCount = 1;
return NS_OK;
}
NS_IMETHODIMP
ARIAGridCellAccessible::GetColumnHeaderCells(nsIArray** aHeaderCells)
{
NS_ENSURE_ARG_POINTER(aHeaderCells);
*aHeaderCells = nullptr;
if (IsDefunct())
return NS_ERROR_FAILURE;
nsCOMPtr<nsIAccessibleTable> table;
GetTable(getter_AddRefs(table));
if (!table)
return NS_OK;
return nsAccUtils::GetHeaderCellsFor(table, this,
nsAccUtils::eColumnHeaderCells,
aHeaderCells);
}
NS_IMETHODIMP
ARIAGridCellAccessible::GetRowHeaderCells(nsIArray** aHeaderCells)
{
NS_ENSURE_ARG_POINTER(aHeaderCells);
*aHeaderCells = nullptr;
if (IsDefunct())
return NS_ERROR_FAILURE;
nsCOMPtr<nsIAccessibleTable> table;
GetTable(getter_AddRefs(table));
if (!table)
return NS_OK;
return nsAccUtils::GetHeaderCellsFor(table, this,
nsAccUtils::eRowHeaderCells,
aHeaderCells);
}
NS_IMETHODIMP
ARIAGridCellAccessible::IsSelected(bool* aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = false;
if (IsDefunct())
return NS_ERROR_FAILURE;
Accessible* row = Parent();
if (!row || row->Role() != roles::ROW)
return NS_OK;
if (!nsAccUtils::IsARIASelected(row) && !nsAccUtils::IsARIASelected(this))
return NS_OK;
*aIsSelected = true;
return NS_OK;
return nsAccUtils::IsARIASelected(row) || nsAccUtils::IsARIASelected(this);
}
////////////////////////////////////////////////////////////////////////////////

View File

@ -58,6 +58,7 @@ public:
virtual void SelectRow(uint32_t aRowIdx);
virtual void UnselectCol(uint32_t aColIdx);
virtual void UnselectRow(uint32_t aRowIdx);
virtual Accessible* AsAccessible() { return this; }
protected:
@ -109,9 +110,10 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIAccessibleTableCell
NS_DECL_OR_FORWARD_NSIACCESSIBLETABLECELL_WITH_XPCACCESSIBLETABLECELL
NS_FORWARD_NSIACCESSIBLETABLECELL(xpcAccessibleTableCell::)
// Accessible
virtual TableCellAccessible* AsTableCell() { return this; }
virtual void Shutdown();
virtual void ApplyARIAState(uint64_t* aState) const;
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
@ -136,6 +138,12 @@ protected:
* Return index of the given row.
*/
int32_t RowIndexFor(Accessible* aRow) const;
// TableCellAccessible
virtual TableAccessible* Table() const MOZ_OVERRIDE;
virtual uint32_t ColIdx() const MOZ_OVERRIDE;
virtual uint32_t RowIdx() const MOZ_OVERRIDE;
virtual bool Selected() MOZ_OVERRIDE;
};
} // namespace a11y

View File

@ -2846,7 +2846,21 @@ Accessible::IsWidget() const
bool
Accessible::IsActiveWidget() const
{
return FocusMgr()->IsFocused(this);
if (FocusMgr()->HasDOMFocus(mContent))
return true;
// If text entry of combobox widget has a focus then the combobox widget is
// active.
if (mRoleMapEntry && mRoleMapEntry->Is(nsGkAtoms::combobox)) {
uint32_t childCount = ChildCount();
for (uint32_t idx = 0; idx < childCount; idx++) {
Accessible* child = mChildren.ElementAt(idx);
if (child->Role() == roles::ENTRY)
return FocusMgr()->HasDOMFocus(child->GetContent());
}
}
return false;
}
bool

View File

@ -37,6 +37,7 @@ class HTMLLIAccessible;
class ImageAccessible;
class Relation;
class TableAccessible;
class TableCellAccessible;
class TextLeafAccessible;
class XULTreeAccessible;
@ -514,6 +515,8 @@ public:
virtual mozilla::a11y::TableAccessible* AsTable() { return nullptr; }
virtual mozilla::a11y::TableCellAccessible* AsTableCell() { return nullptr; }
inline bool IsTextLeaf() const { return mFlags & eTextLeafAccessible; }
mozilla::a11y::TextLeafAccessible* AsTextLeaf();

View File

@ -1221,11 +1221,11 @@ DocAccessible::ARIAAttributeChanged(nsIContent* aContent, nsIAtom* aAttribute)
void
DocAccessible::ARIAActiveDescendantChanged(nsIContent* aElm)
{
if (FocusMgr()->HasDOMFocus(aElm)) {
Accessible* widget = GetAccessible(aElm);
if (widget && widget->IsActiveWidget()) {
nsAutoString id;
if (aElm->GetAttr(kNameSpaceID_None, nsGkAtoms::aria_activedescendant, id)) {
nsIDocument* DOMDoc = aElm->OwnerDoc();
dom::Element* activeDescendantElm = DOMDoc->GetElementById(id);
dom::Element* activeDescendantElm = aElm->OwnerDoc()->GetElementById(id);
if (activeDescendantElm) {
Accessible* activeDescendant = GetAccessible(activeDescendantElm);
if (activeDescendant) {

View File

@ -25,6 +25,7 @@ CPPSRCS = \
ImageAccessible.cpp \
OuterDocAccessible.cpp \
RootAccessible.cpp \
TableCellAccessible.cpp \
TextLeafAccessible.cpp \
$(NULL)

View File

@ -175,6 +175,11 @@ public:
* Return true if the table is probably for layout.
*/
virtual bool IsProbablyLayoutTable() { return false; }
/**
* Convert the table to an Accessible*.
*/
virtual Accessible* AsAccessible() = 0;
};
} // namespace a11y

View File

@ -0,0 +1,67 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* 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/. */
#include "TableCellAccessible.h"
#include "Accessible-inl.h"
#include "TableAccessible.h"
using namespace mozilla;
using namespace mozilla::a11y;
void
TableCellAccessible::RowHeaderCells(nsTArray<Accessible*>* aCells)
{
uint32_t rowIdx = RowIdx(), colIdx = ColIdx();
TableAccessible* table = Table();
if (!table)
return;
// Move to the left to find row header cells
for (uint32_t curColIdx = colIdx - 1; curColIdx < colIdx; curColIdx--) {
Accessible* cell = table->CellAt(rowIdx, curColIdx);
if (!cell)
continue;
// CellAt should always return a TableCellAccessible (XXX Bug 587529)
TableCellAccessible* tableCell = cell->AsTableCell();
NS_ASSERTION(tableCell, "cell should be a table cell!");
if (!tableCell)
continue;
// Avoid addding cells multiple times, if this cell spans more columns
// we'll get it later.
if (tableCell->ColIdx() == curColIdx && cell->Role() == roles::ROWHEADER)
aCells->AppendElement(cell);
}
}
void
TableCellAccessible::ColHeaderCells(nsTArray<Accessible*>* aCells)
{
uint32_t rowIdx = RowIdx(), colIdx = ColIdx();
TableAccessible* table = Table();
if (!table)
return;
// Move to the left to find row header cells
for (uint32_t curRowIdx = rowIdx - 1; curRowIdx < rowIdx; curRowIdx--) {
Accessible* cell = table->CellAt(curRowIdx, colIdx);
if (!cell)
continue;
// CellAt should always return a TableCellAccessible (XXX Bug 587529)
TableCellAccessible* tableCell = cell->AsTableCell();
NS_ASSERTION(tableCell, "cell should be a table cell!");
if (!tableCell)
continue;
// Avoid addding cells multiple times, if this cell spans more rows
// we'll get it later.
if (tableCell->RowIdx() == curRowIdx && cell->Role() == roles::COLUMNHEADER)
aCells->AppendElement(cell);
}
}

View File

@ -15,10 +15,10 @@ class Accessible;
namespace mozilla {
namespace a11y {
class TableAccessible;
class TableAccessible;
/**
* abstract interface implemented by table cell accessibles.
* Abstract interface implemented by table cell accessibles.
*/
class TableCellAccessible
{
@ -27,45 +27,45 @@ public:
/**
* Return the table this cell is in.
*/
virtual TableAccessible* Table() { return nullptr; }
virtual TableAccessible* Table() const = 0;
/**
* Return the Column of the table this cell is in.
* Return the column of the table this cell is in.
*/
virtual uint32_t ColIdx() { return 0; }
virtual uint32_t ColIdx() const = 0;
/**
* Return the the row of the table this cell is in.
* Return the row of the table this cell is in.
*/
virtual uint32_t RowIdx() { return 0; }
virtual uint32_t RowIdx() const = 0;
/**
* Return the column extent of this cell.
*/
virtual uint32_t ColExtent() { return 0; }
virtual uint32_t ColExtent() const { return 1; }
/**
* Return the row extent of this cell.
*/
virtual uint32_t RowExtent() { return 0; }
virtual uint32_t RowExtent() const { return 1; }
/**
* Return the column header cells for this cell.
*/
virtual void ColHeaderCells(nsTArray<Accessible*>* aCells) { }
virtual void ColHeaderCells(nsTArray<Accessible*>* aCells);
/**
* Return the row header cells for this cell.
*/
virtual void RowHeaderCells(nsTArray<Accessible*>* aCells) { }
virtual void RowHeaderCells(nsTArray<Accessible*>* aCells);
/**
* Returns true if this cell is selected.
*/
virtual bool Selected() { return false; }
virtual bool Selected() = 0;
};
}
}
} // namespace a11y
} // namespace mozilla
#endif // mozilla_a11y_TableCellAccessible_h__

View File

@ -60,8 +60,8 @@ NS_IMPL_ISUPPORTS_INHERITED1(HTMLTableCellAccessible,
////////////////////////////////////////////////////////////////////////////////
// HTMLTableCellAccessible: Accessible implementation
void
HTMLTableCellAccessible::Shutdown()
void
HTMLTableCellAccessible::Shutdown()
{
mTableCell = nullptr;
HyperTextAccessibleWrap::Shutdown();
@ -103,20 +103,16 @@ HTMLTableCellAccessible::GetAttributesInternal(nsIPersistentProperties* aAttribu
NS_ENSURE_SUCCESS(rv, rv);
// table-cell-index attribute
nsCOMPtr<nsIAccessibleTable> tableAcc(GetTableAccessible());
if (!tableAcc)
TableAccessible* table = Table();
if (!table)
return NS_OK;
int32_t rowIdx = -1, colIdx = -1;
rv = GetCellIndexes(rowIdx, colIdx);
NS_ENSURE_SUCCESS(rv, rv);
int32_t idx = -1;
rv = tableAcc->GetCellIndexAt(rowIdx, colIdx, &idx);
NS_ENSURE_SUCCESS(rv, rv);
nsAutoString stringIdx;
stringIdx.AppendInt(idx);
stringIdx.AppendInt(table->CellIndexAt(rowIdx, colIdx));
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::tableCellIndex, stringIdx);
// abbr attribute
@ -150,203 +146,123 @@ HTMLTableCellAccessible::GetAttributesInternal(nsIPersistentProperties* aAttribu
////////////////////////////////////////////////////////////////////////////////
// HTMLTableCellAccessible: nsIAccessibleTableCell implementation
NS_IMETHODIMP
HTMLTableCellAccessible::GetTable(nsIAccessibleTable** aTable)
TableAccessible*
HTMLTableCellAccessible::Table() const
{
NS_ENSURE_ARG_POINTER(aTable);
*aTable = nullptr;
if (IsDefunct())
return NS_OK;
nsCOMPtr<nsIAccessibleTable> table = GetTableAccessible();
table.swap(*aTable);
return NS_OK;
}
NS_IMETHODIMP
HTMLTableCellAccessible::GetColumnIndex(int32_t* aColumnIndex)
{
NS_ENSURE_ARG_POINTER(aColumnIndex);
*aColumnIndex = -1;
if (IsDefunct())
return NS_ERROR_FAILURE;
nsITableCellLayout* cellLayout = GetCellLayout();
NS_ENSURE_STATE(cellLayout);
return cellLayout->GetColIndex(*aColumnIndex);
}
NS_IMETHODIMP
HTMLTableCellAccessible::GetRowIndex(int32_t* aRowIndex)
{
NS_ENSURE_ARG_POINTER(aRowIndex);
*aRowIndex = -1;
if (IsDefunct())
return NS_ERROR_FAILURE;
nsITableCellLayout* cellLayout = GetCellLayout();
NS_ENSURE_STATE(cellLayout);
return cellLayout->GetRowIndex(*aRowIndex);
}
NS_IMETHODIMP
HTMLTableCellAccessible::GetColumnExtent(int32_t* aExtentCount)
{
NS_ENSURE_ARG_POINTER(aExtentCount);
*aExtentCount = 1;
int32_t rowIdx = -1, colIdx = -1;
GetCellIndexes(rowIdx, colIdx);
nsCOMPtr<nsIAccessibleTable> table = GetTableAccessible();
NS_ENSURE_STATE(table);
return table->GetColumnExtentAt(rowIdx, colIdx, aExtentCount);
}
NS_IMETHODIMP
HTMLTableCellAccessible::GetRowExtent(int32_t* aExtentCount)
{
NS_ENSURE_ARG_POINTER(aExtentCount);
*aExtentCount = 1;
int32_t rowIdx = -1, colIdx = -1;
GetCellIndexes(rowIdx, colIdx);
nsCOMPtr<nsIAccessibleTable> table = GetTableAccessible();
NS_ENSURE_STATE(table);
return table->GetRowExtentAt(rowIdx, colIdx, aExtentCount);
}
NS_IMETHODIMP
HTMLTableCellAccessible::GetColumnHeaderCells(nsIArray** aHeaderCells)
{
NS_ENSURE_ARG_POINTER(aHeaderCells);
*aHeaderCells = nullptr;
if (IsDefunct())
return NS_ERROR_FAILURE;
return GetHeaderCells(nsAccUtils::eColumnHeaderCells, aHeaderCells);
}
NS_IMETHODIMP
HTMLTableCellAccessible::GetRowHeaderCells(nsIArray** aHeaderCells)
{
NS_ENSURE_ARG_POINTER(aHeaderCells);
*aHeaderCells = nullptr;
if (IsDefunct())
return NS_ERROR_FAILURE;
return GetHeaderCells(nsAccUtils::eRowHeaderCells, aHeaderCells);
}
NS_IMETHODIMP
HTMLTableCellAccessible::IsSelected(bool* aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = false;
if (IsDefunct())
return NS_ERROR_FAILURE;
int32_t rowIdx = -1, colIdx = -1;
GetCellIndexes(rowIdx, colIdx);
nsCOMPtr<nsIAccessibleTable> table = GetTableAccessible();
NS_ENSURE_STATE(table);
return table->IsCellSelected(rowIdx, colIdx, aIsSelected);
}
////////////////////////////////////////////////////////////////////////////////
// HTMLTableCellAccessible: protected implementation
already_AddRefed<nsIAccessibleTable>
HTMLTableCellAccessible::GetTableAccessible()
{
Accessible* parent = this;
Accessible* parent = const_cast<HTMLTableCellAccessible*>(this);
while ((parent = parent->Parent())) {
roles::Role role = parent->Role();
if (role == roles::TABLE || role == roles::TREE_TABLE) {
nsIAccessibleTable* tableAcc = nullptr;
CallQueryInterface(parent, &tableAcc);
return tableAcc;
}
if (role == roles::TABLE || role == roles::TREE_TABLE)
return parent->AsTable();
}
return nullptr;
}
nsITableCellLayout*
HTMLTableCellAccessible::GetCellLayout()
uint32_t
HTMLTableCellAccessible::ColIdx() const
{
nsIFrame *frame = mContent->GetPrimaryFrame();
NS_ASSERTION(frame, "The frame cannot be obtaied for HTML table cell.");
if (!frame)
return nullptr;
nsITableCellLayout* cellLayout = GetCellLayout();
NS_ENSURE_TRUE(cellLayout, 0);
nsITableCellLayout *cellLayout = do_QueryFrame(frame);
return cellLayout;
int32_t colIdx = 0;
cellLayout->GetColIndex(colIdx);
return colIdx > 0 ? static_cast<uint32_t>(colIdx) : 0;
}
uint32_t
HTMLTableCellAccessible::RowIdx() const
{
nsITableCellLayout* cellLayout = GetCellLayout();
NS_ENSURE_TRUE(cellLayout, 0);
int32_t rowIdx = 0;
cellLayout->GetRowIndex(rowIdx);
return rowIdx > 0 ? static_cast<uint32_t>(rowIdx) : 0;
}
uint32_t
HTMLTableCellAccessible::ColExtent() const
{
int32_t rowIdx = -1, colIdx = -1;
GetCellIndexes(rowIdx, colIdx);
TableAccessible* table = Table();
NS_ASSERTION(table, "cell not in a table!");
if (!table)
return 0;
return table->ColExtentAt(rowIdx, colIdx);
}
uint32_t
HTMLTableCellAccessible::RowExtent() const
{
int32_t rowIdx = -1, colIdx = -1;
GetCellIndexes(rowIdx, colIdx);
TableAccessible* table = Table();
NS_ASSERTION(table, "cell not in atable!");
if (!table)
return 0;
return table->RowExtentAt(rowIdx, colIdx);
}
void
HTMLTableCellAccessible::ColHeaderCells(nsTArray<Accessible*>* aCells)
{
IDRefsIterator itr(mDoc, mContent, nsGkAtoms::headers);
while (Accessible* cell = itr.Next())
if (cell->Role() == roles::COLUMNHEADER)
aCells->AppendElement(cell);
if (aCells->IsEmpty())
TableCellAccessible::ColHeaderCells(aCells);
}
void
HTMLTableCellAccessible::RowHeaderCells(nsTArray<Accessible*>* aCells)
{
IDRefsIterator itr(mDoc, mContent, nsGkAtoms::headers);
while (Accessible* cell = itr.Next())
if (cell->Role() == roles::ROWHEADER)
aCells->AppendElement(cell);
if (aCells->IsEmpty())
TableCellAccessible::RowHeaderCells(aCells);
}
bool
HTMLTableCellAccessible::Selected()
{
int32_t rowIdx = -1, colIdx = -1;
GetCellIndexes(rowIdx, colIdx);
TableAccessible* table = Table();
NS_ENSURE_TRUE(table, false);
return table->IsCellSelected(rowIdx, colIdx);
}
////////////////////////////////////////////////////////////////////////////////
// HTMLTableCellAccessible: protected implementation
nsITableCellLayout*
HTMLTableCellAccessible::GetCellLayout() const
{
return do_QueryFrame(mContent->GetPrimaryFrame());
}
nsresult
HTMLTableCellAccessible::GetCellIndexes(int32_t& aRowIndex, int32_t& aColIndex)
HTMLTableCellAccessible::GetCellIndexes(int32_t& aRowIdx, int32_t& aColIdx) const
{
nsITableCellLayout *cellLayout = GetCellLayout();
NS_ENSURE_STATE(cellLayout);
return cellLayout->GetCellIndexes(aRowIndex, aColIndex);
return cellLayout->GetCellIndexes(aRowIdx, aColIdx);
}
nsresult
HTMLTableCellAccessible::GetHeaderCells(int32_t aRowOrColumnHeaderCell,
nsIArray** aHeaderCells)
{
// Get header cells from @header attribute.
IDRefsIterator iter(mDoc, mContent, nsGkAtoms::headers);
nsIContent* headerCellElm = iter.NextElem();
if (headerCellElm) {
nsresult rv = NS_OK;
nsCOMPtr<nsIMutableArray> headerCells =
do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
roles::Role desiredRole = static_cast<roles::Role>(-1) ;
if (aRowOrColumnHeaderCell == nsAccUtils::eRowHeaderCells)
desiredRole = roles::ROWHEADER;
else if (aRowOrColumnHeaderCell == nsAccUtils::eColumnHeaderCells)
desiredRole = roles::COLUMNHEADER;
do {
Accessible* headerCell = mDoc->GetAccessible(headerCellElm);
if (headerCell && headerCell->Role() == desiredRole)
headerCells->AppendElement(static_cast<nsIAccessible*>(headerCell),
false);
} while ((headerCellElm = iter.NextElem()));
NS_ADDREF(*aHeaderCells = headerCells);
return NS_OK;
}
// Otherwise calculate header cells from hierarchy (see 11.4.3 "Algorithm to
// find heading information" of w3c HTML 4.01).
nsCOMPtr<nsIAccessibleTable> table = GetTableAccessible();
if (table) {
return nsAccUtils::GetHeaderCellsFor(table, this, aRowOrColumnHeaderCell,
aHeaderCells);
}
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
// HTMLTableHeaderCellAccessible

View File

@ -34,15 +34,26 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIAccessibleTableCell
NS_DECL_OR_FORWARD_NSIACCESSIBLETABLECELL_WITH_XPCACCESSIBLETABLECELL
NS_FORWARD_NSIACCESSIBLETABLECELL(xpcAccessibleTableCell::)
// Accessible
virtual TableCellAccessible* AsTableCell() { return this; }
virtual void Shutdown();
virtual a11y::role NativeRole();
virtual uint64_t NativeState();
virtual uint64_t NativeInteractiveState() const;
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
// TableCellAccessible
virtual TableAccessible* Table() const MOZ_OVERRIDE;
virtual uint32_t ColIdx() const MOZ_OVERRIDE;
virtual uint32_t RowIdx() const MOZ_OVERRIDE;
virtual uint32_t ColExtent() const MOZ_OVERRIDE;
virtual uint32_t RowExtent() const MOZ_OVERRIDE;
virtual void ColHeaderCells(nsTArray<Accessible*>* aCells) MOZ_OVERRIDE;
virtual void RowHeaderCells(nsTArray<Accessible*>* aCells) MOZ_OVERRIDE;
virtual bool Selected() MOZ_OVERRIDE;
protected:
/**
* Return host table accessible.
@ -52,18 +63,12 @@ protected:
/**
* Return nsITableCellLayout of the table cell frame.
*/
nsITableCellLayout* GetCellLayout();
nsITableCellLayout* GetCellLayout() const;
/**
* Return row and column indices of the cell.
*/
nsresult GetCellIndexes(int32_t& aRowIdx, int32_t& aColIdx);
/**
* Return an array of row or column header cells.
*/
nsresult GetHeaderCells(int32_t aRowOrColumnHeaderCell,
nsIArray **aHeaderCells);
nsresult GetCellIndexes(int32_t& aRowIdx, int32_t& aColIdx) const;
};
@ -130,6 +135,7 @@ public:
virtual void UnselectCol(uint32_t aColIdx);
virtual void UnselectRow(uint32_t aRowIdx);
virtual bool IsProbablyLayoutTable();
virtual Accessible* AsAccessible() { return this; }
// nsAccessNode
virtual void Shutdown();

View File

@ -137,9 +137,9 @@ __try {
if (IsDefunct())
return E_FAIL;
if (NS_FAILED(GetCharacterExtents(aStartIndex, aEndIndex,
aX, aY, aWidth, aHeight))) {
return NS_ERROR_FAILURE;
if (FAILED(GetCharacterExtents(aStartIndex, aEndIndex,
aX, aY, aWidth, aHeight))) {
return E_FAIL;
}
} __except(FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
@ -191,7 +191,7 @@ TextLeafAccessibleWrap::GetPointFromOffset(nsIFrame* aContainingFrame,
/*
* Given an offset, the x, y, width, and height values are filled appropriately.
*/
nsresult
HRESULT
TextLeafAccessibleWrap::GetCharacterExtents(int32_t aStartOffset,
int32_t aEndOffset,
int32_t* aX,
@ -207,7 +207,7 @@ TextLeafAccessibleWrap::GetCharacterExtents(int32_t aStartOffset,
nsPresContext* presContext = mDoc->PresContext();
nsIFrame *frame = GetFrame();
NS_ENSURE_TRUE(frame, NS_ERROR_FAILURE);
NS_ENSURE_TRUE(frame, E_FAIL);
nsPoint startPoint, endPoint;
nsIFrame *startFrame = GetPointFromOffset(frame, aStartOffset, true, startPoint);
@ -234,7 +234,7 @@ TextLeafAccessibleWrap::GetCharacterExtents(int32_t aStartOffset,
*aWidth = sum.width;
*aHeight = sum.height;
return NS_OK;
return S_OK;
}
STDMETHODIMP

View File

@ -55,9 +55,9 @@ public:
/* [retval][out] */ BSTR __RPC_FAR *fontFamily);
protected:
nsresult GetCharacterExtents(int32_t aStartOffset, int32_t aEndOffset,
int32_t* aX, int32_t* aY,
int32_t* aWidth, int32_t* aHeight);
HRESULT GetCharacterExtents(int32_t aStartOffset, int32_t aEndOffset,
int32_t* aX, int32_t* aY,
int32_t* aWidth, int32_t* aHeight);
// Return child frame containing offset on success
nsIFrame* GetPointFromOffset(nsIFrame *aContainingFrame,

View File

@ -56,7 +56,8 @@ NS_IMPL_ISUPPORTS_INHERITED1(nsAccessNodeWrap, nsAccessNode, nsIWinAccessNode);
NS_IMETHODIMP
nsAccessNodeWrap::QueryNativeInterface(REFIID aIID, void** aInstancePtr)
{
return QueryInterface(aIID, aInstancePtr);
// XXX Wrong for E_NOINTERFACE
return static_cast<nsresult>(QueryInterface(aIID, aInstancePtr));
}
//-----------------------------------------------------

View File

@ -18,6 +18,7 @@ CPPSRCS = \
nsAccEvent.cpp \
nsAccessibleRelation.cpp \
xpcAccessibleTable.cpp \
xpcAccessibleTableCell.cpp \
$(NULL)
# we don't want the shared lib, but we want to force the creation of a static lib.

View File

@ -0,0 +1,158 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* 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/. */
#include "xpcAccessibleTableCell.h"
#include "Accessible.h"
#include "TableAccessible.h"
#include "TableCellAccessible.h"
#include "nsIAccessibleTable.h"
#include "nsComponentManagerUtils.h"
#include "nsIMutableArray.h"
using namespace mozilla;
using namespace mozilla::a11y;
nsresult
xpcAccessibleTableCell::GetTable(nsIAccessibleTable** aTable)
{
NS_ENSURE_ARG_POINTER(aTable);
*aTable = nullptr;
if (!mTableCell)
return NS_ERROR_FAILURE;
TableAccessible* table = mTableCell->Table();
if (!table)
return NS_ERROR_FAILURE;
nsCOMPtr<nsIAccessibleTable> xpcTable =
do_QueryInterface(static_cast<nsIAccessible*>(table->AsAccessible()));
xpcTable.forget(aTable);
return NS_OK;
}
nsresult
xpcAccessibleTableCell::GetColumnIndex(int32_t* aColIdx)
{
NS_ENSURE_ARG_POINTER(aColIdx);
*aColIdx = -1;
if (!mTableCell)
return NS_ERROR_FAILURE;
*aColIdx = mTableCell->ColIdx();
return NS_OK;
}
nsresult
xpcAccessibleTableCell::GetRowIndex(int32_t* aRowIdx)
{
NS_ENSURE_ARG_POINTER(aRowIdx);
*aRowIdx = -1;
if (!mTableCell)
return NS_ERROR_FAILURE;
*aRowIdx = mTableCell->RowIdx();
return NS_OK;
}
nsresult
xpcAccessibleTableCell::GetColumnExtent(int32_t* aExtent)
{
NS_ENSURE_ARG_POINTER(aExtent);
*aExtent = -1;
if (!mTableCell)
return NS_ERROR_FAILURE;
*aExtent = mTableCell->ColExtent();
return NS_OK;
}
nsresult
xpcAccessibleTableCell::GetRowExtent(int32_t* aExtent)
{
NS_ENSURE_ARG_POINTER(aExtent);
*aExtent = -1;
if (!mTableCell)
return NS_ERROR_FAILURE;
*aExtent = mTableCell->RowExtent();
return NS_OK;
}
nsresult
xpcAccessibleTableCell::GetColumnHeaderCells(nsIArray** aHeaderCells)
{
NS_ENSURE_ARG_POINTER(aHeaderCells);
*aHeaderCells = nullptr;
if (!mTableCell)
return NS_ERROR_FAILURE;
nsAutoTArray<Accessible*, 10> headerCells;
mTableCell->ColHeaderCells(&headerCells);
nsCOMPtr<nsIMutableArray> cells = do_CreateInstance(NS_ARRAY_CONTRACTID);
NS_ENSURE_TRUE(cells, NS_ERROR_FAILURE);
for (uint32_t idx = 0; idx < headerCells.Length(); idx++) {
cells->
AppendElement(static_cast<nsIAccessible*>(headerCells.ElementAt(idx)),
false);
}
NS_ADDREF(*aHeaderCells = cells);
return NS_OK;
}
nsresult
xpcAccessibleTableCell::GetRowHeaderCells(nsIArray** aHeaderCells)
{
NS_ENSURE_ARG_POINTER(aHeaderCells);
*aHeaderCells = nullptr;
if (!mTableCell)
return NS_ERROR_FAILURE;
nsAutoTArray<Accessible*, 10> headerCells;
mTableCell->RowHeaderCells(&headerCells);
nsCOMPtr<nsIMutableArray> cells = do_CreateInstance(NS_ARRAY_CONTRACTID);
NS_ENSURE_TRUE(cells, NS_ERROR_FAILURE);
for (uint32_t idx = 0; idx < headerCells.Length(); idx++) {
cells->
AppendElement(static_cast<nsIAccessible*>(headerCells.ElementAt(idx)),
false);
}
NS_ADDREF(*aHeaderCells = cells);
return NS_OK;
}
nsresult
xpcAccessibleTableCell::IsSelected(bool* aSelected)
{
NS_ENSURE_ARG_POINTER(aSelected);
*aSelected = false;
if (!mTableCell)
return NS_ERROR_FAILURE;
*aSelected = mTableCell->Selected();
return NS_OK;
}

View File

@ -4,34 +4,43 @@
* 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/. */
#ifndef MOZILLA_A11Y_XPCOM_XPACESSIBLETABLECELL_H_
#define MOZILLA_A11Y_XPCOM_XPACESSIBLETABLECELL_H_
#ifndef mozilla_a11y_xpcom_xpcAccessibletableCell_h_
#define mozilla_a11y_xpcom_xpcAccessibletableCell_h_
#include "nscore.h"
class nsIAccessibleTable;
class nsIArray;
namespace mozilla {
namespace a11y {
class TableAccessible;
class TableCellAccessible;
}
}
/**
* This class provides an implementation of the nsIAccessibleTableCell
* interface's methods.
*/
class xpcAccessibleTableCell
{
public:
xpcAccessibleTableCell(mozilla::a11y::TableCellAccessible* aTableCell) :
mTableCell(aTableCell) { }
nsresult GetTable(nsIAccessibleTable** aTable);
nsresult GetColumnIndex(int32_t* aColIdx);
nsresult GetRowIndex(int32_t* aRowIdx);
nsresult GetColumnExtent(int32_t* aExtent);
nsresult GetRowExtent(int32_t* aExtent);
nsresult GetColumnHeaderCells(nsIArray** aHeaderCells);
nsresult GetRowHeaderCells(nsIArray** aHeaderCells);
nsresult IsSelected(bool* aSelected);
protected:
mozilla::a11y::TableCellAccessible* mTableCell;
};
} // namespace a11y
} // namespace mozilla
#define NS_DECL_OR_FORWARD_NSIACCESSIBLETABLECELL_WITH_XPCACCESSIBLETABLECELL \
NS_IMETHOD GetTable(nsIAccessibleTable * *aTable); \
NS_IMETHOD GetColumnIndex(int32_t *aColumnIndex); \
NS_IMETHOD GetRowIndex(int32_t *aRowIndex); \
NS_IMETHOD GetColumnExtent(int32_t *aColumnExtent); \
NS_IMETHOD GetRowExtent(int32_t *aRowExtent); \
NS_IMETHOD GetColumnHeaderCells(nsIArray * *aColumnHeaderCells); \
NS_IMETHOD GetRowHeaderCells(nsIArray * *aRowHeaderCells); \
NS_IMETHOD IsSelected(bool *_retval );
#endif // MOZILLA_A11Y_XPCOM_XPACESSIBLETABLECELL_H_
#endif // mozilla_a11y_xpcom_xpcAccessibletableCell_h_

View File

@ -742,126 +742,74 @@ NS_IMPL_ISUPPORTS_INHERITED1(XULListCellAccessible,
////////////////////////////////////////////////////////////////////////////////
// XULListCellAccessible: nsIAccessibleTableCell implementation
NS_IMETHODIMP
XULListCellAccessible::GetTable(nsIAccessibleTable** aTable)
TableAccessible*
XULListCellAccessible::Table() const
{
NS_ENSURE_ARG_POINTER(aTable);
*aTable = nullptr;
if (IsDefunct())
return NS_ERROR_FAILURE;
Accessible* thisRow = Parent();
if (!thisRow || thisRow->Role() != roles::ROW)
return NS_OK;
return nullptr;
Accessible* table = thisRow->Parent();
if (!table || table->Role() != roles::TABLE)
return NS_OK;
return nullptr;
CallQueryInterface(table, aTable);
return NS_OK;
return table->AsTable();
}
NS_IMETHODIMP
XULListCellAccessible::GetColumnIndex(int32_t* aColumnIndex)
uint32_t
XULListCellAccessible::ColIdx() const
{
NS_ENSURE_ARG_POINTER(aColumnIndex);
*aColumnIndex = -1;
if (IsDefunct())
return NS_ERROR_FAILURE;
Accessible* row = Parent();
if (!row)
return NS_OK;
*aColumnIndex = 0;
return 0;
int32_t indexInRow = IndexInParent();
uint32_t colIdx = 0;
for (int32_t idx = 0; idx < indexInRow; idx++) {
Accessible* cell = row->GetChildAt(idx);
roles::Role role = cell->Role();
if (role == roles::CELL || role == roles::GRID_CELL ||
role == roles::ROWHEADER || role == roles::COLUMNHEADER)
(*aColumnIndex)++;
colIdx++;
}
return NS_OK;
return colIdx;
}
NS_IMETHODIMP
XULListCellAccessible::GetRowIndex(int32_t* aRowIndex)
uint32_t
XULListCellAccessible::RowIdx() const
{
NS_ENSURE_ARG_POINTER(aRowIndex);
*aRowIndex = -1;
if (IsDefunct())
return NS_ERROR_FAILURE;
Accessible* row = Parent();
if (!row)
return NS_OK;
return 0;
Accessible* table = row->Parent();
if (!table)
return NS_OK;
*aRowIndex = 0;
return 0;
int32_t indexInTable = row->IndexInParent();
uint32_t rowIdx = 0;
for (int32_t idx = 0; idx < indexInTable; idx++) {
row = table->GetChildAt(idx);
if (row->Role() == roles::ROW)
(*aRowIndex)++;
rowIdx++;
}
return NS_OK;
return rowIdx;
}
NS_IMETHODIMP
XULListCellAccessible::GetColumnExtent(int32_t* aExtentCount)
void
XULListCellAccessible::ColHeaderCells(nsTArray<Accessible*>* aCells)
{
NS_ENSURE_ARG_POINTER(aExtentCount);
*aExtentCount = 0;
if (IsDefunct())
return NS_ERROR_FAILURE;
*aExtentCount = 1;
return NS_OK;
}
NS_IMETHODIMP
XULListCellAccessible::GetRowExtent(int32_t* aExtentCount)
{
NS_ENSURE_ARG_POINTER(aExtentCount);
*aExtentCount = 0;
if (IsDefunct())
return NS_ERROR_FAILURE;
*aExtentCount = 1;
return NS_OK;
}
NS_IMETHODIMP
XULListCellAccessible::GetColumnHeaderCells(nsIArray** aHeaderCells)
{
NS_ENSURE_ARG_POINTER(aHeaderCells);
*aHeaderCells = nullptr;
if (IsDefunct())
return NS_ERROR_FAILURE;
nsCOMPtr<nsIAccessibleTable> table;
GetTable(getter_AddRefs(table));
NS_ENSURE_STATE(table); // we expect to be in a listbox (table)
TableAccessible* table = Table();
NS_ASSERTION(table, "cell not in a table!");
if (!table)
return;
// Get column header cell from XUL listhead.
Accessible* list = nullptr;
nsRefPtr<Accessible> tableAcc(do_QueryObject(table));
Accessible* tableAcc = table->AsAccessible();
uint32_t tableChildCount = tableAcc->ChildCount();
for (uint32_t childIdx = 0; childIdx < tableChildCount; childIdx++) {
Accessible* child = tableAcc->GetChildAt(childIdx);
@ -872,64 +820,24 @@ XULListCellAccessible::GetColumnHeaderCells(nsIArray** aHeaderCells)
}
if (list) {
int32_t colIdx = -1;
GetColumnIndex(&colIdx);
nsIAccessible *headerCell = list->GetChildAt(colIdx);
Accessible* headerCell = list->GetChildAt(ColIdx());
if (headerCell) {
nsresult rv = NS_OK;
nsCOMPtr<nsIMutableArray> headerCells =
do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
headerCells->AppendElement(headerCell, false);
NS_ADDREF(*aHeaderCells = headerCells);
return NS_OK;
aCells->AppendElement(headerCell);
return;
}
}
// No column header cell from XUL markup, try to get it from ARIA markup.
return nsAccUtils::GetHeaderCellsFor(table, this,
nsAccUtils::eColumnHeaderCells,
aHeaderCells);
TableCellAccessible::ColHeaderCells(aCells);
}
NS_IMETHODIMP
XULListCellAccessible::GetRowHeaderCells(nsIArray** aHeaderCells)
bool
XULListCellAccessible::Selected()
{
NS_ENSURE_ARG_POINTER(aHeaderCells);
*aHeaderCells = nullptr;
TableAccessible* table = Table();
NS_ENSURE_TRUE(table, false); // we expect to be in a listbox (table)
if (IsDefunct())
return NS_ERROR_FAILURE;
nsCOMPtr<nsIAccessibleTable> table;
GetTable(getter_AddRefs(table));
NS_ENSURE_STATE(table); // we expect to be in a listbox (table)
// Calculate row header cells from ARIA markup.
return nsAccUtils::GetHeaderCellsFor(table, this,
nsAccUtils::eRowHeaderCells,
aHeaderCells);
}
NS_IMETHODIMP
XULListCellAccessible::IsSelected(bool* aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = false;
if (IsDefunct())
return NS_ERROR_FAILURE;
nsCOMPtr<nsIAccessibleTable> table;
GetTable(getter_AddRefs(table));
NS_ENSURE_STATE(table); // we expect to be in a listbox (table)
int32_t rowIdx = -1;
GetRowIndex(&rowIdx);
return table->IsRowSelected(rowIdx, aIsSelected);
return table->IsRowSelected(RowIdx());
}
////////////////////////////////////////////////////////////////////////////////
@ -957,20 +865,11 @@ XULListCellAccessible::GetAttributesInternal(nsIPersistentProperties* aAttribute
return NS_ERROR_FAILURE;
// "table-cell-index" attribute
nsCOMPtr<nsIAccessibleTable> table;
GetTable(getter_AddRefs(table));
TableAccessible* table = Table();
NS_ENSURE_STATE(table); // we expect to be in a listbox (table)
int32_t rowIdx = -1;
GetRowIndex(&rowIdx);
int32_t colIdx = -1;
GetColumnIndex(&colIdx);
int32_t cellIdx = -1;
table->GetCellIndexAt(rowIdx, colIdx, &cellIdx);
nsAutoString stringIdx;
stringIdx.AppendInt(cellIdx);
stringIdx.AppendInt(table->CellIndexAt(RowIdx(), ColIdx()));
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::tableCellIndex,
stringIdx);

View File

@ -90,6 +90,7 @@ public:
virtual void SelectedRowIndices(nsTArray<uint32_t>* aRows);
virtual void SelectRow(uint32_t aRowIdx);
virtual void UnselectRow(uint32_t aRowIdx);
virtual Accessible* AsAccessible() { return this; }
// nsAccessNode
virtual void Shutdown();
@ -164,12 +165,20 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIAccessibleTableCell
NS_DECL_OR_FORWARD_NSIACCESSIBLETABLECELL_WITH_XPCACCESSIBLETABLECELL
NS_FORWARD_NSIACCESSIBLETABLECELL(xpcAccessibleTableCell::)
// Accessible
virtual TableCellAccessible* AsTableCell() { return this; }
virtual void Shutdown();
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
virtual a11y::role NativeRole();
// TableCellAccessible
virtual TableAccessible* Table() const MOZ_OVERRIDE;
virtual uint32_t ColIdx() const MOZ_OVERRIDE;
virtual uint32_t RowIdx() const MOZ_OVERRIDE;
virtual void ColHeaderCells(nsTArray<Accessible*>* aHeaderCells) MOZ_OVERRIDE;
virtual bool Selected() MOZ_OVERRIDE;
};
} // namespace a11y

View File

@ -500,8 +500,8 @@ NS_IMPL_RELEASE_INHERITED(XULTreeGridCellAccessible, LeafAccessible)
////////////////////////////////////////////////////////////////////////////////
// XULTreeGridCellAccessible: nsIAccessible implementation
void
XULTreeGridCellAccessible::Shutdown()
void
XULTreeGridCellAccessible::Shutdown()
{
mTableCell = nullptr;
LeafAccessible::Shutdown();
@ -655,126 +655,55 @@ XULTreeGridCellAccessible::DoAction(uint8_t aIndex)
////////////////////////////////////////////////////////////////////////////////
// XULTreeGridCellAccessible: nsIAccessibleTableCell implementation
NS_IMETHODIMP
XULTreeGridCellAccessible::GetTable(nsIAccessibleTable** aTable)
TableAccessible*
XULTreeGridCellAccessible::Table() const
{
NS_ENSURE_ARG_POINTER(aTable);
*aTable = nullptr;
if (IsDefunct())
return NS_OK;
Accessible* grandParent = mParent->Parent();
if (grandParent)
CallQueryInterface(grandParent, aTable);
return grandParent->AsTable();
return NS_OK;
return nullptr;
}
NS_IMETHODIMP
XULTreeGridCellAccessible::GetColumnIndex(int32_t* aColumnIndex)
uint32_t
XULTreeGridCellAccessible::ColIdx() const
{
NS_ENSURE_ARG_POINTER(aColumnIndex);
*aColumnIndex = -1;
uint32_t colIdx = 0;
nsCOMPtr<nsITreeColumn> column = mColumn;
while ((column = nsCoreUtils::GetPreviousSensibleColumn(column)))
colIdx++;
if (IsDefunct())
return NS_ERROR_FAILURE;
*aColumnIndex = GetColumnIndex();
return NS_OK;
return colIdx;
}
NS_IMETHODIMP
XULTreeGridCellAccessible::GetRowIndex(int32_t* aRowIndex)
uint32_t
XULTreeGridCellAccessible::RowIdx() const
{
NS_ENSURE_ARG_POINTER(aRowIndex);
*aRowIndex = -1;
if (IsDefunct())
return NS_ERROR_FAILURE;
*aRowIndex = mRow;
return NS_OK;
return mRow;
}
NS_IMETHODIMP
XULTreeGridCellAccessible::GetColumnExtent(int32_t* aExtentCount)
void
XULTreeGridCellAccessible::ColHeaderCells(nsTArray<Accessible*>* aHeaderCells)
{
NS_ENSURE_ARG_POINTER(aExtentCount);
*aExtentCount = 1;
return NS_OK;
}
NS_IMETHODIMP
XULTreeGridCellAccessible::GetRowExtent(int32_t* aExtentCount)
{
NS_ENSURE_ARG_POINTER(aExtentCount);
*aExtentCount = 1;
return NS_OK;
}
NS_IMETHODIMP
XULTreeGridCellAccessible::GetColumnHeaderCells(nsIArray** aHeaderCells)
{
NS_ENSURE_ARG_POINTER(aHeaderCells);
*aHeaderCells = nullptr;
if (IsDefunct() || !mDoc)
return NS_ERROR_FAILURE;
nsresult rv = NS_OK;
nsCOMPtr<nsIMutableArray> headerCells =
do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDOMElement> columnElm;
mColumn->GetElement(getter_AddRefs(columnElm));
nsCOMPtr<nsIContent> columnContent(do_QueryInterface(columnElm));
Accessible* headerCell = mDoc->GetAccessible(columnContent);
if (headerCell)
headerCells->AppendElement(static_cast<nsIAccessible*>(headerCell),
false);
NS_ADDREF(*aHeaderCells = headerCells);
return NS_OK;
aHeaderCells->AppendElement(headerCell);
}
NS_IMETHODIMP
XULTreeGridCellAccessible::GetRowHeaderCells(nsIArray** aHeaderCells)
bool
XULTreeGridCellAccessible::Selected()
{
NS_ENSURE_ARG_POINTER(aHeaderCells);
*aHeaderCells = nullptr;
if (IsDefunct())
return NS_ERROR_FAILURE;
nsresult rv = NS_OK;
nsCOMPtr<nsIMutableArray> headerCells =
do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
NS_ADDREF(*aHeaderCells = headerCells);
return NS_OK;
}
NS_IMETHODIMP
XULTreeGridCellAccessible::IsSelected(bool* aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = false;
if (IsDefunct() || !mTreeView)
return NS_ERROR_FAILURE;
nsCOMPtr<nsITreeSelection> selection;
nsresult rv = mTreeView->GetSelection(getter_AddRefs(selection));
NS_ENSURE_SUCCESS(rv, rv);
NS_ENSURE_SUCCESS(rv, false);
return selection->IsSelected(mRow, aIsSelected);
bool selected = false;
selection->IsSelected(mRow, &selected);
return selected;
}
////////////////////////////////////////////////////////////////////////////////
@ -807,25 +736,13 @@ XULTreeGridCellAccessible::GetAttributesInternal(nsIPersistentProperties* aAttri
return NS_ERROR_FAILURE;
// "table-cell-index" attribute
Accessible* grandParent = mParent->Parent();
if (!grandParent)
return NS_OK;
nsCOMPtr<nsIAccessibleTable> tableAccessible = do_QueryObject(grandParent);
// XXX - temp fix for crash bug 516047
if (!tableAccessible)
TableAccessible* table = Table();
if (!table)
return NS_ERROR_FAILURE;
int32_t colIdx = GetColumnIndex();
int32_t cellIdx = -1;
tableAccessible->GetCellIndexAt(mRow, colIdx, &cellIdx);
nsAutoString stringIdx;
stringIdx.AppendInt(cellIdx);
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::tableCellIndex,
stringIdx);
stringIdx.AppendInt(table->CellIndexAt(mRow, ColIdx()));
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::tableCellIndex, stringIdx);
// "cycles" attribute
bool isCycler = false;
@ -884,7 +801,7 @@ XULTreeGridCellAccessible::NativeInteractiveState() const
int32_t
XULTreeGridCellAccessible::IndexInParent() const
{
return GetColumnIndex();
return ColIdx();
}
Relation
@ -896,21 +813,6 @@ XULTreeGridCellAccessible::RelationByType(uint32_t aType)
////////////////////////////////////////////////////////////////////////////////
// XULTreeGridCellAccessible: public implementation
int32_t
XULTreeGridCellAccessible::GetColumnIndex() const
{
int32_t index = 0;
nsCOMPtr<nsITreeColumn> column = mColumn;
while (true) {
column = nsCoreUtils::GetPreviousSensibleColumn(column);
if (!column)
break;
index++;
}
return index;
}
void
XULTreeGridCellAccessible::CellInvalidated()
{

View File

@ -49,6 +49,7 @@ public:
virtual void SelectedRowIndices(nsTArray<uint32_t>* aRows);
virtual void SelectRow(uint32_t aRowIdx);
virtual void UnselectRow(uint32_t aRowIdx);
virtual Accessible* AsAccessible() { return this; }
// nsAccessNode
virtual void Shutdown();
@ -147,12 +148,13 @@ public:
NS_IMETHOD DoAction(uint8_t aIndex);
// nsIAccessibleTableCell
NS_DECL_OR_FORWARD_NSIACCESSIBLETABLECELL_WITH_XPCACCESSIBLETABLECELL
NS_FORWARD_NSIACCESSIBLETABLECELL(xpcAccessibleTableCell::)
// nsAccessNode
virtual void Init();
// Accessible
virtual TableCellAccessible* AsTableCell() { return this; }
virtual void Shutdown();
virtual ENameValueFlag Name(nsString& aName);
virtual Accessible* FocusedChild();
@ -166,14 +168,17 @@ public:
// ActionAccessible
virtual uint8_t ActionCount();
// TableCellAccessible
virtual TableAccessible* Table() const MOZ_OVERRIDE;
virtual uint32_t ColIdx() const MOZ_OVERRIDE;
virtual uint32_t RowIdx() const MOZ_OVERRIDE;
virtual void ColHeaderCells(nsTArray<Accessible*>* aHeaderCells) MOZ_OVERRIDE;
virtual void RowHeaderCells(nsTArray<Accessible*>* aCells) MOZ_OVERRIDE { }
virtual bool Selected() MOZ_OVERRIDE;
// XULTreeGridCellAccessible
NS_DECLARE_STATIC_IID_ACCESSOR(XULTREEGRIDCELLACCESSIBLE_IMPL_CID)
/**
* Return index of the column.
*/
int32_t GetColumnIndex() const;
/**
* Fire name or state change event if the accessible text or value has been
* changed.

View File

@ -70,6 +70,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=429547
gQueue.push(new synthFocus("container", new focusChecker("item1")));
gQueue.push(new changeARIAActiveDescendant("container", "item2"));
gQueue.push(new synthFocus("combobox_entry", new focusChecker("combobox_entry")));
gQueue.push(new changeARIAActiveDescendant("combobox", "combobox_option2"));
todo(false, "No focus for inserted element, bug 687011");
//gQueue.push(new insertItemNFocus("container", "item3"));
@ -87,6 +91,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=429547
title="Support aria-activedescendant usage in nsIAccesible::TakeFocus()">
Mozilla Bug 429547
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=761102"
title="Focus may be missed when ARIA active-descendant is changed on active composite widget">
Mozilla Bug 761102
</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
@ -96,5 +105,13 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=429547
<div role="listitem" id="item1">item1</div>
<div role="listitem" id="item2">item2</div>
</div>
<div role="combobox" id="combobox">
<input id="combobox_entry">
<ul>
<li role="option" id="combobox_option1">option1</li>
<li role="option" id="combobox_option2">option2</li>
</ul>
</div>
</body>
</html>

View File

@ -123,6 +123,33 @@
testAccessibleTree("list6", tree);
// li having no display:list-item style
var tree =
{ LIST: [ // ul
{ LISTITEM: [ // li
{ TEXT_LEAF: [] },
] },
{ TEXT_LEAF: [] },
{ LISTITEM: [ // li
{ TEXT_LEAF: [] }
] }
] };
testAccessibleTree("list7", tree);
var tree =
{ LIST: [ // ul
{ LISTITEM: [ // li
{ TEXT_LEAF: [] },
] },
{ LISTITEM: [ // li
{ TEXT_LEAF: [] }
] }
] };
testAccessibleTree("list8", tree);
// span having display:list-item style
testAccessibleTree("list9", discAccTree);
SimpleTest.finish();
}
@ -137,6 +164,11 @@
href="https://bugzilla.mozilla.org/show_bug.cgi?id=342045">
Mozilla Bug 342045
</a>
<a target="_blank"
title="Wrong accessible is created for HTML:li having block display style"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=507555">
Mozilla Bug 507555
</a>
<a target="_blank"
title="Bullets of nested not ordered lists have one and the same character."
href="https://bugzilla.mozilla.org/show_bug.cgi?id=604587">
@ -193,5 +225,23 @@
</dl>
</li>
</ol>
<!-- display style different than list-item -->
<ul id="list7">
<li id="l7_li1" style="display:inline-block;">Oranges</li>
<li id="l7_li2" style="display:inline-block;">Apples</li>
</ul>
<ul id="list8">
<li id="l8_li1" style="display:inline; float:right;">Oranges</li>
<li id="l8_li2" style="display:inline; float:right;">Apples</li>
</ul>
<!-- list-item display style -->
<ul id="list9">
<span id="l9_li1" style="display:list-item">Oranges</span>
<span id="l9_li2" style="display:list-item">Apples</span>
<span id="l9_li3" style="display:list-item">Bananas</span>
</ul>
</body>
</html>

View File

@ -44,9 +44,9 @@ pref("network.http.pipelining.ssl", true);
pref("network.http.proxy.pipelining", true);
pref("network.http.pipelining.maxrequests" , 6);
pref("network.http.keep-alive.timeout", 600);
pref("network.http.max-connections", 6);
pref("network.http.max-persistent-connections-per-server", 4);
pref("network.http.max-persistent-connections-per-proxy", 4);
pref("network.http.max-connections", 20);
pref("network.http.max-persistent-connections-per-server", 6);
pref("network.http.max-persistent-connections-per-proxy", 20);
// See bug 545869 for details on why these are set the way they are
pref("network.buffer.cache.count", 24);
@ -507,7 +507,7 @@ pref("dom.ipc.processPriorityManager.enabled", true);
pref("dom.ipc.processPriorityManager.gracePeriodMS", 1000);
pref("hal.processPriorityManager.gonk.masterOomAdjust", 0);
pref("hal.processPriorityManager.gonk.foregroundOomAdjust", 1);
pref("hal.processPriorityManager.gonk.backgroundOomAdjust", 2);
pref("hal.processPriorityManager.gonk.backgroundOomAdjust", 6);
pref("hal.processPriorityManager.gonk.masterNice", -1);
pref("hal.processPriorityManager.gonk.foregroundNice", 0);
pref("hal.processPriorityManager.gonk.backgroundNice", 10);
@ -525,3 +525,6 @@ pref("dom.disable_window_open_dialog_feature", true);
// Screen reader support
pref("accessibility.accessfu.activate", 2);
// Disable native prompt
pref("browser.prompt.allowNative", false);

View File

@ -118,13 +118,28 @@ let FormAssistant = {
case "Forms:Select:Choice":
let options = target.options;
let valueChanged = false;
if ("index" in json) {
options.item(json.index).selected = true;
if (options.selectedIndex != json.index) {
options.selectedIndex = json.index;
valueChanged = true;
}
} else if ("indexes" in json) {
for (let i = 0; i < options.length; i++) {
options.item(i).selected = (json.indexes.indexOf(i) != -1);
let newValue = (json.indexes.indexOf(i) != -1);
if (options.item(i).selected != newValue) {
options.item(i).selected = newValue;
valueChanged = true;
}
}
}
// only fire onchange event if any selected option is changed
if (valueChanged) {
let event = content.document.createEvent('HTMLEvents');
event.initEvent('change', true, true);
target.dispatchEvent(event);
}
break;
}
},

View File

@ -72,7 +72,7 @@ window.addEventListener('load', function() {
}
let setReq =
navigator.mozSettings.getLock().set({'lockscreen.enabled': false});
navigator.mozSettings.createLock().set({'lockscreen.enabled': false});
setReq.onsuccess = function() {
// give the event loop another turn to disable the lock screen
window.setTimeout(function() {

View File

@ -35,7 +35,7 @@ var SettingsListener = {
throw new Error('Callback is not a function');
}
var req = settings.getLock().get(name);
var req = settings.createLock().get(name);
req.addEventListener('success', (function onsuccess() {
callback(typeof(req.result[name]) != 'undefined' ?
req.result[name] : defaultValue);

View File

@ -509,6 +509,9 @@ var CustomEventManager = {
case 'select-choicechange':
FormsHelper.handleEvent(detail);
break;
case 'system-message-listener-ready':
Services.obs.notifyObservers(null, 'system-message-listener-ready', null);
break;
}
}
}

View File

@ -0,0 +1,7 @@
# 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/.
# This file is included at the top of all b2g mozconfigs
. "$topsrcdir/build/mozconfig.common"

View File

@ -0,0 +1,7 @@
# 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/.
# This file is included at the bottom of all b2g mozconfigs
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -1,3 +1,5 @@
. "$topsrcdir/b2g/config/mozconfigs/common"
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-b2g
mk_add_options MOZ_MAKE_FLAGS="-j8"
@ -15,3 +17,5 @@ ENABLE_MARIONETTE=1
# Enable dump() from JS.
export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
. "$topsrcdir/b2g/config/mozconfigs/common.override"

View File

@ -1,3 +1,5 @@
. "$topsrcdir/b2g/config/mozconfigs/common"
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-b2g
mk_add_options MOZ_MAKE_FLAGS="-j8"
@ -15,3 +17,5 @@ ENABLE_MARIONETTE=1
# Enable dump() from JS.
export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
. "$topsrcdir/b2g/config/mozconfigs/common.override"

View File

@ -18,3 +18,5 @@ ENABLE_MARIONETTE=1
# Enable dump() from JS.
export CXXFLAGS="-DMOZ_ENABLE_JS_DUMP -include $topsrcdir/gonk-toolchain/gonk-misc/Unicode.h -include $topsrcdir/gonk-toolchain/system/vold/ResponseCode.h"
. "$topsrcdir/b2g/config/mozconfigs/common.override"

View File

@ -1,3 +1,5 @@
. "$topsrcdir/b2g/config/mozconfigs/common"
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-b2g
mk_add_options MOZ_MAKE_FLAGS="-j8"
@ -18,3 +20,5 @@ ENABLE_MARIONETTE=1
# Enable dump() from JS.
export CXXFLAGS="-DMOZ_ENABLE_JS_DUMP -include $topsrcdir/gonk-toolchain/gonk-misc/Unicode.h -include $topsrcdir/gonk-toolchain/system/vold/ResponseCode.h"
. "$topsrcdir/b2g/config/mozconfigs/common.override"

View File

@ -1,3 +1,5 @@
. "$topsrcdir/b2g/config/mozconfigs/common"
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --enable-update-packaging
ac_add_options --enable-codesighs
@ -36,3 +38,5 @@ ac_add_options --enable-application=b2g
ENABLE_MARIONETTE=1
ac_add_options --disable-elf-hack
export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
. "$topsrcdir/b2g/config/mozconfigs/common.override"

View File

@ -38,3 +38,5 @@ ac_add_options --enable-application=b2g
ENABLE_MARIONETTE=1
ac_add_options --disable-elf-hack
export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
. "$topsrcdir/b2g/config/mozconfigs/common.override"

View File

@ -1,4 +1,4 @@
. $topsrcdir/build/macosx/common
. $topsrcdir/build/macosx/mozconfig.common
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --enable-update-packaging
@ -26,3 +26,5 @@ ac_add_options --with-ccache
ENABLE_MARIONETTE=1
export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
. "$topsrcdir/b2g/config/mozconfigs/common.override"

View File

@ -1,3 +1,5 @@
. "$topsrcdir/b2g/config/mozconfigs/common"
# for pgo
mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) $(MOZ_OBJDIR)/_profile/pgo/profileserver.py'
@ -27,3 +29,5 @@ ac_add_options --enable-application=b2g
ENABLE_MARIONETTE=1
export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
. "$topsrcdir/b2g/config/mozconfigs/common.override"

View File

@ -126,7 +126,7 @@ ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
libs::
cp -p $(MOZ_APP_NAME)$(BIN_SUFFIX) $(DIST)/bin/$(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
GARBAGE += $(addprefix $(DIST)/bin/defaults/pref/, firefox.js)
GARBAGE += $(addprefix $(FINAL_TARGET)/defaults/pref/, firefox.js)
endif
@ -134,24 +134,24 @@ endif #} LIBXUL_SDK
ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
libs::
$(INSTALL) $(IFLAGS1) $(DIST)/branding/mozicon128.png $(DIST)/bin/icons
$(INSTALL) $(IFLAGS1) $(DIST)/branding/default16.png $(DIST)/bin/chrome/icons/default
$(INSTALL) $(IFLAGS1) $(DIST)/branding/default32.png $(DIST)/bin/chrome/icons/default
$(INSTALL) $(IFLAGS1) $(DIST)/branding/default48.png $(DIST)/bin/chrome/icons/default
$(INSTALL) $(IFLAGS1) $(DIST)/branding/mozicon128.png $(FINAL_TARGET)/icons
$(INSTALL) $(IFLAGS1) $(DIST)/branding/default16.png $(FINAL_TARGET)/chrome/icons/default
$(INSTALL) $(IFLAGS1) $(DIST)/branding/default32.png $(FINAL_TARGET)/chrome/icons/default
$(INSTALL) $(IFLAGS1) $(DIST)/branding/default48.png $(FINAL_TARGET)/chrome/icons/default
endif
libs:: $(srcdir)/profile/prefs.js
$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin/defaults/profile
$(INSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/defaults/profile
ifndef LIBXUL_SDK
# channel-prefs.js is handled separate from other prefs due to bug 756325
libs:: $(srcdir)/profile/channel-prefs.js
$(NSINSTALL) -D $(DIST)/bin/defaults/pref
$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(PREF_PPFLAGS) $(ACDEFINES) $^ > $(DIST)/bin/defaults/pref/channel-prefs.js
$(NSINSTALL) -D $(FINAL_TARGET)/defaults/pref
$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(PREF_PPFLAGS) $(ACDEFINES) $^ > $(FINAL_TARGET)/defaults/pref/channel-prefs.js
endif
libs:: $(srcdir)/blocklist.xml
$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin
$(INSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))

View File

@ -8,7 +8,7 @@ topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
DISTROEXT = $(call core_abspath,$(DIST))/bin/distribution/extensions
DISTROEXT = $(call core_abspath,$(FINAL_TARGET))/distribution/extensions
include $(DEPTH)/config/autoconf.mk

View File

@ -17,9 +17,6 @@ FILES := \
libs::
$(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $(srcdir)/install.rdf.in > install.rdf
$(INSTALL) $(FILES) $(DIST)/bin/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
$(INSTALL) $(FILES) $(FINAL_TARGET)/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
install::
$(SYSINSTALL) $(IFLAGS1) $(FILES) $(DESTDIR)$(mozappdir)/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
GARBAGE += $(FILES)

View File

@ -11,37 +11,48 @@
*/
var tabPreviews = {
aspectRatio: 0.5625, // 16:9
get width() {
delete this.width;
return this.width = Math.ceil(screen.availWidth / 5.75);
},
get height() {
delete this.height;
return this.height = Math.round(this.width * this.aspectRatio);
},
init: function tabPreviews_init() {
if (this._selectedTab)
return;
this._selectedTab = gBrowser.selectedTab;
this.width = Math.ceil(screen.availWidth / 5.75);
this.height = Math.round(this.width * this.aspectRatio);
window.addEventListener("unload", this, false);
gBrowser.tabContainer.addEventListener("TabSelect", this, false);
gBrowser.tabContainer.addEventListener("SSTabRestored", this, false);
},
uninit: function tabPreviews_uninit() {
window.removeEventListener("unload", this, false);
gBrowser.tabContainer.removeEventListener("TabSelect", this, false);
gBrowser.tabContainer.removeEventListener("SSTabRestored", this, false);
this._selectedTab = null;
},
get: function tabPreviews_get(aTab) {
this.init();
let uri = aTab.linkedBrowser.currentURI.spec;
if (aTab.__thumbnail_lastURI &&
aTab.__thumbnail_lastURI != aTab.linkedBrowser.currentURI.spec) {
aTab.__thumbnail_lastURI != uri) {
aTab.__thumbnail = null;
aTab.__thumbnail_lastURI = null;
}
return aTab.__thumbnail || this.capture(aTab, !aTab.hasAttribute("busy"));
},
capture: function tabPreviews_capture(aTab, aStore) {
this.init();
if (aTab.__thumbnail)
return aTab.__thumbnail;
if (aTab.getAttribute("pending") == "true") {
let img = new Image;
img.src = PageThumbs.getThumbnailURL(uri);
return img;
}
return this.capture(aTab, !aTab.hasAttribute("busy"));
},
capture: function tabPreviews_capture(aTab, aStore) {
var thumbnail = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas");
thumbnail.mozOpaque = true;
thumbnail.height = this.height;
@ -61,6 +72,7 @@ var tabPreviews = {
}
return thumbnail;
},
handleEvent: function tabPreviews_handleEvent(event) {
switch (event.type) {
case "TabSelect":
@ -83,9 +95,6 @@ var tabPreviews = {
case "SSTabRestored":
this.capture(event.target, true);
break;
case "unload":
this.uninit();
break;
}
}
};

View File

@ -419,8 +419,8 @@ window[chromehidden~="toolbar"] toolbar:not(.toolbar-primary):not(.chromeclass-m
-moz-binding: url("chrome://global/content/bindings/toolbarbutton.xml#toolbarbutton-image");
}
.ctrlTab-preview > html|canvas,
.allTabs-preview > html|canvas {
:-moz-any(.ctrlTab-preview, .allTabs-preview) > html|img,
:-moz-any(.ctrlTab-preview, .allTabs-preview) > html|canvas {
min-width: inherit;
max-width: inherit;
min-height: inherit;

View File

@ -146,14 +146,14 @@ XPCOMUtils.defineLazyModuleGetter(this, "PageThumbs",
#ifdef MOZ_SAFE_BROWSING
XPCOMUtils.defineLazyGetter(this, "SafeBrowsing", function() {
let tmp = {};
Cu.import("resource://gre/modules/SafeBrowsing.jsm", tmp);
Cu.import("resource:///modules/SafeBrowsing.jsm", tmp);
return tmp.SafeBrowsing;
});
#endif
XPCOMUtils.defineLazyGetter(this, "gBrowserNewTabPreloader", function () {
let tmp = {};
Cu.import("resource://gre/modules/BrowserNewTabPreloader.jsm", tmp);
Cu.import("resource:///modules/BrowserNewTabPreloader.jsm", tmp);
return new tmp.BrowserNewTabPreloader();
});

View File

@ -399,10 +399,6 @@
</hbox>
</panel>
<tooltip id="urlTooltip">
<label crop="center" flex="1" class="tooltip-label"/>
</tooltip>
<panel id="ctrlTab-panel" class="KUI-panel" hidden="true" norestorefocus="true" level="top">
<hbox>
<button class="ctrlTab-preview" flex="1"/>

View File

@ -53,3 +53,13 @@ tabpanels {
.tabbrowser-tabs:not(:hover) > .tabbrowser-arrowscrollbox > .closing-tabs-spacer {
transition: width .15s ease-out;
}
/**
* Optimization for tabs that are restored lazily. We can save a good amount of
* memory that to-be-restored tabs would otherwise consume simply by setting
* their browsers to 'display: none' as that will prevent them from having to
* create a presentation and the like.
*/
browser[pending] {
display: none;
}

View File

@ -3647,7 +3647,6 @@
}
}
var newIndex = this._getDropIndex(event);
var scrollRect = tabStrip.scrollClientRect;
var rect = tabStrip.getBoundingClientRect();
var minMargin = scrollRect.left - rect.left;
@ -3663,6 +3662,7 @@
newMargin = (pixelsToScroll > 0) ? maxMargin : minMargin;
}
else {
let newIndex = this._getDropIndex(event);
if (newIndex == this.childNodes.length) {
let tabRect = this.childNodes[newIndex-1].getBoundingClientRect();
if (ltr)

View File

@ -58,8 +58,6 @@
this._formattingEnabled = this._prefs.getBoolPref("formatting.enabled");
this._mayTrimURLs = this._prefs.getBoolPref("trimURLs");
this._urlTooltip = document.getElementById("urlTooltip");
this.inputField.controllers.insertControllerAt(0, this._copyCutController);
this.inputField.addEventListener("mousedown", this, false);
this.inputField.addEventListener("mousemove", this, false);
@ -410,26 +408,13 @@
<body><![CDATA[
if (this.focused || !this._contentIsCropped)
return;
if (this._tooltipTimer)
clearTimeout(this._tooltipTimer);
this._tooltipTimer = setTimeout(function (self) {
self._tooltipTimer = 0;
var label = self._urlTooltip.firstChild;
label.value = self.value;
var bO = self.boxObject;
self._urlTooltip.maxWidth = bO.width;
self._urlTooltip.showPopup(self, bO.screenX, bO.screenY + bO.height, "tooltip");
}, 700, this);
this.inputField.setAttribute("tooltiptext", this.value);
]]></body>
</method>
<method name="_hideURLTooltip">
<body><![CDATA[
if (this._tooltipTimer) {
clearTimeout(this._tooltipTimer);
this._tooltipTimer = 0;
}
this._urlTooltip.hidePopup();
this.inputField.removeAttribute("tooltiptext");
]]></body>
</method>

View File

@ -346,7 +346,7 @@ nsFeedSniffer::AppendSegmentToString(nsIInputStream* inputStream,
NS_IMETHODIMP
nsFeedSniffer::OnDataAvailable(nsIRequest* request, nsISupports* context,
nsIInputStream* stream, uint32_t offset,
nsIInputStream* stream, uint64_t offset,
uint32_t count)
{
uint32_t read;

View File

@ -3,7 +3,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DEPTH = ../../..
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@

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/.
DEPTH = ../../../../..
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
relativesrcdir = browser/components/safebrowsing/content/test
relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk

View File

@ -2987,6 +2987,7 @@ let SessionStoreInternal = {
// a tab gets closed before it's been properly restored
browser.__SS_data = tabData;
browser.__SS_restoreState = TAB_STATE_NEEDS_RESTORE;
browser.setAttribute("pending", "true");
tab.setAttribute("pending", "true");
// Make sure that set/getTabValue will set/read the correct data by
@ -3171,6 +3172,7 @@ let SessionStoreInternal = {
// Set this tab's state to restoring
browser.__SS_restoreState = TAB_STATE_RESTORING;
browser.removeAttribute("pending");
aTab.removeAttribute("pending");
// Remove the history listener, since we no longer need it once we start restoring
@ -4335,6 +4337,9 @@ let SessionStoreInternal = {
// The browser is no longer in any sort of restoring state.
delete browser.__SS_restoreState;
aTab.removeAttribute("pending");
browser.removeAttribute("pending");
// We want to decrement window.__SS_tabsToRestore here so that we always
// decrement it AFTER a tab is done restoring or when a tab gets "reset".
window.__SS_tabsToRestore--;

View File

@ -613,7 +613,7 @@ nsWindowsShellService::SetDefaultBrowser(bool aClaimAllTypes, bool aForAllUsers)
NS_ENSURE_SUCCESS(rv, rv);
bool isDefaultBrowser = false;
rv = NS_SUCCEEDED(IsDefaultBrowser(&isDefaultBrowser)) &&
isDefaultBrowser ? S_OK : NS_ERROR_FAILURE;
isDefaultBrowser ? NS_OK : NS_ERROR_FAILURE;
}
return rv;
}

View File

@ -0,0 +1,7 @@
# 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/.
# This file is included by all browser mozconfigs
. "$topsrcdir/build/mozconfig.common"

View File

@ -22,3 +22,5 @@ ac_add_options --enable-warnings-as-errors
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -16,3 +16,5 @@ mk_add_options MOZ_MAKE_FLAGS="-j4"
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -5,3 +5,5 @@ ac_add_options --enable-update-packaging
. $topsrcdir/build/unix/mozconfig.linux
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -36,3 +36,5 @@ ac_add_options --with-ccache=/usr/bin/ccache
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -18,3 +18,5 @@ mk_add_options MOZ_MAKE_FLAGS="-j4"
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -26,3 +26,5 @@ ac_add_options --disable-crashreporter
# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
ac_add_options --enable-warnings-as-errors
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -24,3 +24,5 @@ mk_add_options MOZ_MAKE_FLAGS="-j4"
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -29,3 +29,5 @@ ac_add_options --with-ccache=/usr/bin/ccache
# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
ac_add_options --enable-warnings-as-errors
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -22,3 +22,5 @@ ac_add_options --enable-warnings-as-errors
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -16,3 +16,5 @@ mk_add_options MOZ_MAKE_FLAGS="-j4"
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -5,3 +5,5 @@ ac_add_options --enable-update-packaging
. $topsrcdir/build/unix/mozconfig.linux
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -36,3 +36,5 @@ ac_add_options --with-ccache=/usr/bin/ccache
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -18,3 +18,5 @@ mk_add_options MOZ_MAKE_FLAGS="-j4"
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -24,3 +24,5 @@ mk_add_options MOZ_MAKE_FLAGS="-j4"
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -29,3 +29,5 @@ ac_add_options --with-ccache=/usr/bin/ccache
# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
ac_add_options --enable-warnings-as-errors
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -26,3 +26,5 @@ ac_add_options --enable-warnings-as-errors
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -20,3 +20,5 @@ mk_add_options MOZ_MAKE_FLAGS="-j4"
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -24,3 +24,5 @@ export MOZ_PKG_SPECIAL="shark"
# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
ac_add_options --enable-warnings-as-errors
ac_add_options --with-ccache
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -1,4 +1,5 @@
. $topsrcdir/build/macosx/mozconfig.leopard
ac_add_options --enable-debug
ac_add_options --enable-trace-malloc
ac_add_options --enable-signmar
@ -14,3 +15,5 @@ ac_add_options --with-macbundlename-prefix=Firefox
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -1,4 +1,4 @@
. $topsrcdir/build/macosx/common
. $topsrcdir/build/macosx/mozconfig.common
ac_add_options --enable-debug
ac_add_options --enable-trace-malloc
@ -19,3 +19,5 @@ ac_add_options --enable-warnings-as-errors
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -12,3 +12,5 @@ mk_add_options MOZ_MAKE_FLAGS="-j12"
export MOZ_PACKAGE_JSSHELL=1
ac_add_options --with-macbundlename-prefix=Firefox
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -1,5 +1,9 @@
. "$topsrcdir/browser/config/mozconfigs/common"
ac_add_options --with-l10n-base=../../l10n-central
ac_add_options --enable-official-branding
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --enable-update-packaging
ac_add_options --with-ccache
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -1,3 +1,5 @@
. "$topsrcdir/browser/config/mozconfigs/common"
ac_add_options --enable-debug
ac_add_options --enable-trace-malloc
ac_add_options --enable-signmar
@ -20,3 +22,5 @@ fi
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -1,3 +1,5 @@
. "$topsrcdir/browser/config/mozconfigs/common"
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --enable-update-packaging
ac_add_options --enable-official-branding
@ -8,3 +10,5 @@ if test "$PROCESSOR_ARCHITECTURE" = "AMD64" -o "$PROCESSOR_ARCHITEW6432" = "AMD6
else
. $topsrcdir/build/win32/mozconfig.vs2010
fi
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -1,3 +1,5 @@
. "$topsrcdir/browser/config/mozconfigs/common"
# for pgo
mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) $(MOZ_OBJDIR)/_profile/pgo/profileserver.py'
@ -29,3 +31,5 @@ fi
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -1,3 +1,5 @@
. "$topsrcdir/browser/config/mozconfigs/common"
# for pgo
mk_add_options MOZ_PGO=1
mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) $(MOZ_OBJDIR)/_profile/pgo/profileserver.py'
@ -26,3 +28,5 @@ fi
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -15,3 +15,5 @@ mk_add_options MOZ_MAKE_FLAGS=-j1
export MOZ_PACKAGE_JSSHELL=1
. $topsrcdir/build/win64/mozconfig.vs2010
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -24,3 +24,5 @@ mk_add_options MOZ_MAKE_FLAGS=-j1
export MOZ_PACKAGE_JSSHELL=1
. $topsrcdir/build/win64/mozconfig.vs2010
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -18,7 +18,7 @@ XPCOMUtils.defineLazyGetter(this, "prefBranch", function() {
XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
"resource://gre/modules/NetUtil.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "console",
"resource:///modules/devtools/Console.jsm");
"resource://gre/modules/devtools/Console.jsm");
const PREF_DIR = "devtools.commands.dir";

View File

@ -10,7 +10,7 @@ Cu.import("resource:///modules/devtools/gcli.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "console",
"resource:///modules/devtools/Console.jsm");
"resource://gre/modules/devtools/Console.jsm");
// We should really be using nsICookieManager so we can read more than just the
// key/value of cookies. The difficulty is filtering the cookies that are

View File

@ -7,7 +7,7 @@ topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
CHROMEDIR = $(call core_abspath,$(DIST))/bin/chrome
CHROMEDIR = $(call core_abspath,$(FINAL_TARGET))/chrome
include $(DEPTH)/config/autoconf.mk
@ -23,13 +23,13 @@ exclude_files = \
icon64.png \
$(NULL)
$(DIST)/bin/chrome/pdfjs.manifest: $(GLOBAL_DEPS)
$(FINAL_TARGET)/chrome/pdfjs.manifest: $(GLOBAL_DEPS)
printf "manifest pdfjs/chrome.manifest" > $@
libs:: $(DIST)/bin/chrome/pdfjs.manifest
libs:: $(FINAL_TARGET)/chrome/pdfjs.manifest
$(PYTHON) $(topsrcdir)/config/nsinstall.py \
$(srcdir)/pdfjs \
$(foreach exclude,$(exclude_files), -X $(srcdir)/pdfjs/$(exclude)) \
$(DIST)/bin/chrome
$(FINAL_TARGET)/chrome
$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py \
$(DIST)/bin/chrome.manifest "manifest chrome/pdfjs.manifest"
$(FINAL_TARGET)/chrome.manifest "manifest chrome/pdfjs.manifest"

View File

@ -198,17 +198,19 @@ installers-%: clobber-% langpack-% repackage-win32-installer-% repackage-zip-%
@echo "repackaging done"
ifdef MOZ_UPDATER
# Note that we want updater.ini to be in the top directory, not the browser/
# subdirectory, because that's where the updater is installed and runs.
libs:: $(call MERGE_FILE,updater/updater.ini)
ifeq ($(OS_ARCH),WINNT)
cat $< $(srcdir)/../installer/windows/nsis/updater_append.ini | \
sed -e "s/^InfoText=/Info=/" -e "s/^TitleText=/Title=/" | \
sed -e "s/%MOZ_APP_DISPLAYNAME%/$(MOZ_APP_DISPLAYNAME)/" > \
$(FINAL_TARGET)/updater.ini
$(DIST)/bin/updater.ini
else
cat $< | \
sed -e "s/^InfoText=/Info=/" -e "s/^TitleText=/Title=/" | \
sed -e "s/%MOZ_APP_DISPLAYNAME%/$(MOZ_APP_DISPLAYNAME)/" > \
$(FINAL_TARGET)/updater.ini
$(DIST)/bin/updater.ini
endif
endif

View File

@ -1,3 +1,9 @@
# 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/.
. "$topsrcdir/build/mozconfig.common"
if [ -d "$topsrcdir/clang" ]; then
# mozilla-central based build
export CC=$topsrcdir/clang/bin/clang

View File

@ -1,6 +1,6 @@
. $topsrcdir/build/macosx/common
. $topsrcdir/build/macosx/mozconfig.common
# Mac builds don't nomally have to be handled as cross
# Mac builds don't normally have to be handled as cross
# compilation, but some of the libraries on the bots
# (IDL for example) are built only for one arch.

View File

@ -12,7 +12,7 @@ ac_add_app_options x86_64 --target=x86_64-apple-darwin10
ac_add_options --with-macos-sdk=/Developer/SDKs/MacOSX10.6.sdk
. $topsrcdir/build/macosx/common
. $topsrcdir/build/macosx/mozconfig.common
# $MOZ_BUILD_APP is only defined when sourced by configure. That's not a
# problem, because the variables it affects only need to be set for

11
build/mozconfig.common Normal file
View File

@ -0,0 +1,11 @@
# 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/.
# Common mozconfig for all users
#
# Add options to this file that will be inherited by all in-tree mozconfigs.
# This is useful for eg try builds with nondefault options that apply to all
# architectures, though note that if you want to override options set in
# another mozconfig file, you'll need to use mozconfig.common.override instead
# of this file.

View File

@ -0,0 +1,11 @@
# 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/.
# Common mozconfig for all users
#
# Add options to this file that will be inherited by all in-tree mozconfigs.
# This file is included at the *end* of the mozconfigs, and so may be used
# to override anything done previously.
#
# The common expected usage is for try builds with nondefault options.

View File

@ -771,9 +771,8 @@ class ShellFunction(Function):
cline = self._arguments[0].resolvestr(makefile, variables, setting)
log.debug("%s: running shell command '%s'" % (self.loc, cline))
if msys:
cline = [shell, "-c", cline]
p = subprocess.Popen(cline, env=makefile.env, shell=not msys,
cline = [shell, "-c", cline]
p = subprocess.Popen(cline, env=makefile.env, shell=False,
stdout=subprocess.PIPE, cwd=makefile.workdir)
stdout, stderr = p.communicate()

View File

@ -88,8 +88,8 @@ def call(cline, env, cwd, loc, cb, context, echo, justprint=False):
if msys:
if len(cline) > 3 and cline[1] == ':' and cline[2] == '/':
cline = '/' + cline[0] + cline[2:]
cline = [shell, "-c", cline]
context.call(cline, shell=not msys, env=env, cwd=cwd, cb=cb, echo=echo,
cline = [shell, "-c", cline]
context.call(cline, shell=False, env=env, cwd=cwd, cb=cb, echo=echo,
justprint=justprint)
return

View File

@ -1,2 +1,4 @@
. "$topsrcdir/build/mozconfig.common"
CC=/tools/gcc-4.5-0moz3/bin/gcc
CXX=/tools/gcc-4.5-0moz3/bin/g++

View File

@ -20,15 +20,13 @@ VISIBILITY_FLAGS =
STDCXX_COMPAT =
ifneq (WINNT,$(HOST_OS_ARCH))
HOST_PROGRAM = nsinstall$(HOST_BIN_SUFFIX)
HOST_PROGRAM = nsinstall_real$(HOST_BIN_SUFFIX)
HOST_CSRCS = nsinstall.c pathsub.c
endif
TARGETS = $(HOST_PROGRAM) $(SIMPLE_PROGRAMS)
ifndef CROSS_COMPILE
ifdef USE_ELF_DYNSTR_GC
TARGETS += elf-dynstr-gc
export:: elf-dynstr-gc
# Compiling the above will create dependency files.
NEED_MDDEPDIR = 1
endif
@ -49,6 +47,26 @@ include $(topsrcdir)/config/config.mk
# Do not install util programs
NO_INSTALL=1
ifneq (WINNT,$(HOST_OS_ARCH))
# Ensure nsinstall is atomically created
nsinstall$(HOST_BIN_SUFFIX): $(HOST_PROGRAM)
cp $^ $@.tmp
mv $@.tmp $@
NSINSTALL_FILES := nsinstall$(HOST_BIN_SUFFIX)
NSINSTALL_DEST := $(DIST)/bin
NSINSTALL_TARGET := export
INSTALL_TARGETS += NSINSTALL
endif
HEADERS_FILES = \
$(DEPTH)/mozilla-config.h \
$(srcdir)/nsStaticComponents.h \
$(NULL)
HEADERS_DEST := $(DIST)/include
HEADERS_TARGET := export
INSTALL_TARGETS += HEADERS
include $(topsrcdir)/config/rules.mk
HOST_CFLAGS += -DUNICODE -D_UNICODE
@ -57,17 +75,8 @@ ifeq ($(OS_CONFIG),SunOS4.1)
NSPR_CFLAGS += -I$(srcdir)/../nsprpub/pr/include/md
endif
HEADERS = \
$(DEPTH)/mozilla-config.h \
$(srcdir)/nsStaticComponents.h \
$(NULL)
export:: $(TARGETS) $(HEADERS)
$(INSTALL) $(IFLAGS1) $(HEADERS) $(DIST)/include
export::
-$(RM) $(FINAL_LINK_COMPS) $(FINAL_LINK_LIBS) $(FINAL_LINK_COMP_NAMES)
ifdef HOST_PROGRAM
$(INSTALL) $(HOST_PROGRAM) $(DIST)/bin
endif
# Generate a new buildid every time we "export" in config... that's only
# supposed to be once per-build!

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