This commit is contained in:
Rob Campbell 2012-04-12 15:22:15 -04:00
Родитель dd30ddaf37 75680118d0
Коммит 926b4aa5d0
241 изменённых файлов: 4243 добавлений и 2024 удалений

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

@ -37,13 +37,18 @@
*
* ***** END LICENSE BLOCK ***** */
#ifndef _NSARIAGRIDACCESSIBLEWRAP_H
#define _NSARIAGRIDACCESSIBLEWRAP_H
#ifndef MOZILLA_A11Y_ARIAGRIDACCESSIBLEWRAP_H
#define MOZILLA_A11Y_ARIAGRIDACCESSIBLEWRAP_H
#include "nsARIAGridAccessible.h"
#include "ARIAGridAccessible.h"
typedef class nsARIAGridAccessible nsARIAGridAccessibleWrap;
typedef class nsARIAGridCellAccessible nsARIAGridCellAccessibleWrap;
namespace mozilla {
namespace a11y {
typedef class ARIAGridAccessible ARIAGridAccessibleWrap;
typedef class ARIAGridCellAccessible ARIAGridCellAccessibleWrap;
} // namespace a11y
} // namespace mozilla
#endif

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

@ -69,9 +69,9 @@ CPPSRCS = \
$(NULL)
EXPORTS = \
ARIAGridAccessibleWrap.h \
AtkSocketAccessible.h \
nsAccessNodeWrap.h \
nsARIAGridAccessibleWrap.h \
nsAccessibleWrap.h \
nsDocAccessibleWrap.h \
nsRootAccessibleWrap.h \

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

@ -58,7 +58,6 @@ CPPSRCS = \
NotificationController.cpp \
nsAccDocManager.cpp \
nsAccessNode.cpp \
nsARIAGridAccessible.cpp \
nsARIAMap.cpp \
nsDocAccessible.cpp \
nsCoreUtils.cpp \
@ -109,10 +108,10 @@ LOCAL_INCLUDES += \
-I$(srcdir)/../html \
-I$(srcdir)/../xpcom \
-I$(srcdir)/../xul \
-I$(srcdir)/../xforms \
-I$(srcdir)/../../../layout/generic \
-I$(srcdir)/../../../layout/style \
-I$(srcdir)/../../../layout/xul/base/src \
-I$(srcdir)/../xforms \
$(NULL)
ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)

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

@ -36,21 +36,19 @@
*
* ***** END LICENSE BLOCK ***** */
#include "mozilla/Util.h"
#include "nsAccessibilityService.h"
// NOTE: alphabetically ordered
#include "nsAccessibilityService.h"
#include "nsAccessiblePivot.h"
#include "nsCoreUtils.h"
#include "nsAccUtils.h"
#include "nsApplicationAccessibleWrap.h"
#include "nsARIAGridAccessibleWrap.h"
#include "nsARIAMap.h"
#include "ARIAGridAccessibleWrap.h"
#ifdef MOZ_ACCESSIBILITY_ATK
#include "AtkSocketAccessible.h"
#endif
#include "FocusManager.h"
#include "nsIContentViewer.h"
#include "nsCURILoader.h"
#include "nsDocAccessible.h"
#include "nsAccessiblePivot.h"
#include "nsAccUtils.h"
#include "nsARIAMap.h"
#include "nsApplicationAccessibleWrap.h"
#include "nsIAccessibleProvider.h"
#include "nsHTMLCanvasAccessible.h"
#include "nsHTMLImageMapAccessible.h"
#include "nsHTMLLinkAccessible.h"
@ -58,12 +56,20 @@
#include "nsHTMLTableAccessibleWrap.h"
#include "nsHTMLTextAccessible.h"
#include "nsHyperTextAccessibleWrap.h"
#include "nsIAccessibilityService.h"
#include "nsIAccessibleProvider.h"
#include "nsRootAccessibleWrap.h"
#include "nsXFormsFormControlsAccessible.h"
#include "nsXFormsWidgetsAccessible.h"
#include "OuterDocAccessible.h"
#include "Role.h"
#include "States.h"
#include "Statistics.h"
#ifdef XP_WIN
#include "nsHTMLWin32ObjectAccessible.h"
#endif
#include "nsCURILoader.h"
#include "nsEventStates.h"
#include "nsIContentViewer.h"
#include "nsIDOMDocument.h"
#include "nsIDOMHTMLAreaElement.h"
#include "nsIDOMHTMLLegendElement.h"
@ -79,10 +85,11 @@
#include "nsNPAPIPluginInstance.h"
#include "nsISupportsUtils.h"
#include "nsObjectFrame.h"
#include "nsRootAccessibleWrap.h"
#include "nsTextFragment.h"
#include "mozilla/FunctionTimer.h"
#include "mozilla/dom/Element.h"
#include "mozilla/Services.h"
#include "nsEventStates.h"
#include "mozilla/Util.h"
#ifdef MOZ_XUL
#include "nsXULAlertAccessible.h"
@ -97,23 +104,6 @@
#include "nsXULTreeGridAccessibleWrap.h"
#endif
// For native window support for object/embed/applet tags
#ifdef XP_WIN
#include "nsHTMLWin32ObjectAccessible.h"
#endif
// For embedding plugin accessibles
#ifdef MOZ_ACCESSIBILITY_ATK
#include "AtkSocketAccessible.h"
#endif
#include "nsXFormsFormControlsAccessible.h"
#include "nsXFormsWidgetsAccessible.h"
#include "OuterDocAccessible.h"
#include "mozilla/FunctionTimer.h"
#include "mozilla/dom/Element.h"
using namespace mozilla;
using namespace mozilla::a11y;
@ -1176,12 +1166,12 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
if (roleMapEntry->role == roles::TABLE ||
roleMapEntry->role == roles::TREE_TABLE) {
newAcc = new nsARIAGridAccessibleWrap(content, docAcc);
newAcc = new ARIAGridAccessibleWrap(content, docAcc);
} else if (roleMapEntry->role == roles::GRID_CELL ||
roleMapEntry->role == roles::ROWHEADER ||
roleMapEntry->role == roles::COLUMNHEADER) {
newAcc = new nsARIAGridCellAccessibleWrap(content, docAcc);
newAcc = new ARIAGridCellAccessibleWrap(content, docAcc);
}
}
}

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

@ -1661,17 +1661,25 @@ nsAccessible::ApplyARIAState(PRUint64* aState)
aria::MapToState(mRoleMapEntry->attributeMap3, element, aState);
}
/* DOMString getValue (); */
NS_IMETHODIMP
nsAccessible::GetValue(nsAString& aValue)
{
if (IsDefunct())
return NS_ERROR_FAILURE;
nsAutoString value;
Value(value);
aValue.Assign(value);
return NS_OK;
}
void
nsAccessible::Value(nsString& aValue)
{
if (mRoleMapEntry) {
if (mRoleMapEntry->valueRule == eNoValue) {
return NS_OK;
}
if (mRoleMapEntry->valueRule == eNoValue)
return;
// aria-valuenow is a number, and aria-valuetext is the optional text equivalent
// For the string value, we will try the optional text equivalent first
@ -1683,18 +1691,16 @@ nsAccessible::GetValue(nsAString& aValue)
}
if (!aValue.IsEmpty())
return NS_OK;
return;
// Check if it's a simple xlink.
if (nsCoreUtils::IsXLink(mContent)) {
nsIPresShell* presShell = mDoc->PresShell();
if (presShell) {
nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
return presShell->GetLinkLocation(DOMNode, aValue);
presShell->GetLinkLocation(DOMNode, aValue);
}
}
return NS_OK;
}
// nsIAccessibleValue

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

@ -131,10 +131,15 @@ public:
// Public methods
/**
* get the description of this accessible
* Get the description of this accessible.
*/
virtual void Description(nsString& aDescription);
/**
* Get the value of this accessible.
*/
virtual void Value(nsString& aValue);
/**
* Return DOM node associated with this accessible.
*/

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

@ -124,19 +124,18 @@ nsApplicationAccessible::GetName(nsAString& aName)
return NS_OK;
}
NS_IMETHODIMP
nsApplicationAccessible::GetValue(nsAString &aValue)
{
aValue.Truncate();
return NS_OK;
}
void
nsApplicationAccessible::Description(nsString &aDescription)
{
aDescription.Truncate();
}
void
nsApplicationAccessible::Value(nsString& aValue)
{
aValue.Truncate();
}
PRUint64
nsApplicationAccessible::State()
{

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

@ -80,7 +80,6 @@ public:
NS_IMETHOD GetNextSibling(nsIAccessible **aNextSibling);
NS_IMETHOD GetPreviousSibling(nsIAccessible **aPreviousSibling);
NS_IMETHOD GetName(nsAString &aName);
NS_IMETHOD GetValue(nsAString &aValue);
NS_IMETHOD GetAttributes(nsIPersistentProperties **aAttributes);
NS_IMETHOD GroupPosition(PRInt32 *aGroupLevel, PRInt32 *aSimilarItemsInGroup,
PRInt32 *aPositionInGroup);
@ -104,6 +103,7 @@ public:
// nsAccessible
virtual void ApplyARIAState(PRUint64* aState);
virtual void Description(nsString& aDescription);
virtual void Value(nsString& aValue);
virtual mozilla::a11y::role NativeRole();
virtual PRUint64 State();
virtual PRUint64 NativeState();

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

@ -124,16 +124,17 @@ nsLinkableAccessible::NativeState()
return states;
}
NS_IMETHODIMP
nsLinkableAccessible::GetValue(nsAString& aValue)
void
nsLinkableAccessible::Value(nsString& aValue)
{
aValue.Truncate();
nsAccessible::GetValue(aValue);
nsAccessible::Value(aValue);
if (!aValue.IsEmpty())
return NS_OK;
return;
return mIsLink ? mActionAcc->GetValue(aValue) : NS_ERROR_NOT_IMPLEMENTED;
if (aValue.IsEmpty() && mIsLink)
mActionAcc->Value(aValue);
}

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

@ -89,13 +89,13 @@ public:
// nsIAccessible
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
NS_IMETHOD GetValue(nsAString& _retval);
NS_IMETHOD TakeFocus();
// nsAccessNode
virtual void Shutdown();
// nsAccessible
virtual void Value(nsString& aValue);
virtual PRUint64 NativeState();
// ActionAccessible

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

@ -110,32 +110,29 @@ ProgressMeterAccessible<Max>::IsWidget() const
// nsIAccessibleValue
template<int Max>
NS_IMETHODIMP
ProgressMeterAccessible<Max>::GetValue(nsAString& aValue)
void
ProgressMeterAccessible<Max>::Value(nsString& aValue)
{
nsresult rv = nsFormControlAccessible::GetValue(aValue);
NS_ENSURE_SUCCESS(rv, rv);
nsFormControlAccessible::Value(aValue);
if (!aValue.IsEmpty())
return NS_OK;
return;
double maxValue = 0;
rv = GetMaximumValue(&maxValue);
NS_ENSURE_SUCCESS(rv, rv);
nsresult rv = GetMaximumValue(&maxValue);
NS_ENSURE_SUCCESS(rv, );
if (maxValue == 0)
return;
double curValue = 0;
rv = GetCurrentValue(&curValue);
NS_ENSURE_SUCCESS(rv, rv);
GetCurrentValue(&curValue);
NS_ENSURE_SUCCESS(rv, );
// Treat the current value bigger than maximum as 100%.
double percentValue = (curValue < maxValue) ?
(curValue / maxValue) * 100 : 100;
nsAutoString value;
value.AppendFloat(percentValue); // AppendFloat isn't available on nsAString
value.AppendLiteral("%");
aValue = value;
return NS_OK;
aValue.AppendFloat(percentValue);
aValue.AppendLiteral("%");
}
template<int Max>

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

@ -58,10 +58,8 @@ public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIACCESSIBLEVALUE
// nsIAccessible
NS_IMETHOD GetValue(nsAString &aValue);
// nsAccessible
virtual void Value(nsString& aValue);
virtual mozilla::a11y::role NativeRole();
virtual PRUint64 NativeState();

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

@ -283,8 +283,7 @@ nsTextEquivUtils::AppendFromValue(nsAccessible *aAccessible,
nsAutoString text;
if (aAccessible != gInitiatorAcc) {
nsresult rv = aAccessible->GetValue(text);
NS_ENSURE_SUCCESS(rv, rv);
aAccessible->Value(text);
return AppendString(aString, text) ?
NS_OK : NS_OK_NO_NAME_CLAUSE_HANDLED;
@ -304,8 +303,7 @@ nsTextEquivUtils::AppendFromValue(nsAccessible *aAccessible,
siblingContent = siblingContent->GetNextSibling()) {
// .. and subsequent text
if (!siblingContent->TextIsOnlyWhitespace()) {
nsresult rv = aAccessible->GetValue(text);
NS_ENSURE_SUCCESS(rv, rv);
aAccessible->Value(text);
return AppendString(aString, text) ?
NS_OK : NS_OK_NO_NAME_CLAUSE_HANDLED;

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

@ -36,7 +36,7 @@
*
* ***** END LICENSE BLOCK ***** */
#include "nsARIAGridAccessible.h"
#include "ARIAGridAccessible.h"
#include "AccIterator.h"
#include "nsAccUtils.h"
@ -46,18 +46,19 @@
#include "nsIMutableArray.h"
#include "nsComponentManagerUtils.h"
using namespace mozilla;
using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
// nsARIAGridAccessible
// ARIAGridAccessible
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Constructor
nsARIAGridAccessible::
nsARIAGridAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
ARIAGridAccessible::
ARIAGridAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsAccessibleWrap(aContent, aDoc), xpcAccessibleTable(this)
{
}
@ -65,7 +66,7 @@ nsARIAGridAccessible::
////////////////////////////////////////////////////////////////////////////////
// nsISupports
NS_IMPL_ISUPPORTS_INHERITED1(nsARIAGridAccessible,
NS_IMPL_ISUPPORTS_INHERITED1(ARIAGridAccessible,
nsAccessible,
nsIAccessibleTable)
@ -73,7 +74,7 @@ NS_IMPL_ISUPPORTS_INHERITED1(nsARIAGridAccessible,
//nsAccessNode
void
nsARIAGridAccessible::Shutdown()
ARIAGridAccessible::Shutdown()
{
mTable = nsnull;
nsAccessibleWrap::Shutdown();
@ -83,7 +84,7 @@ nsARIAGridAccessible::Shutdown()
// nsIAccessibleTable
NS_IMETHODIMP
nsARIAGridAccessible::GetSummary(nsAString &aSummary)
ARIAGridAccessible::GetSummary(nsAString& aSummary)
{
aSummary.Truncate();
@ -95,10 +96,10 @@ nsARIAGridAccessible::GetSummary(nsAString &aSummary)
}
NS_IMETHODIMP
nsARIAGridAccessible::GetColumnCount(PRInt32 *acolumnCount)
ARIAGridAccessible::GetColumnCount(PRInt32* aColumnCount)
{
NS_ENSURE_ARG_POINTER(acolumnCount);
*acolumnCount = 0;
NS_ENSURE_ARG_POINTER(aColumnCount);
*aColumnCount = 0;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -112,33 +113,33 @@ nsARIAGridAccessible::GetColumnCount(PRInt32 *acolumnCount)
nsAccessible *cell = nsnull;
while ((cell = cellIter.Next()))
(*acolumnCount)++;
(*aColumnCount)++;
return NS_OK;
}
NS_IMETHODIMP
nsARIAGridAccessible::GetRowCount(PRInt32 *arowCount)
ARIAGridAccessible::GetRowCount(PRInt32* aRowCount)
{
NS_ENSURE_ARG_POINTER(arowCount);
*arowCount = 0;
NS_ENSURE_ARG_POINTER(aRowCount);
*aRowCount = 0;
if (IsDefunct())
return NS_ERROR_FAILURE;
AccIterator rowIter(this, filters::GetRow);
while (rowIter.Next())
(*arowCount)++;
(*aRowCount)++;
return NS_OK;
}
NS_IMETHODIMP
nsARIAGridAccessible::GetCellAt(PRInt32 aRowIndex, PRInt32 aColumnIndex,
nsIAccessible **aAccessible)
ARIAGridAccessible::GetCellAt(PRInt32 aRowIndex, PRInt32 aColumnIndex,
nsIAccessible** aCell)
{
NS_ENSURE_ARG_POINTER(aAccessible);
*aAccessible = nsnull;
NS_ENSURE_ARG_POINTER(aCell);
*aCell = nsnull;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -149,13 +150,13 @@ nsARIAGridAccessible::GetCellAt(PRInt32 aRowIndex, PRInt32 aColumnIndex,
nsAccessible *cell = GetCellInRowAt(row, aColumnIndex);
NS_ENSURE_ARG(cell);
NS_ADDREF(*aAccessible = cell);
NS_ADDREF(*aCell = cell);
return NS_OK;
}
NS_IMETHODIMP
nsARIAGridAccessible::GetCellIndexAt(PRInt32 aRowIndex, PRInt32 aColumnIndex,
PRInt32 *aCellIndex)
ARIAGridAccessible::GetCellIndexAt(PRInt32 aRowIndex, PRInt32 aColumnIndex,
PRInt32* aCellIndex)
{
NS_ENSURE_ARG_POINTER(aCellIndex);
*aCellIndex = -1;
@ -178,8 +179,8 @@ nsARIAGridAccessible::GetCellIndexAt(PRInt32 aRowIndex, PRInt32 aColumnIndex,
}
NS_IMETHODIMP
nsARIAGridAccessible::GetColumnIndexAt(PRInt32 aCellIndex,
PRInt32 *aColumnIndex)
ARIAGridAccessible::GetColumnIndexAt(PRInt32 aCellIndex,
PRInt32* aColumnIndex)
{
NS_ENSURE_ARG_POINTER(aColumnIndex);
*aColumnIndex = -1;
@ -202,7 +203,7 @@ nsARIAGridAccessible::GetColumnIndexAt(PRInt32 aCellIndex,
}
NS_IMETHODIMP
nsARIAGridAccessible::GetRowIndexAt(PRInt32 aCellIndex, PRInt32 *aRowIndex)
ARIAGridAccessible::GetRowIndexAt(PRInt32 aCellIndex, PRInt32* aRowIndex)
{
NS_ENSURE_ARG_POINTER(aRowIndex);
*aRowIndex = -1;
@ -225,9 +226,9 @@ nsARIAGridAccessible::GetRowIndexAt(PRInt32 aCellIndex, PRInt32 *aRowIndex)
}
NS_IMETHODIMP
nsARIAGridAccessible::GetRowAndColumnIndicesAt(PRInt32 aCellIndex,
PRInt32* aRowIndex,
PRInt32* aColumnIndex)
ARIAGridAccessible::GetRowAndColumnIndicesAt(PRInt32 aCellIndex,
PRInt32* aRowIndex,
PRInt32* aColumnIndex)
{
NS_ENSURE_ARG_POINTER(aRowIndex);
*aRowIndex = -1;
@ -253,8 +254,8 @@ nsARIAGridAccessible::GetRowAndColumnIndicesAt(PRInt32 aCellIndex,
}
NS_IMETHODIMP
nsARIAGridAccessible::GetColumnExtentAt(PRInt32 aRow, PRInt32 aColumn,
PRInt32 *aExtentCount)
ARIAGridAccessible::GetRowExtentAt(PRInt32 aRow, PRInt32 aColumn,
PRInt32* aExtentCount)
{
NS_ENSURE_ARG_POINTER(aExtentCount);
*aExtentCount = 0;
@ -269,8 +270,8 @@ nsARIAGridAccessible::GetColumnExtentAt(PRInt32 aRow, PRInt32 aColumn,
}
NS_IMETHODIMP
nsARIAGridAccessible::GetRowExtentAt(PRInt32 aRow, PRInt32 aColumn,
PRInt32 *aExtentCount)
ARIAGridAccessible::GetColumnExtentAt(PRInt32 aRow, PRInt32 aColumn,
PRInt32* aExtentCount)
{
NS_ENSURE_ARG_POINTER(aExtentCount);
*aExtentCount = 0;
@ -285,8 +286,8 @@ nsARIAGridAccessible::GetRowExtentAt(PRInt32 aRow, PRInt32 aColumn,
}
NS_IMETHODIMP
nsARIAGridAccessible::GetColumnDescription(PRInt32 aColumn,
nsAString& aDescription)
ARIAGridAccessible::GetColumnDescription(PRInt32 aColumn,
nsAString& aDescription)
{
aDescription.Truncate();
@ -300,7 +301,7 @@ nsARIAGridAccessible::GetColumnDescription(PRInt32 aColumn,
}
NS_IMETHODIMP
nsARIAGridAccessible::GetRowDescription(PRInt32 aRow, nsAString& aDescription)
ARIAGridAccessible::GetRowDescription(PRInt32 aRow, nsAString& aDescription)
{
aDescription.Truncate();
@ -314,7 +315,7 @@ nsARIAGridAccessible::GetRowDescription(PRInt32 aRow, nsAString& aDescription)
}
NS_IMETHODIMP
nsARIAGridAccessible::IsColumnSelected(PRInt32 aColumn, bool *aIsSelected)
ARIAGridAccessible::IsColumnSelected(PRInt32 aColumn, bool* aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = false;
@ -345,7 +346,7 @@ nsARIAGridAccessible::IsColumnSelected(PRInt32 aColumn, bool *aIsSelected)
}
NS_IMETHODIMP
nsARIAGridAccessible::IsRowSelected(PRInt32 aRow, bool *aIsSelected)
ARIAGridAccessible::IsRowSelected(PRInt32 aRow, bool* aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = false;
@ -370,8 +371,8 @@ nsARIAGridAccessible::IsRowSelected(PRInt32 aRow, bool *aIsSelected)
}
NS_IMETHODIMP
nsARIAGridAccessible::IsCellSelected(PRInt32 aRow, PRInt32 aColumn,
bool *aIsSelected)
ARIAGridAccessible::IsCellSelected(PRInt32 aRow, PRInt32 aColumn,
bool* aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = false;
@ -395,7 +396,7 @@ nsARIAGridAccessible::IsCellSelected(PRInt32 aRow, PRInt32 aColumn,
}
NS_IMETHODIMP
nsARIAGridAccessible::GetSelectedCellCount(PRUint32* aCount)
ARIAGridAccessible::GetSelectedCellCount(PRUint32* aCount)
{
NS_ENSURE_ARG_POINTER(aCount);
*aCount = 0;
@ -428,13 +429,13 @@ nsARIAGridAccessible::GetSelectedCellCount(PRUint32* aCount)
}
NS_IMETHODIMP
nsARIAGridAccessible::GetSelectedColumnCount(PRUint32* aCount)
ARIAGridAccessible::GetSelectedColumnCount(PRUint32* aCount)
{
return GetSelectedColumnsArray(aCount);
}
NS_IMETHODIMP
nsARIAGridAccessible::GetSelectedRowCount(PRUint32* aCount)
ARIAGridAccessible::GetSelectedRowCount(PRUint32* aCount)
{
NS_ENSURE_ARG_POINTER(aCount);
*aCount = 0;
@ -472,7 +473,7 @@ nsARIAGridAccessible::GetSelectedRowCount(PRUint32* aCount)
}
NS_IMETHODIMP
nsARIAGridAccessible::GetSelectedCells(nsIArray **aCells)
ARIAGridAccessible::GetSelectedCells(nsIArray** aCells)
{
NS_ENSURE_ARG_POINTER(aCells);
*aCells = nsnull;
@ -510,8 +511,8 @@ nsARIAGridAccessible::GetSelectedCells(nsIArray **aCells)
}
NS_IMETHODIMP
nsARIAGridAccessible::GetSelectedCellIndices(PRUint32 *aCellsCount,
PRInt32 **aCells)
ARIAGridAccessible::GetSelectedCellIndices(PRUint32* aCellsCount,
PRInt32** aCells)
{
NS_ENSURE_ARG_POINTER(aCellsCount);
*aCellsCount = 0;
@ -562,20 +563,20 @@ nsARIAGridAccessible::GetSelectedCellIndices(PRUint32 *aCellsCount,
}
NS_IMETHODIMP
nsARIAGridAccessible::GetSelectedColumnIndices(PRUint32 *acolumnCount,
PRInt32 **aColumns)
ARIAGridAccessible::GetSelectedColumnIndices(PRUint32* aColumnCount,
PRInt32** aColumns)
{
NS_ENSURE_ARG_POINTER(aColumns);
return GetSelectedColumnsArray(acolumnCount, aColumns);
return GetSelectedColumnsArray(aColumnCount, aColumns);
}
NS_IMETHODIMP
nsARIAGridAccessible::GetSelectedRowIndices(PRUint32 *arowCount,
PRInt32 **aRows)
ARIAGridAccessible::GetSelectedRowIndices(PRUint32* aRowCount,
PRInt32** aRows)
{
NS_ENSURE_ARG_POINTER(arowCount);
*arowCount = 0;
NS_ENSURE_ARG_POINTER(aRowCount);
*aRowCount = 0;
NS_ENSURE_ARG_POINTER(aRows);
*aRows = nsnull;
@ -623,12 +624,12 @@ nsARIAGridAccessible::GetSelectedRowIndices(PRUint32 *arowCount,
nsMemory::Clone(selRows.Elements(), selrowCount * sizeof(PRInt32)));
NS_ENSURE_TRUE(*aRows, NS_ERROR_OUT_OF_MEMORY);
*arowCount = selrowCount;
*aRowCount = selrowCount;
return NS_OK;
}
NS_IMETHODIMP
nsARIAGridAccessible::SelectRow(PRInt32 aRow)
ARIAGridAccessible::SelectRow(PRInt32 aRow)
{
NS_ENSURE_ARG(IsValidRow(aRow));
@ -647,7 +648,7 @@ nsARIAGridAccessible::SelectRow(PRInt32 aRow)
}
NS_IMETHODIMP
nsARIAGridAccessible::SelectColumn(PRInt32 aColumn)
ARIAGridAccessible::SelectColumn(PRInt32 aColumn)
{
NS_ENSURE_ARG(IsValidColumn(aColumn));
@ -674,7 +675,7 @@ nsARIAGridAccessible::SelectColumn(PRInt32 aColumn)
}
NS_IMETHODIMP
nsARIAGridAccessible::UnselectRow(PRInt32 aRow)
ARIAGridAccessible::UnselectRow(PRInt32 aRow)
{
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -686,7 +687,7 @@ nsARIAGridAccessible::UnselectRow(PRInt32 aRow)
}
NS_IMETHODIMP
nsARIAGridAccessible::UnselectColumn(PRInt32 aColumn)
ARIAGridAccessible::UnselectColumn(PRInt32 aColumn)
{
NS_ENSURE_ARG(IsValidColumn(aColumn));
@ -711,7 +712,7 @@ nsARIAGridAccessible::UnselectColumn(PRInt32 aColumn)
// Protected
bool
nsARIAGridAccessible::IsValidRow(PRInt32 aRow)
ARIAGridAccessible::IsValidRow(PRInt32 aRow)
{
if (aRow < 0)
return false;
@ -722,7 +723,7 @@ nsARIAGridAccessible::IsValidRow(PRInt32 aRow)
}
bool
nsARIAGridAccessible::IsValidColumn(PRInt32 aColumn)
ARIAGridAccessible::IsValidColumn(PRInt32 aColumn)
{
if (aColumn < 0)
return false;
@ -733,7 +734,7 @@ nsARIAGridAccessible::IsValidColumn(PRInt32 aColumn)
}
bool
nsARIAGridAccessible::IsValidRowNColumn(PRInt32 aRow, PRInt32 aColumn)
ARIAGridAccessible::IsValidRowNColumn(PRInt32 aRow, PRInt32 aColumn)
{
if (aRow < 0 || aColumn < 0)
return false;
@ -749,7 +750,7 @@ nsARIAGridAccessible::IsValidRowNColumn(PRInt32 aRow, PRInt32 aColumn)
}
nsAccessible*
nsARIAGridAccessible::GetRowAt(PRInt32 aRow)
ARIAGridAccessible::GetRowAt(PRInt32 aRow)
{
PRInt32 rowIdx = aRow;
@ -763,7 +764,7 @@ nsARIAGridAccessible::GetRowAt(PRInt32 aRow)
}
nsAccessible*
nsARIAGridAccessible::GetCellInRowAt(nsAccessible *aRow, PRInt32 aColumn)
ARIAGridAccessible::GetCellInRowAt(nsAccessible* aRow, PRInt32 aColumn)
{
PRInt32 colIdx = aColumn;
@ -776,8 +777,8 @@ nsARIAGridAccessible::GetCellInRowAt(nsAccessible *aRow, PRInt32 aColumn)
}
nsresult
nsARIAGridAccessible::SetARIASelected(nsAccessible *aAccessible,
bool aIsSelected, bool aNotify)
ARIAGridAccessible::SetARIASelected(nsAccessible* aAccessible,
bool aIsSelected, bool aNotify)
{
nsIContent *content = aAccessible->GetContent();
NS_ENSURE_STATE(content);
@ -844,11 +845,11 @@ nsARIAGridAccessible::SetARIASelected(nsAccessible *aAccessible,
}
nsresult
nsARIAGridAccessible::GetSelectedColumnsArray(PRUint32 *acolumnCount,
PRInt32 **aColumns)
ARIAGridAccessible::GetSelectedColumnsArray(PRUint32* aColumnCount,
PRInt32** aColumns)
{
NS_ENSURE_ARG_POINTER(acolumnCount);
*acolumnCount = 0;
NS_ENSURE_ARG_POINTER(aColumnCount);
*aColumnCount = 0;
if (aColumns)
*aColumns = nsnull;
@ -893,7 +894,7 @@ nsARIAGridAccessible::GetSelectedColumnsArray(PRUint32 *acolumnCount,
return NS_OK;
if (!aColumns) {
*acolumnCount = selColCount;
*aColumnCount = selColCount;
return NS_OK;
}
@ -901,7 +902,7 @@ nsARIAGridAccessible::GetSelectedColumnsArray(PRUint32 *acolumnCount,
nsMemory::Alloc(selColCount * sizeof(PRInt32)));
NS_ENSURE_TRUE(*aColumns, NS_ERROR_OUT_OF_MEMORY);
*acolumnCount = selColCount;
*aColumnCount = selColCount;
for (PRInt32 colIdx = 0, idx = 0; colIdx < colCount; colIdx++) {
if (isColSelArray[colIdx])
(*aColumns)[idx++] = colIdx;
@ -912,15 +913,15 @@ nsARIAGridAccessible::GetSelectedColumnsArray(PRUint32 *acolumnCount,
////////////////////////////////////////////////////////////////////////////////
// nsARIAGridCellAccessible
// ARIAGridCellAccessible
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Constructor
nsARIAGridCellAccessible::
nsARIAGridCellAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
ARIAGridCellAccessible::
ARIAGridCellAccessible(nsIContent* aContent, nsDocAccessible* aDoc) :
nsHyperTextAccessibleWrap(aContent, aDoc)
{
}
@ -928,7 +929,7 @@ nsARIAGridCellAccessible::
////////////////////////////////////////////////////////////////////////////////
// nsISupports
NS_IMPL_ISUPPORTS_INHERITED1(nsARIAGridCellAccessible,
NS_IMPL_ISUPPORTS_INHERITED1(ARIAGridCellAccessible,
nsHyperTextAccessible,
nsIAccessibleTableCell)
@ -936,7 +937,7 @@ NS_IMPL_ISUPPORTS_INHERITED1(nsARIAGridCellAccessible,
// nsIAccessibleTableCell
NS_IMETHODIMP
nsARIAGridCellAccessible::GetTable(nsIAccessibleTable **aTable)
ARIAGridCellAccessible::GetTable(nsIAccessibleTable** aTable)
{
NS_ENSURE_ARG_POINTER(aTable);
*aTable = nsnull;
@ -958,7 +959,7 @@ nsARIAGridCellAccessible::GetTable(nsIAccessibleTable **aTable)
}
NS_IMETHODIMP
nsARIAGridCellAccessible::GetColumnIndex(PRInt32 *aColumnIndex)
ARIAGridCellAccessible::GetColumnIndex(PRInt32* aColumnIndex)
{
NS_ENSURE_ARG_POINTER(aColumnIndex);
*aColumnIndex = -1;
@ -985,7 +986,7 @@ nsARIAGridCellAccessible::GetColumnIndex(PRInt32 *aColumnIndex)
}
NS_IMETHODIMP
nsARIAGridCellAccessible::GetRowIndex(PRInt32 *aRowIndex)
ARIAGridCellAccessible::GetRowIndex(PRInt32* aRowIndex)
{
NS_ENSURE_ARG_POINTER(aRowIndex);
*aRowIndex = -1;
@ -1014,7 +1015,7 @@ nsARIAGridCellAccessible::GetRowIndex(PRInt32 *aRowIndex)
}
NS_IMETHODIMP
nsARIAGridCellAccessible::GetColumnExtent(PRInt32 *aExtentCount)
ARIAGridCellAccessible::GetColumnExtent(PRInt32* aExtentCount)
{
NS_ENSURE_ARG_POINTER(aExtentCount);
*aExtentCount = 0;
@ -1027,7 +1028,7 @@ nsARIAGridCellAccessible::GetColumnExtent(PRInt32 *aExtentCount)
}
NS_IMETHODIMP
nsARIAGridCellAccessible::GetRowExtent(PRInt32 *aExtentCount)
ARIAGridCellAccessible::GetRowExtent(PRInt32* aExtentCount)
{
NS_ENSURE_ARG_POINTER(aExtentCount);
*aExtentCount = 0;
@ -1040,7 +1041,7 @@ nsARIAGridCellAccessible::GetRowExtent(PRInt32 *aExtentCount)
}
NS_IMETHODIMP
nsARIAGridCellAccessible::GetColumnHeaderCells(nsIArray **aHeaderCells)
ARIAGridCellAccessible::GetColumnHeaderCells(nsIArray** aHeaderCells)
{
NS_ENSURE_ARG_POINTER(aHeaderCells);
*aHeaderCells = nsnull;
@ -1059,7 +1060,7 @@ nsARIAGridCellAccessible::GetColumnHeaderCells(nsIArray **aHeaderCells)
}
NS_IMETHODIMP
nsARIAGridCellAccessible::GetRowHeaderCells(nsIArray **aHeaderCells)
ARIAGridCellAccessible::GetRowHeaderCells(nsIArray** aHeaderCells)
{
NS_ENSURE_ARG_POINTER(aHeaderCells);
*aHeaderCells = nsnull;
@ -1078,7 +1079,7 @@ nsARIAGridCellAccessible::GetRowHeaderCells(nsIArray **aHeaderCells)
}
NS_IMETHODIMP
nsARIAGridCellAccessible::IsSelected(bool *aIsSelected)
ARIAGridCellAccessible::IsSelected(bool* aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = false;
@ -1101,7 +1102,7 @@ nsARIAGridCellAccessible::IsSelected(bool *aIsSelected)
// nsAccessible
void
nsARIAGridCellAccessible::ApplyARIAState(PRUint64* aState)
ARIAGridCellAccessible::ApplyARIAState(PRUint64* aState)
{
nsHyperTextAccessibleWrap::ApplyARIAState(aState);
@ -1124,7 +1125,7 @@ nsARIAGridCellAccessible::ApplyARIAState(PRUint64* aState)
}
nsresult
nsARIAGridCellAccessible::GetAttributesInternal(nsIPersistentProperties *aAttributes)
ARIAGridCellAccessible::GetAttributesInternal(nsIPersistentProperties* aAttributes)
{
if (IsDefunct())
return NS_ERROR_FAILURE;

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

@ -36,8 +36,8 @@
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsARIAGridAccessible_h_
#define nsARIAGridAccessible_h_
#ifndef MOZILLA_A11Y_ARIAGridAccessible_h_
#define MOZILLA_A11Y_ARIAGridAccessible_h_
#include "nsIAccessibleTable.h"
@ -45,16 +45,19 @@
#include "TableAccessible.h"
#include "xpcAccessibleTable.h"
namespace mozilla {
namespace a11y {
/**
* Accessible for ARIA grid and treegrid.
*/
class nsARIAGridAccessible : public nsAccessibleWrap,
public xpcAccessibleTable,
public nsIAccessibleTable,
public mozilla::a11y::TableAccessible
class ARIAGridAccessible : public nsAccessibleWrap,
public xpcAccessibleTable,
public nsIAccessibleTable,
public TableAccessible
{
public:
nsARIAGridAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
ARIAGridAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
@ -116,11 +119,11 @@ protected:
/**
* Accessible for ARIA gridcell and rowheader/columnheader.
*/
class nsARIAGridCellAccessible : public nsHyperTextAccessibleWrap,
public nsIAccessibleTableCell
class ARIAGridCellAccessible : public nsHyperTextAccessibleWrap,
public nsIAccessibleTableCell
{
public:
nsARIAGridCellAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
ARIAGridCellAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
@ -133,4 +136,7 @@ public:
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
};
} // namespace a11y
} // namespace mozilla
#endif

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

@ -15,6 +15,7 @@ LIBXUL_LIBRARY = 1
CPPSRCS = \
ARIAGridAccessible.cpp \
OuterDocAccessible.cpp \
$(NULL)

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

@ -406,25 +406,23 @@ nsHTMLTextFieldAccessible::GetNameInternal(nsAString& aName)
return NS_OK;
}
NS_IMETHODIMP nsHTMLTextFieldAccessible::GetValue(nsAString& _retval)
void
nsHTMLTextFieldAccessible::Value(nsString& aValue)
{
if (IsDefunct())
return NS_ERROR_FAILURE;
aValue.Truncate();
if (NativeState() & states::PROTECTED) // Don't return password text!
return NS_ERROR_FAILURE;
return;
nsCOMPtr<nsIDOMHTMLTextAreaElement> textArea(do_QueryInterface(mContent));
if (textArea) {
return textArea->GetValue(_retval);
textArea->GetValue(aValue);
return;
}
nsCOMPtr<nsIDOMHTMLInputElement> inputElement(do_QueryInterface(mContent));
if (inputElement) {
return inputElement->GetValue(_retval);
inputElement->GetValue(aValue);
}
return NS_ERROR_FAILURE;
}
void

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

@ -134,7 +134,6 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIAccessible
NS_IMETHOD GetValue(nsAString& _retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
@ -142,6 +141,7 @@ public:
virtual already_AddRefed<nsIEditor> GetEditor() const;
// nsAccessible
virtual void Value(nsString& aValue);
virtual void ApplyARIAState(PRUint64* aState);
virtual nsresult GetNameInternal(nsAString& aName);
virtual mozilla::a11y::role NativeRole();

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

@ -106,20 +106,18 @@ nsHTMLLinkAccessible::NativeState()
return states;
}
NS_IMETHODIMP
nsHTMLLinkAccessible::GetValue(nsAString& aValue)
void
nsHTMLLinkAccessible::Value(nsString& aValue)
{
aValue.Truncate();
nsresult rv = nsHyperTextAccessible::GetValue(aValue);
NS_ENSURE_SUCCESS(rv, rv);
nsHyperTextAccessible::Value(aValue);
if (!aValue.IsEmpty())
return NS_OK;
return;
nsIPresShell* presShell(mDoc->PresShell());
nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
return presShell->GetLinkLocation(DOMNode, aValue);
presShell->GetLinkLocation(DOMNode, aValue);
}
PRUint8

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

@ -50,12 +50,11 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIAccessible
NS_IMETHOD GetValue(nsAString& aValue);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 aIndex);
// nsAccessible
virtual void Value(nsString& aValue);
virtual mozilla::a11y::role NativeRole();
virtual PRUint64 NativeState();

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

@ -587,11 +587,13 @@ nsHTMLComboboxAccessible::Description(nsString& aDescription)
option->Description(aDescription);
}
NS_IMETHODIMP nsHTMLComboboxAccessible::GetValue(nsAString& aValue)
void
nsHTMLComboboxAccessible::Value(nsString& aValue)
{
// Use accessible name of selected option.
nsAccessible* option = SelectedOption();
return option ? option->GetName(aValue) : NS_OK;
if (option)
option->GetName(aValue);
}
PRUint8

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

@ -187,7 +187,6 @@ public:
virtual ~nsHTMLComboboxAccessible() {}
// nsIAccessible
NS_IMETHOD GetValue(nsAString& _retval);
NS_IMETHOD DoAction(PRUint8 index);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
@ -196,6 +195,7 @@ public:
// nsAccessible
virtual void Description(nsString& aDescription);
virtual void Value(nsString& aValue);
virtual mozilla::a11y::role NativeRole();
virtual PRUint64 NativeState();
virtual void InvalidateChildren();

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

@ -38,13 +38,18 @@
*
* ***** END LICENSE BLOCK ***** */
#ifndef _NSARIAGRIDACCESSIBLEWRAP_H
#define _NSARIAGRIDACCESSIBLEWRAP_H
#ifndef MOZILLA_A11Y_ARIAGRIDACCESSIBLEWRAP_H
#define MOZILLA_A11Y_ARIAGRIDACCESSIBLEWRAP_H
#include "nsARIAGridAccessible.h"
#include "ARIAGridAccessible.h"
typedef class nsARIAGridAccessible nsARIAGridAccessibleWrap;
typedef class nsARIAGridCellAccessible nsARIAGridCellAccessibleWrap;
namespace mozilla {
namespace a11y {
typedef class ARIAGridAccessible ARIAGridAccessibleWrap;
typedef class ARIAGridCellAccessible ARIAGridCellAccessibleWrap;
} // namespace a11y
} // namespace mozilla
#endif

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

@ -62,10 +62,10 @@ CMMSRCS = nsAccessNodeWrap.mm \
EXPORTS = \
ARIAGridAccessibleWrap.h \
nsAccessNodeWrap.h \
nsTextAccessibleWrap.h \
nsAccessibleWrap.h \
nsARIAGridAccessibleWrap.h \
nsDocAccessibleWrap.h \
nsRootAccessibleWrap.h \
nsXULMenuAccessibleWrap.h \

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

@ -116,12 +116,11 @@
- (NSURL*)url
{
if (!mGeckoAccessible)
if (!mGeckoAccessible || mGeckoAccessible->IsDefunct())
return nil;
nsAutoString value;
nsresult rv = mGeckoAccessible->GetValue(value);
NS_ENSURE_SUCCESS(rv, nil);
mGeckoAccessible->Value(value);
NSString* urlString = value.IsEmpty() ? nil : nsCocoaUtils::ToNSString(value);
if (!urlString)

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

@ -38,27 +38,31 @@
*
* ***** END LICENSE BLOCK ***** */
#include "nsARIAGridAccessibleWrap.h"
#include "ARIAGridAccessibleWrap.h"
using namespace mozilla;
using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
// nsARIAGridAccessibleWrap
// ARIAGridAccessibleWrap
////////////////////////////////////////////////////////////////////////////////
NS_IMPL_ISUPPORTS_INHERITED0(nsARIAGridAccessibleWrap,
nsARIAGridAccessible)
NS_IMPL_ISUPPORTS_INHERITED0(ARIAGridAccessibleWrap,
ARIAGridAccessible)
IMPL_IUNKNOWN_INHERITED1(nsARIAGridAccessibleWrap,
IMPL_IUNKNOWN_INHERITED1(ARIAGridAccessibleWrap,
nsAccessibleWrap,
CAccessibleTable)
////////////////////////////////////////////////////////////////////////////////
// nsARIAGridCellAccessibleWrap
// ARIAGridCellAccessibleWrap
////////////////////////////////////////////////////////////////////////////////
NS_IMPL_ISUPPORTS_INHERITED0(nsARIAGridCellAccessibleWrap,
nsARIAGridCellAccessible)
NS_IMPL_ISUPPORTS_INHERITED0(ARIAGridCellAccessibleWrap,
ARIAGridCellAccessible)
IMPL_IUNKNOWN_INHERITED1(nsARIAGridCellAccessibleWrap,
IMPL_IUNKNOWN_INHERITED1(ARIAGridCellAccessibleWrap,
nsHyperTextAccessibleWrap,
CAccessibleTableCell)

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

@ -38,23 +38,26 @@
*
* ***** END LICENSE BLOCK ***** */
#ifndef _NSARIAGRIDACCESSIBLEWRAP_H
#define _NSARIAGRIDACCESSIBLEWRAP_H
#ifndef MOZILLA_A11Y_ARIAGRIDACCESSIBLEWRAP_H
#define MOZILLA_A11Y_ARIAGRIDACCESSIBLEWRAP_H
#include "nsARIAGridAccessible.h"
#include "ARIAGridAccessible.h"
#include "CAccessibleTable.h"
#include "CAccessibleTableCell.h"
namespace mozilla {
namespace a11y {
/**
* IA2 wrapper class for nsARIAGridAccessible implementing IAccessibleTable and
* IA2 wrapper class for ARIAGridAccessible implementing IAccessibleTable and
* IAccessibleTable2 interfaces.
*/
class nsARIAGridAccessibleWrap : public nsARIAGridAccessible,
public CAccessibleTable
class ARIAGridAccessibleWrap : public ARIAGridAccessible,
public CAccessibleTable
{
public:
nsARIAGridAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsARIAGridAccessible(aContent, aDoc) {}
ARIAGridAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
ARIAGridAccessible(aContent, aDoc) {}
// IUnknown
DECL_IUNKNOWN_INHERITED
@ -64,15 +67,15 @@ public:
};
/**
* IA2 wrapper class for nsARIAGridCellAccessible implementing
* IA2 wrapper class for ARIAGridCellAccessible implementing
* IAccessibleTableCell interface.
*/
class nsARIAGridCellAccessibleWrap : public nsARIAGridCellAccessible,
public CAccessibleTableCell
class ARIAGridCellAccessibleWrap : public ARIAGridCellAccessible,
public CAccessibleTableCell
{
public:
nsARIAGridCellAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
nsARIAGridCellAccessible(aContent, aDoc) {}
ARIAGridCellAccessibleWrap(nsIContent* aContent, nsDocAccessible* aDoc) :
ARIAGridCellAccessible(aContent, aDoc) {}
// IUnknown
DECL_IUNKNOWN_INHERITED
@ -81,4 +84,7 @@ public:
NS_DECL_ISUPPORTS_INHERITED
};
} // namespace a11y
} // namespace mozilla
#endif

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

@ -80,8 +80,8 @@ __try {
*aY = 0;
nsRefPtr<nsAccessible> acc(do_QueryObject(this));
if (!acc)
return E_FAIL;
if (acc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
// If the object is not on any screen the returned position is (0,0).
PRUint64 state = acc->State();
@ -128,7 +128,7 @@ CAccessibleComponent::get_foreground(IA2Color* aForeground)
__try {
nsRefPtr<nsAccessible> acc(do_QueryObject(this));
if (acc->IsDefunct())
return E_FAIL;
return CO_E_OBJNOTCONNECTED;
nsIFrame* frame = acc->GetFrame();
if (frame)
@ -147,7 +147,7 @@ CAccessibleComponent::get_background(IA2Color* aBackground)
__try {
nsRefPtr<nsAccessible> acc(do_QueryObject(this));
if (acc->IsDefunct())
return E_FAIL;
return CO_E_OBJNOTCONNECTED;
nsIFrame* frame = acc->GetFrame();
if (frame)

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

@ -40,20 +40,12 @@
#include "CAccessibleEditableText.h"
#include "nsIAccessibleEditableText.h"
#include "AccessibleEditableText_i.c"
#include "nsAccessNodeWrap.h"
#include "nsHyperTextAccessible.h"
#include "nsCOMPtr.h"
#include "nsString.h"
#define GET_NSIACCESSIBLEEDITABLETEXT \
nsCOMPtr<nsIAccessibleEditableText> textAcc(do_QueryObject(this));\
NS_ASSERTION(textAcc,\
"Subclass of CAccessibleEditableText doesn't implement nsIAccessibleEditableText");\
if (!textAcc)\
return E_FAIL;\
// IUnknown
STDMETHODIMP
@ -79,7 +71,9 @@ STDMETHODIMP
CAccessibleEditableText::copyText(long aStartOffset, long aEndOffset)
{
__try {
GET_NSIACCESSIBLEEDITABLETEXT
nsRefPtr<nsHyperTextAccessible> textAcc(do_QueryObject(this));
if (textAcc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsresult rv = textAcc->CopyText(aStartOffset, aEndOffset);
return GetHRESULT(rv);
@ -92,7 +86,9 @@ STDMETHODIMP
CAccessibleEditableText::deleteText(long aStartOffset, long aEndOffset)
{
__try {
GET_NSIACCESSIBLEEDITABLETEXT
nsRefPtr<nsHyperTextAccessible> textAcc(do_QueryObject(this));
if (textAcc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsresult rv = textAcc->DeleteText(aStartOffset, aEndOffset);
return GetHRESULT(rv);
@ -105,7 +101,9 @@ STDMETHODIMP
CAccessibleEditableText::insertText(long aOffset, BSTR *aText)
{
__try {
GET_NSIACCESSIBLEEDITABLETEXT
nsRefPtr<nsHyperTextAccessible> textAcc(do_QueryObject(this));
if (textAcc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
PRUint32 length = ::SysStringLen(*aText);
nsAutoString text(*aText, length);
@ -121,7 +119,9 @@ STDMETHODIMP
CAccessibleEditableText::cutText(long aStartOffset, long aEndOffset)
{
__try {
GET_NSIACCESSIBLEEDITABLETEXT
nsRefPtr<nsHyperTextAccessible> textAcc(do_QueryObject(this));
if (textAcc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsresult rv = textAcc->CutText(aStartOffset, aEndOffset);
return GetHRESULT(rv);
@ -134,7 +134,9 @@ STDMETHODIMP
CAccessibleEditableText::pasteText(long aOffset)
{
__try {
GET_NSIACCESSIBLEEDITABLETEXT
nsRefPtr<nsHyperTextAccessible> textAcc(do_QueryObject(this));
if (textAcc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsresult rv = textAcc->PasteText(aOffset);
return GetHRESULT(rv);
@ -148,7 +150,9 @@ CAccessibleEditableText::replaceText(long aStartOffset, long aEndOffset,
BSTR *aText)
{
__try {
GET_NSIACCESSIBLEEDITABLETEXT
nsRefPtr<nsHyperTextAccessible> textAcc(do_QueryObject(this));
if (textAcc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsresult rv = textAcc->DeleteText(aStartOffset, aEndOffset);
if (NS_FAILED(rv))

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

@ -44,7 +44,7 @@
#include "AccessibleHyperlink.h"
#include "AccessibleHyperlink_i.c"
#include "nsAccessible.h"
#include "nsAccessibleWrap.h"
#include "nsIWinAccessNode.h"
// IUnknown
@ -76,26 +76,26 @@ __try {
VariantInit(aAnchor);
nsRefPtr<nsAccessible> thisObj = do_QueryObject(this);
if (thisObj->IsDefunct() || !thisObj->IsLink())
return E_FAIL;
if (thisObj->IsDefunct())
return CO_E_OBJNOTCONNECTED;
if (aIndex < 0 || aIndex >= static_cast<long>(thisObj->AnchorCount()))
return E_INVALIDARG;
nsAccessible* anchor = thisObj->AnchorAt(aIndex);
if (!thisObj->IsLink())
return S_FALSE;
nsAccessibleWrap* anchor =
static_cast<nsAccessibleWrap*>(thisObj->AnchorAt(aIndex));
if (!anchor)
return S_FALSE;
nsCOMPtr<nsIWinAccessNode> winAccessNode(do_QueryObject(anchor));
if (!winAccessNode)
return E_FAIL;
void* instancePtr = NULL;
HRESULT result = anchor->QueryInterface(IID_IUnknown, &instancePtr);
if (FAILED(result))
return result;
void *instancePtr = NULL;
nsresult rv = winAccessNode->QueryNativeInterface(IID_IUnknown, &instancePtr);
if (NS_FAILED(rv))
return E_FAIL;
IUnknown *unknownPtr = static_cast<IUnknown*>(instancePtr);
IUnknown* unknownPtr = static_cast<IUnknown*>(instancePtr);
aAnchor->ppunkVal = &unknownPtr;
aAnchor->vt = VT_UNKNOWN;
return S_OK;
@ -111,12 +111,15 @@ __try {
VariantInit(aAnchorTarget);
nsRefPtr<nsAccessible> thisObj = do_QueryObject(this);
if (thisObj->IsDefunct() || !thisObj->IsLink())
return E_FAIL;
if (thisObj->IsDefunct())
return CO_E_OBJNOTCONNECTED;
if (aIndex < 0 || aIndex >= static_cast<long>(thisObj->AnchorCount()))
return E_INVALIDARG;
if (!thisObj->IsLink())
return S_FALSE;
nsCOMPtr<nsIURI> uri = thisObj->AnchorURIAt(aIndex);
if (!uri)
return S_FALSE;
@ -151,8 +154,11 @@ __try {
*aIndex = 0;
nsRefPtr<nsAccessible> thisObj = do_QueryObject(this);
if (thisObj->IsDefunct() || !thisObj->IsLink())
return E_FAIL;
if (thisObj->IsDefunct())
return CO_E_OBJNOTCONNECTED;
if (!thisObj->IsLink())
return S_FALSE;
*aIndex = thisObj->StartOffset();
return S_OK;
@ -168,8 +174,11 @@ __try {
*aIndex = 0;
nsRefPtr<nsAccessible> thisObj = do_QueryObject(this);
if (thisObj->IsDefunct() || !thisObj->IsLink())
return E_FAIL;
if (thisObj->IsDefunct())
return CO_E_OBJNOTCONNECTED;
if (!thisObj->IsLink())
return S_FALSE;
*aIndex = thisObj->EndOffset();
return S_OK;
@ -185,8 +194,11 @@ __try {
*aValid = false;
nsRefPtr<nsAccessible> thisObj = do_QueryObject(this);
if (thisObj->IsDefunct() || !thisObj->IsLink())
return E_FAIL;
if (thisObj->IsDefunct())
return CO_E_OBJNOTCONNECTED;
if (!thisObj->IsLink())
return S_FALSE;
*aValid = thisObj->IsLinkValid();
return S_OK;

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

@ -72,8 +72,8 @@ __try {
*aHyperlinkCount = 0;
nsRefPtr<nsHyperTextAccessible> hyperText = do_QueryObject(this);
if (!hyperText)
return E_FAIL;
if (hyperText->IsDefunct())
return CO_E_OBJNOTCONNECTED;
*aHyperlinkCount = hyperText->GetLinkCount();
return S_OK;
@ -90,8 +90,8 @@ __try {
*aHyperlink = NULL;
nsRefPtr<nsHyperTextAccessible> hyperText = do_QueryObject(this);
if (!hyperText)
return E_FAIL;
if (hyperText->IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsAccessible* hyperLink = hyperText->GetLinkAt(aLinkIndex);
nsCOMPtr<nsIWinAccessNode> winAccessNode(do_QueryObject(hyperLink));
@ -118,8 +118,8 @@ __try {
*aHyperlinkIndex = 0;
nsRefPtr<nsHyperTextAccessible> hyperAcc(do_QueryObject(this));
if (!hyperAcc)
return E_FAIL;
if (hyperAcc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
*aHyperlinkIndex = hyperAcc->GetLinkIndexAtOffset(aCharIndex);
return S_OK;

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

@ -74,6 +74,9 @@ CAccessibleText::addSelection(long aStartOffset, long aEndOffset)
{
__try {
nsRefPtr<nsHyperTextAccessible> textAcc(do_QueryObject(this));
if (textAcc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsresult rv = textAcc->AddSelection(aStartOffset, aEndOffset);
return GetHRESULT(rv);
@ -94,6 +97,8 @@ __try {
*aTextAttributes = NULL;
nsRefPtr<nsHyperTextAccessible> textAcc(do_QueryObject(this));
if (textAcc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
PRInt32 startOffset = 0, endOffset = 0;
nsCOMPtr<nsIPersistentProperties> attributes;
@ -124,6 +129,8 @@ __try {
*aOffset = -1;
nsRefPtr<nsHyperTextAccessible> textAcc(do_QueryObject(this));
if (textAcc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
PRInt32 offset = 0;
nsresult rv = textAcc->GetCaretOffset(&offset);
@ -150,6 +157,8 @@ __try {
*aHeight = 0;
nsRefPtr<nsHyperTextAccessible> textAcc(do_QueryObject(this));
if (textAcc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
PRUint32 geckoCoordType = (aCoordType == IA2_COORDTYPE_SCREEN_RELATIVE) ?
nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE :
@ -179,7 +188,7 @@ __try {
nsRefPtr<nsHyperTextAccessible> textAcc(do_QueryObject(this));
if (textAcc->IsDefunct())
return E_FAIL;
return CO_E_OBJNOTCONNECTED;
PRInt32 selCount = 0;
nsresult rv = textAcc->GetSelectionCount(&selCount);
@ -202,6 +211,8 @@ __try {
*aOffset = 0;
nsRefPtr<nsHyperTextAccessible> textAcc(do_QueryObject(this));
if (textAcc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
PRUint32 geckoCoordType = (aCoordType == IA2_COORDTYPE_SCREEN_RELATIVE) ?
nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE :
@ -228,6 +239,8 @@ __try {
*aEndOffset = 0;
nsRefPtr<nsHyperTextAccessible> textAcc(do_QueryObject(this));
if (textAcc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
PRInt32 startOffset = 0, endOffset = 0;
nsresult rv = textAcc->GetSelectionBounds(aSelectionIndex,
@ -250,6 +263,8 @@ __try {
*aText = NULL;
nsRefPtr<nsHyperTextAccessible> textAcc(do_QueryObject(this));
if (textAcc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsAutoString text;
nsresult rv = textAcc->GetText(aStartOffset, aEndOffset, text);
@ -279,7 +294,7 @@ __try {
nsRefPtr<nsHyperTextAccessible> textAcc(do_QueryObject(this));
if (textAcc->IsDefunct())
return E_FAIL;
return CO_E_OBJNOTCONNECTED;
nsresult rv = NS_OK;
nsAutoString text;
@ -326,7 +341,7 @@ __try {
nsRefPtr<nsHyperTextAccessible> textAcc(do_QueryObject(this));
if (textAcc->IsDefunct())
return E_FAIL;
return CO_E_OBJNOTCONNECTED;
nsresult rv = NS_OK;
nsAutoString text;
@ -373,7 +388,7 @@ __try {
nsRefPtr<nsHyperTextAccessible> textAcc(do_QueryObject(this));
if (textAcc->IsDefunct())
return E_FAIL;
return CO_E_OBJNOTCONNECTED;
nsresult rv = NS_OK;
nsAutoString text;
@ -412,6 +427,8 @@ CAccessibleText::removeSelection(long aSelectionIndex)
{
__try {
nsRefPtr<nsHyperTextAccessible> textAcc(do_QueryObject(this));
if (textAcc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsresult rv = textAcc->RemoveSelection(aSelectionIndex);
return GetHRESULT(rv);
@ -425,6 +442,8 @@ CAccessibleText::setCaretOffset(long aOffset)
{
__try {
nsRefPtr<nsHyperTextAccessible> textAcc(do_QueryObject(this));
if (textAcc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsresult rv = textAcc->SetCaretOffset(aOffset);
return GetHRESULT(rv);
@ -439,6 +458,8 @@ CAccessibleText::setSelection(long aSelectionIndex, long aStartOffset,
{
__try {
nsRefPtr<nsHyperTextAccessible> textAcc(do_QueryObject(this));
if (textAcc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsresult rv = textAcc->SetSelectionBounds(aSelectionIndex,
aStartOffset, aEndOffset);
@ -456,7 +477,7 @@ __try {
nsRefPtr<nsHyperTextAccessible> textAcc(do_QueryObject(this));
if (textAcc->IsDefunct())
return E_FAIL;
return CO_E_OBJNOTCONNECTED;
*aNCharacters = textAcc->CharacterCount();
return S_OK;
@ -471,6 +492,8 @@ CAccessibleText::scrollSubstringTo(long aStartIndex, long aEndIndex,
{
__try {
nsRefPtr<nsHyperTextAccessible> textAcc(do_QueryObject(this));
if (textAcc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsresult rv = textAcc->ScrollSubstringTo(aStartIndex, aEndIndex, aScrollType);
return GetHRESULT(rv);
@ -486,6 +509,8 @@ CAccessibleText::scrollSubstringToPoint(long aStartIndex, long aEndIndex,
{
__try {
nsRefPtr<nsHyperTextAccessible> textAcc(do_QueryObject(this));
if (textAcc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
PRUint32 geckoCoordType = (aCoordType == IA2_COORDTYPE_SCREEN_RELATIVE) ?
nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE :

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

@ -53,7 +53,7 @@ CPPSRCS = \
nsTextAccessibleWrap.cpp \
nsDocAccessibleWrap.cpp \
nsHTMLWin32ObjectAccessible.cpp \
nsARIAGridAccessibleWrap.cpp \
ARIAGridAccessibleWrap.cpp \
nsRootAccessibleWrap.cpp \
nsXULMenuAccessibleWrap.cpp \
nsXULListboxAccessibleWrap.cpp \
@ -78,13 +78,13 @@ CPPSRCS = \
$(NULL)
EXPORTS = \
ARIAGridAccessibleWrap.h \
nsAccessNodeWrap.h \
nsAccessibleWrap.h \
nsTextAccessibleWrap.h \
nsDocAccessibleWrap.h \
nsRootAccessibleWrap.h \
nsHTMLWin32ObjectAccessible.h \
nsARIAGridAccessibleWrap.h \
nsXULMenuAccessibleWrap.h \
nsXULListboxAccessibleWrap.h \
nsXULTreeGridAccessibleWrap.h \

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

@ -73,7 +73,7 @@ __try {
nsAccessibleWrap* acc = static_cast<nsAccessibleWrap*>(this);
if (acc->IsDefunct())
return E_FAIL;
return CO_E_OBJNOTCONNECTED;
*aActionCount = acc->ActionCount();
return S_OK;
@ -88,7 +88,7 @@ ia2AccessibleAction::doAction(long aActionIndex)
__try {
nsAccessibleWrap* acc = static_cast<nsAccessibleWrap*>(this);
if (acc->IsDefunct())
return E_FAIL;
return CO_E_OBJNOTCONNECTED;
PRUint8 index = static_cast<PRUint8>(aActionIndex);
nsresult rv = acc->DoAction(index);
@ -106,7 +106,7 @@ __try {
nsAccessibleWrap* acc = static_cast<nsAccessibleWrap*>(this);
if (acc->IsDefunct())
return E_FAIL;
return CO_E_OBJNOTCONNECTED;
nsAutoString description;
PRUint8 index = static_cast<PRUint8>(aActionIndex);
@ -144,7 +144,7 @@ __try {
nsAccessibleWrap* acc = static_cast<nsAccessibleWrap*>(this);
if (acc->IsDefunct())
return E_FAIL;
return CO_E_OBJNOTCONNECTED;
// Expose keyboard shortcut if it's not exposed via MSAA keyboard shortcut.
KeyBinding keyBinding = acc->AccessKey();
@ -183,7 +183,7 @@ __try {
nsAccessibleWrap* acc = static_cast<nsAccessibleWrap*>(this);
if (acc->IsDefunct())
return E_FAIL;
return CO_E_OBJNOTCONNECTED;
nsAutoString name;
PRUint8 index = static_cast<PRUint8>(aActionIndex);

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

@ -168,9 +168,9 @@ __try {
*ppdispParent = NULL;
if (IsDefunct())
return E_FAIL;
return CO_E_OBJNOTCONNECTED;
nsRefPtr<nsDocAccessible> doc(do_QueryObject(this));
nsDocAccessible* doc = AsDoc();
if (doc) {
// Return window system accessible object for root document and tab document
// accessibles.
@ -210,7 +210,7 @@ __try {
*pcountChildren = 0;
if (IsDefunct())
return E_FAIL;
return CO_E_OBJNOTCONNECTED;
if (nsAccUtils::MustPrune(this))
return S_OK;
@ -228,7 +228,7 @@ STDMETHODIMP nsAccessibleWrap::get_accChild(
__try {
*ppdispChild = NULL;
if (IsDefunct())
return E_FAIL;
return CO_E_OBJNOTCONNECTED;
// IAccessible::accChild is used to return this accessible or child accessible
// at the given index or to get an accessible by child ID in the case of
@ -236,12 +236,17 @@ __try {
// on the document accessible). The getting an accessible by child ID is used
// by AccessibleObjectFromEvent() called by AT when AT handles our MSAA event.
nsAccessible* child = GetXPAccessibleFor(varChild);
if (child)
*ppdispChild = NativeAccessible(child);
if (!child)
return E_INVALIDARG;
if (child->IsDefunct())
return CO_E_OBJNOTCONNECTED;
*ppdispChild = NativeAccessible(child);
} __except(FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
return (*ppdispChild)? S_OK: E_INVALIDARG;
return S_OK;
}
STDMETHODIMP nsAccessibleWrap::get_accName(
@ -250,9 +255,17 @@ STDMETHODIMP nsAccessibleWrap::get_accName(
{
__try {
*pszName = NULL;
nsAccessible *xpAccessible = GetXPAccessibleFor(varChild);
if (IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsAccessible* xpAccessible = GetXPAccessibleFor(varChild);
if (!xpAccessible)
return E_FAIL;
return E_INVALIDARG;
if (xpAccessible->IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsAutoString name;
nsresult rv = xpAccessible->GetName(name);
if (NS_FAILED(rv))
@ -281,13 +294,21 @@ STDMETHODIMP nsAccessibleWrap::get_accValue(
__try {
*pszValue = NULL;
if (IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsAccessible* xpAccessible = GetXPAccessibleFor(varChild);
if (!xpAccessible || xpAccessible->IsDefunct())
return E_FAIL;
if (!xpAccessible)
return E_INVALIDARG;
if (xpAccessible->IsDefunct())
return CO_E_OBJNOTCONNECTED;
if (xpAccessible->NativeRole() == roles::PASSWORD_TEXT)
return E_ACCESSDENIED;
nsAutoString value;
if (NS_FAILED(xpAccessible->GetValue(value)))
return E_FAIL;
xpAccessible->Value(value);
// See bug 438784: need to expose URL on doc's value attribute. For this,
// reverting part of fix for bug 425693 to make this MSAA method behave
@ -310,9 +331,15 @@ nsAccessibleWrap::get_accDescription(VARIANT varChild,
__try {
*pszDescription = NULL;
nsAccessible *xpAccessible = GetXPAccessibleFor(varChild);
if (!xpAccessible || xpAccessible->IsDefunct())
return E_FAIL;
if (IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsAccessible* xpAccessible = GetXPAccessibleFor(varChild);
if (!xpAccessible)
return E_INVALIDARG;
if (xpAccessible->IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsAutoString description;
xpAccessible->Description(description);
@ -333,11 +360,14 @@ __try {
VariantInit(pvarRole);
if (IsDefunct())
return E_FAIL;
return CO_E_OBJNOTCONNECTED;
nsAccessible *xpAccessible = GetXPAccessibleFor(varChild);
nsAccessible* xpAccessible = GetXPAccessibleFor(varChild);
if (!xpAccessible)
return E_FAIL;
return E_INVALIDARG;
if (xpAccessible->IsDefunct())
return CO_E_OBJNOTCONNECTED;
#ifdef DEBUG_A11Y
NS_ASSERTION(nsAccUtils::IsTextInterfaceSupportCorrect(xpAccessible),
@ -410,9 +440,15 @@ __try {
pvarState->vt = VT_I4;
pvarState->lVal = 0;
nsAccessible *xpAccessible = GetXPAccessibleFor(varChild);
if (IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsAccessible* xpAccessible = GetXPAccessibleFor(varChild);
if (!xpAccessible)
return E_FAIL;
return E_INVALIDARG;
if (xpAccessible->IsDefunct())
return CO_E_OBJNOTCONNECTED;
// MSAA only has 31 states and the lowest 31 bits of our state bit mask
// are the same states as MSAA.
@ -467,9 +503,15 @@ __try {
return E_INVALIDARG;
*pszKeyboardShortcut = NULL;
if (IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsAccessible* acc = GetXPAccessibleFor(varChild);
if (!acc || acc->IsDefunct())
return E_FAIL;
if (!acc)
return E_INVALIDARG;
if (acc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
KeyBinding keyBinding = acc->AccessKey();
if (keyBinding.IsEmpty())
@ -496,7 +538,7 @@ STDMETHODIMP nsAccessibleWrap::get_accFocus(
// for the child object with the keyboard focus.
__try {
if (IsDefunct())
return E_FAIL;
return CO_E_OBJNOTCONNECTED;
VariantInit(pvarChild);
@ -670,6 +712,9 @@ __try {
VariantInit(pvarChildren);
pvarChildren->vt = VT_EMPTY;
if (IsDefunct())
return CO_E_OBJNOTCONNECTED;
if (IsSelect()) {
nsCOMPtr<nsIArray> selectedItems = SelectedItems();
if (selectedItems) {
@ -694,16 +739,24 @@ STDMETHODIMP nsAccessibleWrap::get_accDefaultAction(
{
__try {
*pszDefaultAction = NULL;
nsAccessible *xpAccessible = GetXPAccessibleFor(varChild);
if (xpAccessible) {
nsAutoString defaultAction;
if (NS_FAILED(xpAccessible->GetActionName(0, defaultAction)))
return E_FAIL;
*pszDefaultAction = ::SysAllocStringLen(defaultAction.get(),
defaultAction.Length());
return *pszDefaultAction ? S_OK : E_OUTOFMEMORY;
}
if (IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsAccessible* xpAccessible = GetXPAccessibleFor(varChild);
if (!xpAccessible)
return E_INVALIDARG;
if (xpAccessible->IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsAutoString defaultAction;
if (NS_FAILED(xpAccessible->GetActionName(0, defaultAction)))
return E_FAIL;
*pszDefaultAction = ::SysAllocStringLen(defaultAction.get(),
defaultAction.Length());
return *pszDefaultAction ? S_OK : E_OUTOFMEMORY;
} __except(FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
return E_FAIL;
@ -714,9 +767,16 @@ STDMETHODIMP nsAccessibleWrap::accSelect(
/* [optional][in] */ VARIANT varChild)
{
__try {
if (IsDefunct())
return CO_E_OBJNOTCONNECTED;
// currently only handle focus and selection
nsAccessible *xpAccessible = GetXPAccessibleFor(varChild);
NS_ENSURE_TRUE(xpAccessible, E_FAIL);
nsAccessible* xpAccessible = GetXPAccessibleFor(varChild);
if (!xpAccessible)
return E_INVALIDARG;
if (xpAccessible->IsDefunct())
return CO_E_OBJNOTCONNECTED;
if (flagsSelect & (SELFLAG_TAKEFOCUS|SELFLAG_TAKESELECTION|SELFLAG_REMOVESELECTION))
{
@ -750,19 +810,26 @@ STDMETHODIMP nsAccessibleWrap::accLocation(
/* [optional][in] */ VARIANT varChild)
{
__try {
nsAccessible *xpAccessible = GetXPAccessibleFor(varChild);
if (IsDefunct())
return CO_E_OBJNOTCONNECTED;
if (xpAccessible) {
PRInt32 x, y, width, height;
if (NS_FAILED(xpAccessible->GetBounds(&x, &y, &width, &height)))
return E_FAIL;
nsAccessible* xpAccessible = GetXPAccessibleFor(varChild);
if (!xpAccessible)
return E_INVALIDARG;
if (xpAccessible->IsDefunct())
return CO_E_OBJNOTCONNECTED;
PRInt32 x, y, width, height;
if (NS_FAILED(xpAccessible->GetBounds(&x, &y, &width, &height)))
return E_FAIL;
*pxLeft = x;
*pyTop = y;
*pcxWidth = width;
*pcyHeight = height;
return S_OK;
*pxLeft = x;
*pyTop = y;
*pcxWidth = width;
*pcyHeight = height;
return S_OK;
}
} __except(FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
return E_FAIL;
@ -777,9 +844,15 @@ __try {
if (!pvarEndUpAt)
return E_INVALIDARG;
if (IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsAccessible* accessible = GetXPAccessibleFor(varStart);
if (!accessible || accessible->IsDefunct())
return E_FAIL;
if (!accessible)
return E_INVALIDARG;
if (accessible->IsDefunct())
return CO_E_OBJNOTCONNECTED;
VariantInit(pvarEndUpAt);
@ -884,8 +957,9 @@ STDMETHODIMP nsAccessibleWrap::accHitTest(
{
__try {
VariantInit(pvarChild);
if (IsDefunct())
return E_FAIL;
return CO_E_OBJNOTCONNECTED;
nsAccessible* accessible = ChildAtPoint(xLeft, yTop, eDirectChild);
@ -913,12 +987,20 @@ STDMETHODIMP nsAccessibleWrap::accDoDefaultAction(
/* [optional][in] */ VARIANT varChild)
{
__try {
nsAccessible *xpAccessible = GetXPAccessibleFor(varChild);
if (!xpAccessible || FAILED(xpAccessible->DoAction(0))) {
return E_FAIL;
}
if (IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsAccessible* xpAccessible = GetXPAccessibleFor(varChild);
if (!xpAccessible)
return E_INVALIDARG;
if (xpAccessible->IsDefunct())
return CO_E_OBJNOTCONNECTED;
return GetHRESULT(xpAccessible->DoAction(0));
} __except(nsAccessNodeWrap::FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
return S_OK;
return E_FAIL;
}
STDMETHODIMP nsAccessibleWrap::put_accName(
@ -1033,7 +1115,7 @@ __try {
*aNRelations = 0;
if (IsDefunct())
return E_FAIL;
return CO_E_OBJNOTCONNECTED;
for (PRUint32 relType = nsIAccessibleRelation::RELATION_FIRST;
relType <= nsIAccessibleRelation::RELATION_LAST; relType++) {
@ -1057,7 +1139,7 @@ __try {
*aRelation = NULL;
if (IsDefunct())
return E_FAIL;
return CO_E_OBJNOTCONNECTED;
PRUint32 relIdx = 0;
for (PRUint32 relType = nsIAccessibleRelation::RELATION_FIRST;
@ -1092,7 +1174,7 @@ __try {
*aNRelations = 0;
if (IsDefunct())
return E_FAIL;
return CO_E_OBJNOTCONNECTED;
for (PRUint32 relType = nsIAccessibleRelation::RELATION_FIRST;
relType <= nsIAccessibleRelation::RELATION_LAST &&
@ -1118,7 +1200,7 @@ __try {
*aRole = 0;
if (IsDefunct())
return E_FAIL;
return CO_E_OBJNOTCONNECTED;
NS_ASSERTION(gWindowsRoleMap[roles::LAST_ENTRY].ia2Role == ROLE_WINDOWS_LAST_ENTRY,
"MSAA role map skewed");
@ -1144,6 +1226,9 @@ STDMETHODIMP
nsAccessibleWrap::scrollTo(enum IA2ScrollType aScrollType)
{
__try {
if (IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsAccessNode::ScrollTo(aScrollType);
return S_OK;
@ -1156,6 +1241,9 @@ nsAccessibleWrap::scrollToPoint(enum IA2CoordinateType aCoordType,
long aX, long aY)
{
__try {
if (IsDefunct())
return CO_E_OBJNOTCONNECTED;
PRUint32 geckoCoordType = (aCoordType == IA2_COORDTYPE_SCREEN_RELATIVE) ?
nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE :
nsIAccessibleCoordinateType::COORDTYPE_PARENT_RELATIVE;
@ -1173,6 +1261,9 @@ nsAccessibleWrap::get_groupPosition(long *aGroupLevel,
long *aPositionInGroup)
{
__try {
if (IsDefunct())
return CO_E_OBJNOTCONNECTED;
PRInt32 groupLevel = 0;
PRInt32 similarItemsInGroup = 0;
PRInt32 positionInGroup = 0;
@ -1204,6 +1295,9 @@ nsAccessibleWrap::get_states(AccessibleStates *aStates)
__try {
*aStates = 0;
if (IsDefunct())
return CO_E_OBJNOTCONNECTED;
// XXX: bug 344674 should come with better approach that we have here.
PRUint64 state = State();
@ -1326,7 +1420,7 @@ __try {
*aWindowHandle = 0;
if (IsDefunct())
return E_FAIL;
return CO_E_OBJNOTCONNECTED;
*aWindowHandle = GetHWNDFor(this);
return S_OK;
@ -1344,7 +1438,7 @@ __try {
*aIndexInParent = -1;
if (IsDefunct())
return E_FAIL;
return CO_E_OBJNOTCONNECTED;
*aIndexInParent = IndexInParent();
if (*aIndexInParent == -1)
@ -1364,6 +1458,9 @@ __try {
// Two-letter primary codes are reserved for [ISO639] language abbreviations.
// Any two-letter subcode is understood to be a [ISO3166] country code.
if (IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsAutoString lang;
Language(lang);
@ -1407,6 +1504,9 @@ nsAccessibleWrap::get_attributes(BSTR *aAttributes)
__try {
*aAttributes = NULL;
if (IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsCOMPtr<nsIPersistentProperties> attributes;
nsresult rv = GetAttributes(getter_AddRefs(attributes));
if (NS_FAILED(rv))

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

@ -102,6 +102,9 @@ nsApplicationAccessibleWrap::get_appName(BSTR *aName)
__try {
*aName = NULL;
if (IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsAutoString name;
nsresult rv = GetAppName(name);
if (NS_FAILED(rv))
@ -123,6 +126,9 @@ nsApplicationAccessibleWrap::get_appVersion(BSTR *aVersion)
__try {
*aVersion = NULL;
if (IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsAutoString version;
nsresult rv = GetAppVersion(version);
if (NS_FAILED(rv))
@ -142,6 +148,9 @@ STDMETHODIMP
nsApplicationAccessibleWrap::get_toolkitName(BSTR *aName)
{
__try {
if (IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsAutoString name;
nsresult rv = GetPlatformName(name);
if (NS_FAILED(rv))
@ -163,6 +172,9 @@ nsApplicationAccessibleWrap::get_toolkitVersion(BSTR *aVersion)
__try {
*aVersion = NULL;
if (IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsAutoString version;
nsresult rv = GetPlatformVersion(version);
if (NS_FAILED(rv))

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

@ -38,13 +38,19 @@
*
* ***** END LICENSE BLOCK ***** */
#ifndef _NSARIAGRIDACCESSIBLEWRAP_H
#define _NSARIAGRIDACCESSIBLEWRAP_H
#ifndef MOZILLA_A11Y_ARIAGRIDACCESSIBLEWRAP_H
#define MOZILLA_A11Y_ARIAGRIDACCESSIBLEWRAP_H
#include "nsARIAGridAccessible.h"
#include "ARIAGridAccessible.h"
typedef class nsARIAGridAccessible nsARIAGridAccessibleWrap;
typedef class nsARIAGridCellAccessible nsARIAGridCellAccessibleWrap;
namespace mozilla {
namespace a11y {
typedef class ARIAGridAccessible ARIAGridAccessibleWrap;
typedef class ARIAGridCellAccessible ARIAGridCellAccessibleWrap;
} // namespace a11y
} // namespace mozilla
#endif

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

@ -54,8 +54,8 @@ CPPSRCS = \
$(NULL)
EXPORTS = \
ARIAGridAccessibleWrap.h \
nsAccessNodeWrap.h \
nsARIAGridAccessibleWrap.h \
nsTextAccessibleWrap.h \
nsAccessibleWrap.h \
nsDocAccessibleWrap.h \

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

@ -145,16 +145,6 @@ nsXFormsAccessible::CacheSelectChildren(nsIDOMNode *aContainerNode)
}
}
// nsIAccessible
NS_IMETHODIMP
nsXFormsAccessible::GetValue(nsAString& aValue)
{
NS_ENSURE_TRUE(sXFormsService, NS_ERROR_FAILURE);
nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
return sXFormsService->GetValue(DOMNode, aValue);
}
PRUint64
nsXFormsAccessible::NativeState()
{
@ -213,6 +203,13 @@ nsXFormsAccessible::Description(nsString& aDescription)
GetBoundChildElementValue(NS_LITERAL_STRING("hint"), aDescription);
}
void
nsXFormsAccessible::Value(nsString& aValue)
{
nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
sXFormsService->GetValue(DOMNode, aValue);
}
bool
nsXFormsAccessible::CanHaveAnonChildren()
{
@ -545,11 +542,11 @@ nsXFormsSelectableItemAccessible::
{
}
NS_IMETHODIMP
nsXFormsSelectableItemAccessible::GetValue(nsAString& aValue)
void
nsXFormsSelectableItemAccessible::Value(nsString& aValue)
{
nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
return sXFormsService->GetValue(DOMNode, aValue);
sXFormsService->GetValue(DOMNode, aValue);
}
PRUint8

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

@ -72,15 +72,13 @@ class nsXFormsAccessible : public nsHyperTextAccessibleWrap,
public:
nsXFormsAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsIAccessible
// Returns value of instance node that xforms element is bound to.
NS_IMETHOD GetValue(nsAString& aValue);
// nsAccessible
// Returns value of child xforms 'hint' element.
virtual void Description(nsString& aDescription);
// Returns value of instance node that xforms element is bound to.
virtual void Value(nsString& aValue);
// Returns value of child xforms 'label' element.
virtual nsresult GetNameInternal(nsAString& aName);
@ -189,9 +187,11 @@ public:
nsXFormsSelectableItemAccessible(nsIContent* aContent,
nsDocAccessible* aDoc);
NS_IMETHOD GetValue(nsAString& aValue);
NS_IMETHOD DoAction(PRUint8 aIndex);
// nsAccessible
virtual void Value(nsString& aValue);
// ActionAccessible
virtual PRUint8 ActionCount();

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

@ -109,11 +109,10 @@ nsXFormsTriggerAccessible::NativeRole()
return roles::PUSHBUTTON;
}
NS_IMETHODIMP
nsXFormsTriggerAccessible::GetValue(nsAString& aValue)
void
nsXFormsTriggerAccessible::Value(nsString& aValue)
{
aValue.Truncate();
return NS_OK;
}
PRUint8
@ -295,10 +294,10 @@ nsXFormsSecretAccessible::NativeState()
return nsXFormsInputAccessible::NativeState() | states::PROTECTED;
}
NS_IMETHODIMP
nsXFormsSecretAccessible::GetValue(nsAString& aValue)
void
nsXFormsSecretAccessible::Value(nsString& aValue)
{
return NS_ERROR_FAILURE;
aValue.Truncate();
}
@ -438,11 +437,10 @@ nsXFormsChoicesAccessible::NativeRole()
return roles::GROUPING;
}
NS_IMETHODIMP
nsXFormsChoicesAccessible::GetValue(nsAString& aValue)
void
nsXFormsChoicesAccessible::Value(nsString& aValue)
{
aValue.Truncate();
return NS_OK;
}
void

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

@ -79,12 +79,11 @@ public:
nsXFormsTriggerAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsIAccessible
NS_IMETHOD GetValue(nsAString& aValue);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 aIndex);
// nsAccessible
virtual void Value(nsString& aValue);
virtual mozilla::a11y::role NativeRole();
// ActionAccessible
@ -156,10 +155,8 @@ class nsXFormsSecretAccessible : public nsXFormsInputAccessible
public:
nsXFormsSecretAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsIAccessible
NS_IMETHOD GetValue(nsAString& aValue);
// nsAccessible
virtual void Value(nsString& aValue);
virtual mozilla::a11y::role NativeRole();
virtual PRUint64 NativeState();
};
@ -211,9 +208,9 @@ public:
nsXFormsChoicesAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsIAccessible
NS_IMETHOD GetValue(nsAString& aValue);
// nsAccessible
virtual void Value(nsString& aValue);
virtual mozilla::a11y::role NativeRole();
protected:

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

@ -162,13 +162,6 @@ nsXFormsComboboxPopupWidgetAccessible::NativeState()
return state;
}
NS_IMETHODIMP
nsXFormsComboboxPopupWidgetAccessible::GetValue(nsAString& aValue)
{
aValue.Truncate();
return NS_OK;
}
nsresult
nsXFormsComboboxPopupWidgetAccessible::GetNameInternal(nsAString& aName)
{
@ -183,6 +176,12 @@ nsXFormsComboboxPopupWidgetAccessible::Description(nsString& aDescription)
aDescription.Truncate();
}
void
nsXFormsComboboxPopupWidgetAccessible::Value(nsString& aValue)
{
aValue.Truncate();
}
void
nsXFormsComboboxPopupWidgetAccessible::CacheChildren()
{

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

@ -91,11 +91,9 @@ public:
nsXFormsComboboxPopupWidgetAccessible(nsIContent* aContent,
nsDocAccessible* aDoc);
// nsIAccessible
NS_IMETHOD GetValue(nsAString& aValue);
// nsAccessible
virtual void Description(nsString& aDescription);
virtual void Value(nsString& aValue);
virtual nsresult GetNameInternal(nsAString& aName);
virtual mozilla::a11y::role NativeRole();
virtual PRUint64 NativeState();

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

@ -63,16 +63,12 @@ nsXULColorPickerTileAccessible::
////////////////////////////////////////////////////////////////////////////////
// nsXULColorPickerTileAccessible: nsIAccessible
NS_IMETHODIMP
nsXULColorPickerTileAccessible::GetValue(nsAString& aValue)
void
nsXULColorPickerTileAccessible::Value(nsString& aValue)
{
aValue.Truncate();
if (IsDefunct())
return NS_ERROR_FAILURE;
mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::color, aValue);
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////

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

@ -50,10 +50,8 @@ public:
nsXULColorPickerTileAccessible(nsIContent* aContent,
nsDocAccessible* aDoc);
// nsIAccessible
NS_IMETHOD GetValue(nsAString& _retval);
// nsAccessible
virtual void Value(nsString& aValue);
virtual mozilla::a11y::role NativeRole();
virtual PRUint64 NativeState();

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

@ -103,22 +103,6 @@ nsXULComboboxAccessible::NativeState()
return states;
}
NS_IMETHODIMP
nsXULComboboxAccessible::GetValue(nsAString& aValue)
{
aValue.Truncate();
if (IsDefunct())
return NS_ERROR_FAILURE;
// The value is the option or text shown entered in the combobox.
nsCOMPtr<nsIDOMXULMenuListElement> menuList(do_QueryInterface(mContent));
if (menuList)
return menuList->GetLabel(aValue);
return NS_ERROR_FAILURE;
}
void
nsXULComboboxAccessible::Description(nsString& aDescription)
{
@ -139,6 +123,17 @@ nsXULComboboxAccessible::Description(nsString& aDescription)
}
}
void
nsXULComboboxAccessible::Value(nsString& aValue)
{
aValue.Truncate();
// The value is the option or text shown entered in the combobox.
nsCOMPtr<nsIDOMXULMenuListElement> menuList(do_QueryInterface(mContent));
if (menuList)
menuList->GetLabel(aValue);
}
bool
nsXULComboboxAccessible::CanHaveAnonChildren()
{

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

@ -53,12 +53,12 @@ public:
nsXULComboboxAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsIAccessible
NS_IMETHOD GetValue(nsAString& aValue);
NS_IMETHOD DoAction(PRUint8 aIndex);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
// nsAccessible
virtual void Description(nsString& aDescription);
virtual void Value(nsString& aValue);
virtual mozilla::a11y::role NativeRole();
virtual PRUint64 NativeState();
virtual bool CanHaveAnonChildren();

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

@ -728,25 +728,22 @@ NS_IMPL_ISUPPORTS_INHERITED3(nsXULTextFieldAccessible, nsAccessible, nsHyperText
////////////////////////////////////////////////////////////////////////////////
// nsXULTextFieldAccessible: nsIAccessible
NS_IMETHODIMP nsXULTextFieldAccessible::GetValue(nsAString& aValue)
void
nsXULTextFieldAccessible::Value(nsString& aValue)
{
if (IsDefunct())
return NS_ERROR_FAILURE;
PRUint64 state = NativeState();
if (state & states::PROTECTED) // Don't return password text!
return NS_ERROR_FAILURE;
aValue.Truncate();
if (NativeRole() == roles::PASSWORD_TEXT) // Don't return password text!
return;
nsCOMPtr<nsIDOMXULTextBoxElement> textBox(do_QueryInterface(mContent));
if (textBox) {
return textBox->GetValue(aValue);
textBox->GetValue(aValue);
return;
}
nsCOMPtr<nsIDOMXULMenuListElement> menuList(do_QueryInterface(mContent));
if (menuList) {
return menuList->GetLabel(aValue);
}
return NS_ERROR_FAILURE;
if (menuList)
menuList->GetLabel(aValue);
}
void

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

@ -254,7 +254,6 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIAccessible
NS_IMETHOD GetValue(nsAString& aValue);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
@ -262,6 +261,7 @@ public:
virtual already_AddRefed<nsIEditor> GetEditor() const;
// nsAccessible
virtual void Value(nsString& aValue);
virtual void ApplyARIAState(PRUint64* aState);
virtual mozilla::a11y::role NativeRole();
virtual PRUint64 NativeState();

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

@ -210,17 +210,18 @@ nsXULListboxAccessible::NativeState()
/**
* Our value is the label of our ( first ) selected child.
*/
NS_IMETHODIMP nsXULListboxAccessible::GetValue(nsAString& _retval)
void
nsXULListboxAccessible::Value(nsString& aValue)
{
_retval.Truncate();
aValue.Truncate();
nsCOMPtr<nsIDOMXULSelectControlElement> select(do_QueryInterface(mContent));
if (select) {
nsCOMPtr<nsIDOMXULSelectControlItemElement> selectedItem;
select->GetSelectedItem(getter_AddRefs(selectedItem));
if (selectedItem)
return selectedItem->GetLabel(_retval);
selectedItem->GetLabel(aValue);
}
return NS_ERROR_FAILURE;
}
role

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

@ -104,13 +104,11 @@ public:
// nsIAccessibleTable
NS_DECL_OR_FORWARD_NSIACCESSIBLETABLE_WITH_XPCACCESSIBLETABLE
// nsIAccessible
NS_IMETHOD GetValue(nsAString& aValue);
// nsAccessNode
virtual void Shutdown();
// nsAccessible
virtual void Value(nsString& aValue);
virtual mozilla::a11y::TableAccessible* AsTable() { return this; }
virtual mozilla::a11y::role NativeRole();
virtual PRUint64 NativeState();

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

@ -92,10 +92,10 @@ nsXULSliderAccessible::NativeState()
// nsIAccessible
NS_IMETHODIMP
nsXULSliderAccessible::GetValue(nsAString& aValue)
void
nsXULSliderAccessible::Value(nsString& aValue)
{
return GetSliderAttr(nsGkAtoms::curpos, aValue);
GetSliderAttr(nsGkAtoms::curpos, aValue);
}
PRUint8

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

@ -55,7 +55,6 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIAccessible
NS_IMETHOD GetValue(nsAString& aValue);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 aIndex);
@ -63,6 +62,7 @@ public:
NS_DECL_NSIACCESSIBLEVALUE
// nsAccessible
virtual void Value(nsString& aValue);
virtual mozilla::a11y::role NativeRole();
virtual PRUint64 NativeState();
virtual bool CanHaveAnonChildren();

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

@ -187,10 +187,10 @@ nsXULTabsAccessible::ActionCount()
return 0;
}
/** no value */
NS_IMETHODIMP nsXULTabsAccessible::GetValue(nsAString& _retval)
void
nsXULTabsAccessible::Value(nsString& aValue)
{
return NS_OK;
aValue.Truncate();
}
nsresult

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

@ -76,10 +76,8 @@ class nsXULTabsAccessible : public XULSelectControlAccessible
public:
nsXULTabsAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
// nsIAccessible
NS_IMETHOD GetValue(nsAString& _retval);
// nsAccessible
virtual void Value(nsString& aValue);
virtual nsresult GetNameInternal(nsAString& aName);
virtual mozilla::a11y::role NativeRole();

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

@ -151,16 +151,12 @@ NS_IMPL_ISUPPORTS_INHERITED1(nsXULLinkAccessible, nsHyperTextAccessibleWrap,
////////////////////////////////////////////////////////////////////////////////
// nsXULLinkAccessible. nsIAccessible
NS_IMETHODIMP
nsXULLinkAccessible::GetValue(nsAString& aValue)
void
nsXULLinkAccessible::Value(nsString& aValue)
{
aValue.Truncate();
if (IsDefunct())
return NS_ERROR_FAILURE;
mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::href, aValue);
return NS_OK;
}
nsresult

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

@ -81,12 +81,11 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIAccessible
NS_IMETHOD GetValue(nsAString& aValue);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 aIndex);
// nsAccessible
virtual void Value(nsString& aValue);
virtual nsresult GetNameInternal(nsAString& aName);
virtual mozilla::a11y::role NativeRole();
virtual PRUint64 NativeState();

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

@ -143,20 +143,17 @@ nsXULTreeAccessible::NativeState()
return state;
}
NS_IMETHODIMP
nsXULTreeAccessible::GetValue(nsAString& aValue)
void
nsXULTreeAccessible::Value(nsString& aValue)
{
// Return the value is the first selected child.
aValue.Truncate();
if (IsDefunct() || !mTreeView)
return NS_ERROR_FAILURE;
nsCOMPtr<nsITreeSelection> selection;
mTreeView->GetSelection(getter_AddRefs(selection));
if (!selection)
return NS_ERROR_FAILURE;
return;
PRInt32 currentIndex;
nsCOMPtr<nsIDOMElement> selectItem;
@ -169,10 +166,9 @@ nsXULTreeAccessible::GetValue(nsAString& aValue)
if (cols)
cols->GetKeyColumn(getter_AddRefs(keyCol));
return mTreeView->GetCellText(currentIndex, keyCol, aValue);
mTreeView->GetCellText(currentIndex, keyCol, aValue);
}
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////

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

@ -74,13 +74,11 @@ public:
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsXULTreeAccessible,
nsAccessible)
// nsIAccessible
NS_IMETHOD GetValue(nsAString& aValue);
// nsAccessNode
virtual void Shutdown();
// nsAccessible
virtual void Value(nsString& aValue);
virtual mozilla::a11y::role NativeRole();
virtual PRUint64 NativeState();
virtual nsAccessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,

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

@ -1,16 +1,6 @@
function testValue(aID, aAcc, aValue, aRole)
{
if (aRole == ROLE_PASSWORD_TEXT) {
var value;
try {
value = aAcc.value;
do_throw("We do not want a value on " + aID + "!");
} catch(e) {
is(e.result, Components.results.NS_ERROR_FAILURE,
"Wrong return value for getValue on " + aID + "!");
}
} else
is(aAcc.value, aValue, "Wrong value for " + aID + "!");
is(aAcc.value, aValue, "Wrong value for " + aID + "!");
}
function testAction(aID, aAcc, aNumActions, aActionName, aActionDescription)

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

@ -237,7 +237,9 @@
@BINPATH@/components/pref.xpt
@BINPATH@/components/prefetch.xpt
@BINPATH@/components/profile.xpt
#ifdef MOZ_ENABLE_PROFILER_SPS
@BINPATH@/components/profiler.xpt
#endif
@BINPATH@/components/proxyObject.xpt
@BINPATH@/components/rdf.xpt
@BINPATH@/components/satchel.xpt

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

@ -26,6 +26,11 @@ let gBrowserThumbnails = {
_tabEvents: ["TabClose", "TabSelect"],
init: function Thumbnails_init() {
try {
if (Services.prefs.getBoolPref("browser.pagethumbnails.capturing_disabled"))
return;
} catch (e) {}
gBrowser.addTabsProgressListener(this);
this._tabEvents.forEach(function (aEvent) {
@ -93,6 +98,9 @@ let gBrowserThumbnails = {
},
_shouldCapture: function Thumbnails_shouldCapture(aBrowser) {
if (gPrivateBrowsingUI.privateBrowsingEnabled)
return false;
let doc = aBrowser.contentDocument;
// FIXME Bug 720575 - Don't capture thumbnails for SVG or XML documents as

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

@ -1192,7 +1192,7 @@ GroupItem.prototype = Utils.extend(new Item(), new Subscribable(), {
addAppTab: function GroupItem_addAppTab(xulTab, options) {
GroupItems.getAppTabFavIconUrl(xulTab, function(iconUrl) {
// The tab might have been removed or unpinned while waiting.
if (xulTab.closing || !xulTab.parentNode || !xulTab.pinned)
if (!Utils.isValidXULTab(xulTab) || !xulTab.pinned)
return;
let self = this;

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

@ -636,6 +636,15 @@ let Utils = {
return object instanceof Ci.nsIDOMElement;
},
// ----------
// Function: isValidXULTab
// A xulTab is valid if it has not been closed,
// and it has not been removed from the DOM
// Returns true if the tab is valid.
isValidXULTab: function Utils_isValidXULTab(xulTab) {
return !xulTab.closing && xulTab.parentNode;
},
// ----------
// Function: isNumber
// Returns true if the argument is a valid number.

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

@ -239,7 +239,7 @@ TabItem.prototype = Utils.extend(new Item(), new Subscribable(), {
// Store persistent for this object.
save: function TabItem_save() {
try {
if (!this.tab || this.tab.parentNode == null || !this._reconnected) // too soon/late to save
if (!this.tab || !Utils.isValidXULTab(this.tab) || !this._reconnected) // too soon/late to save
return;
let data = this.getStorageData();
@ -571,7 +571,7 @@ TabItem.prototype = Utils.extend(new Item(), new Subscribable(), {
Utils.assert(Utils.isRect(this.bounds), 'TabItem.setBounds: this.bounds is not a real rectangle!');
if (!this.parent && this.tab.parentNode != null)
if (!this.parent && Utils.isValidXULTab(this.tab))
this.setTrenches(rect);
this.save();

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

@ -60,7 +60,7 @@ let AllTabs = {
},
get tabs() {
return Array.filter(gBrowser.tabs, function (tab) !tab.closing);
return Array.filter(gBrowser.tabs, function (tab) Utils.isValidXULTab(tab));
},
register: function AllTabs_register(eventName, callback) {

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

@ -791,7 +791,7 @@ let UI = {
if (gBrowser.tabs.length > 1) {
// Don't return to TabView if there are any app tabs
for (let a = 0; a < gBrowser._numPinnedTabs; a++) {
if (!gBrowser.tabs[a].closing)
if (Utils.isValidXULTab(gBrowser.tabs[a]))
return;
}

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

@ -1,25 +0,0 @@
. $topsrcdir/build/macosx/universal/mozconfig
# Universal builds override the default of browser (bug 575283 comment 29)
ac_add_options --enable-application=browser
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --enable-update-packaging
ac_add_options --enable-codesighs
ac_add_options --disable-install-strip
ac_add_options --enable-signmar
# Nightlies only since this has a cost in performance
ac_add_options --enable-js-diagnostics
# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1
export MOZ_TELEMETRY_REPORTING=1
mk_add_options MOZ_MAKE_FLAGS="-j12"
ac_add_options --with-macbundlename-prefix=Firefox
# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
ac_add_options --enable-warnings-as-errors
ac_add_options --with-ccache

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

@ -1,20 +0,0 @@
. $topsrcdir/build/macosx/universal/mozconfig
# Universal builds override the default of browser (bug 575283 comment 29)
ac_add_options --enable-application=browser
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --enable-update-packaging
ac_add_options --enable-official-branding
# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1
export MOZ_TELEMETRY_REPORTING=1
# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
ac_add_options --enable-warnings-as-errors
# Enable parallel compiling
mk_add_options MOZ_MAKE_FLAGS="-j4"
ac_add_options --with-ccache

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

@ -1,26 +0,0 @@
# Just like nightlies, but without tests, not on an update channel, and with
# shark and dtrace enabled
. $topsrcdir/build/macosx/universal/mozconfig
# Universal builds override the default of browser (bug 575283 comment 29)
ac_add_options --enable-application=browser
ac_add_options --disable-tests
ac_add_options --disable-install-strip
# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1
# Enable parallel compiling
mk_add_options MOZ_MAKE_FLAGS="-j12"
# shark specific options
ac_add_options --enable-shark
ac_add_options --enable-dtrace
# Need this to prevent name conflicts with the normal nightly build packages
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

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

@ -16,12 +16,13 @@ ac_add_options --enable-js-diagnostics
export MOZILLA_OFFICIAL=1
export MOZ_TELEMETRY_REPORTING=1
mk_add_options MOZ_MAKE_FLAGS="-j4"
mk_add_options MOZ_MAKE_FLAGS="-j12"
ac_add_options --with-macbundlename-prefix=Firefox
# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
ac_add_options --enable-warnings-as-errors
ac_add_options --with-ccache
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1

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

@ -12,7 +12,7 @@ ac_add_options --disable-install-strip
export MOZILLA_OFFICIAL=1
# Enable parallel compiling
mk_add_options MOZ_MAKE_FLAGS="-j4"
mk_add_options MOZ_MAKE_FLAGS="-j12"
# shark specific options
ac_add_options --enable-shark
@ -23,3 +23,4 @@ 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

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

@ -1,13 +0,0 @@
. $topsrcdir/build/macosx/mozconfig.leopard
ac_add_options --enable-debug
ac_add_options --enable-trace-malloc
ac_add_options --enable-signmar
# Enable parallel compiling
mk_add_options MOZ_MAKE_FLAGS="-j12"
# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1
ac_add_options --with-macbundlename-prefix=Firefox
ac_add_options --with-ccache

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

@ -4,12 +4,13 @@ ac_add_options --enable-trace-malloc
ac_add_options --enable-signmar
# Enable parallel compiling
mk_add_options MOZ_MAKE_FLAGS="-j4"
mk_add_options MOZ_MAKE_FLAGS="-j12"
# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1
ac_add_options --with-macbundlename-prefix=Firefox
ac_add_options --with-ccache
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1

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

@ -1,18 +0,0 @@
. $topsrcdir/build/macosx/common
ac_add_options --enable-debug
ac_add_options --enable-trace-malloc
ac_add_options --enable-accessibility
ac_add_options --enable-signmar
# Enable parallel compiling
mk_add_options MOZ_MAKE_FLAGS="-j12"
# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1
ac_add_options --with-macbundlename-prefix=Firefox
# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
ac_add_options --enable-warnings-as-errors
ac_add_options --with-ccache

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

@ -1,5 +0,0 @@
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

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

@ -6,7 +6,7 @@ ac_add_options --enable-accessibility
ac_add_options --enable-signmar
# Enable parallel compiling
mk_add_options MOZ_MAKE_FLAGS="-j4"
mk_add_options MOZ_MAKE_FLAGS="-j12"
# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1
@ -15,6 +15,7 @@ ac_add_options --with-macbundlename-prefix=Firefox
# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
ac_add_options --enable-warnings-as-errors
ac_add_options --with-ccache
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1

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

@ -2,3 +2,4 @@ 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

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

@ -242,7 +242,9 @@
@BINPATH@/components/pref.xpt
@BINPATH@/components/prefetch.xpt
@BINPATH@/components/profile.xpt
#ifdef MOZ_ENABLE_PROFILER_SPS
@BINPATH@/components/profiler.xpt
#endif
@BINPATH@/components/rdf.xpt
@BINPATH@/components/satchel.xpt
@BINPATH@/components/saxparser.xpt

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

@ -405,11 +405,6 @@ MY_RULES := $(DEPTH)/config/myrules.mk
CCC = $(CXX)
PURIFY = purify $(PURIFYOPTIONS)
QUANTIFY = quantify $(QUANTIFYOPTIONS)
ifdef CROSS_COMPILE
XPIDL_COMPILE = $(LIBXUL_DIST)/host/bin/host_xpidl$(HOST_BIN_SUFFIX)
else
XPIDL_COMPILE = $(LIBXUL_DIST)/bin/xpidl$(BIN_SUFFIX)
endif
XPIDL_LINK = $(PYTHON) $(LIBXUL_DIST)/sdk/bin/xpt.py link
# Java macros

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

@ -7230,7 +7230,7 @@ if test "$OS_TARGET" = Android; then
WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=dlopen,--wrap=dlclose,--wrap=dlerror,--wrap=dlsym,--wrap=dladdr"
fi
WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=getaddrinfo,--wrap=freeaddrinfo,--wrap=gai_strerror"
WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=fork,--wrap=pthread_atfork"
WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=fork,--wrap=pthread_atfork,--wrap=raise"
fi
dnl ========================================================

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

@ -585,6 +585,36 @@ nsDOMMutationObserver::Disconnect()
return NS_OK;
}
NS_IMETHODIMP
nsDOMMutationObserver::TakeRecords(nsIVariant** aRetVal)
{
*aRetVal = TakeRecords().get();
return NS_OK;
}
already_AddRefed<nsIVariant>
nsDOMMutationObserver::TakeRecords()
{
nsCOMPtr<nsIWritableVariant> mutations =
do_CreateInstance("@mozilla.org/variant;1");
PRInt32 len = mPendingMutations.Count();
if (len == 0) {
mutations->SetAsEmptyArray();
} else {
nsTArray<nsIDOMMutationRecord*> mods(len);
for (PRInt32 i = 0; i < len; ++i) {
mods.AppendElement(mPendingMutations[i]);
}
mutations->SetAsArray(nsIDataType::VTYPE_INTERFACE,
&NS_GET_IID(nsIDOMMutationRecord),
mods.Length(),
const_cast<void*>(
static_cast<const void*>(mods.Elements())));
mPendingMutations.Clear();
}
return mutations.forget();
}
NS_IMETHODIMP
nsDOMMutationObserver::Initialize(nsISupports* aOwner, JSContext* cx,
@ -639,21 +669,8 @@ nsDOMMutationObserver::HandleMutation()
mPendingMutations.Clear();
return;
}
PRInt32 len = mPendingMutations.Count();
nsTArray<nsIDOMMutationRecord*> mods(len);
for (PRInt32 i = 0; i < len; ++i) {
mods.AppendElement(mPendingMutations[i]);
}
nsCOMPtr<nsIWritableVariant> mutations =
do_CreateInstance("@mozilla.org/variant;1");
mutations->SetAsArray(nsIDataType::VTYPE_INTERFACE,
&NS_GET_IID(nsIDOMMutationRecord),
mods.Length(),
const_cast<void*>(
static_cast<const void*>(mods.Elements())));
mPendingMutations.Clear();
nsCOMPtr<nsIVariant> mutations = TakeRecords();
nsAutoMicroTask mt;
sCurrentObserver = this; // For 'this' handling.
mCallback->HandleMutations(mutations, this);

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

@ -152,7 +152,7 @@ protected:
nsMutationReceiverBase(nsINode* aRegisterTarget,
nsMutationReceiverBase* aParent)
: mTarget(nsnull), mObserver(nsnull), mParent(aParent),
mRegisterTarget(aRegisterTarget)
mRegisterTarget(aRegisterTarget), mKungFuDeathGrip(aParent->Target())
{
NS_ASSERTION(mParent->Subtree(), "Should clone a non-subtree observer!");
mRegisterTarget->AddMutationObserver(this);
@ -195,6 +195,9 @@ protected:
// This is different than mTarget when dealing with transient observers.
nsINode* mRegisterTarget;
nsCOMArray<nsMutationReceiverBase> mTransientReceivers;
// While we have transient receivers, keep the original mutation receiver
// alive so it doesn't go away and disconnect all its transient receivers.
nsCOMPtr<nsINode> mKungFuDeathGrip;
private:
bool mSubtree;
@ -317,6 +320,8 @@ protected:
nsMutationReceiver* GetReceiverFor(nsINode* aNode, bool aMayCreate);
void RemoveReceiver(nsMutationReceiver* aReceiver);
already_AddRefed<nsIVariant> TakeRecords();
void GetAllSubtreeObserversFor(nsINode* aNode,
nsTArray<nsMutationReceiver*>& aObservers);
void ScheduleForRun();

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

@ -665,7 +665,7 @@ nsRange::ComparePoint(nsIDOMNode* aParent, PRInt32 aOffset, PRInt16* aResult)
return NS_ERROR_DOM_INVALID_NODE_TYPE_ERR;
}
if (aOffset < 0 || aOffset > parent->Length()) {
if (aOffset < 0 || PRUint32(aOffset) > parent->Length()) {
return NS_ERROR_DOM_INDEX_SIZE_ERR;
}
@ -929,7 +929,7 @@ nsRange::SetStart(nsINode* aParent, PRInt32 aOffset)
nsINode* newRoot = IsValidBoundary(aParent);
NS_ENSURE_TRUE(newRoot, NS_ERROR_DOM_INVALID_NODE_TYPE_ERR);
if (aOffset < 0 || aOffset > aParent->Length()) {
if (aOffset < 0 || PRUint32(aOffset) > aParent->Length()) {
return NS_ERROR_DOM_INDEX_SIZE_ERR;
}
@ -993,7 +993,7 @@ nsRange::SetEnd(nsINode* aParent, PRInt32 aOffset)
nsINode* newRoot = IsValidBoundary(aParent);
NS_ENSURE_TRUE(newRoot, NS_ERROR_DOM_INVALID_NODE_TYPE_ERR);
if (aOffset < 0 || aOffset > aParent->Length()) {
if (aOffset < 0 || PRUint32(aOffset) > aParent->Length()) {
return NS_ERROR_DOM_INDEX_SIZE_ERR;
}

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

@ -477,7 +477,45 @@ function testModalDialog() {
div.innerHTML = "<span><span>foo</span></span>";
window.showModalDialog("mutationobserver_dialog.html");
ok(didHandleCallback, "Should have called the callback while showing modal dialog!");
then();
then(testTakeRecords);
}
function testTakeRecords() {
var s = "<span>1</span><span>2</span>";
div.innerHTML = s;
var takenRecords;
m = new M(function(records, observer) {
is(records.length, 3, "Should have got 3 records");
is(records[0].type, "attributes", "Should have got attributes");
is(records[0].attributeName, "foo", "");
is(records[1].type, "childList", "Should have got childList");
is(records[1].removedNodes.length, 2, "Should have got removedNodes");
is(records[1].addedNodes.length, 2, "Should have got addedNodes");
is(records[2].type, "attributes", "Should have got attributes");
is(records[2].attributeName, "foo", "");
is(records.length, takenRecords.length, "Should have had similar mutations");
is(records[0].type, takenRecords[0].type, "Should have had similar mutations");
is(records[1].type, takenRecords[1].type, "Should have had similar mutations");
is(records[2].type, takenRecords[2].type, "Should have had similar mutations");
is(records[1].removedNodes.length, takenRecords[1].removedNodes.length, "Should have had similar mutations");
is(records[1].addedNodes.length, takenRecords[1].addedNodes.length, "Should have had similar mutations");
is(m.takeRecords().length, 0, "Shouldn't have any records");
observer.disconnect();
then();
m = null;
});
m.observe(div, { childList: true, attributes: true });
div.setAttribute("foo", "bar");
div.innerHTML = s;
div.removeAttribute("foo");
takenRecords = m.takeRecords();
div.setAttribute("foo", "bar");
div.innerHTML = s;
div.removeAttribute("foo");
}
SimpleTest.waitForExplicitFinish();

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

@ -1167,7 +1167,7 @@ public:
return mCachedMaxUshortElement;
} else {
mHasCachedMaxUshortElement = true;
mCachedMaxUshortElement = FindMaxElementInSubArray<GLshort>(mByteLength>>1, 0);
mCachedMaxUshortElement = FindMaxElementInSubArray<GLushort>(mByteLength>>1, 0);
return mCachedMaxUshortElement;
}
}

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

@ -560,15 +560,15 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
nsIContentSink* aSink)
{
if (!aCommand) {
MOZ_NOT_REACHED("Command is mandatory");
MOZ_ASSERT(false, "Command is mandatory");
return NS_ERROR_INVALID_POINTER;
}
if (aSink) {
MOZ_NOT_REACHED("Got a sink override. Should not happen for HTML doc.");
MOZ_ASSERT(false, "Got a sink override. Should not happen for HTML doc.");
return NS_ERROR_INVALID_ARG;
}
if (!mIsRegularHTML) {
MOZ_NOT_REACHED("Must not set HTML doc to XHTML mode before load start.");
MOZ_ASSERT(false, "Must not set HTML doc to XHTML mode before load start.");
return NS_ERROR_DOM_INVALID_STATE_ERR;
}
@ -580,7 +580,7 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
bool viewSource = !strcmp(aCommand, "view-source");
bool asData = !strcmp(aCommand, kLoadAsData);
if(!(view || viewSource || asData)) {
MOZ_NOT_REACHED("Bad parser command");
MOZ_ASSERT(false, "Bad parser command");
return NS_ERROR_INVALID_ARG;
}
@ -595,7 +595,7 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
contentType.EqualsLiteral(TEXT_JAVASCRIPT) ||
contentType.EqualsLiteral(APPLICATION_JSON));
if (!(html || xhtml || plainText || viewSource)) {
MOZ_NOT_REACHED("Channel with bad content type.");
MOZ_ASSERT(false, "Channel with bad content type.");
return NS_ERROR_INVALID_ARG;
}

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

@ -372,8 +372,15 @@ nsScreen::MozLockOrientation(const nsAString& aOrientation, bool* aReturn)
}
if (!IsChromeType(GetOwner()->GetDocShell())) {
nsCOMPtr<nsIDOMDocument> doc;
GetOwner()->GetDocument(getter_AddRefs(doc));
if (!doc) {
*aReturn = false;
return NS_OK;
}
bool fullscreen;
GetOwner()->GetFullScreen(&fullscreen);
doc->GetMozFullScreen(&fullscreen);
if (!fullscreen) {
*aReturn = false;
return NS_OK;

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

@ -51,10 +51,10 @@ function testSteps()
new Date(2),
new Date(1000),
new Date("1971-01-01"),
new Date("1971-01-01T01:01:01"),
new Date("1971-01-01T01:01:01.001"),
new Date("1971-01-01T01:01:01.01"),
new Date("1971-01-01T01:01:01.1"),
new Date("1971-01-01T01:01:01Z"),
new Date("1971-01-01T01:01:01.001Z"),
new Date("1971-01-01T01:01:01.01Z"),
new Date("1971-01-01T01:01:01.1Z"),
new Date("1980-02-02"),
new Date("3333-03-19T03:33:33.333"),
"",

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

@ -56,12 +56,13 @@ dictionary MutationObserverInit
};
//[Constructor(in nsIMutationCallback aDoneCallback)]
[scriptable, builtinclass, uuid(daeba265-9aa7-45ab-8de2-b6b039c13ced)]
[scriptable, builtinclass, uuid(156e2ce4-e44a-45f3-92c2-e6611f391dae)]
interface nsIDOMMozMutationObserver : nsISupports
{
[implicit_jscontext]
void observe(in nsIDOMNode aTarget, in jsval aOptions);
void disconnect();
nsIVariant takeRecords();
};
[scriptable, function, uuid(fb539590-b088-4d07-96ff-2cefbc90a198)]

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

@ -382,7 +382,6 @@ nsNPAPIPlugin::RunPluginOOP(const nsPluginTag *aPluginTag)
// Java plugins include a number of different file names,
// so use the mime type (mIsJavaPlugin) and a special pref.
bool javaIsEnabled;
if (aPluginTag->mIsJavaPlugin &&
!Preferences::GetBool("dom.ipc.plugins.java.enabled", true)) {
return false;

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

@ -1815,17 +1815,7 @@ void nsPluginInstanceOwner::RemovePluginView()
if (!surface)
return;
JNIEnv* env = GetJNIForThread();
if (!env)
return;
AndroidBridge::AutoLocalJNIFrame frame(env, 1);
jclass cls = env->FindClass("org/mozilla/gecko/GeckoAppShell");
jmethodID method = env->GetStaticMethodID(cls,
"removePluginView",
"(Landroid/view/View;)V");
env->CallStaticVoidMethod(cls, method, surface);
AndroidBridge::RemovePluginView(surface);
}
void nsPluginInstanceOwner::Invalidate() {

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

@ -4304,7 +4304,7 @@ nsHTMLEditor::GetNextHTMLSibling(nsIDOMNode *inParent, PRInt32 inOffset, nsCOMPt
NS_ENSURE_TRUE(outNode && inParent, NS_ERROR_NULL_POINTER);
nsresult res = NS_OK;
*outNode = nsnull;
nsCOMPtr<nsIDOMNode> node = nsEditor::GetChildAt(inParent,inOffset);
nsCOMPtr<nsIDOMNode> node = nsEditor::GetChildAt(inParent, inOffset + 1);
if (!node) {
// return null sibling if no sibling
return NS_OK;
@ -4314,7 +4314,7 @@ nsHTMLEditor::GetNextHTMLSibling(nsIDOMNode *inParent, PRInt32 inOffset, nsCOMPt
return res;
}
// else
return GetPriorHTMLSibling(node, outNode);
return GetNextHTMLSibling(node, outNode);
}

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

@ -12,7 +12,6 @@
<script type="application/javascript">
<![CDATA[
SimpleTest.waitForExplicitFinish();
SimpleTest.ignoreAllUncaughtExceptions();
function getMisspelledWords(editor) {
return editor.selectionController.getSelection(Components.interfaces.nsISelectionController.SELECTION_SPELLCHECK).toString();
@ -36,7 +35,9 @@ function setCurrentDictionary(editor, dictionary) {
}
function RunTest() {
var editor = document.getElementById('textbox').editor;
var textbox = document.getElementById('textbox');
textbox.focus();
var editor = textbox.editor;
var dir = Components.classes["@mozilla.org/file/directory_service;1"].
getService(Components.interfaces.nsIProperties).

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

@ -234,6 +234,10 @@ ffs (int x)
}
#endif
#elif defined(__WIN32__) && defined(__GNUC__)
#define ffs(x) __builtin_ffs(x)
#endif
#if defined(_MSC_VER) && defined(_M_IX86)

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

@ -0,0 +1,25 @@
diff --git a/gfx/cairo/cairo/src/cairo-compiler-private.h b/gfx/cairo/cairo/src/cairo-compiler-private.h
index ffac9ce..9a05831 100644
--- a/gfx/cairo/cairo/src/cairo-compiler-private.h
+++ b/gfx/cairo/cairo/src/cairo-compiler-private.h
@@ -229,16 +229,20 @@ ffs (int x)
if (_BitScanForward(&i, x) != 0)
return i + 1;
return 0;
}
#endif
+#elif defined(__WIN32__) && defined(__GNUC__)
+
+#define ffs(x) __builtin_ffs(x)
+
#endif
#if defined(_MSC_VER) && defined(_M_IX86)
/* When compiling with /Gy and /OPT:ICF identical functions will be folded in together.
The CAIRO_ENSURE_UNIQUE macro ensures that a function is always unique and
will never be folded into another one. Something like this might eventually
be needed for GCC but it seems fine for now. */
#define CAIRO_ENSURE_UNIQUE \

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

@ -501,8 +501,6 @@ CreateOffscreenPBufferContext(const gfxIntSize& aSize,
A_(0);
#undef A_
printf_stderr("colorbits: %d alpha: %d depth: %d stencil: %d\n", aFormat.colorBits(), aFormat.alpha, aFormat.depth, aFormat.stencil);
NSOpenGLPixelFormat *pbFormat = [[NSOpenGLPixelFormat alloc]
initWithAttributes:attribs.Elements()];
if (!pbFormat) {
@ -552,7 +550,6 @@ CreateOffscreenPBufferContext(const gfxIntSize& aSize,
{
GLint l;
[pbFormat getValues:&l forAttribute:NSOpenGLPFADepthSize forVirtualScreen:[context currentVirtualScreen]];
printf_stderr("*** depth: %d (req: %d)\n", l, aFormat.depth);
}
[pbFormat release];

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

@ -1500,24 +1500,25 @@ struct GlyphBufferAzure {
if (invFontMatrix) {
// The brush matrix needs to be multiplied with the inverted matrix
// as well, to move the brush into the space of the glyphs. Before
// the render target transformation
// as well, to move the brush into the space of the glyphs. Before
// the render target transformation
// This relies on the returned Pattern not to be reused by
// others, but regenerated on GetPattern calls. This is true!
Matrix *mat;
Matrix *mat = nsnull;
if (pat->GetType() == PATTERN_LINEAR_GRADIENT) {
mat = &static_cast<LinearGradientPattern*>(pat)->mMatrix;
} else if (pat->GetType() == PATTERN_RADIAL_GRADIENT) {
mat = &static_cast<LinearGradientPattern*>(pat)->mMatrix;
mat = &static_cast<RadialGradientPattern*>(pat)->mMatrix;
} else if (pat->GetType() == PATTERN_SURFACE) {
mat = &static_cast<LinearGradientPattern*>(pat)->mMatrix;
mat = &static_cast<SurfacePattern*>(pat)->mMatrix;
}
*mat = (*mat) * (*invFontMatrix);
if (mat) {
*mat = (*mat) * (*invFontMatrix);
}
}
aDT->FillGlyphs(aFont, buf, *pat,
DrawOptions(), aOptions);
} else if (state.sourceSurface) {

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

@ -168,7 +168,7 @@ MacOSFontEntry::MacOSFontEntry(const nsAString& aPostscriptName,
enum eComplexScript {
eComplexScriptArabic,
eComplexScriptIndic,
eComplexScriptTibetan
eComplexScriptLaoTibetan
};
struct ScriptRange {
@ -180,9 +180,9 @@ struct ScriptRange {
const ScriptRange gScriptsThatRequireShaping[] = {
{ eComplexScriptArabic, 0x0600, 0x077F }, // Basic Arabic, Syriac, Arabic Supplement
{ eComplexScriptIndic, 0x0900, 0x0D7F }, // Indic scripts - Devanagari, Bengali, ..., Malayalam
{ eComplexScriptTibetan, 0x0F00, 0x0FFF } // Tibetan
{ eComplexScriptLaoTibetan, 0x0E80, 0x0FFF } // Lao, Tibetan
// Thai seems to be "renderable" without AAT morphing tables
// xxx - Lao, Khmer?
// xxx - Khmer?
};
nsresult

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