This commit is contained in:
David Anderson 2012-08-22 16:09:24 -07:00
Родитель c50adec55d 845651448b
Коммит 3b9fed8952
4341 изменённых файлов: 61701 добавлений и 58313 удалений

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

@ -53,7 +53,7 @@ public:
* @param aEvent [in] accessible event type
* @param aTarget [in] target of accessible event
*/
virtual void FireAccessibleEvent(PRUint32 aEvent, Accessible* aTarget) = 0;
virtual void FireAccessibleEvent(uint32_t aEvent, Accessible* aTarget) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIAccessibilityService,

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

@ -246,23 +246,23 @@ interface nsIAccessible : nsISupports
/**
* The number of accessible actions associated with this accessible
*/
readonly attribute PRUint8 actionCount;
readonly attribute uint8_t actionCount;
/**
* The name of the accessible action at the given zero-based index
*/
AString getActionName(in PRUint8 index);
AString getActionName(in uint8_t index);
/**
* The description of the accessible action at the given zero-based index
*/
AString getActionDescription(in PRUint8 aIndex);
AString getActionDescription(in uint8_t aIndex);
/**
* Perform the accessible action at the given zero-based index
* Action number 0 is the default action
*/
void doAction(in PRUint8 index);
void doAction(in uint8_t index);
/**
* Makes an object visible on screen.

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

@ -17,8 +17,8 @@ interface nsIAccessibleText : nsISupports
// In parameters for character offsets:
// -1 will be treated as the equal to the end of the text
// -2 will be treated as the caret position
const PRInt32 TEXT_OFFSET_END_OF_TEXT = -1;
const PRInt32 TEXT_OFFSET_CARET = -2;
const int32_t TEXT_OFFSET_END_OF_TEXT = -1;
const int32_t TEXT_OFFSET_CARET = -2;
const AccessibleTextBoundary BOUNDARY_CHAR = 0;
const AccessibleTextBoundary BOUNDARY_WORD_START = 1;

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

@ -141,8 +141,8 @@ struct MaiAtkObjectClass
static guint mai_atk_object_signals [LAST_SIGNAL] = { 0, };
#ifdef MAI_LOGGING
PRInt32 sMaiAtkObjCreated = 0;
PRInt32 sMaiAtkObjDeleted = 0;
int32_t sMaiAtkObjCreated = 0;
int32_t sMaiAtkObjDeleted = 0;
#endif
G_BEGIN_DECLS
@ -198,8 +198,8 @@ static AtkRelationSet* refRelationSetCB(AtkObject *aAtkObj);
*/
G_END_DECLS
static GType GetMaiAtkType(PRUint16 interfacesBits);
static const char * GetUniqueMaiAtkTypeName(PRUint16 interfacesBits);
static GType GetMaiAtkType(uint16_t interfacesBits);
static const char * GetUniqueMaiAtkTypeName(uint16_t interfacesBits);
static gpointer parent_class = NULL;
@ -232,8 +232,8 @@ mai_atk_object_get_type(void)
}
#ifdef MAI_LOGGING
PRInt32 AccessibleWrap::mAccWrapCreated = 0;
PRInt32 AccessibleWrap::mAccWrapDeleted = 0;
int32_t AccessibleWrap::mAccWrapCreated = 0;
int32_t AccessibleWrap::mAccWrapDeleted = 0;
#endif
AccessibleWrap::
@ -363,10 +363,10 @@ AccessibleWrap::GetAtkObject(nsIAccessible* acc)
}
/* private */
PRUint16
uint16_t
AccessibleWrap::CreateMaiInterfaces(void)
{
PRUint16 interfacesBits = 0;
uint16_t interfacesBits = 0;
// The Component interface is supported by all accessibles.
interfacesBits |= 1 << MAI_INTERFACE_COMPONENT;
@ -422,7 +422,7 @@ AccessibleWrap::CreateMaiInterfaces(void)
}
static GType
GetMaiAtkType(PRUint16 interfacesBits)
GetMaiAtkType(uint16_t interfacesBits)
{
GType type;
static const GTypeInfo tinfo = {
@ -454,7 +454,7 @@ GetMaiAtkType(PRUint16 interfacesBits)
* gobject limits the number of types that can directly derive from any
* given object type to 4095.
*/
static PRUint16 typeRegCount = 0;
static uint16_t typeRegCount = 0;
if (typeRegCount++ >= 4095) {
return G_TYPE_INVALID;
}
@ -462,7 +462,7 @@ GetMaiAtkType(PRUint16 interfacesBits)
atkTypeName,
&tinfo, GTypeFlags(0));
for (PRUint32 index = 0; index < ArrayLength(atk_if_infos); index++) {
for (uint32_t index = 0; index < ArrayLength(atk_if_infos); index++) {
if (interfacesBits & (1 << index)) {
g_type_add_interface_static(type,
GetAtkTypeForMai((MaiInterfaceType)index),
@ -474,9 +474,9 @@ GetMaiAtkType(PRUint16 interfacesBits)
}
static const char*
GetUniqueMaiAtkTypeName(PRUint16 interfacesBits)
GetUniqueMaiAtkTypeName(uint16_t interfacesBits)
{
#define MAI_ATK_TYPE_NAME_LEN (30) /* 10+sizeof(PRUint16)*8/4+1 < 30 */
#define MAI_ATK_TYPE_NAME_LEN (30) /* 10+sizeof(uint16_t)*8/4+1 < 30 */
static gchar namePrefix[] = "MaiAtkType"; /* size = 10 */
static gchar name[MAI_ATK_TYPE_NAME_LEN + 1];
@ -848,12 +848,12 @@ getIndexInParentCB(AtkObject *aAtkObj)
}
static void
TranslateStates(PRUint64 aState, AtkStateSet* aStateSet)
TranslateStates(uint64_t aState, AtkStateSet* aStateSet)
{
// Convert every state to an entry in AtkStateMap
PRUint32 stateIndex = 0;
PRUint64 bitMask = 1;
uint32_t stateIndex = 0;
uint64_t bitMask = 1;
while (gAtkStateMap[stateIndex].stateMapEntryType != kNoSuchState) {
if (gAtkStateMap[stateIndex].atkState) { // There's potentially an ATK state for this
bool isStateOn = (aState & bitMask) != 0;
@ -897,7 +897,7 @@ refRelationSetCB(AtkObject *aAtkObj)
if (!accWrap)
return relation_set;
PRUint32 relationTypes[] = {
uint32_t relationTypes[] = {
nsIAccessibleRelation::RELATION_LABELLED_BY,
nsIAccessibleRelation::RELATION_LABEL_FOR,
nsIAccessibleRelation::RELATION_NODE_CHILD_OF,
@ -910,7 +910,7 @@ refRelationSetCB(AtkObject *aAtkObj)
nsIAccessibleRelation::RELATION_DESCRIPTION_FOR,
};
for (PRUint32 i = 0; i < ArrayLength(relationTypes); i++) {
for (uint32_t i = 0; i < ArrayLength(relationTypes); i++) {
AtkRelationType atkType = static_cast<AtkRelationType>(relationTypes[i]);
AtkRelation* atkRelation =
atk_relation_set_get_relation_by_type(relation_set, atkType);
@ -969,7 +969,7 @@ AccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
Accessible* accessible = aEvent->GetAccessible();
NS_ENSURE_TRUE(accessible, NS_ERROR_FAILURE);
PRUint32 type = aEvent->GetEventType();
uint32_t type = aEvent->GetEventType();
AtkObject* atkObj = AccessibleWrap::GetAtkObject(accessible);
@ -1062,7 +1062,7 @@ AccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
if (!caretMoveEvent)
break;
PRInt32 caretOffset = caretMoveEvent->GetCaretOffset();
int32_t caretOffset = caretMoveEvent->GetCaretOffset();
MAI_LOG_DEBUG(("\n\nCaret postion: %d", caretOffset));
g_signal_emit_by_name(atkObj,
@ -1089,8 +1089,8 @@ AccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
AccTableChangeEvent* tableEvent = downcast_accEvent(aEvent);
NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);
PRInt32 rowIndex = tableEvent->GetIndex();
PRInt32 numRows = tableEvent->GetCount();
int32_t rowIndex = tableEvent->GetIndex();
int32_t numRows = tableEvent->GetCount();
g_signal_emit_by_name(atkObj,
"row_inserted",
@ -1106,8 +1106,8 @@ AccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
AccTableChangeEvent* tableEvent = downcast_accEvent(aEvent);
NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);
PRInt32 rowIndex = tableEvent->GetIndex();
PRInt32 numRows = tableEvent->GetCount();
int32_t rowIndex = tableEvent->GetIndex();
int32_t numRows = tableEvent->GetCount();
g_signal_emit_by_name(atkObj,
"row_deleted",
@ -1130,8 +1130,8 @@ AccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
AccTableChangeEvent* tableEvent = downcast_accEvent(aEvent);
NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);
PRInt32 colIndex = tableEvent->GetIndex();
PRInt32 numCols = tableEvent->GetCount();
int32_t colIndex = tableEvent->GetIndex();
int32_t numCols = tableEvent->GetCount();
g_signal_emit_by_name(atkObj,
"column_inserted",
@ -1147,8 +1147,8 @@ AccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
AccTableChangeEvent* tableEvent = downcast_accEvent(aEvent);
NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);
PRInt32 colIndex = tableEvent->GetIndex();
PRInt32 numCols = tableEvent->GetCount();
int32_t colIndex = tableEvent->GetIndex();
int32_t numCols = tableEvent->GetCount();
g_signal_emit_by_name(atkObj,
"column_deleted",
@ -1273,7 +1273,7 @@ AccessibleWrap::FireAtkStateChangeEvent(AccEvent* aEvent,
NS_ENSURE_TRUE(event, NS_ERROR_FAILURE);
bool isEnabled = event->IsStateEnabled();
PRInt32 stateIndex = AtkStateMap::GetStateIndexFor(event->GetState());
int32_t stateIndex = AtkStateMap::GetStateIndexFor(event->GetState());
if (stateIndex >= 0) {
NS_ASSERTION(gAtkStateMap[stateIndex].stateMapEntryType != kNoSuchState,
"No such state");
@ -1304,8 +1304,8 @@ AccessibleWrap::FireAtkTextChangedEvent(AccEvent* aEvent,
AccTextChangeEvent* event = downcast_accEvent(aEvent);
NS_ENSURE_TRUE(event, NS_ERROR_FAILURE);
PRInt32 start = event->GetStartOffset();
PRUint32 length = event->GetLength();
int32_t start = event->GetStartOffset();
uint32_t length = event->GetLength();
bool isInserted = event->IsTextInserted();
bool isFromUserInput = aEvent->IsFromUserInput();
char* signal_name = nullptr;
@ -1346,7 +1346,7 @@ AccessibleWrap::FireAtkShowHideEvent(AccEvent* aEvent,
MAI_LOG_DEBUG(("\n\nReceived: Hide event\n"));
}
PRInt32 indexInParent = getIndexInParentCB(aObject);
int32_t indexInParent = getIndexInParentCB(aObject);
AtkObject *parentObject = getParentCB(aObject);
NS_ENSURE_STATE(parentObject);

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

@ -36,7 +36,7 @@ enum AtkProperty {
};
struct AtkPropertyChange {
PRInt32 type; // property type as listed above
int32_t type; // property type as listed above
void *oldvalue;
void *newvalue;
};
@ -59,8 +59,8 @@ public:
#ifdef MAI_LOGGING
virtual void DumpAccessibleWrapInfo(int aDepth) {}
static PRInt32 mAccWrapCreated;
static PRInt32 mAccWrapDeleted;
static int32_t mAccWrapCreated;
static int32_t mAccWrapDeleted;
#endif
// return the atk object for this AccessibleWrap
@ -107,7 +107,7 @@ private:
static EAvailableAtkSignals gAvailableAtkSignals;
PRUint16 CreateMaiInterfaces(void);
uint16_t CreateMaiInterfaces(void);
};
#endif /* __NS_ACCESSIBLE_WRAP_H__ */

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

@ -690,7 +690,7 @@ ApplicationAccessibleWrap::GetNativeInterface(void** aOutAccessible)
struct AtkRootAccessibleAddedEvent {
AtkObject *app_accessible;
AtkObject *root_accessible;
PRUint32 index;
uint32_t index;
};
gboolean fireRootAccessibleAddedCB(gpointer data)
@ -714,7 +714,7 @@ ApplicationAccessibleWrap::AppendChild(Accessible* aChild)
AtkObject* atkAccessible = AccessibleWrap::GetAtkObject(aChild);
atk_object_set_parent(atkAccessible, mAtkObject);
PRUint32 count = mChildren.Length();
uint32_t count = mChildren.Length();
// Emit children_changed::add in a timeout
// to make sure aRootAccWrap is fully initialized.
@ -735,7 +735,7 @@ ApplicationAccessibleWrap::AppendChild(Accessible* aChild)
bool
ApplicationAccessibleWrap::RemoveChild(Accessible* aChild)
{
PRInt32 index = aChild->IndexInParent();
int32_t index = aChild->IndexInParent();
AtkObject* atkAccessible = AccessibleWrap::GetAtkObject(aChild);
atk_object_set_parent(atkAccessible, NULL);
@ -795,8 +795,8 @@ LoadGtkModule(GnomeAccessibilityModule& aModule)
MAI_LOG_DEBUG(("Current Lib path=%s\n", libPath.get()));
PR_FreeLibraryName(curLibPath);
PRInt16 loc1 = 0, loc2 = 0;
PRInt16 subLen = 0;
int16_t loc1 = 0, loc2 = 0;
int16_t subLen = 0;
while (loc2 >= 0) {
loc2 = libPath.FindChar(':', loc1);
if (loc2 < 0)

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

@ -77,7 +77,7 @@ getExtentsHelper(AccessibleWrap* aAccWrap,
if (!aAccWrap || aAccWrap->IsDefunct())
return;
PRInt32 x = 0, y = 0, width = 0, height = 0;
int32_t x = 0, y = 0, width = 0, height = 0;
// Returned in screen coordinates
nsresult rv = aAccWrap->GetBounds(&x, &y, &width, &height);
if (NS_FAILED(rv))

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

@ -71,7 +71,7 @@ insertTextCB(AtkEditableText *aText,
// interface changed in nsIAccessibleEditableText.idl ???
//
// PRInt32 pos = *aPosition;
// int32_t pos = *aPosition;
// nsresult rv = accText->InsertText(strContent, aLength, &pos);
// *aPosition = pos;

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

@ -58,7 +58,7 @@ getLinkIndexCB(AtkHypertext *aText, gint aCharIndex)
HyperTextAccessible* hyperText = accWrap->AsHyperText();
NS_ENSURE_TRUE(hyperText, -1);
PRInt32 index = -1;
int32_t index = -1;
nsresult rv = hyperText->GetLinkIndexAtOffset(aCharIndex, &index);
NS_ENSURE_SUCCESS(rv, -1);

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

@ -25,7 +25,7 @@ getImagePositionCB(AtkImage* aImage, gint* aAccX, gint* aAccY,
return;
ImageAccessible* image = accWrap->AsImage();
PRUint32 geckoCoordType = (aCoordType == ATK_XY_WINDOW) ?
uint32_t geckoCoordType = (aCoordType == ATK_XY_WINDOW) ?
nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE :
nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE;
// Returned in screen coordinates

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

@ -66,7 +66,7 @@ getColumnAtIndexCB(AtkTable *aTable, gint aIndex)
getter_AddRefs(accTable));
NS_ENSURE_TRUE(accTable, -1);
PRInt32 col;
int32_t col;
nsresult rv = accTable->GetColumnIndexAt(aIndex, &col);
NS_ENSURE_SUCCESS(rv, -1);
@ -85,7 +85,7 @@ getRowAtIndexCB(AtkTable *aTable, gint aIndex)
getter_AddRefs(accTable));
NS_ENSURE_TRUE(accTable, -1);
PRInt32 row;
int32_t row;
nsresult rv = accTable->GetRowIndexAt(aIndex, &row);
NS_ENSURE_SUCCESS(rv, -1);
@ -104,7 +104,7 @@ getColumnCountCB(AtkTable *aTable)
getter_AddRefs(accTable));
NS_ENSURE_TRUE(accTable, -1);
PRInt32 count;
int32_t count;
nsresult rv = accTable->GetColumnCount(&count);
NS_ENSURE_SUCCESS(rv, -1);
@ -123,7 +123,7 @@ getRowCountCB(AtkTable *aTable)
getter_AddRefs(accTable));
NS_ENSURE_TRUE(accTable, -1);
PRInt32 count;
int32_t count;
nsresult rv = accTable->GetRowCount(&count);
NS_ENSURE_SUCCESS(rv, -1);
@ -143,7 +143,7 @@ getColumnExtentAtCB(AtkTable *aTable,
getter_AddRefs(accTable));
NS_ENSURE_TRUE(accTable, -1);
PRInt32 extent;
int32_t extent;
nsresult rv = accTable->GetColumnExtentAt(aRow, aColumn, &extent);
NS_ENSURE_SUCCESS(rv, -1);
@ -163,7 +163,7 @@ getRowExtentAtCB(AtkTable *aTable,
getter_AddRefs(accTable));
NS_ENSURE_TRUE(accTable, -1);
PRInt32 extent;
int32_t extent;
nsresult rv = accTable->GetRowExtentAt(aRow, aColumn, &extent);
NS_ENSURE_SUCCESS(rv, -1);
@ -328,8 +328,8 @@ getSelectedColumnsCB(AtkTable *aTable, gint **aSelected)
getter_AddRefs(accTable));
NS_ENSURE_TRUE(accTable, 0);
PRUint32 size = 0;
PRInt32 *columns = NULL;
uint32_t size = 0;
int32_t *columns = NULL;
nsresult rv = accTable->GetSelectedColumnIndices(&size, &columns);
if (NS_FAILED(rv) || (size == 0) || !columns) {
*aSelected = nullptr;
@ -343,7 +343,7 @@ getSelectedColumnsCB(AtkTable *aTable, gint **aSelected)
}
//copy
for (PRUint32 index = 0; index < size; ++index)
for (uint32_t index = 0; index < size; ++index)
atkColumns[index] = static_cast<gint>(columns[index]);
nsMemory::Free(columns);
@ -363,8 +363,8 @@ getSelectedRowsCB(AtkTable *aTable, gint **aSelected)
getter_AddRefs(accTable));
NS_ENSURE_TRUE(accTable, 0);
PRUint32 size = 0;
PRInt32 *rows = NULL;
uint32_t size = 0;
int32_t *rows = NULL;
nsresult rv = accTable->GetSelectedRowIndices(&size, &rows);
if (NS_FAILED(rv) || (size == 0) || !rows) {
*aSelected = nullptr;
@ -378,7 +378,7 @@ getSelectedRowsCB(AtkTable *aTable, gint **aSelected)
}
//copy
for (PRUint32 index = 0; index < size; ++index)
for (uint32_t index = 0; index < size; ++index)
atkRows[index] = static_cast<gint>(rows[index]);
nsMemory::Free(rows);

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

@ -20,7 +20,7 @@ ConvertTexttoAsterisks(AccessibleWrap* accWrap, nsAString& aString)
{
// convert each char to "*" when it's "password text"
if (accWrap->NativeRole() == roles::PASSWORD_TEXT) {
for (PRUint32 i = 0; i < aString.Length(); i++)
for (uint32_t i = 0; i < aString.Length(); i++)
aString.Replace(i, 1, NS_LITERAL_STRING("*"));
}
}
@ -65,7 +65,7 @@ getTextAfterOffsetCB(AtkText *aText, gint aOffset,
NS_ENSURE_TRUE(accText, nullptr);
nsAutoString autoStr;
PRInt32 startOffset = 0, endOffset = 0;
int32_t startOffset = 0, endOffset = 0;
nsresult rv =
accText->GetTextAfterOffset(aOffset, aBoundaryType,
&startOffset, &endOffset, autoStr);
@ -94,7 +94,7 @@ getTextAtOffsetCB(AtkText *aText, gint aOffset,
NS_ENSURE_TRUE(accText, nullptr);
nsAutoString autoStr;
PRInt32 startOffset = 0, endOffset = 0;
int32_t startOffset = 0, endOffset = 0;
nsresult rv =
accText->GetTextAtOffset(aOffset, aBoundaryType,
&startOffset, &endOffset, autoStr);
@ -149,7 +149,7 @@ getTextBeforeOffsetCB(AtkText *aText, gint aOffset,
NS_ENSURE_TRUE(accText, nullptr);
nsAutoString autoStr;
PRInt32 startOffset = 0, endOffset = 0;
int32_t startOffset = 0, endOffset = 0;
nsresult rv =
accText->GetTextBeforeOffset(aOffset, aBoundaryType,
&startOffset, &endOffset, autoStr);
@ -175,7 +175,7 @@ getCaretOffsetCB(AtkText *aText)
getter_AddRefs(accText));
NS_ENSURE_TRUE(accText, 0);
PRInt32 offset;
int32_t offset;
nsresult rv = accText->GetCaretOffset(&offset);
return (NS_FAILED(rv)) ? 0 : static_cast<gint>(offset);
}
@ -198,7 +198,7 @@ getRunAttributesCB(AtkText *aText, gint aOffset,
NS_ENSURE_TRUE(accText, nullptr);
nsCOMPtr<nsIPersistentProperties> attributes;
PRInt32 startOffset = 0, endOffset = 0;
int32_t startOffset = 0, endOffset = 0;
nsresult rv = accText->GetTextAttributes(false, aOffset,
&startOffset, &endOffset,
getter_AddRefs(attributes));
@ -246,10 +246,10 @@ getCharacterExtentsCB(AtkText *aText, gint aOffset,
if (!accText)
return;
PRInt32 extY = 0, extX = 0;
PRInt32 extWidth = 0, extHeight = 0;
int32_t extY = 0, extX = 0;
int32_t extWidth = 0, extHeight = 0;
PRUint32 geckoCoordType;
uint32_t geckoCoordType;
if (aCoords == ATK_XY_SCREEN)
geckoCoordType = nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE;
else
@ -283,10 +283,10 @@ getRangeExtentsCB(AtkText *aText, gint aStartOffset, gint aEndOffset,
if (!accText)
return;
PRInt32 extY = 0, extX = 0;
PRInt32 extWidth = 0, extHeight = 0;
int32_t extY = 0, extX = 0;
int32_t extWidth = 0, extHeight = 0;
PRUint32 geckoCoordType;
uint32_t geckoCoordType;
if (aCoords == ATK_XY_SCREEN)
geckoCoordType = nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE;
else
@ -333,8 +333,8 @@ getOffsetAtPointCB(AtkText *aText,
getter_AddRefs(accText));
NS_ENSURE_TRUE(accText, -1);
PRInt32 offset = 0;
PRUint32 geckoCoordType;
int32_t offset = 0;
uint32_t geckoCoordType;
if (aCoords == ATK_XY_SCREEN)
geckoCoordType = nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE;
else
@ -356,7 +356,7 @@ getTextSelectionCountCB(AtkText *aText)
getter_AddRefs(accText));
NS_ENSURE_TRUE(accText, 0);
PRInt32 selectionCount;
int32_t selectionCount;
nsresult rv = accText->GetSelectionCount(&selectionCount);
return NS_FAILED(rv) ? 0 : selectionCount;
@ -375,7 +375,7 @@ getTextSelectionCB(AtkText *aText, gint aSelectionNum,
getter_AddRefs(accText));
NS_ENSURE_TRUE(accText, nullptr);
PRInt32 startOffset = 0, endOffset = 0;
int32_t startOffset = 0, endOffset = 0;
nsresult rv = accText->GetSelectionBounds(aSelectionNum,
&startOffset, &endOffset);

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

@ -47,9 +47,9 @@ struct AtkStateMap {
AtkStateType atkState;
EStateMapEntryType stateMapEntryType;
static PRInt32 GetStateIndexFor(PRUint64 aState)
static int32_t GetStateIndexFor(uint64_t aState)
{
PRInt32 stateIndex = -1;
int32_t stateIndex = -1;
while (aState > 0) {
++ stateIndex;
aState >>= 1;

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

@ -21,28 +21,28 @@ using namespace mozilla::a11y::aria;
struct EnumTypeData
{
EnumTypeData(nsIAtom* aAttrName,
nsIAtom** aValue1, PRUint64 aState1,
nsIAtom** aValue2, PRUint64 aState2,
nsIAtom** aValue3 = 0, PRUint64 aState3 = 0) :
nsIAtom** aValue1, uint64_t aState1,
nsIAtom** aValue2, uint64_t aState2,
nsIAtom** aValue3 = 0, uint64_t aState3 = 0) :
mState1(aState1), mState2(aState2), mState3(aState3), mDefaultState(0),
mAttrName(aAttrName), mValue1(aValue1), mValue2(aValue2), mValue3(aValue3),
mNullValue(nullptr)
{ }
EnumTypeData(nsIAtom* aAttrName, PRUint64 aDefaultState,
nsIAtom** aValue1, PRUint64 aState1) :
EnumTypeData(nsIAtom* aAttrName, uint64_t aDefaultState,
nsIAtom** aValue1, uint64_t aState1) :
mState1(aState1), mState2(0), mState3(0), mDefaultState(aDefaultState),
mAttrName(aAttrName), mValue1(aValue1), mValue2(nullptr), mValue3(nullptr),
mNullValue(nullptr)
{ }
// States applied if corresponding enum values are matched.
const PRUint64 mState1;
const PRUint64 mState2;
const PRUint64 mState3;
const uint64_t mState1;
const uint64_t mState2;
const uint64_t mState3;
// Default state if no one enum value is matched.
const PRUint64 mDefaultState;
const uint64_t mDefaultState;
// ARIA attribute name.
nsIAtom* const mAttrName;
@ -68,10 +68,10 @@ enum ETokenType
*/
struct TokenTypeData
{
TokenTypeData(nsIAtom* aAttrName, PRUint32 aType,
PRUint64 aPermanentState,
PRUint64 aTrueState,
PRUint64 aFalseState = 0) :
TokenTypeData(nsIAtom* aAttrName, uint32_t aType,
uint64_t aPermanentState,
uint64_t aTrueState,
uint64_t aFalseState = 0) :
mAttrName(aAttrName), mType(aType), mPermanentState(aPermanentState),
mTrueState(aTrueState), mFalseState(aFalseState)
{ }
@ -80,31 +80,31 @@ struct TokenTypeData
nsIAtom* const mAttrName;
// Type.
const PRUint32 mType;
const uint32_t mType;
// State applied if the attribute is defined or mType doesn't have
// eDefinedIfAbsent flag set.
const PRUint64 mPermanentState;
const uint64_t mPermanentState;
// States applied if the attribute value is true/false.
const PRUint64 mTrueState;
const PRUint64 mFalseState;
const uint64_t mTrueState;
const uint64_t mFalseState;
};
/**
* Map enum type attribute value to accessible state.
*/
static void MapEnumType(dom::Element* aElement, PRUint64* aState,
static void MapEnumType(dom::Element* aElement, uint64_t* aState,
const EnumTypeData& aData);
/**
* Map token type attribute value to states.
*/
static void MapTokenType(dom::Element* aContent, PRUint64* aState,
static void MapTokenType(dom::Element* aContent, uint64_t* aState,
const TokenTypeData& aData);
bool
aria::MapToState(EStateRule aRule, dom::Element* aElement, PRUint64* aState)
aria::MapToState(EStateRule aRule, dom::Element* aElement, uint64_t* aState)
{
switch (aRule) {
case eARIAAutoComplete:
@ -315,7 +315,7 @@ aria::MapToState(EStateRule aRule, dom::Element* aElement, PRUint64* aState)
}
static void
MapEnumType(dom::Element* aElement, PRUint64* aState, const EnumTypeData& aData)
MapEnumType(dom::Element* aElement, uint64_t* aState, const EnumTypeData& aData)
{
switch (aElement->FindAttrValueIn(kNameSpaceID_None, aData.mAttrName,
&aData.mValue1, eCaseMatters)) {
@ -334,7 +334,7 @@ MapEnumType(dom::Element* aElement, PRUint64* aState, const EnumTypeData& aData)
}
static void
MapTokenType(dom::Element* aElement, PRUint64* aState,
MapTokenType(dom::Element* aElement, uint64_t* aState,
const TokenTypeData& aData)
{
if (aElement->HasAttr(kNameSpaceID_None, aData.mAttrName)) {

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

@ -7,7 +7,7 @@
#ifndef _mozilla_a11y_aria_ARIAStateMap_h_
#define _mozilla_a11y_aria_ARIAStateMap_h_
#include "prtypes.h"
#include "mozilla/StandardInteger.h"
namespace mozilla {
@ -54,7 +54,7 @@ enum EStateRule
* @param aState [in/out] accessible states
* @return true if state map rule ID is valid
*/
bool MapToState(EStateRule aRule, dom::Element* aElement, PRUint64* aState);
bool MapToState(EStateRule aRule, dom::Element* aElement, uint64_t* aState);
} // namespace aria
} // namespace a11y

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

@ -20,7 +20,7 @@ AccCollector::~AccCollector()
{
}
PRUint32
uint32_t
AccCollector::Count()
{
EnsureNGetIndex(nullptr);
@ -28,7 +28,7 @@ AccCollector::Count()
}
Accessible*
AccCollector::GetAccessibleAt(PRUint32 aIndex)
AccCollector::GetAccessibleAt(uint32_t aIndex)
{
Accessible* accessible = mObjects.SafeElementAt(aIndex, nullptr);
if (accessible)
@ -37,10 +37,10 @@ AccCollector::GetAccessibleAt(PRUint32 aIndex)
return EnsureNGetObject(aIndex);
}
PRInt32
int32_t
AccCollector::GetIndexAt(Accessible* aAccessible)
{
PRInt32 index = mObjects.IndexOf(aAccessible);
int32_t index = mObjects.IndexOf(aAccessible);
if (index != -1)
return index;
@ -51,9 +51,9 @@ AccCollector::GetIndexAt(Accessible* aAccessible)
// nsAccCollector protected
Accessible*
AccCollector::EnsureNGetObject(PRUint32 aIndex)
AccCollector::EnsureNGetObject(uint32_t aIndex)
{
PRUint32 childCount = mRoot->ChildCount();
uint32_t childCount = mRoot->ChildCount();
while (mRootChildIdx < childCount) {
Accessible* child = mRoot->GetChildAt(mRootChildIdx++);
if (!mFilterFunc(child))
@ -67,10 +67,10 @@ AccCollector::EnsureNGetObject(PRUint32 aIndex)
return nullptr;
}
PRInt32
int32_t
AccCollector::EnsureNGetIndex(Accessible* aAccessible)
{
PRUint32 childCount = mRoot->ChildCount();
uint32_t childCount = mRoot->ChildCount();
while (mRootChildIdx < childCount) {
Accessible* child = mRoot->GetChildAt(mRootChildIdx++);
if (!mFilterFunc(child))
@ -94,7 +94,7 @@ AccCollector::AppendObject(Accessible* aAccessible)
// EmbeddedObjCollector
////////////////////////////////////////////////////////////////////////////////
PRInt32
int32_t
EmbeddedObjCollector::GetIndexAt(Accessible* aAccessible)
{
if (aAccessible->mParent != mRoot)

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

@ -23,28 +23,28 @@ public:
/**
* Return accessible count within the collection.
*/
PRUint32 Count();
uint32_t Count();
/**
* Return an accessible from the collection at the given index.
*/
Accessible* GetAccessibleAt(PRUint32 aIndex);
Accessible* GetAccessibleAt(uint32_t aIndex);
/**
* Return index of the given accessible within the collection.
*/
virtual PRInt32 GetIndexAt(Accessible* aAccessible);
virtual int32_t GetIndexAt(Accessible* aAccessible);
protected:
/**
* Ensure accessible at the given index is stored and return it.
*/
Accessible* EnsureNGetObject(PRUint32 aIndex);
Accessible* EnsureNGetObject(uint32_t aIndex);
/**
* Ensure index for the given accessible is stored and return it.
*/
PRInt32 EnsureNGetIndex(Accessible* aAccessible);
int32_t EnsureNGetIndex(Accessible* aAccessible);
/**
* Append the object to collection.
@ -53,7 +53,7 @@ protected:
filters::FilterFuncPtr mFilterFunc;
Accessible* mRoot;
PRUint32 mRootChildIdx;
uint32_t mRootChildIdx;
nsTArray<Accessible*> mObjects;
@ -73,7 +73,7 @@ public:
virtual ~EmbeddedObjCollector() { };
public:
virtual PRInt32 GetIndexAt(Accessible* aAccessible);
virtual int32_t GetIndexAt(Accessible* aAccessible);
protected:
// Make sure it's used by Accessible class only.

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

@ -28,14 +28,14 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
// AccEvent constructors
AccEvent::AccEvent(PRUint32 aEventType, Accessible* aAccessible,
AccEvent::AccEvent(uint32_t aEventType, Accessible* aAccessible,
EIsFromUserInput aIsFromUserInput, EEventRule aEventRule) :
mEventType(aEventType), mEventRule(aEventRule), mAccessible(aAccessible)
{
CaptureIsFromUserInput(aIsFromUserInput);
}
AccEvent::AccEvent(PRUint32 aEventType, nsINode* aNode,
AccEvent::AccEvent(uint32_t aEventType, nsINode* aNode,
EIsFromUserInput aIsFromUserInput, EEventRule aEventRule) :
mEventType(aEventType), mEventRule(aEventRule), mNode(aNode)
{
@ -167,7 +167,7 @@ AccEvent::CaptureIsFromUserInput(EIsFromUserInput aIsFromUserInput)
// support correct state change coalescence (XXX Bug 569356). Also we need to
// decide how to coalesce events created via accessible (instead of node).
AccStateChangeEvent::
AccStateChangeEvent(Accessible* aAccessible, PRUint64 aState,
AccStateChangeEvent(Accessible* aAccessible, uint64_t aState,
bool aIsEnabled, EIsFromUserInput aIsFromUserInput):
AccEvent(nsIAccessibleEvent::EVENT_STATE_CHANGE, aAccessible,
aIsFromUserInput, eAllowDupes),
@ -176,7 +176,7 @@ AccStateChangeEvent::
}
AccStateChangeEvent::
AccStateChangeEvent(nsINode* aNode, PRUint64 aState, bool aIsEnabled):
AccStateChangeEvent(nsINode* aNode, uint64_t aState, bool aIsEnabled):
AccEvent(::nsIAccessibleEvent::EVENT_STATE_CHANGE, aNode,
eAutoDetect, eAllowDupes),
mState(aState), mIsEnabled(aIsEnabled)
@ -184,7 +184,7 @@ AccStateChangeEvent::
}
AccStateChangeEvent::
AccStateChangeEvent(nsINode* aNode, PRUint64 aState) :
AccStateChangeEvent(nsINode* aNode, uint64_t aState) :
AccEvent(::nsIAccessibleEvent::EVENT_STATE_CHANGE, aNode,
eAutoDetect, eAllowDupes),
mState(aState)
@ -218,12 +218,12 @@ AccStateChangeEvent::CreateXPCOMObject()
// a defunct accessible so the behaviour should be equivalent.
// XXX revisit this when coalescence is faster (eCoalesceFromSameSubtree)
AccTextChangeEvent::
AccTextChangeEvent(Accessible* aAccessible, PRInt32 aStart,
AccTextChangeEvent(Accessible* aAccessible, int32_t aStart,
const nsAString& aModifiedText, bool aIsInserted,
EIsFromUserInput aIsFromUserInput)
: AccEvent(aIsInserted ?
static_cast<PRUint32>(nsIAccessibleEvent::EVENT_TEXT_INSERTED) :
static_cast<PRUint32>(nsIAccessibleEvent::EVENT_TEXT_REMOVED),
static_cast<uint32_t>(nsIAccessibleEvent::EVENT_TEXT_INSERTED) :
static_cast<uint32_t>(nsIAccessibleEvent::EVENT_TEXT_REMOVED),
aAccessible, aIsFromUserInput, eAllowDupes)
, mStart(aStart)
, mIsInserted(aIsInserted)
@ -249,7 +249,7 @@ AccTextChangeEvent::CreateXPCOMObject()
////////////////////////////////////////////////////////////////////////////////
AccMutationEvent::
AccMutationEvent(PRUint32 aEventType, Accessible* aTarget,
AccMutationEvent(uint32_t aEventType, Accessible* aTarget,
nsINode* aTargetNode) :
AccEvent(aEventType, aTarget, eAutoDetect, eCoalesceFromSameSubtree)
{
@ -295,7 +295,7 @@ AccShowEvent::
////////////////////////////////////////////////////////////////////////////////
AccCaretMoveEvent::
AccCaretMoveEvent(Accessible* aAccessible, PRInt32 aCaretOffset) :
AccCaretMoveEvent(Accessible* aAccessible, int32_t aCaretOffset) :
AccEvent(::nsIAccessibleEvent::EVENT_TEXT_CARET_MOVED, aAccessible),
mCaretOffset(aCaretOffset)
{
@ -344,8 +344,8 @@ AccSelChangeEvent::
////////////////////////////////////////////////////////////////////////////////
AccTableChangeEvent::
AccTableChangeEvent(Accessible* aAccessible, PRUint32 aEventType,
PRInt32 aRowOrColIndex, PRInt32 aNumRowsOrCols) :
AccTableChangeEvent(Accessible* aAccessible, uint32_t aEventType,
int32_t aRowOrColIndex, int32_t aNumRowsOrCols) :
AccEvent(aEventType, aAccessible),
mRowOrColIndex(aRowOrColIndex), mNumRowsOrCols(aNumRowsOrCols)
{
@ -367,8 +367,8 @@ AccTableChangeEvent::CreateXPCOMObject()
AccVCChangeEvent::
AccVCChangeEvent(Accessible* aAccessible,
nsIAccessible* aOldAccessible,
PRInt32 aOldStart, PRInt32 aOldEnd,
PRInt16 aReason) :
int32_t aOldStart, int32_t aOldEnd,
int16_t aReason) :
AccEvent(::nsIAccessibleEvent::EVENT_VIRTUALCURSOR_CHANGED, aAccessible),
mOldAccessible(aOldAccessible), mOldStart(aOldStart), mOldEnd(aOldEnd),
mReason(aReason)

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

@ -59,17 +59,17 @@ public:
};
// Initialize with an nsIAccessible
AccEvent(PRUint32 aEventType, Accessible* aAccessible,
AccEvent(uint32_t aEventType, Accessible* aAccessible,
EIsFromUserInput aIsFromUserInput = eAutoDetect,
EEventRule aEventRule = eRemoveDupes);
// Initialize with an nsIDOMNode
AccEvent(PRUint32 aEventType, nsINode* aNode,
AccEvent(uint32_t aEventType, nsINode* aNode,
EIsFromUserInput aIsFromUserInput = eAutoDetect,
EEventRule aEventRule = eRemoveDupes);
virtual ~AccEvent() {}
// AccEvent
PRUint32 GetEventType() const { return mEventType; }
uint32_t GetEventType() const { return mEventType; }
EEventRule GetEventRule() const { return mEventRule; }
bool IsFromUserInput() const { return mIsFromUserInput; }
@ -123,7 +123,7 @@ protected:
void CaptureIsFromUserInput(EIsFromUserInput aIsFromUserInput);
bool mIsFromUserInput;
PRUint32 mEventType;
uint32_t mEventType;
EEventRule mEventRule;
nsRefPtr<Accessible> mAccessible;
nsCOMPtr<nsINode> mNode;
@ -138,13 +138,13 @@ protected:
class AccStateChangeEvent: public AccEvent
{
public:
AccStateChangeEvent(Accessible* aAccessible, PRUint64 aState,
AccStateChangeEvent(Accessible* aAccessible, uint64_t aState,
bool aIsEnabled,
EIsFromUserInput aIsFromUserInput = eAutoDetect);
AccStateChangeEvent(nsINode* aNode, PRUint64 aState, bool aIsEnabled);
AccStateChangeEvent(nsINode* aNode, uint64_t aState, bool aIsEnabled);
AccStateChangeEvent(nsINode* aNode, PRUint64 aState);
AccStateChangeEvent(nsINode* aNode, uint64_t aState);
// AccEvent
virtual already_AddRefed<nsAccEvent> CreateXPCOMObject();
@ -156,11 +156,11 @@ public:
}
// AccStateChangeEvent
PRUint64 GetState() const { return mState; }
uint64_t GetState() const { return mState; }
bool IsStateEnabled() const { return mIsEnabled; }
private:
PRUint64 mState;
uint64_t mState;
bool mIsEnabled;
};
@ -171,7 +171,7 @@ private:
class AccTextChangeEvent: public AccEvent
{
public:
AccTextChangeEvent(Accessible* aAccessible, PRInt32 aStart,
AccTextChangeEvent(Accessible* aAccessible, int32_t aStart,
const nsAString& aModifiedText, bool aIsInserted,
EIsFromUserInput aIsFromUserInput = eAutoDetect);
@ -185,14 +185,14 @@ public:
}
// AccTextChangeEvent
PRInt32 GetStartOffset() const { return mStart; }
PRUint32 GetLength() const { return mModifiedText.Length(); }
int32_t GetStartOffset() const { return mStart; }
uint32_t GetLength() const { return mModifiedText.Length(); }
bool IsTextInserted() const { return mIsInserted; }
void GetModifiedText(nsAString& aModifiedText)
{ aModifiedText = mModifiedText; }
private:
PRInt32 mStart;
int32_t mStart;
bool mIsInserted;
nsString mModifiedText;
@ -206,7 +206,7 @@ private:
class AccMutationEvent: public AccEvent
{
public:
AccMutationEvent(PRUint32 aEventType, Accessible* aTarget,
AccMutationEvent(uint32_t aEventType, Accessible* aTarget,
nsINode* aTargetNode);
// Event
@ -281,7 +281,7 @@ public:
class AccCaretMoveEvent: public AccEvent
{
public:
AccCaretMoveEvent(Accessible* aAccessible, PRInt32 aCaretOffset);
AccCaretMoveEvent(Accessible* aAccessible, int32_t aCaretOffset);
AccCaretMoveEvent(nsINode* aNode);
// AccEvent
@ -294,10 +294,10 @@ public:
}
// AccCaretMoveEvent
PRInt32 GetCaretOffset() const { return mCaretOffset; }
int32_t GetCaretOffset() const { return mCaretOffset; }
private:
PRInt32 mCaretOffset;
int32_t mCaretOffset;
};
@ -331,7 +331,7 @@ private:
nsRefPtr<Accessible> mWidget;
nsRefPtr<Accessible> mItem;
SelChangeType mSelChangeType;
PRUint32 mPreceedingCount;
uint32_t mPreceedingCount;
AccSelChangeEvent* mPackedEvent;
friend class NotificationController;
@ -344,8 +344,8 @@ private:
class AccTableChangeEvent : public AccEvent
{
public:
AccTableChangeEvent(Accessible* aAccessible, PRUint32 aEventType,
PRInt32 aRowOrColIndex, PRInt32 aNumRowsOrCols);
AccTableChangeEvent(Accessible* aAccessible, uint32_t aEventType,
int32_t aRowOrColIndex, int32_t aNumRowsOrCols);
// AccEvent
virtual already_AddRefed<nsAccEvent> CreateXPCOMObject();
@ -357,12 +357,12 @@ public:
}
// AccTableChangeEvent
PRUint32 GetIndex() const { return mRowOrColIndex; }
PRUint32 GetCount() const { return mNumRowsOrCols; }
uint32_t GetIndex() const { return mRowOrColIndex; }
uint32_t GetCount() const { return mNumRowsOrCols; }
private:
PRUint32 mRowOrColIndex; // the start row/column after which the rows are inserted/deleted.
PRUint32 mNumRowsOrCols; // the number of inserted/deleted rows/columns
uint32_t mRowOrColIndex; // the start row/column after which the rows are inserted/deleted.
uint32_t mNumRowsOrCols; // the number of inserted/deleted rows/columns
};
/**
@ -373,8 +373,8 @@ class AccVCChangeEvent : public AccEvent
public:
AccVCChangeEvent(Accessible* aAccessible,
nsIAccessible* aOldAccessible,
PRInt32 aOldStart, PRInt32 aOldEnd,
PRInt16 aReason);
int32_t aOldStart, int32_t aOldEnd,
int16_t aReason);
virtual ~AccVCChangeEvent() { }
@ -389,15 +389,15 @@ public:
// AccTableChangeEvent
nsIAccessible* OldAccessible() const { return mOldAccessible; }
PRInt32 OldStartOffset() const { return mOldStart; }
PRInt32 OldEndOffset() const { return mOldEnd; }
PRInt32 Reason() const { return mReason; }
int32_t OldStartOffset() const { return mOldStart; }
int32_t OldEndOffset() const { return mOldEnd; }
int32_t Reason() const { return mReason; }
private:
nsRefPtr<nsIAccessible> mOldAccessible;
PRInt32 mOldStart;
PRInt32 mOldEnd;
PRInt16 mReason;
int32_t mOldStart;
int32_t mOldEnd;
int16_t mReason;
};
/**

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

@ -17,19 +17,19 @@ AccGroupInfo::AccGroupInfo(Accessible* aItem, role aRole) :
if (!parent)
return;
PRInt32 indexInParent = aItem->IndexInParent();
PRUint32 siblingCount = parent->ChildCount();
int32_t indexInParent = aItem->IndexInParent();
uint32_t siblingCount = parent->ChildCount();
if (indexInParent == -1 ||
indexInParent >= static_cast<PRInt32>(siblingCount)) {
indexInParent >= static_cast<int32_t>(siblingCount)) {
NS_ERROR("Wrong index in parent! Tree invalidation problem.");
return;
}
PRInt32 level = nsAccUtils::GetARIAOrDefaultLevel(aItem);
int32_t level = nsAccUtils::GetARIAOrDefaultLevel(aItem);
// Compute position in set.
mPosInSet = 1;
for (PRInt32 idx = indexInParent - 1; idx >= 0 ; idx--) {
for (int32_t idx = indexInParent - 1; idx >= 0 ; idx--) {
Accessible* sibling = parent->GetChildAt(idx);
roles::Role siblingRole = sibling->Role();
@ -45,7 +45,7 @@ AccGroupInfo::AccGroupInfo(Accessible* aItem, role aRole) :
// level is lesser than this one then group is ended, if the sibling level
// is greater than this one then the group is split by some child elements
// (group will be continued).
PRInt32 siblingLevel = nsAccUtils::GetARIAOrDefaultLevel(sibling);
int32_t siblingLevel = nsAccUtils::GetARIAOrDefaultLevel(sibling);
if (siblingLevel < level) {
mParent = sibling;
break;
@ -70,7 +70,7 @@ AccGroupInfo::AccGroupInfo(Accessible* aItem, role aRole) :
// Compute set size.
mSetSize = mPosInSet;
for (PRUint32 idx = indexInParent + 1; idx < siblingCount; idx++) {
for (uint32_t idx = indexInParent + 1; idx < siblingCount; idx++) {
Accessible* sibling = parent->GetChildAt(idx);
roles::Role siblingRole = sibling->Role();
@ -84,7 +84,7 @@ AccGroupInfo::AccGroupInfo(Accessible* aItem, role aRole) :
continue;
// and check if it's hierarchical flatten structure.
PRInt32 siblingLevel = nsAccUtils::GetARIAOrDefaultLevel(sibling);
int32_t siblingLevel = nsAccUtils::GetARIAOrDefaultLevel(sibling);
if (siblingLevel < level)
break;

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

@ -17,8 +17,8 @@ public:
AccGroupInfo(Accessible* aItem, mozilla::a11y::role aRole);
~AccGroupInfo() { MOZ_COUNT_DTOR(AccGroupInfo); }
PRInt32 PosInSet() const { return mPosInSet; }
PRUint32 SetSize() const { return mSetSize; }
int32_t PosInSet() const { return mPosInSet; }
uint32_t SetSize() const { return mSetSize; }
Accessible* ConceptualParent() const { return mParent; }
/**
@ -71,8 +71,8 @@ private:
static bool IsConceptualParent(mozilla::a11y::role aRole,
mozilla::a11y::role aParentRole);
PRUint32 mPosInSet;
PRUint32 mSetSize;
uint32_t mPosInSet;
uint32_t mSetSize;
Accessible* mParent;
};

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

@ -69,7 +69,7 @@ private:
IteratorState(Accessible* aParent, IteratorState* mParentState = nullptr);
Accessible* mParent;
PRInt32 mIndex;
int32_t mIndex;
IteratorState *mParentState;
};
@ -115,7 +115,7 @@ private:
nsIAtom* mRelAttr;
DocAccessible::AttrRelProviderArray* mProviders;
nsIContent* mBindingParent;
PRUint32 mIndex;
uint32_t mIndex;
};

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

@ -146,9 +146,9 @@ private:
#define A11YDEBUG_FOCUS_LOG_TIME \
{ \
PRIntervalTime time = PR_IntervalNow(); \
PRUint32 mins = (PR_IntervalToSeconds(time) / 60) % 60; \
PRUint32 secs = PR_IntervalToSeconds(time) % 60; \
PRUint32 msecs = PR_IntervalToMilliseconds(time) % 1000; \
uint32_t mins = (PR_IntervalToSeconds(time) / 60) % 60; \
uint32_t secs = PR_IntervalToSeconds(time) % 60; \
uint32_t msecs = PR_IntervalToMilliseconds(time) % 1000; \
printf("Time: %2d:%2d.%3d\n", mins, secs, msecs); \
}

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

@ -27,7 +27,7 @@ using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
// Logging helpers
static PRUint32 sModules = 0;
static uint32_t sModules = 0;
struct ModuleRep {
const char* mStr;
@ -94,7 +94,7 @@ LogDocShellState(nsIDocument* aDocumentNode)
nsCOMPtr<nsISupports> container = aDocumentNode->GetContainer();
if (container) {
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(container);
PRUint32 busyFlags = nsIDocShell::BUSY_FLAGS_NONE;
uint32_t busyFlags = nsIDocShell::BUSY_FLAGS_NONE;
docShell->GetBusyFlags(&busyFlags);
if (busyFlags == nsIDocShell::BUSY_FLAGS_NONE)
printf("'none'");
@ -224,7 +224,7 @@ LogShellLoadType(nsIDocShell* aDocShell)
{
printf("load type: ");
PRUint32 loadType = 0;
uint32_t loadType = 0;
aDocShell->GetLoadType(&loadType);
switch (loadType) {
case LOAD_NORMAL:
@ -299,7 +299,7 @@ LogRequest(nsIRequest* aRequest)
nsCAutoString name;
aRequest->GetName(name);
printf(" request spec: %s\n", name.get());
PRUint32 loadFlags = 0;
uint32_t loadFlags = 0;
aRequest->GetLoadFlags(&loadFlags);
printf(" request load flags: %x; ", loadFlags);
if (loadFlags & nsIChannel::LOAD_DOCUMENT_URI)
@ -324,7 +324,7 @@ LogRequest(nsIRequest* aRequest)
static void
GetDocLoadEventType(AccEvent* aEvent, nsACString& aEventType)
{
PRUint32 type = aEvent->GetEventType();
uint32_t type = aEvent->GetEventType();
if (type == nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_STOPPED) {
aEventType.AssignLiteral("load stopped");
} else if (type == nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_COMPLETE) {
@ -353,7 +353,7 @@ static const char* sDocEventTitle = "DOCEVENT";
void
logging::DocLoad(const char* aMsg, nsIWebProgress* aWebProgress,
nsIRequest* aRequest, PRUint32 aStateFlags)
nsIRequest* aRequest, uint32_t aStateFlags)
{
MsgBegin(sDocLoadTitle, aMsg);
@ -470,7 +470,7 @@ logging::SelChange(nsISelection* aSelection, DocAccessible* aDocument)
{
nsCOMPtr<nsISelectionPrivate> privSel(do_QueryInterface(aSelection));
PRInt16 type = 0;
int16_t type = 0;
privSel->GetType(&type);
const char* strType = 0;
@ -558,7 +558,7 @@ logging::Node(const char* aDescr, nsINode* aNode)
}
nsINode* parentNode = aNode->GetNodeParent();
PRInt32 idxInParent = parentNode ? parentNode->IndexOf(aNode) : - 1;
int32_t idxInParent = parentNode ? parentNode->IndexOf(aNode) : - 1;
if (aNode->IsNodeOfType(nsINode::eTEXT)) {
printf("%s: %p, text node, idx in parent: %d\n",
@ -599,7 +599,7 @@ logging::Stack()
// namespace logging:: initialization
bool
logging::IsEnabled(PRUint32 aModules)
logging::IsEnabled(uint32_t aModules)
{
return sModules & aModules;
}

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

@ -48,13 +48,13 @@ enum EModules {
/**
* Return true if any of the given modules is logged.
*/
bool IsEnabled(PRUint32 aModules);
bool IsEnabled(uint32_t aModules);
/**
* Log the document loading progress.
*/
void DocLoad(const char* aMsg, nsIWebProgress* aWebProgress,
nsIRequest* aRequest, PRUint32 aStateFlags);
nsIRequest* aRequest, uint32_t aStateFlags);
void DocLoad(const char* aMsg, nsIDocument* aDocumentNode);
/**

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

@ -90,8 +90,8 @@ NotificationController::Shutdown()
}
// Shutdown handling child documents.
PRInt32 childDocCount = mHangingChildDocuments.Length();
for (PRInt32 idx = childDocCount - 1; idx >= 0; idx--) {
int32_t childDocCount = mHangingChildDocuments.Length();
for (int32_t idx = childDocCount - 1; idx >= 0; idx--) {
if (!mHangingChildDocuments[idx]->IsDefunct())
mHangingChildDocuments[idx]->Shutdown();
}
@ -225,8 +225,8 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
nsTArray<nsRefPtr<ContentInsertion> > contentInsertions;
contentInsertions.SwapElements(mContentInsertions);
PRUint32 insertionCount = contentInsertions.Length();
for (PRUint32 idx = 0; idx < insertionCount; idx++) {
uint32_t insertionCount = contentInsertions.Length();
for (uint32_t idx = 0; idx < insertionCount; idx++) {
contentInsertions[idx]->Process();
if (!mDocument)
return;
@ -237,8 +237,8 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
mTextHash.Clear();
// Bind hanging child documents.
PRUint32 hangingDocCnt = mHangingChildDocuments.Length();
for (PRUint32 idx = 0; idx < hangingDocCnt; idx++) {
uint32_t hangingDocCnt = mHangingChildDocuments.Length();
for (uint32_t idx = 0; idx < hangingDocCnt; idx++) {
DocAccessible* childDoc = mHangingChildDocuments[idx];
if (childDoc->IsDefunct())
continue;
@ -265,7 +265,7 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
if (mDocument->HasLoadState(DocAccessible::eReady) &&
!mDocument->HasLoadState(DocAccessible::eCompletelyLoaded) &&
hangingDocCnt == 0) {
PRUint32 childDocCnt = mDocument->ChildDocumentCount(), childDocIdx = 0;
uint32_t childDocCnt = mDocument->ChildDocumentCount(), childDocIdx = 0;
for (; childDocIdx < childDocCnt; childDocIdx++) {
DocAccessible* childDoc = mDocument->GetChildDocumentAt(childDocIdx);
if (!childDoc->HasLoadState(DocAccessible::eCompletelyLoaded))
@ -283,8 +283,8 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
nsTArray < nsRefPtr<Notification> > notifications;
notifications.SwapElements(mNotifications);
PRUint32 notificationCount = notifications.Length();
for (PRUint32 idx = 0; idx < notificationCount; idx++) {
uint32_t notificationCount = notifications.Length();
for (uint32_t idx = 0; idx < notificationCount; idx++) {
notifications[idx]->Process();
if (!mDocument)
return;
@ -302,7 +302,7 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
nsTArray<nsRefPtr<AccEvent> > events;
events.SwapElements(mEvents);
PRUint32 eventCount = events.Length();
uint32_t eventCount = events.Length();
#ifdef DEBUG
if (eventCount > 0 && logging::IsEnabled(logging::eEvents)) {
logging::MsgBegin("EVENTS", "events processing");
@ -311,7 +311,7 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
}
#endif
for (PRUint32 idx = 0; idx < eventCount; idx++) {
for (uint32_t idx = 0; idx < eventCount; idx++) {
AccEvent* accEvent = events[idx];
if (accEvent->mEventRule != AccEvent::eDoNotEmit) {
Accessible* target = accEvent->GetAccessible();
@ -354,8 +354,8 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
void
NotificationController::CoalesceEvents()
{
PRUint32 numQueuedEvents = mEvents.Length();
PRInt32 tail = numQueuedEvents - 1;
uint32_t numQueuedEvents = mEvents.Length();
int32_t tail = numQueuedEvents - 1;
AccEvent* tailEvent = mEvents[tail];
switch(tailEvent->mEventRule) {
@ -366,7 +366,7 @@ NotificationController::CoalesceEvents()
if (!tailEvent->mNode)
return;
for (PRInt32 index = tail - 1; index >= 0; index--) {
for (int32_t index = tail - 1; index >= 0; index--) {
AccEvent* thisEvent = mEvents[index];
if (thisEvent->mEventType != tailEvent->mEventType)
@ -462,7 +462,7 @@ NotificationController::CoalesceEvents()
case AccEvent::eCoalesceOfSameType:
{
// Coalesce old events by newer event.
for (PRInt32 index = tail - 1; index >= 0; index--) {
for (int32_t index = tail - 1; index >= 0; index--) {
AccEvent* accEvent = mEvents[index];
if (accEvent->mEventType == tailEvent->mEventType &&
accEvent->mEventRule == tailEvent->mEventRule) {
@ -476,7 +476,7 @@ NotificationController::CoalesceEvents()
{
// Check for repeat events, coalesce newly appended event by more older
// event.
for (PRInt32 index = tail - 1; index >= 0; index--) {
for (int32_t index = tail - 1; index >= 0; index--) {
AccEvent* accEvent = mEvents[index];
if (accEvent->mEventType == tailEvent->mEventType &&
accEvent->mEventRule == tailEvent->mEventRule &&
@ -490,7 +490,7 @@ NotificationController::CoalesceEvents()
case AccEvent::eCoalesceSelectionChange:
{
AccSelChangeEvent* tailSelChangeEvent = downcast_accEvent(tailEvent);
PRInt32 index = tail - 1;
int32_t index = tail - 1;
for (; index >= 0; index--) {
AccEvent* thisEvent = mEvents[index];
if (thisEvent->mEventRule == tailEvent->mEventRule) {
@ -513,11 +513,11 @@ NotificationController::CoalesceEvents()
}
void
NotificationController::ApplyToSiblings(PRUint32 aStart, PRUint32 aEnd,
PRUint32 aEventType, nsINode* aNode,
NotificationController::ApplyToSiblings(uint32_t aStart, uint32_t aEnd,
uint32_t aEventType, nsINode* aNode,
AccEvent::EEventRule aEventRule)
{
for (PRUint32 index = aStart; index < aEnd; index ++) {
for (uint32_t index = aStart; index < aEnd; index ++) {
AccEvent* accEvent = mEvents[index];
if (accEvent->mEventType == aEventType &&
accEvent->mEventRule != AccEvent::eDoNotEmit && accEvent->mNode &&
@ -530,7 +530,7 @@ NotificationController::ApplyToSiblings(PRUint32 aStart, PRUint32 aEnd,
void
NotificationController::CoalesceSelChangeEvents(AccSelChangeEvent* aTailEvent,
AccSelChangeEvent* aThisEvent,
PRInt32 aThisIndex)
int32_t aThisIndex)
{
aTailEvent->mPreceedingCount = aThisEvent->mPreceedingCount + 1;
@ -544,7 +544,7 @@ NotificationController::CoalesceSelChangeEvents(AccSelChangeEvent* aTailEvent,
// Do not emit any preceding selection events for same widget if they
// weren't coalesced yet.
if (aThisEvent->mEventType != nsIAccessibleEvent::EVENT_SELECTION_WITHIN) {
for (PRInt32 jdx = aThisIndex - 1; jdx >= 0; jdx--) {
for (int32_t jdx = aThisIndex - 1; jdx >= 0; jdx--) {
AccEvent* prevEvent = mEvents[jdx];
if (prevEvent->mEventRule == aTailEvent->mEventRule) {
AccSelChangeEvent* prevSelChangeEvent =
@ -622,7 +622,7 @@ NotificationController::CoalesceTextChangeEventsFor(AccHideEvent* aTailEvent,
aTailEvent->mAccessible->AppendTextTo(textEvent->mModifiedText);
} else if (aThisEvent->mPrevSibling == aTailEvent->mAccessible) {
PRUint32 oldLen = textEvent->GetLength();
uint32_t oldLen = textEvent->GetLength();
aTailEvent->mAccessible->AppendTextTo(textEvent->mModifiedText);
textEvent->mStart -= textEvent->GetLength() - oldLen;
}
@ -680,7 +680,7 @@ NotificationController::CreateTextChangeEventFor(AccMutationEvent* aEvent)
}
}
PRInt32 offset = textAccessible->GetChildOffset(aEvent->mAccessible);
int32_t offset = textAccessible->GetChildOffset(aEvent->mAccessible);
nsAutoString text;
aEvent->mAccessible->AppendTextTo(text);

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

@ -210,8 +210,8 @@ private:
* @param aEventRule the event rule to be applied
* (should be eDoNotEmit or eAllowDupes)
*/
void ApplyToSiblings(PRUint32 aStart, PRUint32 aEnd,
PRUint32 aEventType, nsINode* aNode,
void ApplyToSiblings(uint32_t aStart, uint32_t aEnd,
uint32_t aEventType, nsINode* aNode,
AccEvent::EEventRule aEventRule);
/**
@ -219,7 +219,7 @@ private:
*/
void CoalesceSelChangeEvents(AccSelChangeEvent* aTailEvent,
AccSelChangeEvent* aThisEvent,
PRInt32 aThisIndex);
int32_t aThisIndex);
/**
* Coalesce text change events caused by sibling hide events.

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

@ -7,7 +7,7 @@
#ifndef _states_h_
#define _states_h_
#include <prtypes.h>
#include "mozilla/StandardInteger.h"
namespace mozilla {
namespace a11y {
@ -16,40 +16,40 @@ namespace states {
/**
* The object is disabled, opposite to enabled and sensitive.
*/
const PRUint64 UNAVAILABLE = ((PRUint64) 0x1) << 0;
const uint64_t UNAVAILABLE = ((uint64_t) 0x1) << 0;
/**
* The object is selected.
*/
const PRUint64 SELECTED = ((PRUint64) 0x1) << 1;
const uint64_t SELECTED = ((uint64_t) 0x1) << 1;
/**
* The object has the keyboard focus.
*/
const PRUint64 FOCUSED = ((PRUint64) 0x1) << 2;
const uint64_t FOCUSED = ((uint64_t) 0x1) << 2;
/**
* The object is pressed.
*/
const PRUint64 PRESSED = ((PRUint64) 0x1) << 3;
const uint64_t PRESSED = ((uint64_t) 0x1) << 3;
/**
* The checkable object is checked, applied to check box controls,
* @see CHECKABLE and MIXED states.
*/
const PRUint64 CHECKED = ((PRUint64) 0x1) << 4;
const uint64_t CHECKED = ((uint64_t) 0x1) << 4;
/**
* Indicates that the state of a three-state check box or tool bar button is
* undetermined. The check box is neither checked or unchecked, and is
* in the third or mixed state.
*/
const PRUint64 MIXED = ((PRUint64) 0x1) << 5;
const uint64_t MIXED = ((uint64_t) 0x1) << 5;
/**
* The object is designated read-only, so it can't be edited.
*/
const PRUint64 READONLY = ((PRUint64) 0x1) << 6;
const uint64_t READONLY = ((uint64_t) 0x1) << 6;
/**
* The object is hot-tracked by the mouse, which means that its appearance
@ -57,221 +57,221 @@ namespace states {
*
* This is currently unused.
*/
const PRUint64 HOTTRACKED = ((PRUint64) 0x1) << 7;
const uint64_t HOTTRACKED = ((uint64_t) 0x1) << 7;
/**
* This object is the default button in a window.
*/
const PRUint64 DEFAULT = ((PRUint64) 0x1) << 8;
const uint64_t DEFAULT = ((uint64_t) 0x1) << 8;
/**
* The expandable object's children are displayed, the opposite of collapsed,
* applied to trees, list and other controls.
* @see COLLAPSED state
*/
const PRUint64 EXPANDED = ((PRUint64) 0x1) << 9;
const uint64_t EXPANDED = ((uint64_t) 0x1) << 9;
/**
* The expandable object's children are not displayed, the opposite of
* expanded, applied to tree lists and other controls,
* @see EXPANDED state.
*/
const PRUint64 COLLAPSED = ((PRUint64) 0x1) << 10;
const uint64_t COLLAPSED = ((uint64_t) 0x1) << 10;
/**
* The control or document can not accept input at this time.
*/
const PRUint64 BUSY = ((PRUint64) 0x1) << 11;
const uint64_t BUSY = ((uint64_t) 0x1) << 11;
/**
* The object is out of normal flow, may be outside of boundaries of its
* parent.
*/
const PRUint64 FLOATING = ((PRUint64) 0x1) << 12;
const uint64_t FLOATING = ((uint64_t) 0x1) << 12;
/**
* The object can be checked.
*/
const PRUint64 CHECKABLE = ((PRUint64) 0x1) << 13;
const uint64_t CHECKABLE = ((uint64_t) 0x1) << 13;
/**
* This object is a graphic which is rapidly changing appearance.
*/
const PRUint64 ANIMATED = ((PRUint64) 0x1) << 14;
const uint64_t ANIMATED = ((uint64_t) 0x1) << 14;
/**
* The object is programmatically hidden.
* So user action like scrolling or switching tabs won't make this visible.
*/
const PRUint64 INVISIBLE = ((PRUint64) 0x1) << 15;
const uint64_t INVISIBLE = ((uint64_t) 0x1) << 15;
/**
* The object is scrolled off screen.
* User action such as scrolling or changing tab may make the object
* visible.
*/
const PRUint64 OFFSCREEN = ((PRUint64) 0x1) << 16;
const uint64_t OFFSCREEN = ((uint64_t) 0x1) << 16;
/**
* The object can be resized.
*/
const PRUint64 SIZEABLE = ((PRUint64) 0x1) << 17;
const uint64_t SIZEABLE = ((uint64_t) 0x1) << 17;
/**
* The object can be moved to a different position.
*/
const PRUint64 MOVEABLE = ((PRUint64) 0x1) << 18;
const uint64_t MOVEABLE = ((uint64_t) 0x1) << 18;
/**
* The object describes itself with speech.
* Other speech related assistive technology may want to avoid speaking
* information about this object, because the object is already doing this.
*/
const PRUint64 SELFVOICING = ((PRUint64) 0x1) << 19;
const uint64_t SELFVOICING = ((uint64_t) 0x1) << 19;
/**
* The object can have the focus and become focused.
*/
const PRUint64 FOCUSABLE = ((PRUint64) 0x1) << 20;
const uint64_t FOCUSABLE = ((uint64_t) 0x1) << 20;
/**
* The object can be selected.
*/
const PRUint64 SELECTABLE = ((PRUint64) 0x1) << 21;
const uint64_t SELECTABLE = ((uint64_t) 0x1) << 21;
/**
* This object is a link.
*/
const PRUint64 LINKED = ((PRUint64) 0x1) << 22;
const uint64_t LINKED = ((uint64_t) 0x1) << 22;
/**
* This is used for links that have been traversed
* i.e. the linked page has been visited.
*/
const PRUint64 TRAVERSED = ((PRUint64) 0x1) << 23;
const uint64_t TRAVERSED = ((uint64_t) 0x1) << 23;
/**
* Supports multiple selection.
*/
const PRUint64 MULTISELECTABLE = ((PRUint64) 0x1) << 24;
const uint64_t MULTISELECTABLE = ((uint64_t) 0x1) << 24;
/**
* Supports extended selection.
* All objects supporting this are also multipselectable.
* This only makes sense for msaa see bug 635690.
*/
const PRUint64 EXTSELECTABLE = ((PRUint64) 0x1) << 25;
const uint64_t EXTSELECTABLE = ((uint64_t) 0x1) << 25;
/**
* The user is required to interact with this object.
*/
const PRUint64 REQUIRED = ((PRUint64) 0x1) << 26;
const uint64_t REQUIRED = ((uint64_t) 0x1) << 26;
/**
* The object is an alert, notifying the user of something important.
*/
const PRUint64 ALERT = ((PRUint64) 0x1) << 27;
const uint64_t ALERT = ((uint64_t) 0x1) << 27;
/**
* Used for text fields containing invalid values.
*/
const PRUint64 INVALID = ((PRUint64) 0x1) << 28;
const uint64_t INVALID = ((uint64_t) 0x1) << 28;
/**
* The controls value can not be obtained, and is returned as a set of "*"s.
*/
const PRUint64 PROTECTED = ((PRUint64) 0x1) << 29;
const uint64_t PROTECTED = ((uint64_t) 0x1) << 29;
/**
* The object can be invoked to show a pop up menu or window.
*/
const PRUint64 HASPOPUP = ((PRUint64) 0x1) << 30;
const uint64_t HASPOPUP = ((uint64_t) 0x1) << 30;
/**
* The editable area has some kind of autocompletion.
*/
const PRUint64 SUPPORTS_AUTOCOMPLETION = ((PRUint64) 0x1) << 31;
const uint64_t SUPPORTS_AUTOCOMPLETION = ((uint64_t) 0x1) << 31;
/**
* The object is no longer available to be queried.
*/
const PRUint64 DEFUNCT = ((PRUint64) 0x1) << 32;
const uint64_t DEFUNCT = ((uint64_t) 0x1) << 32;
/**
* The text is selectable, the object must implement the text interface.
*/
const PRUint64 SELECTABLE_TEXT = ((PRUint64) 0x1) << 33;
const uint64_t SELECTABLE_TEXT = ((uint64_t) 0x1) << 33;
/**
* The text in this object can be edited.
*/
const PRUint64 EDITABLE = ((PRUint64) 0x1) << 34;
const uint64_t EDITABLE = ((uint64_t) 0x1) << 34;
/**
* This window is currently the active window.
*/
const PRUint64 ACTIVE = ((PRUint64) 0x1) << 35;
const uint64_t ACTIVE = ((uint64_t) 0x1) << 35;
/**
* Indicates that the object is modal. Modal objects have the behavior
* that something must be done with the object before the user can
* interact with an object in a different window.
*/
const PRUint64 MODAL = ((PRUint64) 0x1) << 36;
const uint64_t MODAL = ((uint64_t) 0x1) << 36;
/**
* Edit control that can take multiple lines.
*/
const PRUint64 MULTI_LINE = ((PRUint64) 0x1) << 37;
const uint64_t MULTI_LINE = ((uint64_t) 0x1) << 37;
/**
* Uses horizontal layout.
*/
const PRUint64 HORIZONTAL = ((PRUint64) 0x1) << 38;
const uint64_t HORIZONTAL = ((uint64_t) 0x1) << 38;
/**
* Indicates this object paints every pixel within its rectangular region.
*/
const PRUint64 OPAQUE1 = ((PRUint64) 0x1) << 39;
const uint64_t OPAQUE1 = ((uint64_t) 0x1) << 39;
/**
* This text object can only contain 1 line of text.
*/
const PRUint64 SINGLE_LINE = ((PRUint64) 0x1) << 40;
const uint64_t SINGLE_LINE = ((uint64_t) 0x1) << 40;
/**
* The parent object manages descendants, and this object may only exist
* while it is visible or has focus.
* For example the focused cell of a table or the current element of a list box may have this state.
*/
const PRUint64 TRANSIENT = ((PRUint64) 0x1) << 41;
const uint64_t TRANSIENT = ((uint64_t) 0x1) << 41;
/**
* Uses vertical layout.
* Especially used for sliders and scrollbars.
*/
const PRUint64 VERTICAL = ((PRUint64) 0x1) << 42;
const uint64_t VERTICAL = ((uint64_t) 0x1) << 42;
/**
* Object not dead, but not up-to-date either.
*/
const PRUint64 STALE = ((PRUint64) 0x1) << 43;
const uint64_t STALE = ((uint64_t) 0x1) << 43;
/**
* A widget that is not unavailable.
*/
const PRUint64 ENABLED = ((PRUint64) 0x1) << 44;
const uint64_t ENABLED = ((uint64_t) 0x1) << 44;
/**
* Same as ENABLED state for now see bug 636158
*/
const PRUint64 SENSITIVE = ((PRUint64) 0x1) << 45;
const uint64_t SENSITIVE = ((uint64_t) 0x1) << 45;
/**
* The object is expandable, provides a UI to expand/collapse its children
* @see EXPANDED and COLLAPSED states.
*/
const PRUint64 EXPANDABLE = ((PRUint64) 0x1) << 46;
const uint64_t EXPANDABLE = ((uint64_t) 0x1) << 46;
} // namespace states
} // namespace a11y
} // namespace mozilla

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

@ -16,7 +16,7 @@ namespace statistics {
inline void A11yInitialized()
{ Telemetry::Accumulate(Telemetry::A11Y_INSTANTIATED_FLAG, true); }
inline void A11yConsumers(PRUint32 aConsumer)
inline void A11yConsumers(uint32_t aConsumer)
{ Telemetry::Accumulate(Telemetry::A11Y_CONSUMERS, aConsumer); }
/**

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

@ -115,7 +115,7 @@ StyleInfo::FormatFontStyle(const nscoord& aValue, nsAString& aFormattedValue)
}
void
StyleInfo::FormatTextDecorationStyle(PRUint8 aValue, nsAString& aFormattedValue)
StyleInfo::FormatTextDecorationStyle(uint8_t aValue, nsAString& aFormattedValue)
{
nsCSSKeyword keyword =
nsCSSProps::ValueToKeywordEnum(aValue,

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

@ -29,7 +29,7 @@ public:
static void FormatColor(const nscolor& aValue, nsString& aFormattedValue);
static void FormatFontStyle(const nscoord& aValue, nsAString& aFormattedValue);
static void FormatTextDecorationStyle(PRUint8 aValue, nsAString& aFormattedValue);
static void FormatTextDecorationStyle(uint8_t aValue, nsAString& aFormattedValue);
private:
StyleInfo() MOZ_DELETE;

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

@ -24,8 +24,8 @@ using namespace mozilla::a11y;
void
TextAttrsMgr::GetAttributes(nsIPersistentProperties* aAttributes,
PRInt32* aStartHTOffset,
PRInt32* aEndHTOffset)
int32_t* aStartHTOffset,
int32_t* aEndHTOffset)
{
// 1. Hyper text accessible must be specified always.
// 2. Offset accessible and result hyper text offsets must be specified in
@ -43,7 +43,7 @@ TextAttrsMgr::GetAttributes(nsIPersistentProperties* aAttributes,
// Embedded objects are combined into own range with empty attributes set.
if (mOffsetAcc && nsAccUtils::IsEmbeddedObject(mOffsetAcc)) {
for (PRInt32 childIdx = mOffsetAccIdx - 1; childIdx >= 0; childIdx--) {
for (int32_t childIdx = mOffsetAccIdx - 1; childIdx >= 0; childIdx--) {
Accessible* currAcc = mHyperTextAcc->GetChildAt(childIdx);
if (!nsAccUtils::IsEmbeddedObject(currAcc))
break;
@ -51,8 +51,8 @@ TextAttrsMgr::GetAttributes(nsIPersistentProperties* aAttributes,
(*aStartHTOffset)--;
}
PRUint32 childCount = mHyperTextAcc->ChildCount();
for (PRUint32 childIdx = mOffsetAccIdx + 1; childIdx < childCount;
uint32_t childCount = mHyperTextAcc->ChildCount();
for (uint32_t childIdx = mOffsetAccIdx + 1; childIdx < childCount;
childIdx++) {
Accessible* currAcc = mHyperTextAcc->GetChildAt(childIdx);
if (!nsAccUtils::IsEmbeddedObject(currAcc))
@ -126,7 +126,7 @@ TextAttrsMgr::GetAttributes(nsIPersistentProperties* aAttributes,
// Expose text attributes if applicable.
if (aAttributes) {
for (PRUint32 idx = 0; idx < ArrayLength(attrArray); idx++)
for (uint32_t idx = 0; idx < ArrayLength(attrArray); idx++)
attrArray[idx]->Expose(aAttributes, mIncludeDefAttrs);
}
@ -136,11 +136,11 @@ TextAttrsMgr::GetAttributes(nsIPersistentProperties* aAttributes,
}
void
TextAttrsMgr::GetRange(TextAttr* aAttrArray[], PRUint32 aAttrArrayLen,
PRInt32* aStartHTOffset, PRInt32* aEndHTOffset)
TextAttrsMgr::GetRange(TextAttr* aAttrArray[], uint32_t aAttrArrayLen,
int32_t* aStartHTOffset, int32_t* aEndHTOffset)
{
// Navigate backward from anchor accessible to find start offset.
for (PRInt32 childIdx = mOffsetAccIdx - 1; childIdx >= 0; childIdx--) {
for (int32_t childIdx = mOffsetAccIdx - 1; childIdx >= 0; childIdx--) {
Accessible* currAcc = mHyperTextAcc->GetChildAt(childIdx);
// Stop on embedded accessible since embedded accessibles are combined into
@ -149,7 +149,7 @@ TextAttrsMgr::GetRange(TextAttr* aAttrArray[], PRUint32 aAttrArrayLen,
break;
bool offsetFound = false;
for (PRUint32 attrIdx = 0; attrIdx < aAttrArrayLen; attrIdx++) {
for (uint32_t attrIdx = 0; attrIdx < aAttrArrayLen; attrIdx++) {
TextAttr* textAttr = aAttrArray[attrIdx];
if (!textAttr->Equal(currAcc)) {
offsetFound = true;
@ -164,14 +164,14 @@ TextAttrsMgr::GetRange(TextAttr* aAttrArray[], PRUint32 aAttrArrayLen,
}
// Navigate forward from anchor accessible to find end offset.
PRUint32 childLen = mHyperTextAcc->ChildCount();
for (PRUint32 childIdx = mOffsetAccIdx + 1; childIdx < childLen; childIdx++) {
uint32_t childLen = mHyperTextAcc->ChildCount();
for (uint32_t childIdx = mOffsetAccIdx + 1; childIdx < childLen; childIdx++) {
Accessible* currAcc = mHyperTextAcc->GetChildAt(childIdx);
if (nsAccUtils::IsEmbeddedObject(currAcc))
break;
bool offsetFound = false;
for (PRUint32 attrIdx = 0; attrIdx < aAttrArrayLen; attrIdx++) {
for (uint32_t attrIdx = 0; attrIdx < aAttrArrayLen; attrIdx++) {
TextAttr* textAttr = aAttrArray[attrIdx];
// Alter the end offset when text attribute changes its value and stop
@ -478,7 +478,7 @@ TextAttrsMgr::FontStyleTextAttr::
TextAttrsMgr::FontWeightTextAttr::
FontWeightTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame) :
TTextAttr<PRInt32>(!aFrame)
TTextAttr<int32_t>(!aFrame)
{
mRootNativeValue = GetFontWeight(aRootFrame);
mIsRootDefined = true;
@ -491,7 +491,7 @@ TextAttrsMgr::FontWeightTextAttr::
bool
TextAttrsMgr::FontWeightTextAttr::
GetValueFor(Accessible* aAccessible, PRInt32* aValue)
GetValueFor(Accessible* aAccessible, int32_t* aValue)
{
nsIContent* elm = nsCoreUtils::GetDOMElementFor(aAccessible->GetContent());
nsIFrame* frame = elm->GetPrimaryFrame();
@ -505,7 +505,7 @@ TextAttrsMgr::FontWeightTextAttr::
void
TextAttrsMgr::FontWeightTextAttr::
ExposeValue(nsIPersistentProperties* aAttributes, const PRInt32& aValue)
ExposeValue(nsIPersistentProperties* aAttributes, const int32_t& aValue)
{
nsAutoString formattedValue;
formattedValue.AppendInt(aValue);
@ -513,7 +513,7 @@ TextAttrsMgr::FontWeightTextAttr::
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::fontWeight, formattedValue);
}
PRInt32
int32_t
TextAttrsMgr::FontWeightTextAttr::
GetFontWeight(nsIFrame* aFrame)
{

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

@ -52,7 +52,7 @@ public:
TextAttrsMgr(HyperTextAccessible* aHyperTextAcc,
bool aIncludeDefAttrs,
Accessible* aOffsetAcc,
PRInt32 aOffsetAccIdx) :
int32_t aOffsetAccIdx) :
mOffsetAcc(aOffsetAcc), mHyperTextAcc(aHyperTextAcc),
mOffsetAccIdx(aOffsetAccIdx), mIncludeDefAttrs(aIncludeDefAttrs) { }
@ -68,8 +68,8 @@ public:
* @param aEndHTOffset [out, optional] end hyper text offset
*/
void GetAttributes(nsIPersistentProperties* aAttributes,
PRInt32* aStartHTOffset = nullptr,
PRInt32* aEndHTOffset = nullptr);
int32_t* aStartHTOffset = nullptr,
int32_t* aEndHTOffset = nullptr);
protected:
/**
@ -83,13 +83,13 @@ protected:
* @param aEndHTOffset [in, out] the end offset
*/
class TextAttr;
void GetRange(TextAttr* aAttrArray[], PRUint32 aAttrArrayLen,
PRInt32* aStartHTOffset, PRInt32* aEndHTOffset);
void GetRange(TextAttr* aAttrArray[], uint32_t aAttrArrayLen,
int32_t* aStartHTOffset, int32_t* aEndHTOffset);
private:
Accessible* mOffsetAcc;
HyperTextAccessible* mHyperTextAcc;
PRInt32 mOffsetAccIdx;
int32_t mOffsetAccIdx;
bool mIncludeDefAttrs;
protected:
@ -315,7 +315,7 @@ protected:
/**
* Class is used for the work with "font-weight" text attribute.
*/
class FontWeightTextAttr : public TTextAttr<PRInt32>
class FontWeightTextAttr : public TTextAttr<int32_t>
{
public:
FontWeightTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame);
@ -324,12 +324,12 @@ protected:
protected:
// TTextAttr
virtual bool GetValueFor(Accessible* aAccessible, PRInt32* aValue);
virtual bool GetValueFor(Accessible* aAccessible, int32_t* aValue);
virtual void ExposeValue(nsIPersistentProperties* aAttributes,
const PRInt32& aValue);
const int32_t& aValue);
private:
PRInt32 GetFontWeight(nsIFrame* aFrame);
int32_t GetFontWeight(nsIFrame* aFrame);
};
/**
@ -363,7 +363,7 @@ protected:
TextDecorValue(nsIFrame* aFrame);
nscolor Color() const { return mColor; }
PRUint8 Style() const { return mStyle; }
uint8_t Style() const { return mStyle; }
bool IsDefined() const
{ return IsUnderline() || IsLineThrough(); }
@ -382,8 +382,8 @@ protected:
private:
nscolor mColor;
PRUint8 mLine;
PRUint8 mStyle;
uint8_t mLine;
uint8_t mStyle;
};
class TextDecorTextAttr : public TTextAttr<TextDecorValue>

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

@ -18,11 +18,11 @@ TextUpdater::Run(DocAccessible* aDocument, TextLeafAccessible* aTextLeaf,
NS_ASSERTION(aTextLeaf, "No text leaf accessible?");
const nsString& oldText = aTextLeaf->Text();
PRUint32 oldLen = oldText.Length(), newLen = aNewText.Length();
PRUint32 minLen = NS_MIN(oldLen, newLen);
uint32_t oldLen = oldText.Length(), newLen = aNewText.Length();
uint32_t minLen = NS_MIN(oldLen, newLen);
// Skip coinciding begin substrings.
PRUint32 skipStart = 0;
uint32_t skipStart = 0;
for (; skipStart < minLen; skipStart++) {
if (aNewText[skipStart] != oldText[skipStart])
break;
@ -37,7 +37,7 @@ TextUpdater::Run(DocAccessible* aDocument, TextLeafAccessible* aTextLeaf,
void
TextUpdater::DoUpdate(const nsAString& aNewText, const nsAString& aOldText,
PRUint32 aSkipStart)
uint32_t aSkipStart)
{
Accessible* parent = mTextLeaf->Parent();
if (!parent)
@ -54,18 +54,18 @@ TextUpdater::DoUpdate(const nsAString& aNewText, const nsAString& aOldText,
NS_ASSERTION(mTextOffset != -1,
"Text leaf hasn't offset within hyper text!");
PRUint32 oldLen = aOldText.Length(), newLen = aNewText.Length();
PRUint32 minLen = NS_MIN(oldLen, newLen);
uint32_t oldLen = aOldText.Length(), newLen = aNewText.Length();
uint32_t minLen = NS_MIN(oldLen, newLen);
// Trim coinciding substrings from the end.
PRUint32 skipEnd = 0;
uint32_t skipEnd = 0;
while (minLen - skipEnd > aSkipStart &&
aNewText[newLen - skipEnd - 1] == aOldText[oldLen - skipEnd - 1]) {
skipEnd++;
}
PRUint32 strLen1 = oldLen - aSkipStart - skipEnd;
PRUint32 strLen2 = newLen - aSkipStart - skipEnd;
uint32_t strLen1 = oldLen - aSkipStart - skipEnd;
uint32_t strLen2 = newLen - aSkipStart - skipEnd;
const nsAString& str1 = Substring(aOldText, aSkipStart, strLen1);
const nsAString& str2 = Substring(aNewText, aSkipStart, strLen2);
@ -104,22 +104,22 @@ TextUpdater::DoUpdate(const nsAString& aNewText, const nsAString& aOldText,
// affect the Levenshtein distance.
// Compute the flat structured matrix need to compute the difference.
PRUint32 len1 = strLen1 + 1, len2 = strLen2 + 1;
PRUint32* entries = new PRUint32[len1 * len2];
uint32_t len1 = strLen1 + 1, len2 = strLen2 + 1;
uint32_t* entries = new uint32_t[len1 * len2];
for (PRUint32 colIdx = 0; colIdx < len1; colIdx++)
for (uint32_t colIdx = 0; colIdx < len1; colIdx++)
entries[colIdx] = colIdx;
PRUint32* row = entries;
for (PRUint32 rowIdx = 1; rowIdx < len2; rowIdx++) {
PRUint32* prevRow = row;
uint32_t* row = entries;
for (uint32_t rowIdx = 1; rowIdx < len2; rowIdx++) {
uint32_t* prevRow = row;
row += len1;
row[0] = rowIdx;
for (PRUint32 colIdx = 1; colIdx < len1; colIdx++) {
for (uint32_t colIdx = 1; colIdx < len1; colIdx++) {
if (str1[colIdx - 1] != str2[rowIdx - 1]) {
PRUint32 left = row[colIdx - 1];
PRUint32 up = prevRow[colIdx];
PRUint32 upleft = prevRow[colIdx - 1];
uint32_t left = row[colIdx - 1];
uint32_t up = prevRow[colIdx];
uint32_t upleft = prevRow[colIdx - 1];
row[colIdx] = NS_MIN(upleft, NS_MIN(left, up)) + 1;
} else {
row[colIdx] = prevRow[colIdx - 1];
@ -134,7 +134,7 @@ TextUpdater::DoUpdate(const nsAString& aNewText, const nsAString& aOldText,
delete [] entries;
// Fire events.
for (PRInt32 idx = events.Length() - 1; idx >= 0; idx--)
for (int32_t idx = events.Length() - 1; idx >= 0; idx--)
mDocument->FireDelayedAccessibleEvent(events[idx]);
mDocument->MaybeNotifyOfValueChange(mHyperText);
@ -146,18 +146,18 @@ TextUpdater::DoUpdate(const nsAString& aNewText, const nsAString& aOldText,
void
TextUpdater::ComputeTextChangeEvents(const nsAString& aStr1,
const nsAString& aStr2,
PRUint32* aEntries,
uint32_t* aEntries,
nsTArray<nsRefPtr<AccEvent> >& aEvents)
{
PRInt32 colIdx = aStr1.Length(), rowIdx = aStr2.Length();
int32_t colIdx = aStr1.Length(), rowIdx = aStr2.Length();
// Point at which strings last matched.
PRInt32 colEnd = colIdx;
PRInt32 rowEnd = rowIdx;
int32_t colEnd = colIdx;
int32_t rowEnd = rowIdx;
PRInt32 colLen = colEnd + 1;
PRUint32* row = aEntries + rowIdx * colLen;
PRUint32 dist = row[colIdx]; // current Levenshtein distance
int32_t colLen = colEnd + 1;
uint32_t* row = aEntries + rowIdx * colLen;
uint32_t dist = row[colIdx]; // current Levenshtein distance
while (rowIdx && colIdx) { // stop when we can't move diagonally
if (aStr1[colIdx - 1] == aStr2[rowIdx - 1]) { // match
if (rowIdx < rowEnd) { // deal with any pending insertion

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

@ -38,7 +38,7 @@ private:
* (if applicable) events for its container hypertext accessible.
*/
void DoUpdate(const nsAString& aNewText, const nsAString& aOldText,
PRUint32 aSkipStart);
uint32_t aSkipStart);
private:
TextUpdater();
@ -50,13 +50,13 @@ private:
*/
void ComputeTextChangeEvents(const nsAString& aStr1,
const nsAString& aStr2,
PRUint32* aEntries,
uint32_t* aEntries,
nsTArray<nsRefPtr<AccEvent> >& aEvents);
/**
* Helper to create text change events for inserted text.
*/
inline void FireInsertEvent(const nsAString& aText, PRUint32 aAddlOffset,
inline void FireInsertEvent(const nsAString& aText, uint32_t aAddlOffset,
nsTArray<nsRefPtr<AccEvent> >& aEvents)
{
nsRefPtr<AccEvent> event =
@ -68,7 +68,7 @@ private:
/**
* Helper to create text change events for removed text.
*/
inline void FireDeleteEvent(const nsAString& aText, PRUint32 aAddlOffset,
inline void FireDeleteEvent(const nsAString& aText, uint32_t aAddlOffset,
nsTArray<nsRefPtr<AccEvent> >& aEvents)
{
nsRefPtr<AccEvent> event =
@ -81,13 +81,13 @@ private:
* The constant used to skip string difference calculation in case of long
* strings.
*/
const static PRUint32 kMaxStrLen = 1 << 6;
const static uint32_t kMaxStrLen = 1 << 6;
private:
DocAccessible* mDocument;
TextLeafAccessible* mTextLeaf;
HyperTextAccessible* mHyperText;
PRInt32 mTextOffset;
int32_t mTextOffset;
};
} // namespace a11y

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

@ -636,7 +636,7 @@ nsAttributeCharacteristics nsARIAMap::gWAIUnivAttrMap[] = {
{&nsGkAtoms::aria_valuetext, ATTR_BYPASSOBJ }
};
PRUint32
uint32_t
nsARIAMap::gWAIUnivAttrMapLength = NS_ARRAY_LENGTH(nsARIAMap::gWAIUnivAttrMap);
nsRoleMapEntry*
@ -655,11 +655,11 @@ aria::GetRoleMap(nsINode* aNode)
while (tokenizer.hasMoreTokens()) {
// Do a binary search through table for the next role in role list
const nsDependentSubstring role = tokenizer.nextToken();
PRUint32 low = 0;
PRUint32 high = ArrayLength(sWAIRoleMaps);
uint32_t low = 0;
uint32_t high = ArrayLength(sWAIRoleMaps);
while (low < high) {
PRUint32 idx = (low + high) / 2;
PRInt32 compare = Compare(role, sWAIRoleMaps[idx].ARIARoleString());
uint32_t idx = (low + high) / 2;
int32_t compare = Compare(role, sWAIRoleMaps[idx].ARIARoleString());
if (compare == 0)
return sWAIRoleMaps + idx;
@ -675,11 +675,11 @@ aria::GetRoleMap(nsINode* aNode)
return &sLandmarkRoleMap;
}
PRUint64
uint64_t
aria::UniversalStatesFor(mozilla::dom::Element* aElement)
{
PRUint64 state = 0;
PRUint32 index = 0;
uint64_t state = 0;
uint32_t index = 0;
while (MapToState(sWAIUnivStateMap[index], aElement, &state))
index++;
@ -701,7 +701,7 @@ AttrIterator::Next(nsAString& aAttrName, nsAString& aAttrValue)
if (!StringBeginsWith(attrStr, NS_LITERAL_STRING("aria-")))
continue; // Not ARIA
PRUint8 attrFlags = nsAccUtils::GetAttributeCharacteristics(attrAtom);
uint8_t attrFlags = nsAccUtils::GetAttributeCharacteristics(attrAtom);
if (attrFlags & ATTR_BYPASSOBJ)
continue; // No need to handle exposing as obj attribute here

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

@ -96,13 +96,13 @@ const bool kUseNativeRole = false;
* This means it either isn't mean't to be exposed as an object attribute, or
* that it should, but is already handled in other code.
*/
const PRUint8 ATTR_BYPASSOBJ = 0x0001;
const uint8_t ATTR_BYPASSOBJ = 0x0001;
/**
* This mask indicates the attribute is expected to have an NMTOKEN or bool value.
* (See for example usage in Accessible::GetAttributes)
*/
const PRUint8 ATTR_VALTOKEN = 0x0010;
const uint8_t ATTR_VALTOKEN = 0x0010;
/**
* Small footprint storage of persistent aria attribute characteristics.
@ -110,7 +110,7 @@ const PRUint8 ATTR_VALTOKEN = 0x0010;
struct nsAttributeCharacteristics
{
nsIAtom** attributeName;
const PRUint8 characteristics;
const uint8_t characteristics;
};
@ -169,7 +169,7 @@ struct nsRoleMapEntry
ELiveAttrRule liveAttRule;
// Automatic state mapping rule: always include in nsIAccessibleStates
PRUint64 state; // or kNoReqStates if no nsIAccessibleStates are automatic for this role.
uint64_t state; // or kNoReqStates if no nsIAccessibleStates are automatic for this role.
// ARIA properties supported for this role
// (in other words, the aria-foo attribute to nsIAccessibleStates mapping rules)
@ -203,7 +203,7 @@ struct nsARIAMap
* Map of attribute to attribute characteristics.
*/
static nsAttributeCharacteristics gWAIUnivAttrMap[];
static PRUint32 gWAIUnivAttrMapLength;
static uint32_t gWAIUnivAttrMapLength;
};
namespace mozilla {
@ -224,7 +224,7 @@ nsRoleMapEntry* GetRoleMap(nsINode* aNode);
* Return accessible state from ARIA universal states applied to the given
* element.
*/
PRUint64 UniversalStatesFor(mozilla::dom::Element* aElement);
uint64_t UniversalStatesFor(mozilla::dom::Element* aElement);
/**
* Represents a simple enumerator for iterating through ARIA attributes
@ -247,8 +247,8 @@ private:
AttrIterator& operator= (const AttrIterator&) MOZ_DELETE;
nsIContent* mContent;
PRUint32 mAttrIdx;
PRUint32 mAttrCount;
uint32_t mAttrIdx;
uint32_t mAttrCount;
};
} // namespace aria

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

@ -124,7 +124,7 @@ NS_IMPL_THREADSAFE_ISUPPORTS3(nsAccDocManager,
NS_IMETHODIMP
nsAccDocManager::OnStateChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest, PRUint32 aStateFlags,
nsIRequest *aRequest, uint32_t aStateFlags,
nsresult aStatus)
{
NS_ASSERTION(aStateFlags & STATE_IS_DOCUMENT, "Other notifications excluded");
@ -151,7 +151,7 @@ nsAccDocManager::OnStateChange(nsIWebProgress *aWebProgress,
#endif
// Figure out an event type to notify the document has been loaded.
PRUint32 eventType = nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_STOPPED;
uint32_t eventType = nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_STOPPED;
// Some XUL documents get start state and then stop state with failure
// status when everything is ok. Fire document load complete event in this
@ -163,7 +163,7 @@ nsAccDocManager::OnStateChange(nsIWebProgress *aWebProgress,
// any event because it means no new document has been loaded, for example,
// it happens when user clicks on file link.
if (aRequest) {
PRUint32 loadFlags = 0;
uint32_t loadFlags = 0;
aRequest->GetLoadFlags(&loadFlags);
if (loadFlags & nsIChannel::LOAD_RETARGETED_DOCUMENT_URI)
eventType = 0;
@ -188,7 +188,7 @@ nsAccDocManager::OnStateChange(nsIWebProgress *aWebProgress,
NS_ENSURE_STATE(docShell);
bool isReloading = false;
PRUint32 loadType;
uint32_t loadType;
docShell->GetLoadType(&loadType);
if (loadType == LOAD_RELOAD_NORMAL ||
loadType == LOAD_RELOAD_BYPASS_CACHE ||
@ -204,10 +204,10 @@ nsAccDocManager::OnStateChange(nsIWebProgress *aWebProgress,
NS_IMETHODIMP
nsAccDocManager::OnProgressChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
PRInt32 aCurSelfProgress,
PRInt32 aMaxSelfProgress,
PRInt32 aCurTotalProgress,
PRInt32 aMaxTotalProgress)
int32_t aCurSelfProgress,
int32_t aMaxSelfProgress,
int32_t aCurTotalProgress,
int32_t aMaxTotalProgress)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
@ -216,7 +216,7 @@ nsAccDocManager::OnProgressChange(nsIWebProgress *aWebProgress,
NS_IMETHODIMP
nsAccDocManager::OnLocationChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest, nsIURI *aLocation,
PRUint32 aFlags)
uint32_t aFlags)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
@ -234,7 +234,7 @@ nsAccDocManager::OnStatusChange(nsIWebProgress *aWebProgress,
NS_IMETHODIMP
nsAccDocManager::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
PRUint32 aState)
uint32_t aState)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
@ -306,7 +306,7 @@ nsAccDocManager::HandleEvent(nsIDOMEvent *aEvent)
void
nsAccDocManager::HandleDOMDocumentLoad(nsIDocument *aDocument,
PRUint32 aLoadEventType)
uint32_t aLoadEventType)
{
// Document accessible can be created before we were notified the DOM document
// was loaded completely. However if it's not created yet then create it.

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

@ -96,7 +96,7 @@ private:
* if 0 then no event is fired
*/
void HandleDOMDocumentLoad(nsIDocument* aDocument,
PRUint32 aLoadEventType);
uint32_t aLoadEventType);
/**
* Add 'pagehide' and 'DOMContentLoaded' event listeners.

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

@ -22,7 +22,7 @@ struct WalkState
nsCOMPtr<nsIContent> content;
nsCOMPtr<nsINodeList> childList;
PRUint32 childIdx;
uint32_t childIdx;
WalkState *prevState;
};
@ -69,7 +69,7 @@ nsAccTreeWalker::NextChildInternal(bool aNoWalkUp)
if (!mState->childList)
mState->childList = mState->content->GetChildren(mChildFilter);
PRUint32 length = 0;
uint32_t length = 0;
if (mState->childList)
mState->childList->GetLength(&length);

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

@ -60,7 +60,7 @@ private:
void PopState();
DocAccessible* mDoc;
PRInt32 mChildFilter;
int32_t mChildFilter;
bool mWalkCache;
WalkState* mState;
};

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

@ -47,8 +47,8 @@ nsAccUtils::SetAccAttr(nsIPersistentProperties *aAttributes,
void
nsAccUtils::SetAccGroupAttrs(nsIPersistentProperties *aAttributes,
PRInt32 aLevel, PRInt32 aSetSize,
PRInt32 aPosInSet)
int32_t aLevel, int32_t aSetSize,
int32_t aPosInSet)
{
nsAutoString value;
@ -68,7 +68,7 @@ nsAccUtils::SetAccGroupAttrs(nsIPersistentProperties *aAttributes,
}
}
PRInt32
int32_t
nsAccUtils::GetDefaultLevel(Accessible* aAccessible)
{
roles::Role role = aAccessible->Role();
@ -87,10 +87,10 @@ nsAccUtils::GetDefaultLevel(Accessible* aAccessible)
return 0;
}
PRInt32
int32_t
nsAccUtils::GetARIAOrDefaultLevel(Accessible* aAccessible)
{
PRInt32 level = 0;
int32_t level = 0;
nsCoreUtils::GetUIntAttr(aAccessible->GetContent(),
nsGkAtoms::aria_level, &level);
@ -100,7 +100,7 @@ nsAccUtils::GetARIAOrDefaultLevel(Accessible* aAccessible)
return GetDefaultLevel(aAccessible);
}
PRInt32
int32_t
nsAccUtils::GetLevelForXULContainerItem(nsIContent *aContent)
{
nsCOMPtr<nsIDOMXULContainerItemElement> item(do_QueryInterface(aContent));
@ -113,7 +113,7 @@ nsAccUtils::GetLevelForXULContainerItem(nsIContent *aContent)
return 0;
// Get level of the item.
PRInt32 level = -1;
int32_t level = -1;
while (container) {
level++;
@ -205,7 +205,7 @@ nsAccUtils::GetARIAToken(dom::Element* aElement, nsIAtom* aAttr)
{ &nsGkAtoms::_false, &nsGkAtoms::_true,
&nsGkAtoms::mixed, nullptr};
PRInt32 idx = aElement->FindAttrValueIn(kNameSpaceID_None,
int32_t idx = aElement->FindAttrValueIn(kNameSpaceID_None,
aAttr, tokens, eCaseMatters);
if (idx >= 0)
return *(tokens[idx]);
@ -214,12 +214,12 @@ nsAccUtils::GetARIAToken(dom::Element* aElement, nsIAtom* aAttr)
}
Accessible*
nsAccUtils::GetAncestorWithRole(Accessible* aDescendant, PRUint32 aRole)
nsAccUtils::GetAncestorWithRole(Accessible* aDescendant, uint32_t aRole)
{
Accessible* document = aDescendant->Document();
Accessible* parent = aDescendant;
while ((parent = parent->Parent())) {
PRUint32 testRole = parent->Role();
uint32_t testRole = parent->Role();
if (testRole == aRole)
return parent;
@ -230,7 +230,7 @@ nsAccUtils::GetAncestorWithRole(Accessible* aDescendant, PRUint32 aRole)
}
Accessible*
nsAccUtils::GetSelectableContainer(Accessible* aAccessible, PRUint64 aState)
nsAccUtils::GetSelectableContainer(Accessible* aAccessible, uint64_t aState)
{
if (!aAccessible)
return nullptr;
@ -265,7 +265,7 @@ nsAccUtils::GetTextAccessibleFromSelection(nsISelection* aSelection)
if (!focusDOMNode)
return nullptr;
PRInt32 focusOffset = 0;
int32_t focusOffset = 0;
aSelection->GetFocusOffset(&focusOffset);
nsCOMPtr<nsINode> focusNode(do_QueryInterface(focusDOMNode));
@ -295,8 +295,8 @@ nsAccUtils::GetTextAccessibleFromSelection(nsISelection* aSelection)
}
nsresult
nsAccUtils::ConvertToScreenCoords(PRInt32 aX, PRInt32 aY,
PRUint32 aCoordinateType,
nsAccUtils::ConvertToScreenCoords(int32_t aX, int32_t aY,
uint32_t aCoordinateType,
nsAccessNode *aAccessNode,
nsIntPoint *aCoords)
{
@ -330,8 +330,8 @@ nsAccUtils::ConvertToScreenCoords(PRInt32 aX, PRInt32 aY,
}
nsresult
nsAccUtils::ConvertScreenCoordsTo(PRInt32 *aX, PRInt32 *aY,
PRUint32 aCoordinateType,
nsAccUtils::ConvertScreenCoordsTo(int32_t *aX, int32_t *aY,
uint32_t aCoordinateType,
nsAccessNode *aAccessNode)
{
switch (aCoordinateType) {
@ -385,10 +385,10 @@ nsAccUtils::GetScreenCoordsForParent(nsAccessNode *aAccessNode)
return nsIntPoint(parentRect.x, parentRect.y);
}
PRUint8
uint8_t
nsAccUtils::GetAttributeCharacteristics(nsIAtom* aAtom)
{
for (PRUint32 i = 0; i < nsARIAMap::gWAIUnivAttrMapLength; i++)
for (uint32_t i = 0; i < nsARIAMap::gWAIUnivAttrMapLength; i++)
if (*nsARIAMap::gWAIUnivAttrMap[i].attributeName == aAtom)
return nsARIAMap::gWAIUnivAttrMap[i].characteristics;
@ -396,7 +396,7 @@ nsAccUtils::GetAttributeCharacteristics(nsIAtom* aAtom)
}
bool
nsAccUtils::GetLiveAttrValue(PRUint32 aRule, nsAString& aValue)
nsAccUtils::GetLiveAttrValue(uint32_t aRule, nsAString& aValue)
{
switch (aRule) {
case eOffLiveAttr:
@ -421,8 +421,8 @@ nsAccUtils::IsTextInterfaceSupportCorrect(Accessible* aAccessible)
return true;
bool foundText = false;
PRUint32 childCount = aAccessible->ChildCount();
for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
uint32_t childCount = aAccessible->ChildCount();
for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) {
Accessible* child = aAccessible->GetChildAt(childIdx);
if (IsText(child)) {
foundText = true;
@ -441,7 +441,7 @@ nsAccUtils::IsTextInterfaceSupportCorrect(Accessible* aAccessible)
}
#endif
PRUint32
uint32_t
nsAccUtils::TextLength(Accessible* aAccessible)
{
if (!IsText(aAccessible))
@ -484,27 +484,27 @@ nsAccUtils::MustPrune(Accessible* aAccessible)
nsresult
nsAccUtils::GetHeaderCellsFor(nsIAccessibleTable *aTable,
nsIAccessibleTableCell *aCell,
PRInt32 aRowOrColHeaderCells, nsIArray **aCells)
int32_t aRowOrColHeaderCells, nsIArray **aCells)
{
nsresult rv = NS_OK;
nsCOMPtr<nsIMutableArray> cells = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
PRInt32 rowIdx = -1;
int32_t rowIdx = -1;
rv = aCell->GetRowIndex(&rowIdx);
NS_ENSURE_SUCCESS(rv, rv);
PRInt32 colIdx = -1;
int32_t colIdx = -1;
rv = aCell->GetColumnIndex(&colIdx);
NS_ENSURE_SUCCESS(rv, rv);
bool moveToLeft = aRowOrColHeaderCells == eRowHeaderCells;
// Move to the left or top to find row header cells or column header cells.
PRInt32 index = (moveToLeft ? colIdx : rowIdx) - 1;
int32_t index = (moveToLeft ? colIdx : rowIdx) - 1;
for (; index >= 0; index--) {
PRInt32 curRowIdx = moveToLeft ? rowIdx : index;
PRInt32 curColIdx = moveToLeft ? index : colIdx;
int32_t curRowIdx = moveToLeft ? rowIdx : index;
int32_t curColIdx = moveToLeft ? index : colIdx;
nsCOMPtr<nsIAccessible> cell;
rv = aTable->GetCellAt(curRowIdx, curColIdx, getter_AddRefs(cell));
@ -516,7 +516,7 @@ nsAccUtils::GetHeaderCellsFor(nsIAccessibleTable *aTable,
// GetCellAt should always return an nsIAccessibleTableCell (XXX Bug 587529)
NS_ENSURE_STATE(tableCellAcc);
PRInt32 origIdx = 1;
int32_t origIdx = 1;
if (moveToLeft)
rv = tableCellAcc->GetColumnIndex(&origIdx);
else
@ -525,7 +525,7 @@ nsAccUtils::GetHeaderCellsFor(nsIAccessibleTable *aTable,
if (origIdx == index) {
// Append original header cells only.
PRUint32 role = Role(cell);
uint32_t role = Role(cell);
bool isHeader = moveToLeft ?
role == nsIAccessibleRole::ROLE_ROWHEADER :
role == nsIAccessibleRole::ROLE_COLUMNHEADER;

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

@ -57,24 +57,24 @@ public:
* Set group attributes ('level', 'setsize', 'posinset').
*/
static void SetAccGroupAttrs(nsIPersistentProperties *aAttributes,
PRInt32 aLevel, PRInt32 aSetSize,
PRInt32 aPosInSet);
int32_t aLevel, int32_t aSetSize,
int32_t aPosInSet);
/**
* Get default value of the level for the given accessible.
*/
static PRInt32 GetDefaultLevel(Accessible* aAcc);
static int32_t GetDefaultLevel(Accessible* aAcc);
/**
* Return ARIA level value or the default one if ARIA is missed for the
* given accessible.
*/
static PRInt32 GetARIAOrDefaultLevel(Accessible* aAccessible);
static int32_t GetARIAOrDefaultLevel(Accessible* aAccessible);
/**
* Compute group level for nsIDOMXULContainerItemElement node.
*/
static PRInt32 GetLevelForXULContainerItem(nsIContent *aContent);
static int32_t GetLevelForXULContainerItem(nsIContent *aContent);
/**
* Set container-foo live region attributes for the given node.
@ -130,7 +130,7 @@ public:
* nullptr if no match is found
*/
static Accessible* GetAncestorWithRole(Accessible* aDescendant,
PRUint32 aRole);
uint32_t aRole);
/**
* Return single or multi selectable container for the given item.
@ -139,7 +139,7 @@ public:
* @param aState [in] the state of the item accessible
*/
static Accessible* GetSelectableContainer(Accessible* aAccessible,
PRUint64 aState);
uint64_t aState);
/**
* Return true if the DOM node of given accessible has aria-selected="true"
@ -168,8 +168,8 @@ public:
* relative it.
* @param aCoords [out] converted coordinates
*/
static nsresult ConvertToScreenCoords(PRInt32 aX, PRInt32 aY,
PRUint32 aCoordinateType,
static nsresult ConvertToScreenCoords(int32_t aX, int32_t aY,
uint32_t aCoordinateType,
nsAccessNode *aAccessNode,
nsIntPoint *aCoords);
@ -184,8 +184,8 @@ public:
* @param aAccessNode [in] the accessible if coordinates are given
* relative it
*/
static nsresult ConvertScreenCoordsTo(PRInt32 *aX, PRInt32 *aY,
PRUint32 aCoordinateType,
static nsresult ConvertScreenCoordsTo(int32_t *aX, int32_t *aY,
uint32_t aCoordinateType,
nsAccessNode *aAccessNode);
/**
@ -205,9 +205,9 @@ public:
/**
* Return the role of the given accessible.
*/
static PRUint32 Role(nsIAccessible *aAcc)
static uint32_t Role(nsIAccessible *aAcc)
{
PRUint32 role = nsIAccessibleRole::ROLE_NOTHING;
uint32_t role = nsIAccessibleRole::ROLE_NOTHING;
if (aAcc)
aAcc->GetRole(&role);
@ -221,7 +221,7 @@ public:
* @return A bitflag representing the attribute characteristics
* (see nsARIAMap.h for possible bit masks, prefixed "ARIA_")
*/
static PRUint8 GetAttributeCharacteristics(nsIAtom* aAtom);
static uint8_t GetAttributeCharacteristics(nsIAtom* aAtom);
/**
* Get the 'live' or 'container-live' object attribute value from the given
@ -232,7 +232,7 @@ public:
*
* @return true if object attribute should be exposed
*/
static bool GetLiveAttrValue(PRUint32 aRule, nsAString& aValue);
static bool GetLiveAttrValue(uint32_t aRule, nsAString& aValue);
#ifdef DEBUG
/**
@ -247,7 +247,7 @@ public:
*/
static bool IsText(nsIAccessible *aAcc)
{
PRUint32 role = Role(aAcc);
uint32_t role = Role(aAcc);
return role == nsIAccessibleRole::ROLE_TEXT_LEAF ||
role == nsIAccessibleRole::ROLE_STATICTEXT;
}
@ -255,14 +255,14 @@ public:
/**
* Return text length of the given accessible, return 0 on failure.
*/
static PRUint32 TextLength(Accessible* aAccessible);
static uint32_t TextLength(Accessible* aAccessible);
/**
* Return true if the given accessible is embedded object.
*/
static bool IsEmbeddedObject(nsIAccessible *aAcc)
{
PRUint32 role = Role(aAcc);
uint32_t role = Role(aAcc);
return role != nsIAccessibleRole::ROLE_TEXT_LEAF &&
role != nsIAccessibleRole::ROLE_WHITESPACE &&
role != nsIAccessibleRole::ROLE_STATICTEXT;
@ -271,21 +271,21 @@ public:
/**
* Transform nsIAccessibleStates constants to internal state constant.
*/
static inline PRUint64 To64State(PRUint32 aState1, PRUint32 aState2)
static inline uint64_t To64State(uint32_t aState1, uint32_t aState2)
{
return static_cast<PRUint64>(aState1) +
(static_cast<PRUint64>(aState2) << 31);
return static_cast<uint64_t>(aState1) +
(static_cast<uint64_t>(aState2) << 31);
}
/**
* Transform internal state constant to nsIAccessibleStates constants.
*/
static inline void To32States(PRUint64 aState64,
PRUint32* aState1, PRUint32* aState2)
static inline void To32States(uint64_t aState64,
uint32_t* aState1, uint32_t* aState2)
{
*aState1 = aState64 & 0x7fffffff;
if (aState2)
*aState2 = static_cast<PRUint32>(aState64 >> 31);
*aState2 = static_cast<uint32_t>(aState64 >> 31);
}
/**
@ -317,7 +317,7 @@ public:
*/
static nsresult GetHeaderCellsFor(nsIAccessibleTable *aTable,
nsIAccessibleTableCell *aCell,
PRInt32 aRowOrColHeaderCells,
int32_t aRowOrColHeaderCells,
nsIArray **aCells);
};

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

@ -132,7 +132,7 @@ nsAccessibilityService::NotifyOfAnchorJumpTo(nsIContent* aTargetNode)
// nsIAccessibilityService
void
nsAccessibilityService::FireAccessibleEvent(PRUint32 aEvent,
nsAccessibilityService::FireAccessibleEvent(uint32_t aEvent,
Accessible* aTarget)
{
nsEventShell::FireEvent(aEvent, aTarget);
@ -627,7 +627,7 @@ nsAccessibilityService::GetAccessibleFor(nsIDOMNode *aNode,
}
NS_IMETHODIMP
nsAccessibilityService::GetStringRole(PRUint32 aRole, nsAString& aString)
nsAccessibilityService::GetStringRole(uint32_t aRole, nsAString& aString)
{
#define ROLE(geckoRole, stringRole, atkRole, \
macRole, msaaRole, ia2Role, nameRule) \
@ -646,13 +646,13 @@ nsAccessibilityService::GetStringRole(PRUint32 aRole, nsAString& aString)
}
NS_IMETHODIMP
nsAccessibilityService::GetStringStates(PRUint32 aState, PRUint32 aExtraState,
nsAccessibilityService::GetStringStates(uint32_t aState, uint32_t aExtraState,
nsIDOMDOMStringList **aStringStates)
{
nsAccessibleDOMStringList* stringStates = new nsAccessibleDOMStringList();
NS_ENSURE_TRUE(stringStates, NS_ERROR_OUT_OF_MEMORY);
PRUint64 state = nsAccUtils::To64State(aState, aExtraState);
uint64_t state = nsAccUtils::To64State(aState, aExtraState);
// states
if (state & states::UNAVAILABLE)
@ -753,7 +753,7 @@ nsAccessibilityService::GetStringStates(PRUint32 aState, PRUint32 aExtraState,
stringStates->Add(NS_LITERAL_STRING("expandable"));
//unknown states
PRUint32 stringStatesLength = 0;
uint32_t stringStatesLength = 0;
stringStates->GetLength(&stringStatesLength);
if (!stringStatesLength)
stringStates->Add(NS_LITERAL_STRING("unknown"));
@ -764,7 +764,7 @@ nsAccessibilityService::GetStringStates(PRUint32 aState, PRUint32 aExtraState,
// nsIAccessibleRetrieval::getStringEventType()
NS_IMETHODIMP
nsAccessibilityService::GetStringEventType(PRUint32 aEventType,
nsAccessibilityService::GetStringEventType(uint32_t aEventType,
nsAString& aString)
{
NS_ASSERTION(nsIAccessibleEvent::EVENT_LAST_ENTRY == ArrayLength(kEventTypeNames),
@ -781,7 +781,7 @@ nsAccessibilityService::GetStringEventType(PRUint32 aEventType,
// nsIAccessibleRetrieval::getStringRelationType()
NS_IMETHODIMP
nsAccessibilityService::GetStringRelationType(PRUint32 aRelationType,
nsAccessibilityService::GetStringRelationType(uint32_t aRelationType,
nsAString& aString)
{
if (aRelationType >= ArrayLength(kRelationTypeNames)) {
@ -1273,7 +1273,7 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
if (!accessibleProvider)
return nullptr;
PRInt32 type;
int32_t type;
nsresult rv = accessibleProvider->GetAccessibleType(&type);
if (NS_FAILED(rv))
return nullptr;
@ -1778,7 +1778,7 @@ nsAccessibilityService::CreateAccessibleForXULTree(nsIContent* aContent,
if (!treeColumns)
return nullptr;
PRInt32 count = 0;
int32_t count = 0;
treeColumns->GetCount(&count);
// Outline of list accessible.

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

@ -178,7 +178,7 @@ public:
*/
void RecreateAccessible(nsIPresShell* aPresShell, nsIContent* aContent);
virtual void FireAccessibleEvent(PRUint32 aEvent, Accessible* aTarget);
virtual void FireAccessibleEvent(uint32_t aEvent, Accessible* aTarget);
// nsAccessibiltiyService

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

@ -32,13 +32,13 @@ public:
nsMemory::Free(mAcceptRoles);
}
nsresult ApplyFilter(Accessible* aAccessible, PRUint16* aResult);
nsresult ApplyFilter(Accessible* aAccessible, uint16_t* aResult);
private:
nsCOMPtr<nsIAccessibleTraversalRule> mRule;
PRUint32* mAcceptRoles;
PRUint32 mAcceptRolesLength;
PRUint32 mPreFilter;
uint32_t* mAcceptRoles;
uint32_t mAcceptRolesLength;
uint32_t mPreFilter;
};
////////////////////////////////////////////////////////////////////////////////
@ -59,7 +59,7 @@ NS_IMPL_CYCLE_COLLECTION_CLASS(nsAccessiblePivot)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsAccessiblePivot)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mRoot, nsIAccessible)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mPosition, nsIAccessible)
PRUint32 i, length = tmp->mObservers.Length(); \
uint32_t i, length = tmp->mObservers.Length(); \
for (i = 0; i < length; ++i) {
cb.NoteXPCOMChild(tmp->mObservers.ElementAt(i).get());
}
@ -116,7 +116,7 @@ nsAccessiblePivot::SetPosition(nsIAccessible* aPosition)
// Swap old position with new position, saves us an AddRef/Release.
mPosition.swap(secondPosition);
PRInt32 oldStart = mStartOffset, oldEnd = mEndOffset;
int32_t oldStart = mStartOffset, oldEnd = mEndOffset;
mStartOffset = mEndOffset = -1;
NotifyOfPivotChange(secondPosition, oldStart, oldEnd,
nsIAccessiblePivot::REASON_NONE);
@ -125,7 +125,7 @@ nsAccessiblePivot::SetPosition(nsIAccessible* aPosition)
}
NS_IMETHODIMP
nsAccessiblePivot::GetStartOffset(PRInt32* aStartOffset)
nsAccessiblePivot::GetStartOffset(int32_t* aStartOffset)
{
NS_ENSURE_ARG_POINTER(aStartOffset);
@ -135,7 +135,7 @@ nsAccessiblePivot::GetStartOffset(PRInt32* aStartOffset)
}
NS_IMETHODIMP
nsAccessiblePivot::GetEndOffset(PRInt32* aEndOffset)
nsAccessiblePivot::GetEndOffset(int32_t* aEndOffset)
{
NS_ENSURE_ARG_POINTER(aEndOffset);
@ -146,7 +146,7 @@ nsAccessiblePivot::GetEndOffset(PRInt32* aEndOffset)
NS_IMETHODIMP
nsAccessiblePivot::SetTextRange(nsIAccessibleText* aTextAccessible,
PRInt32 aStartOffset, PRInt32 aEndOffset)
int32_t aStartOffset, int32_t aEndOffset)
{
NS_ENSURE_ARG(aTextAccessible);
@ -165,12 +165,12 @@ nsAccessiblePivot::SetTextRange(nsIAccessibleText* aTextAccessible,
return NS_ERROR_INVALID_ARG;
// Make sure the given offsets don't exceed the character count.
PRInt32 charCount = newPosition->CharacterCount();
int32_t charCount = newPosition->CharacterCount();
if (aEndOffset > charCount)
return NS_ERROR_FAILURE;
PRInt32 oldStart = mStartOffset, oldEnd = mEndOffset;
int32_t oldStart = mStartOffset, oldEnd = mEndOffset;
mStartOffset = aStartOffset;
mEndOffset = aEndOffset;
@ -188,7 +188,7 @@ nsAccessiblePivot::SetTextRange(nsIAccessibleText* aTextAccessible,
NS_IMETHODIMP
nsAccessiblePivot::MoveNext(nsIAccessibleTraversalRule* aRule,
nsIAccessible* aAnchor, bool aIncludeStart,
PRUint8 aArgc, bool* aResult)
uint8_t aArgc, bool* aResult)
{
NS_ENSURE_ARG(aResult);
NS_ENSURE_ARG(aRule);
@ -215,7 +215,7 @@ NS_IMETHODIMP
nsAccessiblePivot::MovePrevious(nsIAccessibleTraversalRule* aRule,
nsIAccessible* aAnchor,
bool aIncludeStart,
PRUint8 aArgc, bool* aResult)
uint8_t aArgc, bool* aResult)
{
NS_ENSURE_ARG(aResult);
NS_ENSURE_ARG(aRule);
@ -309,7 +309,7 @@ nsAccessiblePivot::MovePreviousByText(TextBoundaryType aBoundary, bool* aResult)
NS_IMETHODIMP
nsAccessiblePivot::MoveToPoint(nsIAccessibleTraversalRule* aRule,
PRInt32 aX, PRInt32 aY, bool aIgnoreNoMatch,
int32_t aX, int32_t aY, bool aIgnoreNoMatch,
bool* aResult)
{
NS_ENSURE_ARG_POINTER(aResult);
@ -324,7 +324,7 @@ nsAccessiblePivot::MoveToPoint(nsIAccessibleTraversalRule* aRule,
Accessible* match = nullptr;
Accessible* child = mRoot->ChildAtPoint(aX, aY, Accessible::eDeepestChild);
while (child && mRoot != child) {
PRUint16 filtered = nsIAccessibleTraversalRule::FILTER_IGNORE;
uint16_t filtered = nsIAccessibleTraversalRule::FILTER_IGNORE;
nsresult rv = cache.ApplyFilter(child, &filtered);
NS_ENSURE_SUCCESS(rv, rv);
@ -334,7 +334,7 @@ nsAccessiblePivot::MoveToPoint(nsIAccessibleTraversalRule* aRule,
// Match if no node below this is a match
if ((filtered & nsIAccessibleTraversalRule::FILTER_MATCH) && !match) {
PRInt32 childX, childY, childWidth, childHeight;
int32_t childX, childY, childWidth, childHeight;
child->GetBounds(&childX, &childY, &childWidth, &childHeight);
// Double-check child's bounds since the deepest child may have been out
// of bounds. This assures we don't return a false positive.
@ -396,7 +396,7 @@ nsAccessiblePivot::MovePivotInternal(Accessible* aPosition,
{
nsRefPtr<Accessible> oldPosition = mPosition.forget();
mPosition = aPosition;
PRInt32 oldStart = mStartOffset, oldEnd = mEndOffset;
int32_t oldStart = mStartOffset, oldEnd = mEndOffset;
mStartOffset = mEndOffset = -1;
return NotifyOfPivotChange(oldPosition, oldStart, oldEnd, aReason);
@ -417,7 +417,7 @@ nsAccessiblePivot::SearchBackward(Accessible* aAccessible,
RuleCache cache(aRule);
Accessible* accessible = aAccessible;
PRUint16 filtered = nsIAccessibleTraversalRule::FILTER_IGNORE;
uint16_t filtered = nsIAccessibleTraversalRule::FILTER_IGNORE;
if (aSearchCurrent) {
*aResult = cache.ApplyFilter(accessible, &filtered);
@ -428,7 +428,7 @@ nsAccessiblePivot::SearchBackward(Accessible* aAccessible,
while (accessible != mRoot) {
Accessible* parent = accessible->Parent();
PRInt32 idxInParent = accessible->IndexInParent();
int32_t idxInParent = accessible->IndexInParent();
while (idxInParent > 0) {
if (!(accessible = parent->GetChildAt(--idxInParent)))
continue;
@ -476,7 +476,7 @@ nsAccessiblePivot::SearchForward(Accessible* aAccessible,
RuleCache cache(aRule);
PRUint16 filtered = nsIAccessibleTraversalRule::FILTER_IGNORE;
uint16_t filtered = nsIAccessibleTraversalRule::FILTER_IGNORE;
*aResult = cache.ApplyFilter(accessible, &filtered);
NS_ENSURE_SUCCESS(*aResult, nullptr);
if (aSearchCurrent && (filtered & nsIAccessibleTraversalRule::FILTER_MATCH))
@ -522,8 +522,8 @@ nsAccessiblePivot::SearchForward(Accessible* aAccessible,
bool
nsAccessiblePivot::NotifyOfPivotChange(Accessible* aOldPosition,
PRInt32 aOldStart, PRInt32 aOldEnd,
PRInt16 aReason)
int32_t aOldStart, int32_t aOldEnd,
int16_t aReason)
{
if (aOldPosition == mPosition &&
aOldStart == mStartOffset && aOldEnd == mEndOffset)
@ -539,7 +539,7 @@ nsAccessiblePivot::NotifyOfPivotChange(Accessible* aOldPosition,
}
nsresult
RuleCache::ApplyFilter(Accessible* aAccessible, PRUint16* aResult)
RuleCache::ApplyFilter(Accessible* aAccessible, uint16_t* aResult)
{
*aResult = nsIAccessibleTraversalRule::FILTER_IGNORE;
@ -551,7 +551,7 @@ RuleCache::ApplyFilter(Accessible* aAccessible, PRUint16* aResult)
}
if (mPreFilter) {
PRUint64 state = aAccessible->State();
uint64_t state = aAccessible->State();
if ((nsIAccessibleTraversalRule::PREFILTER_INVISIBLE & mPreFilter) &&
(state & states::INVISIBLE))
@ -567,9 +567,9 @@ RuleCache::ApplyFilter(Accessible* aAccessible, PRUint16* aResult)
}
if (mAcceptRolesLength > 0) {
PRUint32 accessibleRole = aAccessible->Role();
uint32_t accessibleRole = aAccessible->Role();
bool matchesRole = false;
for (PRUint32 idx = 0; idx < mAcceptRolesLength; idx++) {
for (uint32_t idx = 0; idx < mAcceptRolesLength; idx++) {
matchesRole = mAcceptRoles[idx] == accessibleRole;
if (matchesRole)
break;

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

@ -45,7 +45,7 @@ private:
* observers have been notified.
*/
bool NotifyOfPivotChange(Accessible* aOldAccessible,
PRInt32 aOldStart, PRInt32 aOldEnd,
int32_t aOldStart, int32_t aOldEnd,
PivotMoveReason aReason);
/*
@ -88,12 +88,12 @@ private:
/*
* The text start offset ofthe pivot.
*/
PRInt32 mStartOffset;
int32_t mStartOffset;
/*
* The text end offset ofthe pivot.
*/
PRInt32 mEndOffset;
int32_t mEndOffset;
/*
* The list of pivot-changed observers.

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

@ -173,7 +173,7 @@ nsCaretAccessible::RemoveDocSelectionListener(nsIPresShell *aShell)
NS_IMETHODIMP
nsCaretAccessible::NotifySelectionChanged(nsIDOMDocument* aDOMDocument,
nsISelection* aSelection,
PRInt16 aReason)
int16_t aReason)
{
NS_ENSURE_ARG(aDOMDocument);
NS_ENSURE_STATE(mRootAccessible);
@ -204,7 +204,7 @@ nsCaretAccessible::ProcessSelectionChanged(nsISelection* aSelection)
{
nsCOMPtr<nsISelectionPrivate> privSel(do_QueryInterface(aSelection));
PRInt16 type = 0;
int16_t type = 0;
privSel->GetType(&type);
if (type == nsISelectionController::SELECTION_NORMAL)
@ -219,7 +219,7 @@ nsCaretAccessible::NormalSelectionChanged(nsISelection* aSelection)
{
mLastUsedSelection = do_GetWeakReference(aSelection);
PRInt32 rangeCount = 0;
int32_t rangeCount = 0;
aSelection->GetRangeCount(&rangeCount);
if (rangeCount == 0) {
mLastTextAccessible = nullptr;
@ -231,13 +231,13 @@ nsCaretAccessible::NormalSelectionChanged(nsISelection* aSelection)
if (!textAcc)
return;
PRInt32 caretOffset = -1;
int32_t caretOffset = -1;
nsresult rv = textAcc->GetCaretOffset(&caretOffset);
if (NS_FAILED(rv))
return;
if (textAcc == mLastTextAccessible && caretOffset == mLastCaretOffset) {
PRInt32 selectionCount = 0;
int32_t selectionCount = 0;
textAcc->GetSelectionCount(&selectionCount); // Don't swallow similar events when selecting text
if (!selectionCount)
return; // Swallow duplicate caret event
@ -322,7 +322,7 @@ nsCaretAccessible::GetCaretRect(nsIWidget **aOutWidget)
// Correct for character size, so that caret always matches the size of the character
// This is important for font size transitions, and is necessary because the Gecko caret uses the
// previous character's size as the user moves forward in the text by character.
PRInt32 charX, charY, charWidth, charHeight;
int32_t charX, charY, charWidth, charHeight;
if (NS_SUCCEEDED(mLastTextAccessible->GetCharacterExtents(mLastCaretOffset, &charX, &charY,
&charWidth, &charHeight,
nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE))) {

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

@ -118,7 +118,7 @@ private:
// a document where the selection changed.
nsCOMPtr<nsIWeakReference> mLastUsedSelection; // Weak ref to nsISelection
nsRefPtr<HyperTextAccessible> mLastTextAccessible;
PRInt32 mLastCaretOffset;
int32_t mLastCaretOffset;
mozilla::a11y::RootAccessible* mRootAccessible;
};

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

@ -57,7 +57,7 @@ nsCoreUtils::HasClickListener(nsIContent *aContent)
void
nsCoreUtils::DispatchClickEvent(nsITreeBoxObject *aTreeBoxObj,
PRInt32 aRowIndex, nsITreeColumn *aColumn,
int32_t aRowIndex, nsITreeColumn *aColumn,
const nsCString& aPseudoElt)
{
nsCOMPtr<nsIDOMElement> tcElm;
@ -79,7 +79,7 @@ nsCoreUtils::DispatchClickEvent(nsITreeBoxObject *aTreeBoxObj,
aTreeBoxObj->EnsureRowIsVisible(aRowIndex);
// Calculate x and y coordinates.
PRInt32 x = 0, y = 0, width = 0, height = 0;
int32_t x = 0, y = 0, width = 0, height = 0;
nsresult rv = aTreeBoxObj->GetCoordsForCellItem(aRowIndex, aColumn,
aPseudoElt,
&x, &y, &width, &height);
@ -90,10 +90,10 @@ nsCoreUtils::DispatchClickEvent(nsITreeBoxObject *aTreeBoxObj,
nsCOMPtr<nsIBoxObject> tcBoxObj;
tcXULElm->GetBoxObject(getter_AddRefs(tcBoxObj));
PRInt32 tcX = 0;
int32_t tcX = 0;
tcBoxObj->GetX(&tcX);
PRInt32 tcY = 0;
int32_t tcY = 0;
tcBoxObj->GetY(&tcY);
// Dispatch mouse events.
@ -106,9 +106,9 @@ nsCoreUtils::DispatchClickEvent(nsITreeBoxObject *aTreeBoxObj,
nsPresContext* presContext = presShell->GetPresContext();
PRInt32 cnvdX = presContext->CSSPixelsToDevPixels(tcX + x + 1) +
int32_t cnvdX = presContext->CSSPixelsToDevPixels(tcX + x + 1) +
presContext->AppUnitsToDevPixels(offset.x);
PRInt32 cnvdY = presContext->CSSPixelsToDevPixels(tcY + y + 1) +
int32_t cnvdY = presContext->CSSPixelsToDevPixels(tcY + y + 1) +
presContext->AppUnitsToDevPixels(offset.y);
DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, cnvdX, cnvdY,
@ -119,7 +119,7 @@ nsCoreUtils::DispatchClickEvent(nsITreeBoxObject *aTreeBoxObj,
}
bool
nsCoreUtils::DispatchMouseEvent(PRUint32 aEventType,
nsCoreUtils::DispatchMouseEvent(uint32_t aEventType,
nsIPresShell *aPresShell,
nsIContent *aContent)
{
@ -137,8 +137,8 @@ nsCoreUtils::DispatchMouseEvent(PRUint32 aEventType,
nsPresContext* presContext = aPresShell->GetPresContext();
PRInt32 x = presContext->AppUnitsToDevPixels(point.x + size.width / 2);
PRInt32 y = presContext->AppUnitsToDevPixels(point.y + size.height / 2);
int32_t x = presContext->AppUnitsToDevPixels(point.x + size.width / 2);
int32_t y = presContext->AppUnitsToDevPixels(point.y + size.height / 2);
// Fire mouse event.
DispatchMouseEvent(aEventType, x, y, aContent, frame, aPresShell, widget);
@ -146,7 +146,7 @@ nsCoreUtils::DispatchMouseEvent(PRUint32 aEventType,
}
void
nsCoreUtils::DispatchMouseEvent(PRUint32 aEventType, PRInt32 aX, PRInt32 aY,
nsCoreUtils::DispatchMouseEvent(uint32_t aEventType, int32_t aX, int32_t aY,
nsIContent *aContent, nsIFrame *aFrame,
nsIPresShell *aPresShell, nsIWidget *aRootWidget)
{
@ -163,7 +163,7 @@ nsCoreUtils::DispatchMouseEvent(PRUint32 aEventType, PRInt32 aX, PRInt32 aY,
aPresShell->HandleEventWithTarget(&event, aFrame, aContent, &status);
}
PRUint32
uint32_t
nsCoreUtils::GetAccessKeyFor(nsIContent *aContent)
{
if (!aContent)
@ -203,10 +203,10 @@ nsCoreUtils::GetDOMElementFor(nsIContent *aContent)
}
nsINode *
nsCoreUtils::GetDOMNodeFromDOMPoint(nsINode *aNode, PRUint32 aOffset)
nsCoreUtils::GetDOMNodeFromDOMPoint(nsINode *aNode, uint32_t aOffset)
{
if (aNode && aNode->IsElement()) {
PRUint32 childCount = aNode->GetChildCount();
uint32_t childCount = aNode->GetChildCount();
NS_ASSERTION(aOffset <= childCount, "Wrong offset of the DOM point!");
// The offset can be after last child of container node that means DOM point
@ -262,7 +262,7 @@ nsCoreUtils::IsAncestorOf(nsINode *aPossibleAncestorNode,
nsresult
nsCoreUtils::ScrollSubstringTo(nsIFrame* aFrame, nsRange* aRange,
PRUint32 aScrollType)
uint32_t aScrollType)
{
nsIPresShell::ScrollAxis vertical, horizontal;
ConvertScrollTypeToPercents(aScrollType, &vertical, &horizontal);
@ -313,8 +313,8 @@ nsCoreUtils::ScrollFrameToPoint(nsIFrame *aScrollableFrame,
nsPresContext *presContext = aFrame->PresContext();
nsIntRect frameRect = aFrame->GetScreenRectExternal();
PRInt32 devDeltaX = aPoint.x - frameRect.x;
PRInt32 devDeltaY = aPoint.y - frameRect.y;
int32_t devDeltaX = aPoint.x - frameRect.x;
int32_t devDeltaY = aPoint.y - frameRect.y;
nsPoint deltaPoint;
deltaPoint.x = presContext->DevPixelsToAppUnits(devDeltaX);
@ -327,11 +327,11 @@ nsCoreUtils::ScrollFrameToPoint(nsIFrame *aScrollableFrame,
}
void
nsCoreUtils::ConvertScrollTypeToPercents(PRUint32 aScrollType,
nsCoreUtils::ConvertScrollTypeToPercents(uint32_t aScrollType,
nsIPresShell::ScrollAxis *aVertical,
nsIPresShell::ScrollAxis *aHorizontal)
{
PRInt16 whereY, whereX;
int16_t whereY, whereX;
nsIPresShell::WhenToScroll whenY, whenX;
switch (aScrollType)
{
@ -441,7 +441,7 @@ nsCoreUtils::IsContentDocument(nsIDocument *aDocument)
do_QueryInterface(container);
NS_ASSERTION(docShellTreeItem, "No document shell tree item for document!");
PRInt32 contentType;
int32_t contentType;
docShellTreeItem->GetItemType(&contentType);
return (contentType == nsIDocShellTreeItem::typeContent);
}
@ -512,13 +512,13 @@ nsCoreUtils::GetID(nsIContent *aContent, nsAString& aID)
}
bool
nsCoreUtils::GetUIntAttr(nsIContent *aContent, nsIAtom *aAttr, PRInt32 *aUInt)
nsCoreUtils::GetUIntAttr(nsIContent *aContent, nsIAtom *aAttr, int32_t *aUInt)
{
nsAutoString value;
aContent->GetAttr(kNameSpaceID_None, aAttr, value);
if (!value.IsEmpty()) {
nsresult error = NS_OK;
PRInt32 integer = value.ToInteger(&error);
int32_t integer = value.ToInteger(&error);
if (NS_SUCCEEDED(error) && integer > 0) {
*aUInt = integer;
return true;
@ -605,10 +605,10 @@ nsCoreUtils::GetFirstSensibleColumn(nsITreeBoxObject *aTree)
return column.forget();
}
PRUint32
uint32_t
nsCoreUtils::GetSensibleColumnCount(nsITreeBoxObject *aTree)
{
PRUint32 count = 0;
uint32_t count = 0;
nsCOMPtr<nsITreeColumns> cols;
aTree->GetColumns(getter_AddRefs(cols));
@ -631,9 +631,9 @@ nsCoreUtils::GetSensibleColumnCount(nsITreeBoxObject *aTree)
}
already_AddRefed<nsITreeColumn>
nsCoreUtils::GetSensibleColumnAt(nsITreeBoxObject *aTree, PRUint32 aIndex)
nsCoreUtils::GetSensibleColumnAt(nsITreeBoxObject *aTree, uint32_t aIndex)
{
PRUint32 idx = aIndex;
uint32_t idx = aIndex;
nsCOMPtr<nsITreeColumn> column = GetFirstSensibleColumn(aTree);
while (column) {
@ -689,7 +689,7 @@ nsCoreUtils::IsColumnHidden(nsITreeColumn *aColumn)
void
nsCoreUtils::ScrollTo(nsIPresShell* aPresShell, nsIContent* aContent,
PRUint32 aScrollType)
uint32_t aScrollType)
{
nsIPresShell::ScrollAxis vertical, horizontal;
ConvertScrollTypeToPercents(aScrollType, &vertical, &horizontal);
@ -705,7 +705,7 @@ nsCoreUtils::ScrollTo(nsIPresShell* aPresShell, nsIContent* aContent,
NS_IMPL_ISUPPORTS1(nsAccessibleDOMStringList, nsIDOMDOMStringList)
NS_IMETHODIMP
nsAccessibleDOMStringList::Item(PRUint32 aIndex, nsAString& aResult)
nsAccessibleDOMStringList::Item(uint32_t aIndex, nsAString& aResult)
{
if (aIndex >= mNames.Length())
SetDOMStringToNull(aResult);
@ -716,7 +716,7 @@ nsAccessibleDOMStringList::Item(PRUint32 aIndex, nsAString& aResult)
}
NS_IMETHODIMP
nsAccessibleDOMStringList::GetLength(PRUint32* aLength)
nsAccessibleDOMStringList::GetLength(uint32_t* aLength)
{
*aLength = mNames.Length();

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

@ -45,7 +45,7 @@ public:
* nsITreeBoxObject for available values
*/
static void DispatchClickEvent(nsITreeBoxObject *aTreeBoxObj,
PRInt32 aRowIndex, nsITreeColumn *aColumn,
int32_t aRowIndex, nsITreeColumn *aColumn,
const nsCString& aPseudoElt = EmptyCString());
/**
@ -55,7 +55,7 @@ public:
* @param aPresShell [in] the presshell for the given element
* @param aContent [in] the element
*/
static bool DispatchMouseEvent(PRUint32 aEventType,
static bool DispatchMouseEvent(uint32_t aEventType,
nsIPresShell *aPresShell,
nsIContent *aContent);
@ -70,7 +70,7 @@ public:
* @param aPresShell [in] the presshell for the element
* @param aRootWidget [in] the root widget of the element
*/
static void DispatchMouseEvent(PRUint32 aEventType, PRInt32 aX, PRInt32 aY,
static void DispatchMouseEvent(uint32_t aEventType, int32_t aX, int32_t aY,
nsIContent *aContent, nsIFrame *aFrame,
nsIPresShell *aPresShell,
nsIWidget *aRootWidget);
@ -81,7 +81,7 @@ public:
*
* @param aContent - the given element.
*/
static PRUint32 GetAccessKeyFor(nsIContent *aContent);
static uint32_t GetAccessKeyFor(nsIContent *aContent);
/**
* Return DOM element related with the given node, i.e.
@ -96,7 +96,7 @@ public:
/**
* Return DOM node for the given DOM point.
*/
static nsINode *GetDOMNodeFromDOMPoint(nsINode *aNode, PRUint32 aOffset);
static nsINode *GetDOMNodeFromDOMPoint(nsINode *aNode, uint32_t aOffset);
/**
* Return the nsIContent* to check for ARIA attributes on -- this may not
@ -135,7 +135,7 @@ public:
* @param aScrollType the place a range should be scrolled to
*/
static nsresult ScrollSubstringTo(nsIFrame* aFrame, nsRange* aRange,
PRUint32 aScrollType);
uint32_t aScrollType);
/** Helper method to scroll range into view, used for implementation of
* nsIAccessibleText::scrollSubstringTo[Point]().
@ -164,7 +164,7 @@ public:
* Converts scroll type constant defined in nsIAccessibleScrollType to
* vertical and horizontal parameters.
*/
static void ConvertScrollTypeToPercents(PRUint32 aScrollType,
static void ConvertScrollTypeToPercents(uint32_t aScrollType,
nsIPresShell::ScrollAxis *aVertical,
nsIPresShell::ScrollAxis *aHorizontal);
@ -228,7 +228,7 @@ public:
* attribute or wrong value then false is returned.
*/
static bool GetUIntAttr(nsIContent *aContent, nsIAtom *aAttr,
PRInt32 *aUInt);
int32_t *aUInt);
/**
* Check if the given element is XLink.
@ -269,13 +269,13 @@ public:
/**
* Return sensible columns count for the given tree box object.
*/
static PRUint32 GetSensibleColumnCount(nsITreeBoxObject *aTree);
static uint32_t GetSensibleColumnCount(nsITreeBoxObject *aTree);
/**
* Return sensible column at the given index for the given tree box object.
*/
static already_AddRefed<nsITreeColumn>
GetSensibleColumnAt(nsITreeBoxObject *aTree, PRUint32 aIndex);
GetSensibleColumnAt(nsITreeBoxObject *aTree, uint32_t aIndex);
/**
* Return next sensible column for the given column.
@ -298,7 +298,7 @@ public:
* Scroll content into view.
*/
static void ScrollTo(nsIPresShell* aPresShell, nsIContent* aContent,
PRUint32 aScrollType);
uint32_t aScrollType);
/**
* Return true if the given node is table header element.

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

@ -32,7 +32,7 @@ nsEventShell::FireEvent(AccEvent* aEvent)
}
void
nsEventShell::FireEvent(PRUint32 aEventType, Accessible* aAccessible,
nsEventShell::FireEvent(uint32_t aEventType, Accessible* aAccessible,
EIsFromUserInput aIsFromUserInput)
{
NS_ENSURE_TRUE(aAccessible,);

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

@ -28,7 +28,7 @@ public:
* @param aEventType [in] the event type
* @param aAccessible [in] the event target
*/
static void FireEvent(PRUint32 aEventType, Accessible* aAccessible,
static void FireEvent(uint32_t aEventType, Accessible* aAccessible,
EIsFromUserInput aIsFromUserInput = eAutoDetect);
/**

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

@ -171,8 +171,8 @@ nsTextEquivUtils::AppendFromAccessibleChildren(Accessible* aAccessible,
{
nsresult rv = NS_OK_NO_NAME_CLAUSE_HANDLED;
PRUint32 childCount = aAccessible->ChildCount();
for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
uint32_t childCount = aAccessible->ChildCount();
for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) {
Accessible* child = aAccessible->GetChildAt(childIdx);
rv = AppendFromAccessible(child, aString);
NS_ENSURE_SUCCESS(rv, rv);
@ -212,7 +212,7 @@ nsTextEquivUtils::AppendFromAccessible(Accessible* aAccessible,
// into subtree if accessible allows "text equivalent from subtree rule" or
// it's not root and not control.
if (isEmptyTextEquiv) {
PRUint32 nameRule = GetRoleRule(aAccessible->Role());
uint32_t nameRule = GetRoleRule(aAccessible->Role());
if (nameRule & eFromSubtreeIfRec) {
rv = AppendFromAccessibleChildren(aAccessible, aString);
NS_ENSURE_SUCCESS(rv, rv);
@ -361,7 +361,7 @@ nsTextEquivUtils::IsWhitespace(PRUnichar aChar)
aChar == '\r' || aChar == '\t' || aChar == 0xa0;
}
PRUint32
uint32_t
nsTextEquivUtils::GetRoleRule(role aRole)
{
#define ROLE(geckoRole, stringRole, atkRole, \

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

@ -143,7 +143,7 @@ private:
/**
* Returns the rule (constant of ETextEquivRule) for a given role.
*/
static PRUint32 GetRoleRule(mozilla::a11y::roles::Role aRole);
static uint32_t GetRoleRule(mozilla::a11y::roles::Role aRole);
/**
* The accessible for which we are computing a text equivalent. It is useful

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

@ -51,7 +51,7 @@ ARIAGridAccessible::Shutdown()
////////////////////////////////////////////////////////////////////////////////
// nsIAccessibleTable
PRUint32
uint32_t
ARIAGridAccessible::ColCount()
{
AccIterator rowIter(this, filters::GetRow);
@ -62,17 +62,17 @@ ARIAGridAccessible::ColCount()
AccIterator cellIter(row, filters::GetCell);
Accessible* cell = nullptr;
PRUint32 colCount = 0;
uint32_t colCount = 0;
while ((cell = cellIter.Next()))
colCount++;
return colCount;
}
PRUint32
uint32_t
ARIAGridAccessible::RowCount()
{
PRUint32 rowCount = 0;
uint32_t rowCount = 0;
AccIterator rowIter(this, filters::GetRow);
while (rowIter.Next())
rowCount++;
@ -81,7 +81,7 @@ ARIAGridAccessible::RowCount()
}
Accessible*
ARIAGridAccessible::CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex)
ARIAGridAccessible::CellAt(uint32_t aRowIndex, uint32_t aColumnIndex)
{
Accessible* row = GetRowAt(aRowIndex);
if (!row)
@ -91,7 +91,7 @@ ARIAGridAccessible::CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex)
}
bool
ARIAGridAccessible::IsColSelected(PRUint32 aColIdx)
ARIAGridAccessible::IsColSelected(uint32_t aColIdx)
{
AccIterator rowIter(this, filters::GetRow);
Accessible* row = rowIter.Next();
@ -110,7 +110,7 @@ ARIAGridAccessible::IsColSelected(PRUint32 aColIdx)
}
bool
ARIAGridAccessible::IsRowSelected(PRUint32 aRowIdx)
ARIAGridAccessible::IsRowSelected(uint32_t aRowIdx)
{
Accessible* row = GetRowAt(aRowIdx);
if(!row)
@ -129,7 +129,7 @@ ARIAGridAccessible::IsRowSelected(PRUint32 aRowIdx)
}
bool
ARIAGridAccessible::IsCellSelected(PRUint32 aRowIdx, PRUint32 aColIdx)
ARIAGridAccessible::IsCellSelected(uint32_t aRowIdx, uint32_t aColIdx)
{
Accessible* row = GetRowAt(aRowIdx);
if(!row)
@ -144,10 +144,10 @@ ARIAGridAccessible::IsCellSelected(PRUint32 aRowIdx, PRUint32 aColIdx)
return true;
}
PRUint32
uint32_t
ARIAGridAccessible::SelectedCellCount()
{
PRUint32 count = 0, colCount = ColCount();
uint32_t count = 0, colCount = ColCount();
AccIterator rowIter(this, filters::GetRow);
Accessible* row = nullptr;
@ -170,10 +170,10 @@ ARIAGridAccessible::SelectedCellCount()
return count;
}
PRUint32
uint32_t
ARIAGridAccessible::SelectedColCount()
{
PRUint32 colCount = ColCount();
uint32_t colCount = ColCount();
if (!colCount)
return 0;
@ -186,14 +186,14 @@ ARIAGridAccessible::SelectedColCount()
isColSelArray.AppendElements(colCount);
memset(isColSelArray.Elements(), true, colCount * sizeof(bool));
PRUint32 selColCount = colCount;
uint32_t selColCount = colCount;
do {
if (nsAccUtils::IsARIASelected(row))
continue;
AccIterator cellIter(row, filters::GetCell);
Accessible* cell = nullptr;
for (PRUint32 colIdx = 0;
for (uint32_t colIdx = 0;
(cell = cellIter.Next()) && colIdx < colCount; colIdx++)
if (isColSelArray[colIdx] && !nsAccUtils::IsARIASelected(cell)) {
isColSelArray[colIdx] = false;
@ -204,10 +204,10 @@ ARIAGridAccessible::SelectedColCount()
return selColCount;
}
PRUint32
uint32_t
ARIAGridAccessible::SelectedRowCount()
{
PRUint32 count = 0;
uint32_t count = 0;
AccIterator rowIter(this, filters::GetRow);
Accessible* row = nullptr;
@ -263,15 +263,15 @@ ARIAGridAccessible::SelectedCells(nsTArray<Accessible*>* aCells)
}
void
ARIAGridAccessible::SelectedCellIndices(nsTArray<PRUint32>* aCells)
ARIAGridAccessible::SelectedCellIndices(nsTArray<uint32_t>* aCells)
{
PRUint32 colCount = ColCount();
uint32_t colCount = ColCount();
AccIterator rowIter(this, filters::GetRow);
Accessible* row = nullptr;
for (PRUint32 rowIdx = 0; (row = rowIter.Next()); rowIdx++) {
for (uint32_t rowIdx = 0; (row = rowIter.Next()); rowIdx++) {
if (nsAccUtils::IsARIASelected(row)) {
for (PRUint32 colIdx = 0; colIdx < colCount; colIdx++)
for (uint32_t colIdx = 0; colIdx < colCount; colIdx++)
aCells->AppendElement(rowIdx * colCount + colIdx);
continue;
@ -279,7 +279,7 @@ ARIAGridAccessible::SelectedCellIndices(nsTArray<PRUint32>* aCells)
AccIterator cellIter(row, filters::GetCell);
Accessible* cell = nullptr;
for (PRUint32 colIdx = 0; (cell = cellIter.Next()); colIdx++) {
for (uint32_t colIdx = 0; (cell = cellIter.Next()); colIdx++) {
if (nsAccUtils::IsARIASelected(cell))
aCells->AppendElement(rowIdx * colCount + colIdx);
}
@ -287,9 +287,9 @@ ARIAGridAccessible::SelectedCellIndices(nsTArray<PRUint32>* aCells)
}
void
ARIAGridAccessible::SelectedColIndices(nsTArray<PRUint32>* aCols)
ARIAGridAccessible::SelectedColIndices(nsTArray<uint32_t>* aCols)
{
PRUint32 colCount = ColCount();
uint32_t colCount = ColCount();
if (!colCount)
return;
@ -308,24 +308,24 @@ ARIAGridAccessible::SelectedColIndices(nsTArray<PRUint32>* aCols)
AccIterator cellIter(row, filters::GetCell);
Accessible* cell = nullptr;
for (PRUint32 colIdx = 0;
for (uint32_t colIdx = 0;
(cell = cellIter.Next()) && colIdx < colCount; colIdx++)
if (isColSelArray[colIdx] && !nsAccUtils::IsARIASelected(cell)) {
isColSelArray[colIdx] = false;
}
} while ((row = rowIter.Next()));
for (PRUint32 colIdx = 0; colIdx < colCount; colIdx++)
for (uint32_t colIdx = 0; colIdx < colCount; colIdx++)
if (isColSelArray[colIdx])
aCols->AppendElement(colIdx);
}
void
ARIAGridAccessible::SelectedRowIndices(nsTArray<PRUint32>* aRows)
ARIAGridAccessible::SelectedRowIndices(nsTArray<uint32_t>* aRows)
{
AccIterator rowIter(this, filters::GetRow);
Accessible* row = nullptr;
for (PRUint32 rowIdx = 0; (row = rowIter.Next()); rowIdx++) {
for (uint32_t rowIdx = 0; (row = rowIter.Next()); rowIdx++) {
if (nsAccUtils::IsARIASelected(row)) {
aRows->AppendElement(rowIdx);
continue;
@ -350,19 +350,19 @@ ARIAGridAccessible::SelectedRowIndices(nsTArray<PRUint32>* aRows)
}
void
ARIAGridAccessible::SelectRow(PRUint32 aRowIdx)
ARIAGridAccessible::SelectRow(uint32_t aRowIdx)
{
AccIterator rowIter(this, filters::GetRow);
Accessible* row = nullptr;
for (PRInt32 rowIdx = 0; (row = rowIter.Next()); rowIdx++) {
for (int32_t rowIdx = 0; (row = rowIter.Next()); rowIdx++) {
nsresult rv = SetARIASelected(row, rowIdx == aRowIdx);
NS_ASSERTION(NS_SUCCEEDED(rv), "SetARIASelected() Shouldn't fail!");
}
}
void
ARIAGridAccessible::SelectCol(PRUint32 aColIdx)
ARIAGridAccessible::SelectCol(uint32_t aColIdx)
{
AccIterator rowIter(this, filters::GetRow);
@ -380,7 +380,7 @@ ARIAGridAccessible::SelectCol(PRUint32 aColIdx)
}
void
ARIAGridAccessible::UnselectRow(PRUint32 aRowIdx)
ARIAGridAccessible::UnselectRow(uint32_t aRowIdx)
{
Accessible* row = GetRowAt(aRowIdx);
@ -389,7 +389,7 @@ ARIAGridAccessible::UnselectRow(PRUint32 aRowIdx)
}
void
ARIAGridAccessible::UnselectCol(PRUint32 aColIdx)
ARIAGridAccessible::UnselectCol(uint32_t aColIdx)
{
AccIterator rowIter(this, filters::GetRow);
@ -405,31 +405,31 @@ ARIAGridAccessible::UnselectCol(PRUint32 aColIdx)
// Protected
bool
ARIAGridAccessible::IsValidRow(PRInt32 aRow)
ARIAGridAccessible::IsValidRow(int32_t aRow)
{
if (aRow < 0)
return false;
PRInt32 rowCount = 0;
int32_t rowCount = 0;
GetRowCount(&rowCount);
return aRow < rowCount;
}
bool
ARIAGridAccessible::IsValidColumn(PRInt32 aColumn)
ARIAGridAccessible::IsValidColumn(int32_t aColumn)
{
if (aColumn < 0)
return false;
PRInt32 colCount = 0;
int32_t colCount = 0;
GetColumnCount(&colCount);
return aColumn < colCount;
}
Accessible*
ARIAGridAccessible::GetRowAt(PRInt32 aRow)
ARIAGridAccessible::GetRowAt(int32_t aRow)
{
PRInt32 rowIdx = aRow;
int32_t rowIdx = aRow;
AccIterator rowIter(this, filters::GetRow);
@ -441,9 +441,9 @@ ARIAGridAccessible::GetRowAt(PRInt32 aRow)
}
Accessible*
ARIAGridAccessible::GetCellInRowAt(Accessible* aRow, PRInt32 aColumn)
ARIAGridAccessible::GetCellInRowAt(Accessible* aRow, int32_t aColumn)
{
PRInt32 colIdx = aColumn;
int32_t colIdx = aColumn;
AccIterator cellIter(aRow, filters::GetCell);
Accessible* cell = cellIter.Next();
@ -568,7 +568,7 @@ ARIAGridCellAccessible::GetTable(nsIAccessibleTable** aTable)
}
NS_IMETHODIMP
ARIAGridCellAccessible::GetColumnIndex(PRInt32* aColumnIndex)
ARIAGridCellAccessible::GetColumnIndex(int32_t* aColumnIndex)
{
NS_ENSURE_ARG_POINTER(aColumnIndex);
*aColumnIndex = -1;
@ -582,8 +582,8 @@ ARIAGridCellAccessible::GetColumnIndex(PRInt32* aColumnIndex)
*aColumnIndex = 0;
PRInt32 indexInRow = IndexInParent();
for (PRInt32 idx = 0; idx < indexInRow; idx++) {
int32_t indexInRow = IndexInParent();
for (int32_t idx = 0; idx < indexInRow; idx++) {
Accessible* cell = row->GetChildAt(idx);
roles::Role role = cell->Role();
if (role == roles::GRID_CELL || role == roles::ROWHEADER ||
@ -595,7 +595,7 @@ ARIAGridCellAccessible::GetColumnIndex(PRInt32* aColumnIndex)
}
NS_IMETHODIMP
ARIAGridCellAccessible::GetRowIndex(PRInt32* aRowIndex)
ARIAGridCellAccessible::GetRowIndex(int32_t* aRowIndex)
{
NS_ENSURE_ARG_POINTER(aRowIndex);
*aRowIndex = -1;
@ -613,8 +613,8 @@ ARIAGridCellAccessible::GetRowIndex(PRInt32* aRowIndex)
*aRowIndex = 0;
PRInt32 indexInTable = row->IndexInParent();
for (PRInt32 idx = 0; idx < indexInTable; idx++) {
int32_t indexInTable = row->IndexInParent();
for (int32_t idx = 0; idx < indexInTable; idx++) {
row = table->GetChildAt(idx);
if (row->Role() == roles::ROW)
(*aRowIndex)++;
@ -624,7 +624,7 @@ ARIAGridCellAccessible::GetRowIndex(PRInt32* aRowIndex)
}
NS_IMETHODIMP
ARIAGridCellAccessible::GetColumnExtent(PRInt32* aExtentCount)
ARIAGridCellAccessible::GetColumnExtent(int32_t* aExtentCount)
{
NS_ENSURE_ARG_POINTER(aExtentCount);
*aExtentCount = 0;
@ -637,7 +637,7 @@ ARIAGridCellAccessible::GetColumnExtent(PRInt32* aExtentCount)
}
NS_IMETHODIMP
ARIAGridCellAccessible::GetRowExtent(PRInt32* aExtentCount)
ARIAGridCellAccessible::GetRowExtent(int32_t* aExtentCount)
{
NS_ENSURE_ARG_POINTER(aExtentCount);
*aExtentCount = 0;
@ -711,7 +711,7 @@ ARIAGridCellAccessible::IsSelected(bool* aIsSelected)
// Accessible
void
ARIAGridCellAccessible::ApplyARIAState(PRUint64* aState) const
ARIAGridCellAccessible::ApplyARIAState(uint64_t* aState) const
{
HyperTextAccessibleWrap::ApplyARIAState(aState);
@ -748,9 +748,9 @@ ARIAGridCellAccessible::GetAttributesInternal(nsIPersistentProperties* aAttribut
if (!thisRow || thisRow->Role() != roles::ROW)
return NS_OK;
PRInt32 colIdx = 0, colCount = 0;
PRUint32 childCount = thisRow->ChildCount();
for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
int32_t colIdx = 0, colCount = 0;
uint32_t childCount = thisRow->ChildCount();
for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) {
Accessible* child = thisRow->GetChildAt(childIdx);
if (child == this)
colIdx = colCount;
@ -769,9 +769,9 @@ ARIAGridCellAccessible::GetAttributesInternal(nsIPersistentProperties* aAttribut
if (tableRole != roles::TABLE && tableRole != roles::TREE_TABLE)
return NS_OK;
PRInt32 rowIdx = 0;
int32_t rowIdx = 0;
childCount = table->ChildCount();
for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) {
Accessible* child = table->GetChildAt(childIdx);
if (child == thisRow)
break;
@ -780,7 +780,7 @@ ARIAGridCellAccessible::GetAttributesInternal(nsIPersistentProperties* aAttribut
rowIdx++;
}
PRInt32 idx = rowIdx * colCount + colIdx;
int32_t idx = rowIdx * colCount + colIdx;
nsAutoString stringIdx;
stringIdx.AppendInt(idx);

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

@ -41,44 +41,44 @@ public:
virtual void Shutdown();
// TableAccessible
virtual PRUint32 ColCount();
virtual PRUint32 RowCount();
virtual Accessible* CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex);
virtual bool IsColSelected(PRUint32 aColIdx);
virtual bool IsRowSelected(PRUint32 aRowIdx);
virtual bool IsCellSelected(PRUint32 aRowIdx, PRUint32 aColIdx);
virtual PRUint32 SelectedCellCount();
virtual PRUint32 SelectedColCount();
virtual PRUint32 SelectedRowCount();
virtual uint32_t ColCount();
virtual uint32_t RowCount();
virtual Accessible* CellAt(uint32_t aRowIndex, uint32_t aColumnIndex);
virtual bool IsColSelected(uint32_t aColIdx);
virtual bool IsRowSelected(uint32_t aRowIdx);
virtual bool IsCellSelected(uint32_t aRowIdx, uint32_t aColIdx);
virtual uint32_t SelectedCellCount();
virtual uint32_t SelectedColCount();
virtual uint32_t SelectedRowCount();
virtual void SelectedCells(nsTArray<Accessible*>* aCells);
virtual void SelectedCellIndices(nsTArray<PRUint32>* aCells);
virtual void SelectedColIndices(nsTArray<PRUint32>* aCols);
virtual void SelectedRowIndices(nsTArray<PRUint32>* aRows);
virtual void SelectCol(PRUint32 aColIdx);
virtual void SelectRow(PRUint32 aRowIdx);
virtual void UnselectCol(PRUint32 aColIdx);
virtual void UnselectRow(PRUint32 aRowIdx);
virtual void SelectedCellIndices(nsTArray<uint32_t>* aCells);
virtual void SelectedColIndices(nsTArray<uint32_t>* aCols);
virtual void SelectedRowIndices(nsTArray<uint32_t>* aRows);
virtual void SelectCol(uint32_t aColIdx);
virtual void SelectRow(uint32_t aRowIdx);
virtual void UnselectCol(uint32_t aColIdx);
virtual void UnselectRow(uint32_t aRowIdx);
protected:
/**
* Return true if the given row index is valid.
*/
bool IsValidRow(PRInt32 aRow);
bool IsValidRow(int32_t aRow);
/**
* Retrn true if the given column index is valid.
*/
bool IsValidColumn(PRInt32 aColumn);
bool IsValidColumn(int32_t aColumn);
/**
* Return row accessible at the given row index.
*/
Accessible* GetRowAt(PRInt32 aRow);
Accessible* GetRowAt(int32_t aRow);
/**
* Return cell accessible at the given column index in the row.
*/
Accessible* GetCellInRowAt(Accessible* aRow, PRInt32 aColumn);
Accessible* GetCellInRowAt(Accessible* aRow, int32_t aColumn);
/**
* Set aria-selected attribute value on DOM node of the given accessible.
@ -112,7 +112,7 @@ public:
// Accessible
virtual void Shutdown();
virtual void ApplyARIAState(PRUint64* aState) const;
virtual void ApplyARIAState(uint64_t* aState) const;
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
};

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

@ -89,7 +89,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(Accessible, nsAccessNode)
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mParent");
cb.NoteXPCOMChild(static_cast<nsIAccessible*>(tmp->mParent.get()));
PRUint32 i, length = tmp->mChildren.Length();
uint32_t i, length = tmp->mChildren.Length();
for (i = 0; i < length; ++i) {
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mChildren[i]");
cb.NoteXPCOMChild(static_cast<nsIAccessible*>(tmp->mChildren[i].get()));
@ -365,7 +365,7 @@ Accessible::GetAccessKey(nsAString& aAccessKey)
KeyBinding
Accessible::AccessKey() const
{
PRUint32 key = nsCoreUtils::GetAccessKeyFor(mContent);
uint32_t key = nsCoreUtils::GetAccessKeyFor(mContent);
if (!key && mContent->IsElement()) {
Accessible* label = nullptr;
@ -417,7 +417,7 @@ Accessible::AccessKey() const
return KeyBinding();
nsresult rv = NS_ERROR_FAILURE;
PRInt32 itemType = 0, modifierMask = 0;
int32_t itemType = 0, modifierMask = 0;
treeItem->GetItemType(&itemType);
switch (itemType) {
case nsIDocShellTreeItem::typeChrome:
@ -507,7 +507,7 @@ Accessible::GetLastChild(nsIAccessible** aLastChild)
}
NS_IMETHODIMP
Accessible::GetChildAt(PRInt32 aChildIndex, nsIAccessible** aChild)
Accessible::GetChildAt(int32_t aChildIndex, nsIAccessible** aChild)
{
NS_ENSURE_ARG_POINTER(aChild);
*aChild = nullptr;
@ -543,8 +543,8 @@ Accessible::GetChildren(nsIArray** aOutChildren)
do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
PRUint32 childCount = ChildCount();
for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
uint32_t childCount = ChildCount();
for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) {
nsIAccessible* child = GetChildAt(childIdx);
children->AppendElement(child, false);
}
@ -561,7 +561,7 @@ Accessible::CanHaveAnonChildren()
/* readonly attribute long childCount; */
NS_IMETHODIMP
Accessible::GetChildCount(PRInt32* aChildCount)
Accessible::GetChildCount(int32_t* aChildCount)
{
NS_ENSURE_ARG_POINTER(aChildCount);
@ -574,7 +574,7 @@ Accessible::GetChildCount(PRInt32* aChildCount)
/* readonly attribute long indexInParent; */
NS_IMETHODIMP
Accessible::GetIndexInParent(PRInt32* aIndexInParent)
Accessible::GetIndexInParent(int32_t* aIndexInParent)
{
NS_ENSURE_ARG_POINTER(aIndexInParent);
@ -603,10 +603,10 @@ Accessible::TranslateString(const nsString& aKey, nsAString& aStringOut)
aStringOut.Assign(xsValue);
}
PRUint64
uint64_t
Accessible::VisibilityState()
{
PRUint64 vstates = states::INVISIBLE | states::OFFSCREEN;
uint64_t vstates = states::INVISIBLE | states::OFFSCREEN;
nsIFrame* frame = GetFrame();
if (!frame)
@ -618,7 +618,7 @@ Accessible::VisibilityState()
// We need to know if at least a kMinPixels around the object is visible,
// otherwise it will be marked states::OFFSCREEN.
const PRUint16 kMinPixels = 12;
const uint16_t kMinPixels = 12;
const nsSize frameSize = frame->GetSize();
const nsRectVisibility rectVisibility =
shell->GetRectVisibility(frame, nsRect(nsPoint(0,0), frameSize),
@ -650,10 +650,10 @@ Accessible::VisibilityState()
return vstates &= ~states::INVISIBLE;
}
PRUint64
uint64_t
Accessible::NativeState()
{
PRUint64 state = 0;
uint64_t state = 0;
if (!IsInDocument())
state |= states::STALE;
@ -707,7 +707,7 @@ Accessible::NativeState()
return state;
}
PRUint64
uint64_t
Accessible::NativeInteractiveState() const
{
if (!mContent->IsElement())
@ -723,7 +723,7 @@ Accessible::NativeInteractiveState() const
return 0;
}
PRUint64
uint64_t
Accessible::NativeLinkState() const
{
// Expose linked state for simple xlink.
@ -765,12 +765,12 @@ Accessible::FocusedChild()
}
Accessible*
Accessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
Accessible::ChildAtPoint(int32_t aX, int32_t aY,
EWhichChildAtPoint aWhichChild)
{
// If we can't find the point in a child, we will return the fallback answer:
// we return |this| if the point is within it, otherwise nullptr.
PRInt32 x = 0, y = 0, width = 0, height = 0;
int32_t x = 0, y = 0, width = 0, height = 0;
nsresult rv = GetBounds(&x, &y, &width, &height);
NS_ENSURE_SUCCESS(rv, nullptr);
@ -845,11 +845,11 @@ Accessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
// where layout won't walk into things for us, such as image map areas and
// sub documents (XXX: subdocuments should be handled by methods of
// OuterDocAccessibles).
PRUint32 childCount = accessible->ChildCount();
for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
uint32_t childCount = accessible->ChildCount();
for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) {
Accessible* child = accessible->GetChildAt(childIdx);
PRInt32 childX, childY, childWidth, childHeight;
int32_t childX, childY, childWidth, childHeight;
child->GetBounds(&childX, &childY, &childWidth, &childHeight);
if (aX >= childX && aX < childX + childWidth &&
aY >= childY && aY < childY + childHeight &&
@ -867,7 +867,7 @@ Accessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
// nsIAccessible getChildAtPoint(in long x, in long y)
NS_IMETHODIMP
Accessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
Accessible::GetChildAtPoint(int32_t aX, int32_t aY,
nsIAccessible** aAccessible)
{
NS_ENSURE_ARG_POINTER(aAccessible);
@ -882,7 +882,7 @@ Accessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
// nsIAccessible getDeepestChildAtPoint(in long x, in long y)
NS_IMETHODIMP
Accessible::GetDeepestChildAtPoint(PRInt32 aX, PRInt32 aY,
Accessible::GetDeepestChildAtPoint(int32_t aX, int32_t aY,
nsIAccessible** aAccessible)
{
NS_ENSURE_ARG_POINTER(aAccessible);
@ -909,8 +909,8 @@ Accessible::GetBoundsRect(nsRect& aTotalBounds, nsIFrame** aBoundingFrame)
/* void getBounds (out long x, out long y, out long width, out long height); */
NS_IMETHODIMP
Accessible::GetBounds(PRInt32* aX, PRInt32* aY,
PRInt32* aWidth, PRInt32* aHeight)
Accessible::GetBounds(int32_t* aX, int32_t* aY,
int32_t* aWidth, int32_t* aHeight)
{
NS_ENSURE_ARG_POINTER(aX);
*aX = 0;
@ -1161,7 +1161,7 @@ Accessible::HandleAccEvent(AccEvent* aEvent)
}
NS_IMETHODIMP
Accessible::GetRole(PRUint32 *aRole)
Accessible::GetRole(uint32_t *aRole)
{
NS_ENSURE_ARG_POINTER(aRole);
*aRole = nsIAccessibleRole::ROLE_NOTHING;
@ -1376,14 +1376,14 @@ Accessible::GroupPosition()
// Calculate group level if ARIA is missed.
if (groupPos.level == 0) {
PRInt32 level = GetLevelInternal();
int32_t level = GetLevelInternal();
if (level != 0)
groupPos.level = level;
}
// Calculate position in group and group size if ARIA is missed.
if (groupPos.posInSet == 0 || groupPos.setSize == 0) {
PRInt32 posInSet = 0, setSize = 0;
int32_t posInSet = 0, setSize = 0;
GetPositionAndSizeInternal(&posInSet, &setSize);
if (posInSet != 0 && setSize != 0) {
if (groupPos.posInSet == 0)
@ -1398,9 +1398,9 @@ Accessible::GroupPosition()
}
NS_IMETHODIMP
Accessible::GroupPosition(PRInt32* aGroupLevel,
PRInt32* aSimilarItemsInGroup,
PRInt32* aPositionInGroup)
Accessible::GroupPosition(int32_t* aGroupLevel,
int32_t* aSimilarItemsInGroup,
int32_t* aPositionInGroup)
{
NS_ENSURE_ARG_POINTER(aGroupLevel);
*aGroupLevel = 0;
@ -1424,7 +1424,7 @@ Accessible::GroupPosition(PRInt32* aGroupLevel,
}
NS_IMETHODIMP
Accessible::GetState(PRUint32* aState, PRUint32* aExtraState)
Accessible::GetState(uint32_t* aState, uint32_t* aExtraState)
{
NS_ENSURE_ARG_POINTER(aState);
@ -1432,13 +1432,13 @@ Accessible::GetState(PRUint32* aState, PRUint32* aExtraState)
return NS_OK;
}
PRUint64
uint64_t
Accessible::State()
{
if (IsDefunct())
return states::DEFUNCT;
PRUint64 state = NativeState();
uint64_t state = NativeState();
// Apply ARIA states to be sure accessible states will be overridden.
ApplyARIAState(&state);
@ -1474,7 +1474,7 @@ Accessible::State()
}
}
const PRUint32 kExpandCollapseStates = states::COLLAPSED | states::EXPANDED;
const uint32_t kExpandCollapseStates = states::COLLAPSED | states::EXPANDED;
if ((state & kExpandCollapseStates) == kExpandCollapseStates) {
// Cannot be both expanded and collapsed -- this happens in ARIA expanded
// combobox because of limitation of nsARIAMap.
@ -1515,7 +1515,7 @@ Accessible::State()
}
void
Accessible::ApplyARIAState(PRUint64* aState) const
Accessible::ApplyARIAState(uint64_t* aState) const
{
if (!mContent->IsElement())
return;
@ -1644,7 +1644,7 @@ Accessible::SetCurrentValue(double aValue)
if (!mRoleMapEntry || mRoleMapEntry->valueRule == eNoValue)
return NS_OK_NO_ARIA_VALUE;
const PRUint32 kValueCannotChange = states::READONLY | states::UNAVAILABLE;
const uint32_t kValueCannotChange = states::READONLY | states::UNAVAILABLE;
if (State() & kValueCannotChange)
return NS_ERROR_FAILURE;
@ -1728,9 +1728,9 @@ Accessible::NativeRole()
return nsCoreUtils::IsXLink(mContent) ? roles::LINK : roles::NOTHING;
}
// readonly attribute PRUint8 actionCount
// readonly attribute uint8_t actionCount
NS_IMETHODIMP
Accessible::GetActionCount(PRUint8* aActionCount)
Accessible::GetActionCount(uint8_t* aActionCount)
{
NS_ENSURE_ARG_POINTER(aActionCount);
*aActionCount = 0;
@ -1741,15 +1741,15 @@ Accessible::GetActionCount(PRUint8* aActionCount)
return NS_OK;
}
PRUint8
uint8_t
Accessible::ActionCount()
{
return GetActionRule() == eNoAction ? 0 : 1;
}
/* DOMString getAccActionName (in PRUint8 index); */
/* DOMString getAccActionName (in uint8_t index); */
NS_IMETHODIMP
Accessible::GetActionName(PRUint8 aIndex, nsAString& aName)
Accessible::GetActionName(uint8_t aIndex, nsAString& aName)
{
aName.Truncate();
@ -1759,7 +1759,7 @@ Accessible::GetActionName(PRUint8 aIndex, nsAString& aName)
if (IsDefunct())
return NS_ERROR_FAILURE;
PRUint32 actionRule = GetActionRule();
uint32_t actionRule = GetActionRule();
switch (actionRule) {
case eActivateAction:
@ -1776,7 +1776,7 @@ Accessible::GetActionName(PRUint8 aIndex, nsAString& aName)
case eCheckUncheckAction:
{
PRUint64 state = State();
uint64_t state = State();
if (state & states::CHECKED)
aName.AssignLiteral("uncheck");
else if (state & states::MIXED)
@ -1820,9 +1820,9 @@ Accessible::GetActionName(PRUint8 aIndex, nsAString& aName)
return NS_ERROR_INVALID_ARG;
}
// AString getActionDescription(in PRUint8 index)
// AString getActionDescription(in uint8_t index)
NS_IMETHODIMP
Accessible::GetActionDescription(PRUint8 aIndex, nsAString& aDescription)
Accessible::GetActionDescription(uint8_t aIndex, nsAString& aDescription)
{
// default to localized action name.
nsAutoString name;
@ -1833,9 +1833,9 @@ Accessible::GetActionDescription(PRUint8 aIndex, nsAString& aDescription)
return NS_OK;
}
// void doAction(in PRUint8 index)
// void doAction(in uint8_t index)
NS_IMETHODIMP
Accessible::DoAction(PRUint8 aIndex)
Accessible::DoAction(uint8_t aIndex)
{
if (aIndex != 0)
return NS_ERROR_INVALID_ARG;
@ -1870,7 +1870,7 @@ Accessible::GetAtomicRegion() const
// nsIAccessible getRelationByType()
NS_IMETHODIMP
Accessible::GetRelationByType(PRUint32 aType,
Accessible::GetRelationByType(uint32_t aType,
nsIAccessibleRelation** aRelation)
{
NS_ENSURE_ARG_POINTER(aRelation);
@ -1884,7 +1884,7 @@ Accessible::GetRelationByType(PRUint32 aType,
}
Relation
Accessible::RelationByType(PRUint32 aType)
Accessible::RelationByType(uint32_t aType)
{
// Relationships are defined on the same content node that the role would be
// defined on.
@ -2003,11 +2003,11 @@ Accessible::RelationByType(PRUint32 aType)
NS_LITERAL_STRING("true"),
getter_AddRefs(possibleDefaultButtons));
if (possibleDefaultButtons) {
PRUint32 length;
uint32_t length;
possibleDefaultButtons->GetLength(&length);
nsCOMPtr<nsIDOMNode> possibleButton;
// Check for button in list of default="true" elements
for (PRUint32 count = 0; count < length && !buttonEl; count ++) {
for (uint32_t count = 0; count < length && !buttonEl; count ++) {
possibleDefaultButtons->Item(count, getter_AddRefs(possibleButton));
buttonEl = do_QueryInterface(possibleButton);
}
@ -2051,7 +2051,7 @@ Accessible::GetRelations(nsIArray **aRelations)
nsCOMPtr<nsIMutableArray> relations = do_CreateInstance(NS_ARRAY_CONTRACTID);
NS_ENSURE_TRUE(relations, NS_ERROR_OUT_OF_MEMORY);
for (PRUint32 relType = nsIAccessibleRelation::RELATION_FIRST;
for (uint32_t relType = nsIAccessibleRelation::RELATION_FIRST;
relType < nsIAccessibleRelation::RELATION_LAST;
++relType) {
@ -2059,7 +2059,7 @@ Accessible::GetRelations(nsIArray **aRelations)
nsresult rv = GetRelationByType(relType, getter_AddRefs(relation));
if (NS_SUCCEEDED(rv) && relation) {
PRUint32 targets = 0;
uint32_t targets = 0;
relation->GetTargetsCount(&targets);
if (targets)
relations->AppendElement(relation, false);
@ -2084,7 +2084,7 @@ NS_IMETHODIMP Accessible::GetNativeInterface(void **aOutAccessible)
}
void
Accessible::DoCommand(nsIContent *aContent, PRUint32 aActionIndex)
Accessible::DoCommand(nsIContent *aContent, uint32_t aActionIndex)
{
nsIContent* content = aContent ? aContent : mContent.get();
NS_DISPATCH_RUNNABLEMETHOD_ARG2(DispatchClickEvent, this, content,
@ -2092,7 +2092,7 @@ Accessible::DoCommand(nsIContent *aContent, PRUint32 aActionIndex)
}
void
Accessible::DispatchClickEvent(nsIContent *aContent, PRUint32 aActionIndex)
Accessible::DispatchClickEvent(nsIContent *aContent, uint32_t aActionIndex)
{
if (IsDefunct())
return;
@ -2115,7 +2115,7 @@ Accessible::DispatchClickEvent(nsIContent *aContent, PRUint32 aActionIndex)
}
NS_IMETHODIMP
Accessible::ScrollTo(PRUint32 aHow)
Accessible::ScrollTo(uint32_t aHow)
{
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -2125,7 +2125,7 @@ Accessible::ScrollTo(PRUint32 aHow)
}
NS_IMETHODIMP
Accessible::ScrollToPoint(PRUint32 aCoordinateType, PRInt32 aX, PRInt32 aY)
Accessible::ScrollToPoint(uint32_t aCoordinateType, int32_t aX, int32_t aY)
{
nsIFrame *frame = GetFrame();
if (!frame)
@ -2155,7 +2155,7 @@ Accessible::GetSelectedChildren(nsIArray** aSelectedAccessibles)
nsCOMPtr<nsIArray> items = SelectedItems();
if (items) {
PRUint32 length = 0;
uint32_t length = 0;
items->GetLength(&length);
if (length)
items.swap(*aSelectedAccessibles);
@ -2166,7 +2166,7 @@ Accessible::GetSelectedChildren(nsIArray** aSelectedAccessibles)
// return the nth selected descendant nsIAccessible object
NS_IMETHODIMP
Accessible::RefSelection(PRInt32 aIndex, nsIAccessible** aSelected)
Accessible::RefSelection(int32_t aIndex, nsIAccessible** aSelected)
{
NS_ENSURE_ARG_POINTER(aSelected);
*aSelected = nullptr;
@ -2188,7 +2188,7 @@ Accessible::RefSelection(PRInt32 aIndex, nsIAccessible** aSelected)
}
NS_IMETHODIMP
Accessible::GetSelectionCount(PRInt32* aSelectionCount)
Accessible::GetSelectionCount(int32_t* aSelectionCount)
{
NS_ENSURE_ARG_POINTER(aSelectionCount);
*aSelectionCount = 0;
@ -2200,7 +2200,7 @@ Accessible::GetSelectionCount(PRInt32* aSelectionCount)
return NS_OK;
}
NS_IMETHODIMP Accessible::AddChildToSelection(PRInt32 aIndex)
NS_IMETHODIMP Accessible::AddChildToSelection(int32_t aIndex)
{
if (IsDefunct() || !IsSelect())
return NS_ERROR_FAILURE;
@ -2209,7 +2209,7 @@ NS_IMETHODIMP Accessible::AddChildToSelection(PRInt32 aIndex)
NS_OK : NS_ERROR_INVALID_ARG;
}
NS_IMETHODIMP Accessible::RemoveChildFromSelection(PRInt32 aIndex)
NS_IMETHODIMP Accessible::RemoveChildFromSelection(int32_t aIndex)
{
if (IsDefunct() || !IsSelect())
return NS_ERROR_FAILURE;
@ -2218,7 +2218,7 @@ NS_IMETHODIMP Accessible::RemoveChildFromSelection(PRInt32 aIndex)
NS_OK : NS_ERROR_INVALID_ARG;
}
NS_IMETHODIMP Accessible::IsChildSelected(PRInt32 aIndex, bool *aIsSelected)
NS_IMETHODIMP Accessible::IsChildSelected(int32_t aIndex, bool *aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = false;
@ -2262,7 +2262,7 @@ Accessible::SelectAllSelection(bool* aIsMultiSelect)
// readonly attribute long nsIAccessibleHyperLink::anchorCount
NS_IMETHODIMP
Accessible::GetAnchorCount(PRInt32 *aAnchorCount)
Accessible::GetAnchorCount(int32_t *aAnchorCount)
{
NS_ENSURE_ARG_POINTER(aAnchorCount);
*aAnchorCount = 0;
@ -2276,7 +2276,7 @@ Accessible::GetAnchorCount(PRInt32 *aAnchorCount)
// readonly attribute long nsIAccessibleHyperLink::startIndex
NS_IMETHODIMP
Accessible::GetStartIndex(PRInt32 *aStartIndex)
Accessible::GetStartIndex(int32_t *aStartIndex)
{
NS_ENSURE_ARG_POINTER(aStartIndex);
*aStartIndex = 0;
@ -2290,7 +2290,7 @@ Accessible::GetStartIndex(PRInt32 *aStartIndex)
// readonly attribute long nsIAccessibleHyperLink::endIndex
NS_IMETHODIMP
Accessible::GetEndIndex(PRInt32 *aEndIndex)
Accessible::GetEndIndex(int32_t *aEndIndex)
{
NS_ENSURE_ARG_POINTER(aEndIndex);
*aEndIndex = 0;
@ -2303,14 +2303,14 @@ Accessible::GetEndIndex(PRInt32 *aEndIndex)
}
NS_IMETHODIMP
Accessible::GetURI(PRInt32 aIndex, nsIURI **aURI)
Accessible::GetURI(int32_t aIndex, nsIURI **aURI)
{
NS_ENSURE_ARG_POINTER(aURI);
if (IsDefunct())
return NS_ERROR_FAILURE;
if (aIndex < 0 || aIndex >= static_cast<PRInt32>(AnchorCount()))
if (aIndex < 0 || aIndex >= static_cast<int32_t>(AnchorCount()))
return NS_ERROR_INVALID_ARG;
nsRefPtr<nsIURI>(AnchorURIAt(aIndex)).forget(aURI);
@ -2319,7 +2319,7 @@ Accessible::GetURI(PRInt32 aIndex, nsIURI **aURI)
NS_IMETHODIMP
Accessible::GetAnchor(PRInt32 aIndex, nsIAccessible** aAccessible)
Accessible::GetAnchor(int32_t aIndex, nsIAccessible** aAccessible)
{
NS_ENSURE_ARG_POINTER(aAccessible);
*aAccessible = nullptr;
@ -2327,7 +2327,7 @@ Accessible::GetAnchor(PRInt32 aIndex, nsIAccessible** aAccessible)
if (IsDefunct())
return NS_ERROR_FAILURE;
if (aIndex < 0 || aIndex >= static_cast<PRInt32>(AnchorCount()))
if (aIndex < 0 || aIndex >= static_cast<int32_t>(AnchorCount()))
return NS_ERROR_INVALID_ARG;
NS_IF_ADDREF(*aAccessible = AnchorAt(aIndex));
@ -2364,8 +2364,8 @@ Accessible::GetSelected(bool *aSelected)
}
void
Accessible::AppendTextTo(nsAString& aText, PRUint32 aStartOffset,
PRUint32 aLength)
Accessible::AppendTextTo(nsAString& aText, uint32_t aStartOffset,
uint32_t aLength)
{
// Return text representation of non-text accessible within hypertext
// accessible. Text accessible overrides this method to return enclosed text.
@ -2448,7 +2448,7 @@ Accessible::GetNameInternal(nsAString& aName)
// Accessible protected
void
Accessible::BindToParent(Accessible* aParent, PRUint32 aIndexInParent)
Accessible::BindToParent(Accessible* aParent, uint32_t aIndexInParent)
{
NS_PRECONDITION(aParent, "This method isn't used to set null parent!");
@ -2478,8 +2478,8 @@ Accessible::UnbindFromParent()
void
Accessible::InvalidateChildren()
{
PRInt32 childCount = mChildren.Length();
for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
int32_t childCount = mChildren.Length();
for (int32_t childIdx = 0; childIdx < childCount; childIdx++) {
Accessible* child = mChildren.ElementAt(childIdx);
child->UnbindFromParent();
}
@ -2506,7 +2506,7 @@ Accessible::AppendChild(Accessible* aChild)
}
bool
Accessible::InsertChildAt(PRUint32 aIndex, Accessible* aChild)
Accessible::InsertChildAt(uint32_t aIndex, Accessible* aChild)
{
if (!aChild)
return false;
@ -2514,7 +2514,7 @@ Accessible::InsertChildAt(PRUint32 aIndex, Accessible* aChild)
if (!mChildren.InsertElementAt(aIndex, aChild))
return false;
for (PRUint32 idx = aIndex + 1; idx < mChildren.Length(); idx++) {
for (uint32_t idx = aIndex + 1; idx < mChildren.Length(); idx++) {
NS_ASSERTION(mChildren[idx]->mIndexInParent == idx - 1, "Accessible child index doesn't match");
mChildren[idx]->mIndexInParent = idx;
}
@ -2537,14 +2537,14 @@ Accessible::RemoveChild(Accessible* aChild)
if (aChild->mParent != this || aChild->mIndexInParent == -1)
return false;
PRUint32 index = static_cast<PRUint32>(aChild->mIndexInParent);
uint32_t index = static_cast<uint32_t>(aChild->mIndexInParent);
if (index >= mChildren.Length() || mChildren[index] != aChild) {
NS_ERROR("Child is bound to parent but parent hasn't this child at its index!");
aChild->UnbindFromParent();
return false;
}
for (PRUint32 idx = index + 1; idx < mChildren.Length(); idx++) {
for (uint32_t idx = index + 1; idx < mChildren.Length(); idx++) {
NS_ASSERTION(mChildren[idx]->mIndexInParent == idx, "Accessible child index doesn't match");
mChildren[idx]->mIndexInParent = idx - 1;
}
@ -2557,7 +2557,7 @@ Accessible::RemoveChild(Accessible* aChild)
}
Accessible*
Accessible::GetChildAt(PRUint32 aIndex)
Accessible::GetChildAt(uint32_t aIndex)
{
Accessible* child = mChildren.SafeElementAt(aIndex, nullptr);
if (!child)
@ -2572,25 +2572,25 @@ Accessible::GetChildAt(PRUint32 aIndex)
return child;
}
PRUint32
uint32_t
Accessible::ChildCount() const
{
return mChildren.Length();
}
PRInt32
int32_t
Accessible::GetIndexOf(Accessible* aChild)
{
return (aChild->mParent != this) ? -1 : aChild->IndexInParent();
}
PRInt32
int32_t
Accessible::IndexInParent() const
{
return mIndexInParent;
}
PRUint32
uint32_t
Accessible::EmbeddedChildCount()
{
if (IsChildrenFlag(eMixedChildren)) {
@ -2603,7 +2603,7 @@ Accessible::EmbeddedChildCount()
}
Accessible*
Accessible::GetEmbeddedChildAt(PRUint32 aIndex)
Accessible::GetEmbeddedChildAt(uint32_t aIndex)
{
if (IsChildrenFlag(eMixedChildren)) {
if (!mEmbeddedObjCollector)
@ -2615,7 +2615,7 @@ Accessible::GetEmbeddedChildAt(PRUint32 aIndex)
return GetChildAt(aIndex);
}
PRInt32
int32_t
Accessible::GetIndexOfEmbeddedChild(Accessible* aChild)
{
if (IsChildrenFlag(eMixedChildren)) {
@ -2639,7 +2639,7 @@ Accessible::IsLink()
return mParent && mParent->IsHyperText() && nsAccUtils::IsEmbeddedObject(this);
}
PRUint32
uint32_t
Accessible::StartOffset()
{
NS_PRECONDITION(IsLink(), "StartOffset is called not on hyper link!");
@ -2648,7 +2648,7 @@ Accessible::StartOffset()
return hyperText ? hyperText->GetChildOffset(this) : 0;
}
PRUint32
uint32_t
Accessible::EndOffset()
{
NS_PRECONDITION(IsLink(), "EndOffset is called on not hyper link!");
@ -2665,7 +2665,7 @@ Accessible::IsLinkSelected()
return FocusMgr()->IsFocused(this);
}
PRUint32
uint32_t
Accessible::AnchorCount()
{
NS_PRECONDITION(IsLink(), "AnchorCount is called on not hyper link!");
@ -2673,14 +2673,14 @@ Accessible::AnchorCount()
}
Accessible*
Accessible::AnchorAt(PRUint32 aAnchorIndex)
Accessible::AnchorAt(uint32_t aAnchorIndex)
{
NS_PRECONDITION(IsLink(), "GetAnchor is called on not hyper link!");
return aAnchorIndex == 0 ? this : nullptr;
}
already_AddRefed<nsIURI>
Accessible::AnchorURIAt(PRUint32 aAnchorIndex)
Accessible::AnchorURIAt(uint32_t aAnchorIndex)
{
NS_PRECONDITION(IsLink(), "AnchorURIAt is called on not hyper link!");
@ -2739,10 +2739,10 @@ Accessible::SelectedItems()
return items;
}
PRUint32
uint32_t
Accessible::SelectedItemCount()
{
PRUint32 count = 0;
uint32_t count = 0;
AccIterator iter(this, filters::GetSelected, AccIterator::eTreeNav);
Accessible* selected = nullptr;
while ((selected = iter.Next()))
@ -2752,12 +2752,12 @@ Accessible::SelectedItemCount()
}
Accessible*
Accessible::GetSelectedItem(PRUint32 aIndex)
Accessible::GetSelectedItem(uint32_t aIndex)
{
AccIterator iter(this, filters::GetSelected, AccIterator::eTreeNav);
Accessible* selected = nullptr;
PRUint32 index = 0;
uint32_t index = 0;
while ((selected = iter.Next()) && index < aIndex)
index++;
@ -2765,9 +2765,9 @@ Accessible::GetSelectedItem(PRUint32 aIndex)
}
bool
Accessible::IsItemSelected(PRUint32 aIndex)
Accessible::IsItemSelected(uint32_t aIndex)
{
PRUint32 index = 0;
uint32_t index = 0;
AccIterator iter(this, filters::GetSelectable, AccIterator::eTreeNav);
Accessible* selected = nullptr;
while ((selected = iter.Next()) && index < aIndex)
@ -2778,9 +2778,9 @@ Accessible::IsItemSelected(PRUint32 aIndex)
}
bool
Accessible::AddItemToSelection(PRUint32 aIndex)
Accessible::AddItemToSelection(uint32_t aIndex)
{
PRUint32 index = 0;
uint32_t index = 0;
AccIterator iter(this, filters::GetSelectable, AccIterator::eTreeNav);
Accessible* selected = nullptr;
while ((selected = iter.Next()) && index < aIndex)
@ -2793,9 +2793,9 @@ Accessible::AddItemToSelection(PRUint32 aIndex)
}
bool
Accessible::RemoveItemFromSelection(PRUint32 aIndex)
Accessible::RemoveItemFromSelection(uint32_t aIndex)
{
PRUint32 index = 0;
uint32_t index = 0;
AccIterator iter(this, filters::GetSelectable, AccIterator::eTreeNav);
Accessible* selected = nullptr;
while ((selected = iter.Next()) && index < aIndex)
@ -2928,7 +2928,7 @@ void
Accessible::TestChildCache(Accessible* aCachedChild) const
{
#ifdef DEBUG
PRInt32 childCount = mChildren.Length();
int32_t childCount = mChildren.Length();
if (childCount == 0) {
NS_ASSERTION(IsChildrenFlag(eChildrenUninitialized),
"No children but initialized!");
@ -2936,7 +2936,7 @@ Accessible::TestChildCache(Accessible* aCachedChild) const
}
Accessible* child = nullptr;
for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
for (int32_t childIdx = 0; childIdx < childCount; childIdx++) {
child = mChildren[childIdx];
if (child == aCachedChild)
break;
@ -2967,7 +2967,7 @@ Accessible::EnsureChildren()
}
Accessible*
Accessible::GetSiblingAtOffset(PRInt32 aOffset, nsresult* aError) const
Accessible::GetSiblingAtOffset(int32_t aOffset, nsresult* aError) const
{
if (!mParent || mIndexInParent == -1) {
if (aError)
@ -2977,7 +2977,7 @@ Accessible::GetSiblingAtOffset(PRInt32 aOffset, nsresult* aError) const
}
if (aError &&
mIndexInParent + aOffset >= static_cast<PRInt32>(mParent->ChildCount())) {
mIndexInParent + aOffset >= static_cast<int32_t>(mParent->ChildCount())) {
*aError = NS_OK; // fail peacefully
return nullptr;
}
@ -3049,7 +3049,7 @@ Accessible::GetAttrValue(nsIAtom *aProperty, double *aValue)
return NS_OK;
}
PRUint32
uint32_t
Accessible::GetActionRule()
{
if (InteractiveState() & states::UNAVAILABLE)
@ -3094,7 +3094,7 @@ Accessible::GetGroupInfo()
}
void
Accessible::GetPositionAndSizeInternal(PRInt32 *aPosInSet, PRInt32 *aSetSize)
Accessible::GetPositionAndSizeInternal(int32_t *aPosInSet, int32_t *aSetSize)
{
AccGroupInfo* groupInfo = GetGroupInfo();
if (groupInfo) {
@ -3103,10 +3103,10 @@ Accessible::GetPositionAndSizeInternal(PRInt32 *aPosInSet, PRInt32 *aSetSize)
}
}
PRInt32
int32_t
Accessible::GetLevelInternal()
{
PRInt32 level = nsAccUtils::GetDefaultLevel(this);
int32_t level = nsAccUtils::GetDefaultLevel(this);
if (!IsBoundToParent())
return level;
@ -3152,8 +3152,8 @@ Accessible::GetLevelInternal()
// If this listitem is on top of nested lists then expose 'level'
// attribute.
parent = Parent();
PRUint32 siblingCount = parent->ChildCount();
for (PRUint32 siblingIdx = 0; siblingIdx < siblingCount; siblingIdx++) {
uint32_t siblingCount = parent->ChildCount();
for (uint32_t siblingIdx = 0; siblingIdx < siblingCount; siblingIdx++) {
Accessible* sibling = parent->GetChildAt(siblingIdx);
Accessible* siblingChild = sibling->LastChild();

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

@ -61,9 +61,9 @@ struct GroupPos
{
GroupPos() : level(0), posInSet(0), setSize(0) { }
PRInt32 level;
PRInt32 posInSet;
PRInt32 setSize;
int32_t level;
int32_t posInSet;
int32_t setSize;
};
} // namespace a11y
@ -157,7 +157,7 @@ public:
*
* @param [in/out] where to fill the states into.
*/
virtual void ApplyARIAState(PRUint64* aState) const;
virtual void ApplyARIAState(uint64_t* aState) const;
/**
* Returns the accessible name provided by native markup. It doesn't take
@ -197,15 +197,15 @@ public:
/**
* Return all states of accessible (including ARIA states).
*/
virtual PRUint64 State();
virtual uint64_t State();
/**
* Return interactive states present on the accessible
* (@see NativeInteractiveState).
*/
PRUint64 InteractiveState() const
uint64_t InteractiveState() const
{
PRUint64 state = NativeInteractiveState();
uint64_t state = NativeInteractiveState();
ApplyARIAState(&state);
return state;
}
@ -213,9 +213,9 @@ public:
/**
* Return link states present on the accessible.
*/
PRUint64 LinkState() const
uint64_t LinkState() const
{
PRUint64 state = NativeLinkState();
uint64_t state = NativeLinkState();
ApplyARIAState(&state);
return state;
}
@ -224,22 +224,22 @@ public:
* Return the states of accessible, not taking into account ARIA states.
* Use State() to get complete set of states.
*/
virtual PRUint64 NativeState();
virtual uint64_t NativeState();
/**
* Return native interactice state (unavailable, focusable or selectable).
*/
virtual PRUint64 NativeInteractiveState() const;
virtual uint64_t NativeInteractiveState() const;
/**
* Return native link states present on the accessible.
*/
virtual PRUint64 NativeLinkState() const;
virtual uint64_t NativeLinkState() const;
/**
* Return bit set of invisible and offscreen states.
*/
PRUint64 VisibilityState();
uint64_t VisibilityState();
/**
* Return true if native unavailable state present.
@ -273,7 +273,7 @@ public:
* @param aWhichChild [in] flag points if deepest or direct child
* should be returned
*/
virtual Accessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
EWhichChildAtPoint aWhichChild);
/**
@ -284,7 +284,7 @@ public:
/**
* Return calculated group level based on accessible hierarchy.
*/
virtual PRInt32 GetLevelInternal();
virtual int32_t GetLevelInternal();
/**
* Calculate position in group and group size ('posinset' and 'setsize') based
@ -293,13 +293,13 @@ public:
* @param aPosInSet [out] accessible position in the group
* @param aSetSize [out] the group size
*/
virtual void GetPositionAndSizeInternal(PRInt32 *aPosInSet,
PRInt32 *aSetSize);
virtual void GetPositionAndSizeInternal(int32_t *aPosInSet,
int32_t *aSetSize);
/**
* Get the relation of the given type.
*/
virtual mozilla::a11y::Relation RelationByType(PRUint32 aType);
virtual mozilla::a11y::Relation RelationByType(uint32_t aType);
//////////////////////////////////////////////////////////////////////////////
// Initializing methods
@ -339,7 +339,7 @@ public:
* Append/insert/remove a child. Return true if operation was successful.
*/
virtual bool AppendChild(Accessible* aChild);
virtual bool InsertChildAt(PRUint32 aIndex, Accessible* aChild);
virtual bool InsertChildAt(uint32_t aIndex, Accessible* aChild);
virtual bool RemoveChild(Accessible* aChild);
//////////////////////////////////////////////////////////////////////////////
@ -353,22 +353,22 @@ public:
/**
* Return child accessible at the given index.
*/
virtual Accessible* GetChildAt(PRUint32 aIndex);
virtual Accessible* GetChildAt(uint32_t aIndex);
/**
* Return child accessible count.
*/
virtual PRUint32 ChildCount() const;
virtual uint32_t ChildCount() const;
/**
* Return index of the given child accessible.
*/
virtual PRInt32 GetIndexOf(Accessible* aChild);
virtual int32_t GetIndexOf(Accessible* aChild);
/**
* Return index in parent accessible.
*/
virtual PRInt32 IndexInParent() const;
virtual int32_t IndexInParent() const;
/**
* Return true if accessible has children;
@ -386,7 +386,7 @@ public:
{ return GetChildAt(0); }
inline Accessible* LastChild()
{
PRUint32 childCount = ChildCount();
uint32_t childCount = ChildCount();
return childCount != 0 ? GetChildAt(childCount - 1) : nullptr;
}
@ -394,25 +394,25 @@ public:
/**
* Return embedded accessible children count.
*/
PRUint32 EmbeddedChildCount();
uint32_t EmbeddedChildCount();
/**
* Return embedded accessible child at the given index.
*/
Accessible* GetEmbeddedChildAt(PRUint32 aIndex);
Accessible* GetEmbeddedChildAt(uint32_t aIndex);
/**
* Return index of the given embedded accessible child.
*/
PRInt32 GetIndexOfEmbeddedChild(Accessible* aChild);
int32_t GetIndexOfEmbeddedChild(Accessible* aChild);
/**
* Return number of content children/content child at index. The content
* child is created from markup in contrast to it's never constructed by its
* parent accessible (like treeitem accessibles for XUL trees).
*/
PRUint32 ContentChildCount() const { return mChildren.Length(); }
Accessible* ContentChildAt(PRUint32 aIndex) const
uint32_t ContentChildCount() const { return mChildren.Length(); }
Accessible* ContentChildAt(uint32_t aIndex) const
{ return mChildren.ElementAt(aIndex); }
/**
@ -450,8 +450,8 @@ public:
* @param aLength [in, optional] required length of text, if missed
* then text form start offset till the end is appended
*/
virtual void AppendTextTo(nsAString& aText, PRUint32 aStartOffset = 0,
PRUint32 aLength = PR_UINT32_MAX);
virtual void AppendTextTo(nsAString& aText, uint32_t aStartOffset = 0,
uint32_t aLength = PR_UINT32_MAX);
/**
* Assert if child not in parent's cache if the cache was initialized at this
@ -523,7 +523,7 @@ public:
/**
* Return the number of actions that can be performed on this accessible.
*/
virtual PRUint8 ActionCount();
virtual uint8_t ActionCount();
/**
* Return access key, such as Alt+D.
@ -547,12 +547,12 @@ public:
/**
* Return the start offset of the link within the parent accessible.
*/
virtual PRUint32 StartOffset();
virtual uint32_t StartOffset();
/**
* Return the end offset of the link within the parent accessible.
*/
virtual PRUint32 EndOffset();
virtual uint32_t EndOffset();
/**
* Return true if the link is valid (e. g. points to a valid URL).
@ -576,17 +576,17 @@ public:
/**
* Return the number of anchors within the link.
*/
virtual PRUint32 AnchorCount();
virtual uint32_t AnchorCount();
/**
* Returns an anchor accessible at the given index.
*/
virtual Accessible* AnchorAt(PRUint32 aAnchorIndex);
virtual Accessible* AnchorAt(uint32_t aAnchorIndex);
/**
* Returns an anchor URI at the given index.
*/
virtual already_AddRefed<nsIURI> AnchorURIAt(PRUint32 aAnchorIndex);
virtual already_AddRefed<nsIURI> AnchorURIAt(uint32_t aAnchorIndex);
//////////////////////////////////////////////////////////////////////////////
// SelectAccessible
@ -605,27 +605,27 @@ public:
/**
* Return the number of selected items.
*/
virtual PRUint32 SelectedItemCount();
virtual uint32_t SelectedItemCount();
/**
* Return selected item at the given index.
*/
virtual Accessible* GetSelectedItem(PRUint32 aIndex);
virtual Accessible* GetSelectedItem(uint32_t aIndex);
/**
* Determine if item at the given index is selected.
*/
virtual bool IsItemSelected(PRUint32 aIndex);
virtual bool IsItemSelected(uint32_t aIndex);
/**
* Add item at the given index the selection. Return true if success.
*/
virtual bool AddItemToSelection(PRUint32 aIndex);
virtual bool AddItemToSelection(uint32_t aIndex);
/**
* Remove item at the given index from the selection. Return if success.
*/
virtual bool RemoveItemFromSelection(PRUint32 aIndex);
virtual bool RemoveItemFromSelection(uint32_t aIndex);
/**
* Select all items. Return true if success.
@ -702,13 +702,13 @@ protected:
/**
* Set accessible parent and index in parent.
*/
virtual void BindToParent(Accessible* aParent, PRUint32 aIndexInParent);
virtual void BindToParent(Accessible* aParent, uint32_t aIndexInParent);
virtual void UnbindFromParent();
/**
* Return sibling accessible at the given offset.
*/
virtual Accessible* GetSiblingAtOffset(PRInt32 aOffset,
virtual Accessible* GetSiblingAtOffset(int32_t aOffset,
nsresult *aError = nullptr) const;
/**
@ -814,15 +814,15 @@ protected:
* @param aContent [in, optional] element to click
* @param aActionIndex [in, optional] index of accessible action
*/
void DoCommand(nsIContent *aContent = nullptr, PRUint32 aActionIndex = 0);
void DoCommand(nsIContent *aContent = nullptr, uint32_t aActionIndex = 0);
/**
* Dispatch click event.
*/
virtual void DispatchClickEvent(nsIContent *aContent, PRUint32 aActionIndex);
virtual void DispatchClickEvent(nsIContent *aContent, uint32_t aActionIndex);
NS_DECL_RUNNABLEMETHOD_ARG2(Accessible, DispatchClickEvent,
nsCOMPtr<nsIContent>, PRUint32)
nsCOMPtr<nsIContent>, uint32_t)
//////////////////////////////////////////////////////////////////////////////
// Helpers
@ -847,7 +847,7 @@ protected:
* Return the action rule based on ARIA enum constants EActionRule
* (see nsARIAMap.h). Used by ActionCount() and GetActionName().
*/
PRUint32 GetActionRule();
uint32_t GetActionRule();
/**
* Return group info.
@ -867,16 +867,16 @@ protected:
// Data Members
nsRefPtr<Accessible> mParent;
nsTArray<nsRefPtr<Accessible> > mChildren;
PRInt32 mIndexInParent;
int32_t mIndexInParent;
static const PRUint32 kChildrenFlagsMask =
static const uint32_t kChildrenFlagsMask =
eChildrenUninitialized | eMixedChildren | eEmbeddedChildren;
PRUint32 mFlags;
uint32_t mFlags;
friend class DocAccessible;
nsAutoPtr<EmbeddedObjCollector> mEmbeddedObjCollector;
PRInt32 mIndexOfEmbeddedChild;
int32_t mIndexOfEmbeddedChild;
friend class EmbeddedObjCollector;
nsAutoPtr<AccGroupInfo> mGroupInfo;
@ -902,19 +902,19 @@ public:
/**
* Modifier mask values.
*/
static const PRUint32 kShift = 1;
static const PRUint32 kControl = 2;
static const PRUint32 kAlt = 4;
static const PRUint32 kMeta = 8;
static const PRUint32 kOS = 16;
static const uint32_t kShift = 1;
static const uint32_t kControl = 2;
static const uint32_t kAlt = 4;
static const uint32_t kMeta = 8;
static const uint32_t kOS = 16;
KeyBinding() : mKey(0), mModifierMask(0) {}
KeyBinding(PRUint32 aKey, PRUint32 aModifierMask) :
KeyBinding(uint32_t aKey, uint32_t aModifierMask) :
mKey(aKey), mModifierMask(aModifierMask) {};
inline bool IsEmpty() const { return !mKey; }
inline PRUint32 Key() const { return mKey; }
inline PRUint32 ModifierMask() const { return mModifierMask; }
inline uint32_t Key() const { return mKey; }
inline uint32_t ModifierMask() const { return mModifierMask; }
enum Format {
ePlatformFormat,
@ -945,8 +945,8 @@ private:
void ToPlatformFormat(nsAString& aValue) const;
void ToAtkFormat(nsAString& aValue) const;
PRUint32 mKey;
PRUint32 mModifierMask;
uint32_t mKey;
uint32_t mModifierMask;
};
#endif

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

@ -104,7 +104,7 @@ ApplicationAccessible::Value(nsString& aValue)
aValue.Truncate();
}
PRUint64
uint64_t
ApplicationAccessible::State()
{
return IsDefunct() ? states::DEFUNCT : 0;
@ -125,7 +125,7 @@ ApplicationAccessible::GroupPosition()
}
Accessible*
ApplicationAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
ApplicationAccessible::ChildAtPoint(int32_t aX, int32_t aY,
EWhichChildAtPoint aWhichChild)
{
return nullptr;
@ -142,14 +142,14 @@ ApplicationAccessible::FocusedChild()
}
Relation
ApplicationAccessible::RelationByType(PRUint32 aRelationType)
ApplicationAccessible::RelationByType(uint32_t aRelationType)
{
return Relation();
}
NS_IMETHODIMP
ApplicationAccessible::GetBounds(PRInt32* aX, PRInt32* aY,
PRInt32* aWidth, PRInt32* aHeight)
ApplicationAccessible::GetBounds(int32_t* aX, int32_t* aY,
int32_t* aWidth, int32_t* aHeight)
{
NS_ENSURE_ARG_POINTER(aX);
*aX = 0;
@ -180,21 +180,21 @@ ApplicationAccessible::TakeFocus()
return NS_OK;
}
PRUint8
uint8_t
ApplicationAccessible::ActionCount()
{
return 0;
}
NS_IMETHODIMP
ApplicationAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
ApplicationAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
{
aName.Truncate();
return NS_ERROR_INVALID_ARG;
}
NS_IMETHODIMP
ApplicationAccessible::GetActionDescription(PRUint8 aIndex,
ApplicationAccessible::GetActionDescription(uint8_t aIndex,
nsAString& aDescription)
{
aDescription.Truncate();
@ -202,7 +202,7 @@ ApplicationAccessible::GetActionDescription(PRUint8 aIndex,
}
NS_IMETHODIMP
ApplicationAccessible::DoAction(PRUint8 aIndex)
ApplicationAccessible::DoAction(uint8_t aIndex)
{
return NS_OK;
}
@ -290,7 +290,7 @@ ApplicationAccessible::IsPrimaryForNode() const
// Accessible public methods
void
ApplicationAccessible::ApplyARIAState(PRUint64* aState) const
ApplicationAccessible::ApplyARIAState(uint64_t* aState) const
{
}
@ -300,7 +300,7 @@ ApplicationAccessible::NativeRole()
return roles::APP_ROOT;
}
PRUint64
uint64_t
ApplicationAccessible::NativeState()
{
return 0;
@ -363,7 +363,7 @@ ApplicationAccessible::CacheChildren()
}
Accessible*
ApplicationAccessible::GetSiblingAtOffset(PRInt32 aOffset,
ApplicationAccessible::GetSiblingAtOffset(int32_t aOffset,
nsresult* aError) const
{
if (aError)
@ -400,14 +400,14 @@ ApplicationAccessible::GetRootDocument(nsIAccessibleDocument** aRootDocument)
}
NS_IMETHODIMP
ApplicationAccessible::ScrollTo(PRUint32 aScrollType)
ApplicationAccessible::ScrollTo(uint32_t aScrollType)
{
return NS_OK;
}
NS_IMETHODIMP
ApplicationAccessible::ScrollToPoint(PRUint32 aCoordinateType,
PRInt32 aX, PRInt32 aY)
ApplicationAccessible::ScrollToPoint(uint32_t aCoordinateType,
int32_t aX, int32_t aY)
{
return NS_OK;
}

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

@ -41,21 +41,21 @@ public:
NS_IMETHOD GetDOMNode(nsIDOMNode** aDOMNode);
NS_IMETHOD GetDocument(nsIAccessibleDocument** aDocument);
NS_IMETHOD GetRootDocument(nsIAccessibleDocument** aRootDocument);
NS_IMETHOD ScrollTo(PRUint32 aScrollType);
NS_IMETHOD ScrollToPoint(PRUint32 aCoordinateType, PRInt32 aX, PRInt32 aY);
NS_IMETHOD ScrollTo(uint32_t aScrollType);
NS_IMETHOD ScrollToPoint(uint32_t aCoordinateType, int32_t aX, int32_t aY);
NS_IMETHOD GetLanguage(nsAString& aLanguage);
NS_IMETHOD GetParent(nsIAccessible **aParent);
NS_IMETHOD GetNextSibling(nsIAccessible **aNextSibling);
NS_IMETHOD GetPreviousSibling(nsIAccessible **aPreviousSibling);
NS_IMETHOD GetAttributes(nsIPersistentProperties **aAttributes);
NS_IMETHOD GetBounds(PRInt32 *aX, PRInt32 *aY,
PRInt32 *aWidth, PRInt32 *aHeight);
NS_IMETHOD GetBounds(int32_t *aX, int32_t *aY,
int32_t *aWidth, int32_t *aHeight);
NS_IMETHOD SetSelected(bool aIsSelected);
NS_IMETHOD TakeSelection();
NS_IMETHOD TakeFocus();
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString &aName);
NS_IMETHOD GetActionDescription(PRUint8 aIndex, nsAString &aDescription);
NS_IMETHOD DoAction(PRUint8 aIndex);
NS_IMETHOD GetActionName(uint8_t aIndex, nsAString &aName);
NS_IMETHOD GetActionDescription(uint8_t aIndex, nsAString &aDescription);
NS_IMETHOD DoAction(uint8_t aIndex);
// nsIAccessibleApplication
NS_DECL_NSIACCESSIBLEAPPLICATION
@ -68,29 +68,29 @@ public:
// Accessible
virtual GroupPos GroupPosition();
virtual ENameValueFlag Name(nsString& aName);
virtual void ApplyARIAState(PRUint64* aState) const;
virtual void ApplyARIAState(uint64_t* aState) const;
virtual void Description(nsString& aDescription);
virtual void Value(nsString& aValue);
virtual mozilla::a11y::role NativeRole();
virtual PRUint64 State();
virtual PRUint64 NativeState();
virtual Relation RelationByType(PRUint32 aRelType);
virtual uint64_t State();
virtual uint64_t NativeState();
virtual Relation RelationByType(uint32_t aRelType);
virtual Accessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
EWhichChildAtPoint aWhichChild);
virtual Accessible* FocusedChild();
virtual void InvalidateChildren();
// ActionAccessible
virtual PRUint8 ActionCount();
virtual uint8_t ActionCount();
virtual KeyBinding AccessKey() const;
protected:
// Accessible
virtual void CacheChildren();
virtual Accessible* GetSiblingAtOffset(PRInt32 aOffset,
virtual Accessible* GetSiblingAtOffset(int32_t aOffset,
nsresult *aError = nullptr) const;
private:

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

@ -36,7 +36,7 @@ NS_IMPL_ISUPPORTS_INHERITED0(LeafAccessible, Accessible)
// LeafAccessible: Accessible public
Accessible*
LeafAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
LeafAccessible::ChildAtPoint(int32_t aX, int32_t aY,
EWhichChildAtPoint aWhichChild)
{
// Don't walk into leaf accessibles.
@ -77,7 +77,7 @@ LinkableAccessible::TakeFocus()
return mActionAcc ? mActionAcc->TakeFocus() : AccessibleWrap::TakeFocus();
}
PRUint64
uint64_t
LinkableAccessible::NativeLinkState() const
{
if (mIsLink)
@ -100,14 +100,14 @@ LinkableAccessible::Value(nsString& aValue)
}
PRUint8
uint8_t
LinkableAccessible::ActionCount()
{
return (mIsOnclick || mIsLink) ? 1 : 0;
}
NS_IMETHODIMP
LinkableAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
LinkableAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
{
aName.Truncate();
@ -127,7 +127,7 @@ LinkableAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
}
NS_IMETHODIMP
LinkableAccessible::DoAction(PRUint8 aIndex)
LinkableAccessible::DoAction(uint8_t aIndex)
{
if (aIndex != eAction_Jump)
return NS_ERROR_INVALID_ARG;
@ -159,7 +159,7 @@ LinkableAccessible::Shutdown()
// LinkableAccessible: HyperLinkAccessible
already_AddRefed<nsIURI>
LinkableAccessible::AnchorURIAt(PRUint32 aAnchorIndex)
LinkableAccessible::AnchorURIAt(uint32_t aAnchorIndex)
{
if (mIsLink) {
NS_ASSERTION(mActionAcc->IsLink(),
@ -177,7 +177,7 @@ LinkableAccessible::AnchorURIAt(PRUint32 aAnchorIndex)
void
LinkableAccessible::BindToParent(Accessible* aParent,
PRUint32 aIndexInParent)
uint32_t aIndexInParent)
{
AccessibleWrap::BindToParent(aParent, aIndexInParent);

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

@ -32,7 +32,7 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// Accessible
virtual Accessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
EWhichChildAtPoint aWhichChild);
protected:
@ -57,8 +57,8 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIAccessible
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
NS_IMETHOD DoAction(uint8_t index);
NS_IMETHOD TakeFocus();
// nsAccessNode
@ -66,18 +66,18 @@ public:
// Accessible
virtual void Value(nsString& aValue);
virtual PRUint64 NativeLinkState() const;
virtual uint64_t NativeLinkState() const;
// ActionAccessible
virtual PRUint8 ActionCount();
virtual uint8_t ActionCount();
virtual KeyBinding AccessKey() const;
// HyperLinkAccessible
virtual already_AddRefed<nsIURI> AnchorURIAt(PRUint32 aAnchorIndex);
virtual already_AddRefed<nsIURI> AnchorURIAt(uint32_t aAnchorIndex);
protected:
// Accessible
virtual void BindToParent(Accessible* aParent, PRUint32 aIndexInParent);
virtual void BindToParent(Accessible* aParent, uint32_t aIndexInParent);
virtual void UnbindFromParent();
/**

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

@ -70,7 +70,7 @@ static nsIAtom** kRelationAttrs[] =
&nsGkAtoms::control
};
static const PRUint32 kRelationAttrsLen = NS_ARRAY_LENGTH(kRelationAttrs);
static const uint32_t kRelationAttrsLen = NS_ARRAY_LENGTH(kRelationAttrs);
////////////////////////////////////////////////////////////////////////////////
// Constructor/desctructor
@ -131,7 +131,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(DocAccessible, Accessible)
nsAccessiblePivot)
}
PRUint32 i, length = tmp->mChildDocuments.Length();
uint32_t i, length = tmp->mChildDocuments.Length();
for (i = 0; i < length; ++i) {
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mChildDocuments[i],
nsIAccessible)
@ -218,7 +218,7 @@ DocAccessible::NativeRole()
if (docShellTreeItem) {
nsCOMPtr<nsIDocShellTreeItem> sameTypeRoot;
docShellTreeItem->GetSameTypeRootTreeItem(getter_AddRefs(sameTypeRoot));
PRInt32 itemType;
int32_t itemType;
docShellTreeItem->GetItemType(&itemType);
if (sameTypeRoot == docShellTreeItem) {
// Root of content or chrome tree
@ -278,12 +278,12 @@ DocAccessible::Description(nsString& aDescription)
}
// Accessible public method
PRUint64
uint64_t
DocAccessible::NativeState()
{
// The root content of the document might be removed so that mContent is
// out of date.
PRUint64 state = (mContent->GetCurrentDoc() == mDocument) ?
uint64_t state = (mContent->GetCurrentDoc() == mDocument) ?
0 : states::STALE;
// Document is always focusable.
@ -313,7 +313,7 @@ DocAccessible::NativeState()
return state;
}
PRUint64
uint64_t
DocAccessible::NativeInteractiveState() const
{
// Document is always focusable.
@ -328,7 +328,7 @@ DocAccessible::NativelyUnavailable() const
// Accessible public method
void
DocAccessible::ApplyARIAState(PRUint64* aState) const
DocAccessible::ApplyARIAState(uint64_t* aState) const
{
// Combine with states from outer doc
//
@ -438,7 +438,7 @@ DocAccessible::GetDocType(nsAString& aDocType)
}
NS_IMETHODIMP
DocAccessible::GetNameSpaceURIForID(PRInt16 aNameSpaceID, nsAString& aNameSpaceURI)
DocAccessible::GetNameSpaceURIForID(int16_t aNameSpaceID, nsAString& aNameSpaceURI)
{
if (mDocument) {
nsCOMPtr<nsINameSpaceManager> nameSpaceManager =
@ -499,7 +499,7 @@ DocAccessible::GetParentDocument(nsIAccessibleDocument** aDocument)
}
NS_IMETHODIMP
DocAccessible::GetChildDocumentCount(PRUint32* aCount)
DocAccessible::GetChildDocumentCount(uint32_t* aCount)
{
NS_ENSURE_ARG_POINTER(aCount);
*aCount = 0;
@ -511,7 +511,7 @@ DocAccessible::GetChildDocumentCount(PRUint32* aCount)
}
NS_IMETHODIMP
DocAccessible::GetChildDocumentAt(PRUint32 aIndex,
DocAccessible::GetChildDocumentAt(uint32_t aIndex,
nsIAccessibleDocument** aDocument)
{
NS_ENSURE_ARG_POINTER(aDocument);
@ -661,8 +661,8 @@ DocAccessible::Shutdown()
// Walk the array backwards because child documents remove themselves from the
// array as they are shutdown.
PRInt32 childDocCount = mChildDocuments.Length();
for (PRInt32 idx = childDocCount - 1; idx >= 0; idx--)
int32_t childDocCount = mChildDocuments.Length();
for (int32_t idx = childDocCount - 1; idx >= 0; idx--)
mChildDocuments[idx]->Shutdown();
mChildDocuments.Clear();
@ -750,7 +750,7 @@ DocAccessible::AddEventListeners()
// Make sure we're a content docshell
// We don't want to listen to chrome progress
PRInt32 itemType;
int32_t itemType;
docShellTreeItem->GetItemType(&itemType);
bool isContent = (itemType == nsIDocShellTreeItem::typeContent);
@ -797,7 +797,7 @@ DocAccessible::RemoveEventListeners()
NS_ASSERTION(docShellTreeItem, "doc should support nsIDocShellTreeItem.");
if (docShellTreeItem) {
PRInt32 itemType;
int32_t itemType;
docShellTreeItem->GetItemType(&itemType);
if (itemType == nsIDocShellTreeItem::typeContent) {
nsCOMPtr<nsICommandManager> commandManager = do_GetInterface(docShellTreeItem);
@ -884,7 +884,7 @@ DocAccessible::ScrollPositionDidChange(nscoord aX, nscoord aY)
{
// Start new timer, if the timer cycles at least 1 full cycle without more scroll position changes,
// then the ::Notify() method will fire the accessibility event for scroll position changes
const PRUint32 kScrollPosCheckWait = 50;
const uint32_t kScrollPosCheckWait = 50;
if (mScrollWatchTimer) {
mScrollWatchTimer->SetDelay(kScrollPosCheckWait); // Create new timer, to avoid leaks
}
@ -926,7 +926,7 @@ DocAccessible::Observe(nsISupports* aSubject, const char* aTopic,
NS_IMETHODIMP
DocAccessible::OnPivotChanged(nsIAccessiblePivot* aPivot,
nsIAccessible* aOldAccessible,
PRInt32 aOldStart, PRInt32 aOldEnd,
int32_t aOldStart, int32_t aOldEnd,
PivotMoveReason aReason)
{
nsRefPtr<AccEvent> event = new AccVCChangeEvent(this, aOldAccessible,
@ -947,8 +947,8 @@ NS_IMPL_NSIDOCUMENTOBSERVER_STYLE_STUB(DocAccessible)
void
DocAccessible::AttributeWillChange(nsIDocument* aDocument,
dom::Element* aElement,
PRInt32 aNameSpaceID,
nsIAtom* aAttribute, PRInt32 aModType)
int32_t aNameSpaceID,
nsIAtom* aAttribute, int32_t aModType)
{
Accessible* accessible = GetAccessible(aElement);
if (!accessible) {
@ -983,8 +983,8 @@ DocAccessible::AttributeWillChange(nsIDocument* aDocument,
void
DocAccessible::AttributeChanged(nsIDocument* aDocument,
dom::Element* aElement,
PRInt32 aNameSpaceID, nsIAtom* aAttribute,
PRInt32 aModType)
int32_t aNameSpaceID, nsIAtom* aAttribute,
int32_t aModType)
{
NS_ASSERTION(!IsDefunct(),
"Attribute changed called on defunct document accessible!");
@ -1024,7 +1024,7 @@ DocAccessible::AttributeChanged(nsIDocument* aDocument,
// DocAccessible protected member
void
DocAccessible::AttributeChangedImpl(nsIContent* aContent, PRInt32 aNameSpaceID, nsIAtom* aAttribute)
DocAccessible::AttributeChangedImpl(nsIContent* aContent, int32_t aNameSpaceID, nsIAtom* aAttribute)
{
// Fire accessible event after short timer, because we need to wait for
// DOM attribute & resulting layout to actually change. Otherwise,
@ -1163,7 +1163,7 @@ DocAccessible::ARIAAttributeChanged(nsIContent* aContent, nsIAtom* aAttribute)
// For aria attributes like drag and drop changes we fire a generic attribute
// change event; at least until native API comes up with a more meaningful event.
PRUint8 attrFlags = nsAccUtils::GetAttributeCharacteristics(aAttribute);
uint8_t attrFlags = nsAccUtils::GetAttributeCharacteristics(aAttribute);
if (!(attrFlags & ATTR_BYPASSOBJ))
FireDelayedAccessibleEvent(nsIAccessibleEvent::EVENT_OBJECT_ATTRIBUTE_CHANGED,
aContent);
@ -1179,7 +1179,7 @@ DocAccessible::ARIAAttributeChanged(nsIContent* aContent, nsIAtom* aAttribute)
// The following ARIA attributes only take affect when dynamic content role is present
if (aAttribute == nsGkAtoms::aria_checked ||
aAttribute == nsGkAtoms::aria_pressed) {
const PRUint32 kState = (aAttribute == nsGkAtoms::aria_checked) ?
const uint32_t kState = (aAttribute == nsGkAtoms::aria_checked) ?
states::CHECKED : states::PRESSED;
nsRefPtr<AccEvent> event = new AccStateChangeEvent(aContent, kState);
FireDelayedAccessibleEvent(event);
@ -1242,7 +1242,7 @@ void
DocAccessible::ContentAppended(nsIDocument* aDocument,
nsIContent* aContainer,
nsIContent* aFirstNewContent,
PRInt32 /* unused */)
int32_t /* unused */)
{
}
@ -1295,13 +1295,13 @@ DocAccessible::CharacterDataChanged(nsIDocument* aDocument,
void
DocAccessible::ContentInserted(nsIDocument* aDocument, nsIContent* aContainer,
nsIContent* aChild, PRInt32 /* unused */)
nsIContent* aChild, int32_t /* unused */)
{
}
void
DocAccessible::ContentRemoved(nsIDocument* aDocument, nsIContent* aContainer,
nsIContent* aChild, PRInt32 /* unused */,
nsIContent* aChild, int32_t /* unused */,
nsIContent* aPreviousSibling)
{
}
@ -1354,8 +1354,8 @@ DocAccessible::GetAccessibleByUniqueIDInSubtree(void* aUniqueID)
if (child)
return child;
PRUint32 childDocCount = mChildDocuments.Length();
for (PRUint32 childDocIdx= 0; childDocIdx < childDocCount; childDocIdx++) {
uint32_t childDocCount = mChildDocuments.Length();
for (uint32_t childDocIdx= 0; childDocIdx < childDocCount; childDocIdx++) {
DocAccessible* childDocument = mChildDocuments.ElementAt(childDocIdx);
child = childDocument->GetAccessibleByUniqueIDInSubtree(aUniqueID);
if (child)
@ -1478,7 +1478,7 @@ DocAccessible::ProcessInvalidationList()
// Invalidate children of container accessible for each element in
// invalidation list. Allow invalidation list insertions while container
// children are recached.
for (PRUint32 idx = 0; idx < mInvalidationList.Length(); idx++) {
for (uint32_t idx = 0; idx < mInvalidationList.Length(); idx++) {
nsIContent* content = mInvalidationList[idx];
Accessible* accessible = GetAccessible(content);
if (!accessible) {
@ -1600,7 +1600,7 @@ void
DocAccessible::AddDependentIDsFor(Accessible* aRelProvider,
nsIAtom* aRelAttr)
{
for (PRUint32 idx = 0; idx < kRelationAttrsLen; idx++) {
for (uint32_t idx = 0; idx < kRelationAttrsLen; idx++) {
nsIAtom* relAttr = *kRelationAttrs[idx];
if (aRelAttr && aRelAttr != relAttr)
continue;
@ -1661,7 +1661,7 @@ void
DocAccessible::RemoveDependentIDsFor(Accessible* aRelProvider,
nsIAtom* aRelAttr)
{
for (PRUint32 idx = 0; idx < kRelationAttrsLen; idx++) {
for (uint32_t idx = 0; idx < kRelationAttrsLen; idx++) {
nsIAtom* relAttr = *kRelationAttrs[idx];
if (aRelAttr && aRelAttr != *kRelationAttrs[idx])
continue;
@ -1674,7 +1674,7 @@ DocAccessible::RemoveDependentIDsFor(Accessible* aRelProvider,
AttrRelProviderArray* providers = mDependentIDsHash.Get(id);
if (providers) {
for (PRUint32 jdx = 0; jdx < providers->Length(); ) {
for (uint32_t jdx = 0; jdx < providers->Length(); ) {
AttrRelProvider* provider = (*providers)[jdx];
if (provider->mRelAttr == relAttr &&
provider->mContent == aRelProvider->GetContent())
@ -1741,7 +1741,7 @@ DocAccessible::UpdateAccessibleOnAttrChange(dom::Element* aElement,
// DocAccessible public member
nsresult
DocAccessible::FireDelayedAccessibleEvent(PRUint32 aEventType, nsINode* aNode,
DocAccessible::FireDelayedAccessibleEvent(uint32_t aEventType, nsINode* aNode,
AccEvent::EEventRule aAllowDupes,
EIsFromUserInput aIsFromUserInput)
{
@ -1772,17 +1772,17 @@ DocAccessible::FireDelayedAccessibleEvent(AccEvent* aEvent)
void
DocAccessible::ProcessPendingEvent(AccEvent* aEvent)
{
PRUint32 eventType = aEvent->GetEventType();
uint32_t eventType = aEvent->GetEventType();
if (eventType == nsIAccessibleEvent::EVENT_TEXT_CARET_MOVED) {
HyperTextAccessible* hyperText = aEvent->GetAccessible()->AsHyperText();
PRInt32 caretOffset;
int32_t caretOffset;
if (hyperText &&
NS_SUCCEEDED(hyperText->GetCaretOffset(&caretOffset))) {
nsRefPtr<AccEvent> caretMoveEvent =
new AccCaretMoveEvent(hyperText, caretOffset);
nsEventShell::FireEvent(caretMoveEvent);
PRInt32 selectionCount;
int32_t selectionCount;
hyperText->GetSelectionCount(&selectionCount);
if (selectionCount) { // There's a selection so fire selection change as well
nsEventShell::FireEvent(nsIAccessibleEvent::EVENT_TEXT_SELECTION_CHANGED,
@ -1833,7 +1833,7 @@ DocAccessible::ProcessContentInserted(Accessible* aContainer,
// harm an AT.
// Theoretically the element might be not in tree at all at this point what
// means there's no container.
for (PRUint32 idx = 0; idx < aInsertedContent->Length(); idx++) {
for (uint32_t idx = 0; idx < aInsertedContent->Length(); idx++) {
Accessible* directContainer =
GetContainerAccessible(aInsertedContent->ElementAt(idx));
if (directContainer)
@ -1845,7 +1845,7 @@ void
DocAccessible::UpdateTree(Accessible* aContainer, nsIContent* aChildNode,
bool aIsInsert)
{
PRUint32 updateFlags = eNoAccessible;
uint32_t updateFlags = eNoAccessible;
// If child node is not accessible then look for its accessible children.
Accessible* child = GetAccessible(aChildNode);
@ -1911,10 +1911,10 @@ DocAccessible::UpdateTree(Accessible* aContainer, nsIContent* aChildNode,
FireDelayedAccessibleEvent(reorderEvent);
}
PRUint32
uint32_t
DocAccessible::UpdateTreeInternal(Accessible* aChild, bool aIsInsert)
{
PRUint32 updateFlags = eAccessible;
uint32_t updateFlags = eAccessible;
nsINode* node = aChild->GetNode();
if (aIsInsert) {
@ -1997,8 +1997,8 @@ DocAccessible::CacheChildrenInSubtree(Accessible* aRoot)
// Make sure we create accessible tree defined in DOM only, i.e. if accessible
// provides specific tree (like XUL trees) then tree creation is handled by
// this accessible.
PRUint32 count = aRoot->ContentChildCount();
for (PRUint32 idx = 0; idx < count; idx++) {
uint32_t count = aRoot->ContentChildCount();
for (uint32_t idx = 0; idx < count; idx++) {
Accessible* child = aRoot->ContentChildAt(idx);
NS_ASSERTION(child, "Illicit tree change while tree is created!");
// Don't cross document boundaries.
@ -2024,8 +2024,8 @@ DocAccessible::UncacheChildrenInSubtree(Accessible* aRoot)
if (aRoot->IsElement())
RemoveDependentIDsFor(aRoot);
PRUint32 count = aRoot->ContentChildCount();
for (PRUint32 idx = 0; idx < count; idx++)
uint32_t count = aRoot->ContentChildCount();
for (uint32_t idx = 0; idx < count; idx++)
UncacheChildrenInSubtree(aRoot->ContentChildAt(idx));
if (aRoot->IsPrimaryForNode() &&
@ -2040,8 +2040,8 @@ DocAccessible::ShutdownChildrenInSubtree(Accessible* aAccessible)
// child gets shutdown then it removes itself from children array of its
//parent. Use jdx index to process the cases if child is not attached to the
// parent and as result doesn't remove itself from its children.
PRUint32 count = aAccessible->ContentChildCount();
for (PRUint32 idx = 0, jdx = 0; idx < count; idx++) {
uint32_t count = aAccessible->ContentChildCount();
for (uint32_t idx = 0, jdx = 0; idx < count; idx++) {
Accessible* child = aAccessible->ContentChildAt(jdx);
if (!child->IsBoundToParent()) {
NS_ERROR("Parent refers to a child, child doesn't refer to parent!");
@ -2075,7 +2075,7 @@ DocAccessible::IsLoadEventTarget() const
}
// It's content (not chrome) root document.
PRInt32 contentType;
int32_t contentType;
docShellTreeItem->GetItemType(&contentType);
return (contentType == nsIDocShellTreeItem::typeContent);
}

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

@ -31,7 +31,7 @@ class NotificationController;
class nsIScrollableView;
class nsAccessiblePivot;
const PRUint32 kDefaultCacheSize = 256;
const uint32_t kDefaultCacheSize = 256;
class DocAccessible : public HyperTextAccessibleWrap,
public nsIAccessibleDocument,
@ -82,10 +82,10 @@ public:
virtual void Description(nsString& aDescription);
virtual Accessible* FocusedChild();
virtual mozilla::a11y::role NativeRole();
virtual PRUint64 NativeState();
virtual PRUint64 NativeInteractiveState() const;
virtual uint64_t NativeState();
virtual uint64_t NativeInteractiveState() const;
virtual bool NativelyUnavailable() const;
virtual void ApplyARIAState(PRUint64* aState) const;
virtual void ApplyARIAState(uint64_t* aState) const;
virtual void SetRoleMapEntry(nsRoleMapEntry* aRoleMapEntry);
@ -142,8 +142,8 @@ public:
* Return true if the document has given document state.
*/
bool HasLoadState(LoadState aState) const
{ return (mLoadState & static_cast<PRUint32>(aState)) ==
static_cast<PRUint32>(aState); }
{ return (mLoadState & static_cast<uint32_t>(aState)) ==
static_cast<uint32_t>(aState); }
/**
* Return a native window handler or pointer depending on platform.
@ -159,13 +159,13 @@ public:
/**
* Return the child document count.
*/
PRUint32 ChildDocumentCount() const
uint32_t ChildDocumentCount() const
{ return mChildDocuments.Length(); }
/**
* Return the child document at the given index.
*/
DocAccessible* GetChildDocumentAt(PRUint32 aIndex) const
DocAccessible* GetChildDocumentAt(uint32_t aIndex) const
{ return mChildDocuments.SafeElementAt(aIndex, nullptr); }
/**
@ -175,7 +175,7 @@ public:
* @param aDOMNode [in] DOM node the accesible event should be fired for
* @param aAllowDupes [in] rule to process an event (see EEventRule constants)
*/
nsresult FireDelayedAccessibleEvent(PRUint32 aEventType, nsINode *aNode,
nsresult FireDelayedAccessibleEvent(uint32_t aEventType, nsINode *aNode,
AccEvent::EEventRule aAllowDupes = AccEvent::eRemoveDupes,
EIsFromUserInput aIsFromUserInput = eAutoDetect);
@ -324,7 +324,7 @@ protected:
/**
* Marks this document as loaded or loading.
*/
void NotifyOfLoad(PRUint32 aLoadEventType)
void NotifyOfLoad(uint32_t aLoadEventType)
{
mLoadState |= eDOMLoaded;
mLoadEventType = aLoadEventType;
@ -406,7 +406,7 @@ protected:
* @param aNameSpaceID - namespace of changed attribute
* @param aAttribute - changed attribute
*/
void AttributeChangedImpl(nsIContent* aContent, PRInt32 aNameSpaceID, nsIAtom* aAttribute);
void AttributeChangedImpl(nsIContent* aContent, int32_t aNameSpaceID, nsIAtom* aAttribute);
/**
* Fires accessible events when ARIA attribute is changed.
@ -458,7 +458,7 @@ protected:
eAlertAccessible = 2
};
PRUint32 UpdateTreeInternal(Accessible* aChild, bool aIsInsert);
uint32_t UpdateTreeInternal(Accessible* aChild, bool aIsInsert);
/**
* Create accessible tree.
@ -508,17 +508,17 @@ protected:
nsCOMPtr<nsIDocument> mDocument;
nsCOMPtr<nsITimer> mScrollWatchTimer;
PRUint16 mScrollPositionChangedTicks; // Used for tracking scroll events
uint16_t mScrollPositionChangedTicks; // Used for tracking scroll events
/**
* Bit mask of document load states (@see LoadState).
*/
PRUint32 mLoadState;
uint32_t mLoadState;
/**
* Type of document load event fired after the document is loaded completely.
*/
PRUint32 mLoadEventType;
uint32_t mLoadEventType;
/**
* Reference to anchor jump element.

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

@ -47,10 +47,10 @@ ProgressMeterAccessible<Max>::NativeRole()
}
template<int Max>
PRUint64
uint64_t
ProgressMeterAccessible<Max>::NativeState()
{
PRUint64 state = LeafAccessible::NativeState();
uint64_t state = LeafAccessible::NativeState();
// An undetermined progressbar (i.e. without a value) has a mixed state.
nsAutoString attrValue;
@ -185,14 +185,14 @@ RadioButtonAccessible::
{
}
PRUint8
uint8_t
RadioButtonAccessible::ActionCount()
{
return 1;
}
NS_IMETHODIMP
RadioButtonAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
RadioButtonAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
{
if (aIndex == eAction_Click) {
aName.AssignLiteral("select");
@ -202,7 +202,7 @@ RadioButtonAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
}
NS_IMETHODIMP
RadioButtonAccessible::DoAction(PRUint8 aIndex)
RadioButtonAccessible::DoAction(uint8_t aIndex)
{
if (aIndex != eAction_Click)
return NS_ERROR_INVALID_ARG;

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

@ -29,7 +29,7 @@ public:
// Accessible
virtual void Value(nsString& aValue);
virtual mozilla::a11y::role NativeRole();
virtual PRUint64 NativeState();
virtual uint64_t NativeState();
// Widgets
virtual bool IsWidget() const;
@ -45,14 +45,14 @@ public:
RadioButtonAccessible(nsIContent* aContent, DocAccessible* aDoc);
// nsIAccessible
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 aIndex);
NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
NS_IMETHOD DoAction(uint8_t aIndex);
// Accessible
virtual mozilla::a11y::role NativeRole();
// ActionAccessible
virtual PRUint8 ActionCount();
virtual uint8_t ActionCount();
enum { eAction_Click = 0 };

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -19,7 +19,7 @@ namespace mozilla {
namespace a11y {
struct DOMPoint {
nsINode* node;
PRInt32 idx;
int32_t idx;
};
}
}
@ -50,11 +50,11 @@ public:
NS_DECL_NSIACCESSIBLEEDITABLETEXT
// Accessible
virtual PRInt32 GetLevelInternal();
virtual int32_t GetLevelInternal();
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
virtual nsresult GetNameInternal(nsAString& aName);
virtual mozilla::a11y::role NativeRole();
virtual PRUint64 NativeState();
virtual uint64_t NativeState();
virtual void InvalidateChildren();
virtual bool RemoveChild(Accessible* aAccessible);
@ -62,12 +62,12 @@ public:
// HyperTextAccessible (static helper method)
// Convert content offset to rendered text offset
static nsresult ContentToRenderedOffset(nsIFrame *aFrame, PRInt32 aContentOffset,
PRUint32 *aRenderedOffset);
static nsresult ContentToRenderedOffset(nsIFrame *aFrame, int32_t aContentOffset,
uint32_t *aRenderedOffset);
// Convert rendered text offset to content offset
static nsresult RenderedToContentOffset(nsIFrame *aFrame, PRUint32 aRenderedOffset,
PRInt32 *aContentOffset);
static nsresult RenderedToContentOffset(nsIFrame *aFrame, uint32_t aRenderedOffset,
int32_t *aContentOffset);
//////////////////////////////////////////////////////////////////////////////
// HyperLinkAccessible
@ -75,7 +75,7 @@ public:
/**
* Return link count within this hypertext accessible.
*/
PRUint32 GetLinkCount()
uint32_t GetLinkCount()
{
return EmbeddedChildCount();
}
@ -83,7 +83,7 @@ public:
/**
* Return link accessible at the given index.
*/
Accessible* GetLinkAt(PRUint32 aIndex)
Accessible* GetLinkAt(uint32_t aIndex)
{
return GetEmbeddedChildAt(aIndex);
}
@ -91,7 +91,7 @@ public:
/**
* Return index for the given link accessible.
*/
PRInt32 GetLinkIndex(Accessible* aLink)
int32_t GetLinkIndex(Accessible* aLink)
{
return GetIndexOfEmbeddedChild(aLink);
}
@ -99,7 +99,7 @@ public:
/**
* Return link accessible at the given text offset.
*/
PRInt32 GetLinkIndexAtOffset(PRUint32 aOffset)
int32_t GetLinkIndexAtOffset(uint32_t aOffset)
{
Accessible* child = GetChildAtOffset(aOffset);
return child ? GetLinkIndex(child) : -1;
@ -134,8 +134,8 @@ public:
* otherwise nullptr
*/
Accessible* DOMPointToHypertextOffset(nsINode *aNode,
PRInt32 aNodeOffset,
PRInt32* aHypertextOffset,
int32_t aNodeOffset,
int32_t* aHypertextOffset,
bool aIsEndOffset = false);
/**
@ -145,8 +145,8 @@ public:
* @param aEndHTOffset [in] the given end hypertext offset
* @param aRange [out] the range whose bounds to set
*/
nsresult HypertextOffsetsToDOMRange(PRInt32 aStartHTOffset,
PRInt32 aEndHTOffset,
nsresult HypertextOffsetsToDOMRange(int32_t aStartHTOffset,
int32_t aEndHTOffset,
nsRange* aRange);
/**
@ -161,7 +161,7 @@ public:
/**
* Return character count within the hypertext accessible.
*/
PRUint32 CharacterCount()
uint32_t CharacterCount()
{
return GetChildOffset(ChildCount());
}
@ -177,8 +177,8 @@ public:
* @param aEndOffset [out, optional] the end offset of the character
* @return false if offset at the given shift is out of range
*/
bool GetCharAt(PRInt32 aOffset, EGetTextType aShift, nsAString& aChar,
PRInt32* aStartOffset = nullptr, PRInt32* aEndOffset = nullptr);
bool GetCharAt(int32_t aOffset, EGetTextType aShift, nsAString& aChar,
int32_t* aStartOffset = nullptr, int32_t* aEndOffset = nullptr);
/**
* Return text offset of the given child accessible within hypertext
@ -188,17 +188,17 @@ public:
* @param aInvalidateAfter [in, optional] indicates whether invalidate
* cached offsets for next siblings of the child
*/
PRInt32 GetChildOffset(Accessible* aChild,
int32_t GetChildOffset(Accessible* aChild,
bool aInvalidateAfter = false)
{
PRInt32 index = GetIndexOf(aChild);
int32_t index = GetIndexOf(aChild);
return index == -1 ? -1 : GetChildOffset(index, aInvalidateAfter);
}
/**
* Return text offset for the child accessible index.
*/
PRInt32 GetChildOffset(PRUint32 aChildIndex,
int32_t GetChildOffset(uint32_t aChildIndex,
bool aInvalidateAfter = false);
/**
@ -206,14 +206,14 @@ public:
*
* @param aOffset [in] the given text offset
*/
PRInt32 GetChildIndexAtOffset(PRUint32 aOffset);
int32_t GetChildIndexAtOffset(uint32_t aOffset);
/**
* Return child accessible at the given text offset.
*
* @param aOffset [in] the given text offset
*/
Accessible* GetChildAtOffset(PRUint32 aOffset)
Accessible* GetChildAtOffset(uint32_t aOffset)
{
return GetChildAt(GetChildIndexAtOffset(aOffset));
}
@ -221,7 +221,7 @@ public:
/**
* Return the bounds of the text between given start and end offset.
*/
nsIntRect GetTextBounds(PRInt32 aStartOffset, PRInt32 aEndOffset)
nsIntRect GetTextBounds(int32_t aStartOffset, int32_t aEndOffset)
{
nsIntRect bounds;
GetPosAndText(aStartOffset, aEndOffset, nullptr, nullptr, &bounds);
@ -232,7 +232,7 @@ public:
* Provide the line number for the caret.
* @return 1-based index for the line number with the caret
*/
PRInt32 CaretLineNumber();
int32_t CaretLineNumber();
//////////////////////////////////////////////////////////////////////////////
// EditableTextAccessible
@ -248,13 +248,13 @@ protected:
/**
* Transform magic offset into text offset.
*/
PRInt32 ConvertMagicOffset(PRInt32 aOffset)
int32_t ConvertMagicOffset(int32_t aOffset)
{
if (aOffset == nsIAccessibleText::TEXT_OFFSET_END_OF_TEXT)
return CharacterCount();
if (aOffset == nsIAccessibleText::TEXT_OFFSET_CARET) {
PRInt32 caretOffset = -1;
int32_t caretOffset = -1;
GetCaretOffset(&caretOffset);
return caretOffset;
}
@ -273,7 +273,7 @@ protected:
* @return success/failure code
*/
nsresult GetTextHelper(EGetTextType aType, AccessibleTextBoundary aBoundaryType,
PRInt32 aOffset, PRInt32 *aStartOffset, PRInt32 *aEndOffset,
int32_t aOffset, int32_t *aStartOffset, int32_t *aEndOffset,
nsAString & aText);
/**
@ -290,8 +290,8 @@ protected:
* the start or end?
* @return the resulting offset into this hypertext
*/
PRInt32 GetRelativeOffset(nsIPresShell *aPresShell, nsIFrame *aFromFrame,
PRInt32 aFromOffset, Accessible* aFromAccessible,
int32_t GetRelativeOffset(nsIPresShell *aPresShell, nsIFrame *aFromFrame,
int32_t aFromOffset, Accessible* aFromAccessible,
nsSelectionAmount aAmount, nsDirection aDirection,
bool aNeedsStart);
@ -320,14 +320,14 @@ protected:
* substring
* @return the start frame for this substring
*/
nsIFrame* GetPosAndText(PRInt32& aStartOffset, PRInt32& aEndOffset,
nsIFrame* GetPosAndText(int32_t& aStartOffset, int32_t& aEndOffset,
nsAString *aText = nullptr,
nsIFrame **aEndFrame = nullptr,
nsIntRect *aBoundsRect = nullptr,
Accessible** aStartAcc = nullptr,
Accessible** aEndAcc = nullptr);
nsIntRect GetBoundsForString(nsIFrame *aFrame, PRUint32 aStartRenderedOffset, PRUint32 aEndRenderedOffset);
nsIntRect GetBoundsForString(nsIFrame *aFrame, uint32_t aStartRenderedOffset, uint32_t aEndRenderedOffset);
// Selection helpers
@ -339,12 +339,12 @@ protected:
/**
* Return selection ranges within the accessible subtree.
*/
void GetSelectionDOMRanges(PRInt16 aType, nsTArray<nsRange*>* aRanges);
void GetSelectionDOMRanges(int16_t aType, nsTArray<nsRange*>* aRanges);
nsresult SetSelectionRange(PRInt32 aStartPos, PRInt32 aEndPos);
nsresult SetSelectionRange(int32_t aStartPos, int32_t aEndPos);
// Helpers
nsresult GetDOMPointByFrameOffset(nsIFrame* aFrame, PRInt32 aOffset,
nsresult GetDOMPointByFrameOffset(nsIFrame* aFrame, int32_t aOffset,
Accessible* aAccessible,
mozilla::a11y::DOMPoint* aPoint);
@ -365,7 +365,7 @@ protected:
nsresult RangeBoundToHypertextOffset(nsRange *aRange,
bool aIsStartBound,
bool aIsStartOffset,
PRInt32 *aHTOffset);
int32_t *aHTOffset);
/**
* Set 'misspelled' text attribute and return range offsets where the
@ -380,16 +380,16 @@ protected:
* @param aEndOffset [in, out] the end offset
* @param aAttributes [out, optional] result attributes
*/
nsresult GetSpellTextAttribute(nsINode* aNode, PRInt32 aNodeOffset,
PRInt32 *aStartOffset,
PRInt32 *aEndOffset,
nsresult GetSpellTextAttribute(nsINode* aNode, int32_t aNodeOffset,
int32_t *aStartOffset,
int32_t *aEndOffset,
nsIPersistentProperties *aAttributes);
private:
/**
* End text offsets array.
*/
nsTArray<PRUint32> mOffsets;
nsTArray<uint32_t> mOffsets;
};

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

@ -40,13 +40,13 @@ NS_IMPL_ISUPPORTS_INHERITED1(ImageAccessible, Accessible,
////////////////////////////////////////////////////////////////////////////////
// Accessible public
PRUint64
uint64_t
ImageAccessible::NativeState()
{
// The state is a bitfield, get our inherited state, then logically OR it with
// states::ANIMATED if this is an animated image.
PRUint64 state = LinkableAccessible::NativeState();
uint64_t state = LinkableAccessible::NativeState();
nsCOMPtr<nsIImageLoadingContent> content(do_QueryInterface(mContent));
nsCOMPtr<imgIRequest> imageRequest;
@ -100,15 +100,15 @@ ImageAccessible::NativeRole()
////////////////////////////////////////////////////////////////////////////////
// nsIAccessible
PRUint8
uint8_t
ImageAccessible::ActionCount()
{
PRUint8 actionCount = LinkableAccessible::ActionCount();
uint8_t actionCount = LinkableAccessible::ActionCount();
return HasLongDesc() ? actionCount + 1 : actionCount;
}
NS_IMETHODIMP
ImageAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
ImageAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
{
aName.Truncate();
@ -123,7 +123,7 @@ ImageAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
}
NS_IMETHODIMP
ImageAccessible::DoAction(PRUint8 aIndex)
ImageAccessible::DoAction(uint8_t aIndex)
{
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -154,9 +154,9 @@ ImageAccessible::DoAction(PRUint8 aIndex)
// nsIAccessibleImage
NS_IMETHODIMP
ImageAccessible::GetImagePosition(PRUint32 aCoordType, PRInt32* aX, PRInt32* aY)
ImageAccessible::GetImagePosition(uint32_t aCoordType, int32_t* aX, int32_t* aY)
{
PRInt32 width, height;
int32_t width, height;
nsresult rv = GetBounds(aX, aY, &width, &height);
if (NS_FAILED(rv))
return rv;
@ -165,9 +165,9 @@ ImageAccessible::GetImagePosition(PRUint32 aCoordType, PRInt32* aX, PRInt32* aY)
}
NS_IMETHODIMP
ImageAccessible::GetImageSize(PRInt32* aWidth, PRInt32* aHeight)
ImageAccessible::GetImageSize(int32_t* aWidth, int32_t* aHeight)
{
PRInt32 x, y;
int32_t x, y;
return GetBounds(&x, &y, aWidth, aHeight);
}
@ -225,7 +225,7 @@ ImageAccessible::GetLongDescURI() const
}
bool
ImageAccessible::IsLongDescIndex(PRUint8 aIndex)
ImageAccessible::IsLongDescIndex(uint8_t aIndex)
{
return aIndex == LinkableAccessible::ActionCount();
}

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

@ -29,8 +29,8 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIAccessible
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
NS_IMETHOD DoAction(uint8_t index);
// nsIAccessibleImage
NS_DECL_NSIACCESSIBLEIMAGE
@ -38,11 +38,11 @@ public:
// Accessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual a11y::role NativeRole();
virtual PRUint64 NativeState();
virtual uint64_t NativeState();
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
// ActionAccessible
virtual PRUint8 ActionCount();
virtual uint8_t ActionCount();
private:
/**
@ -70,7 +70,7 @@ private:
*
* @returns true if index is valid for longdesc action.
*/
inline bool IsLongDescIndex(PRUint8 aIndex);
inline bool IsLongDescIndex(uint8_t aIndex);
};

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

@ -47,10 +47,10 @@ OuterDocAccessible::NativeRole()
}
Accessible*
OuterDocAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
OuterDocAccessible::ChildAtPoint(int32_t aX, int32_t aY,
EWhichChildAtPoint aWhichChild)
{
PRInt32 docX = 0, docY = 0, docWidth = 0, docHeight = 0;
int32_t docX = 0, docY = 0, docWidth = 0, docHeight = 0;
nsresult rv = GetBounds(&docX, &docY, &docWidth, &docHeight);
NS_ENSURE_SUCCESS(rv, nullptr);
@ -83,7 +83,7 @@ OuterDocAccessible::GetAttributesInternal(nsIPersistentProperties* aAttributes)
////////////////////////////////////////////////////////////////////////////////
// nsIAccessible
PRUint8
uint8_t
OuterDocAccessible::ActionCount()
{
// Internal frame, which is the doc's parent, should not have a click action.
@ -91,7 +91,7 @@ OuterDocAccessible::ActionCount()
}
NS_IMETHODIMP
OuterDocAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
OuterDocAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
{
aName.Truncate();
@ -99,7 +99,7 @@ OuterDocAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
}
NS_IMETHODIMP
OuterDocAccessible::GetActionDescription(PRUint8 aIndex,
OuterDocAccessible::GetActionDescription(uint8_t aIndex,
nsAString& aDescription)
{
aDescription.Truncate();
@ -108,7 +108,7 @@ OuterDocAccessible::GetActionDescription(PRUint8 aIndex,
}
NS_IMETHODIMP
OuterDocAccessible::DoAction(PRUint8 aIndex)
OuterDocAccessible::DoAction(uint8_t aIndex)
{
return NS_ERROR_INVALID_ARG;
}

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

@ -29,9 +29,9 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIAccessible
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD GetActionDescription(PRUint8 aIndex, nsAString& aDescription);
NS_IMETHOD DoAction(PRUint8 aIndex);
NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
NS_IMETHOD GetActionDescription(uint8_t aIndex, nsAString& aDescription);
NS_IMETHOD DoAction(uint8_t aIndex);
// nsAccessNode
virtual void Shutdown();
@ -39,7 +39,7 @@ public:
// Accessible
virtual mozilla::a11y::role NativeRole();
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
virtual Accessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
EWhichChildAtPoint aWhichChild);
virtual void InvalidateChildren();
@ -47,7 +47,7 @@ public:
virtual bool RemoveChild(Accessible* aAccessible);
// ActionAccessible
virtual PRUint8 ActionCount();
virtual uint8_t ActionCount();
protected:
// Accessible

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

@ -102,7 +102,7 @@ RootAccessible::NativeRole()
// RootAccessible protected member
#ifdef MOZ_XUL
PRUint32
uint32_t
RootAccessible::GetChromeFlags()
{
// Return the flag set for the top level window as defined
@ -118,21 +118,21 @@ RootAccessible::GetChromeFlags()
if (!xulWin) {
return 0;
}
PRUint32 chromeFlags;
uint32_t chromeFlags;
xulWin->GetChromeFlags(&chromeFlags);
return chromeFlags;
}
#endif
PRUint64
uint64_t
RootAccessible::NativeState()
{
PRUint64 state = DocAccessibleWrap::NativeState();
uint64_t state = DocAccessibleWrap::NativeState();
if (state & states::DEFUNCT)
return state;
#ifdef MOZ_XUL
PRUint32 chromeFlags = GetChromeFlags();
uint32_t chromeFlags = GetChromeFlags();
if (chromeFlags & nsIWebBrowserChrome::CHROME_WINDOW_RESIZE)
state |= states::SIZEABLE;
// If it has a titlebar it's movable
@ -328,7 +328,7 @@ RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
#endif
if (eventType.EqualsLiteral("RadioStateChange")) {
PRUint64 state = accessible->State();
uint64_t state = accessible->State();
// radiogroup in prefWindow is exposed as a list,
// and panebutton is exposed as XULListitem in A11y.
@ -349,7 +349,7 @@ RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
}
if (eventType.EqualsLiteral("CheckboxStateChange")) {
PRUint64 state = accessible->State();
uint64_t state = accessible->State();
bool isEnabled = !!(state & states::CHECKED);
@ -370,7 +370,7 @@ RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
}
if (treeItemAcc && eventType.EqualsLiteral("OpenStateChange")) {
PRUint64 state = accessible->State();
uint64_t state = accessible->State();
bool isEnabled = (state & states::EXPANDED) != 0;
nsRefPtr<AccEvent> accEvent =
@ -487,7 +487,7 @@ RootAccessible::Shutdown()
// nsIAccessible method
Relation
RootAccessible::RelationByType(PRUint32 aType)
RootAccessible::RelationByType(uint32_t aType)
{
if (!mDocument || aType != nsIAccessibleRelation::RELATION_EMBEDS)
return DocAccessibleWrap::RelationByType(aType);
@ -570,8 +570,8 @@ RootAccessible::HandlePopupHidingEvent(nsINode* aPopupNode)
if (!popupContainer)
return;
PRUint32 childCount = popupContainer->ChildCount();
for (PRUint32 idx = 0; idx < childCount; idx++) {
uint32_t childCount = popupContainer->ChildCount();
for (uint32_t idx = 0; idx < childCount; idx++) {
Accessible* child = popupContainer->GetChildAt(idx);
if (child->IsAutoCompletePopup()) {
popup = child;
@ -591,9 +591,9 @@ RootAccessible::HandlePopupHidingEvent(nsINode* aPopupNode)
// When popup closes (except nested popups and menus) then fire focus event to
// where it was. The focus event is expected even if popup didn't take a focus.
static const PRUint32 kNotifyOfFocus = 1;
static const PRUint32 kNotifyOfState = 2;
PRUint32 notifyOf = 0;
static const uint32_t kNotifyOfFocus = 1;
static const uint32_t kNotifyOfState = 2;
uint32_t notifyOf = 0;
// HTML select is target of popuphidding event. Otherwise get container
// widget. No container widget means this is either tooltip or menupopup.
@ -679,7 +679,7 @@ RootAccessible::HandleTreeRowCountChangedEvent(nsIDOMEvent* aEvent,
if (!countVariant)
return;
PRInt32 index, count;
int32_t index, count;
indexVariant->GetAsInt32(&index);
countVariant->GetAsInt32(&count);
@ -694,7 +694,7 @@ RootAccessible::HandleTreeInvalidatedEvent(nsIDOMEvent* aEvent,
if (!dataEvent)
return;
PRInt32 startRow = 0, endRow = -1, startCol = 0, endCol = -1;
int32_t startRow = 0, endRow = -1, startCol = 0, endCol = -1;
nsCOMPtr<nsIVariant> startRowVariant;
dataEvent->GetData(NS_LITERAL_STRING("startrow"),

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

@ -36,9 +36,9 @@ public:
// Accessible
virtual mozilla::a11y::ENameValueFlag Name(nsString& aName);
virtual Relation RelationByType(PRUint32 aType);
virtual Relation RelationByType(uint32_t aType);
virtual mozilla::a11y::role NativeRole();
virtual PRUint64 NativeState();
virtual uint64_t NativeState();
// RootAccessible
nsCaretAccessible* GetCaretAccessible();
@ -77,7 +77,7 @@ protected:
void HandleTreeInvalidatedEvent(nsIDOMEvent* aEvent,
XULTreeAccessible* aAccessible);
PRUint32 GetChromeFlags();
uint32_t GetChromeFlags();
#endif
nsRefPtr<nsCaretAccessible> mCaretAccessible;

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

@ -36,43 +36,43 @@ public:
/**
* Return the number of columns in the table.
*/
virtual PRUint32 ColCount() { return 0; }
virtual uint32_t ColCount() { return 0; }
/**
* Return the number of rows in the table.
*/
virtual PRUint32 RowCount() { return 0; }
virtual uint32_t RowCount() { return 0; }
/**
* Return the accessible for the cell at the given row and column indices.
*/
virtual Accessible* CellAt(PRUint32 aRowIdx, PRUint32 aColIdx) { return nullptr; }
virtual Accessible* CellAt(uint32_t aRowIdx, uint32_t aColIdx) { return nullptr; }
/**
* Return the index of the cell at the given row and column.
*/
virtual PRInt32 CellIndexAt(PRUint32 aRowIdx, PRUint32 aColIdx)
virtual int32_t CellIndexAt(uint32_t aRowIdx, uint32_t aColIdx)
{ return ColCount() * aRowIdx + aColIdx; }
/**
* Return the column index of the cell with the given index.
*/
virtual PRInt32 ColIndexAt(PRUint32 aCellIdx)
virtual int32_t ColIndexAt(uint32_t aCellIdx)
{ return aCellIdx % ColCount(); }
/**
* Return the row index of the cell with the given index.
*/
virtual PRInt32 RowIndexAt(PRUint32 aCellIdx)
virtual int32_t RowIndexAt(uint32_t aCellIdx)
{ return aCellIdx / ColCount(); }
/**
* Get the row and column indices for the cell at the given index.
*/
virtual void RowAndColIndicesAt(PRUint32 aCellIdx, PRInt32* aRowIdx,
PRInt32* aColIdx)
virtual void RowAndColIndicesAt(uint32_t aCellIdx, int32_t* aRowIdx,
int32_t* aColIdx)
{
PRUint32 colCount = ColCount();
uint32_t colCount = ColCount();
*aRowIdx = aCellIdx / colCount;
*aColIdx = aCellIdx % colCount;
}
@ -81,55 +81,55 @@ public:
* Return the number of columns occupied by the cell at the given row and
* column indices.
*/
virtual PRUint32 ColExtentAt(PRUint32 aRowIdx, PRUint32 aColIdx) { return 1; }
virtual uint32_t ColExtentAt(uint32_t aRowIdx, uint32_t aColIdx) { return 1; }
/**
* Return the number of rows occupied by the cell at the given row and column
* indices.
*/
virtual PRUint32 RowExtentAt(PRUint32 aRowIdx, PRUint32 aColIdx) { return 1; }
virtual uint32_t RowExtentAt(uint32_t aRowIdx, uint32_t aColIdx) { return 1; }
/**
* Get the description of the given column.
*/
virtual void ColDescription(PRUint32 aColIdx, nsString& aDescription)
virtual void ColDescription(uint32_t aColIdx, nsString& aDescription)
{ aDescription.Truncate(); }
/**
* Get the description for the given row.
*/
virtual void RowDescription(PRUint32 aRowIdx, nsString& aDescription)
virtual void RowDescription(uint32_t aRowIdx, nsString& aDescription)
{ aDescription.Truncate(); }
/**
* Return true if the given column is selected.
*/
virtual bool IsColSelected(PRUint32 aColIdx) { return false; }
virtual bool IsColSelected(uint32_t aColIdx) { return false; }
/**
* Return true if the given row is selected.
*/
virtual bool IsRowSelected(PRUint32 aRowIdx) { return false; }
virtual bool IsRowSelected(uint32_t aRowIdx) { return false; }
/**
* Return true if the given cell is selected.
*/
virtual bool IsCellSelected(PRUint32 aRowIdx, PRUint32 aColIdx) { return false; }
virtual bool IsCellSelected(uint32_t aRowIdx, uint32_t aColIdx) { return false; }
/**
* Return the number of selected cells.
*/
virtual PRUint32 SelectedCellCount() { return 0; }
virtual uint32_t SelectedCellCount() { return 0; }
/**
* Return the number of selected columns.
*/
virtual PRUint32 SelectedColCount() { return 0; }
virtual uint32_t SelectedColCount() { return 0; }
/**
* Return the number of selected rows.
*/
virtual PRUint32 SelectedRowCount() { return 0; }
virtual uint32_t SelectedRowCount() { return 0; }
/**
* Get the set of selected cells.
@ -139,37 +139,37 @@ public:
/**
* Get the set of selected cell indices.
*/
virtual void SelectedCellIndices(nsTArray<PRUint32>* aCells) = 0;
virtual void SelectedCellIndices(nsTArray<uint32_t>* aCells) = 0;
/**
* Get the set of selected column indices.
*/
virtual void SelectedColIndices(nsTArray<PRUint32>* aCols) = 0;
virtual void SelectedColIndices(nsTArray<uint32_t>* aCols) = 0;
/**
* Get the set of selected row indices.
*/
virtual void SelectedRowIndices(nsTArray<PRUint32>* aRows) = 0;
virtual void SelectedRowIndices(nsTArray<uint32_t>* aRows) = 0;
/**
* Select the given column unselecting any other selected columns.
*/
virtual void SelectCol(PRUint32 aColIdx) {}
virtual void SelectCol(uint32_t aColIdx) {}
/**
* Select the given row unselecting all other previously selected rows.
*/
virtual void SelectRow(PRUint32 aRowIdx) {}
virtual void SelectRow(uint32_t aRowIdx) {}
/**
* Unselect the given column leaving other selected columns selected.
*/
virtual void UnselectCol(PRUint32 aColIdx) {}
virtual void UnselectCol(uint32_t aColIdx) {}
/**
* Unselect the given row leaving other selected rows selected.
*/
virtual void UnselectRow(PRUint32 aRowIdx) {}
virtual void UnselectRow(uint32_t aRowIdx) {}
/**
* Return true if the table is probably for layout.

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

@ -37,8 +37,8 @@ TextLeafAccessible::NativeRole()
}
void
TextLeafAccessible::AppendTextTo(nsAString& aText, PRUint32 aStartOffset,
PRUint32 aLength)
TextLeafAccessible::AppendTextTo(nsAString& aText, uint32_t aStartOffset,
uint32_t aLength)
{
aText.Append(Substring(mText, aStartOffset, aLength));
}

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

@ -22,8 +22,8 @@ public:
// Accessible
virtual mozilla::a11y::role NativeRole();
virtual void AppendTextTo(nsAString& aText, PRUint32 aStartOffset = 0,
PRUint32 aLength = PR_UINT32_MAX);
virtual void AppendTextTo(nsAString& aText, uint32_t aStartOffset = 0,
uint32_t aLength = PR_UINT32_MAX);
virtual ENameValueFlag Name(nsString& aName);
// TextLeafAccessible

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

@ -35,7 +35,7 @@ HTMLBRAccessible::NativeRole()
return roles::WHITESPACE;
}
PRUint64
uint64_t
HTMLBRAccessible::NativeState()
{
return states::READONLY;
@ -73,7 +73,7 @@ HTMLLabelAccessible::NativeRole()
NS_IMPL_ISUPPORTS_INHERITED0(HTMLOutputAccessible, HyperTextAccessible)
Relation
HTMLOutputAccessible::RelationByType(PRUint32 aType)
HTMLOutputAccessible::RelationByType(uint32_t aType)
{
Relation rel = AccessibleWrap::RelationByType(aType);
if (aType == nsIAccessibleRelation::RELATION_CONTROLLED_BY)

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

@ -39,7 +39,7 @@ public:
// Accessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual a11y::role NativeRole();
virtual PRUint64 NativeState();
virtual uint64_t NativeState();
};
/**
@ -74,7 +74,7 @@ public:
// Accessible
virtual a11y::role NativeRole();
virtual nsresult GetAttributesInternal(nsIPersistentProperties* aAttributes);
virtual Relation RelationByType(PRUint32 aType);
virtual Relation RelationByType(uint32_t aType);
};
} // namespace a11y

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

@ -53,18 +53,18 @@ HTMLCheckboxAccessible::NativeRole()
return roles::CHECKBUTTON;
}
PRUint8
uint8_t
HTMLCheckboxAccessible::ActionCount()
{
return 1;
}
NS_IMETHODIMP
HTMLCheckboxAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
HTMLCheckboxAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
{
if (aIndex == eAction_Click) { // 0 is the magic value for default action
// cycle, check or uncheck
PRUint64 state = NativeState();
uint64_t state = NativeState();
if (state & states::CHECKED)
aName.AssignLiteral("uncheck");
@ -79,7 +79,7 @@ HTMLCheckboxAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
}
NS_IMETHODIMP
HTMLCheckboxAccessible::DoAction(PRUint8 aIndex)
HTMLCheckboxAccessible::DoAction(uint8_t aIndex)
{
if (aIndex != 0)
return NS_ERROR_INVALID_ARG;
@ -88,10 +88,10 @@ HTMLCheckboxAccessible::DoAction(PRUint8 aIndex)
return NS_OK;
}
PRUint64
uint64_t
HTMLCheckboxAccessible::NativeState()
{
PRUint64 state = LeafAccessible::NativeState();
uint64_t state = LeafAccessible::NativeState();
state |= states::CHECKABLE;
bool checkState = false; // Radio buttons and check boxes can be checked or mixed
@ -134,10 +134,10 @@ HTMLRadioButtonAccessible::
{
}
PRUint64
uint64_t
HTMLRadioButtonAccessible::NativeState()
{
PRUint64 state = AccessibleWrap::NativeState();
uint64_t state = AccessibleWrap::NativeState();
state |= states::CHECKABLE;
@ -154,10 +154,10 @@ HTMLRadioButtonAccessible::NativeState()
}
void
HTMLRadioButtonAccessible::GetPositionAndSizeInternal(PRInt32* aPosInSet,
PRInt32* aSetSize)
HTMLRadioButtonAccessible::GetPositionAndSizeInternal(int32_t* aPosInSet,
int32_t* aSetSize)
{
PRInt32 namespaceId = mContent->NodeInfo()->NamespaceID();
int32_t namespaceId = mContent->NodeInfo()->NamespaceID();
nsAutoString tagName;
mContent->NodeInfo()->GetName(tagName);
@ -176,13 +176,13 @@ HTMLRadioButtonAccessible::GetPositionAndSizeInternal(PRInt32* aPosInSet,
inputElms = NS_GetContentList(mContent->OwnerDoc(), namespaceId, tagName);
NS_ENSURE_TRUE(inputElms, );
PRUint32 inputCount = inputElms->Length(false);
uint32_t inputCount = inputElms->Length(false);
// Compute posinset and setsize.
PRInt32 indexOf = 0;
PRInt32 count = 0;
int32_t indexOf = 0;
int32_t count = 0;
for (PRUint32 index = 0; index < inputCount; index++) {
for (uint32_t index = 0; index < inputCount; index++) {
nsIContent* inputElm = inputElms->Item(index, false);
if (inputElm->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
type, eCaseMatters) &&
@ -208,14 +208,14 @@ HTMLButtonAccessible::
{
}
PRUint8
uint8_t
HTMLButtonAccessible::ActionCount()
{
return 1;
}
NS_IMETHODIMP
HTMLButtonAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
HTMLButtonAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
{
if (aIndex == eAction_Click) {
aName.AssignLiteral("press");
@ -225,7 +225,7 @@ HTMLButtonAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
}
NS_IMETHODIMP
HTMLButtonAccessible::DoAction(PRUint8 aIndex)
HTMLButtonAccessible::DoAction(uint8_t aIndex)
{
if (aIndex != eAction_Click)
return NS_ERROR_INVALID_ARG;
@ -234,10 +234,10 @@ HTMLButtonAccessible::DoAction(PRUint8 aIndex)
return NS_OK;
}
PRUint64
uint64_t
HTMLButtonAccessible::State()
{
PRUint64 state = HyperTextAccessibleWrap::State();
uint64_t state = HyperTextAccessibleWrap::State();
if (state == states::DEFUNCT)
return state;
@ -245,7 +245,7 @@ HTMLButtonAccessible::State()
// no special processing for unavailable state since inheritance is supplied
// other code paths.
if (mParent && mParent->IsHTMLFileInput()) {
PRUint64 parentState = mParent->State();
uint64_t parentState = mParent->State();
state |= parentState & (states::BUSY | states::REQUIRED |
states::HASPOPUP | states::INVALID);
}
@ -253,10 +253,10 @@ HTMLButtonAccessible::State()
return state;
}
PRUint64
uint64_t
HTMLButtonAccessible::NativeState()
{
PRUint64 state = HyperTextAccessibleWrap::NativeState();
uint64_t state = HyperTextAccessibleWrap::NativeState();
nsEventStates elmState = mContent->AsElement()->State();
if (elmState.HasState(NS_EVENT_STATE_DEFAULT))
@ -390,17 +390,17 @@ HTMLTextFieldAccessible::Value(nsString& aValue)
}
void
HTMLTextFieldAccessible::ApplyARIAState(PRUint64* aState) const
HTMLTextFieldAccessible::ApplyARIAState(uint64_t* aState) const
{
HyperTextAccessibleWrap::ApplyARIAState(aState);
aria::MapToState(aria::eARIAAutoComplete, mContent->AsElement(), aState);
}
PRUint64
uint64_t
HTMLTextFieldAccessible::State()
{
PRUint64 state = HyperTextAccessibleWrap::State();
uint64_t state = HyperTextAccessibleWrap::State();
if (state & states::DEFUNCT)
return state;
@ -408,7 +408,7 @@ HTMLTextFieldAccessible::State()
// no special processing for unavailable state since inheritance is supplied
// by other code paths.
if (mParent && mParent->IsHTMLFileInput()) {
PRUint64 parentState = mParent->State();
uint64_t parentState = mParent->State();
state |= parentState & (states::BUSY | states::REQUIRED |
states::HASPOPUP | states::INVALID);
}
@ -416,10 +416,10 @@ HTMLTextFieldAccessible::State()
return state;
}
PRUint64
uint64_t
HTMLTextFieldAccessible::NativeState()
{
PRUint64 state = HyperTextAccessibleWrap::NativeState();
uint64_t state = HyperTextAccessibleWrap::NativeState();
// can be focusable, focused, protected. readonly, unavailable, selected
if (mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
@ -479,14 +479,14 @@ HTMLTextFieldAccessible::NativeState()
return state;
}
PRUint8
uint8_t
HTMLTextFieldAccessible::ActionCount()
{
return 1;
}
NS_IMETHODIMP
HTMLTextFieldAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
HTMLTextFieldAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
{
if (aIndex == eAction_Click) {
aName.AssignLiteral("activate");
@ -496,7 +496,7 @@ HTMLTextFieldAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
}
NS_IMETHODIMP
HTMLTextFieldAccessible::DoAction(PRUint8 aIndex)
HTMLTextFieldAccessible::DoAction(uint8_t aIndex)
{
if (aIndex == 0) {
nsCOMPtr<nsIDOMHTMLElement> element(do_QueryInterface(mContent));
@ -655,7 +655,7 @@ HTMLGroupboxAccessible::GetNameInternal(nsAString& aName)
}
Relation
HTMLGroupboxAccessible::RelationByType(PRUint32 aType)
HTMLGroupboxAccessible::RelationByType(uint32_t aType)
{
Relation rel = HyperTextAccessibleWrap::RelationByType(aType);
// No override for label, so use <legend> for this <fieldset>
@ -676,7 +676,7 @@ HTMLLegendAccessible::
}
Relation
HTMLLegendAccessible::RelationByType(PRUint32 aType)
HTMLLegendAccessible::RelationByType(uint32_t aType)
{
Relation rel = HyperTextAccessibleWrap::RelationByType(aType);
if (aType != nsIAccessibleRelation::RELATION_LABEL_FOR)
@ -742,7 +742,7 @@ HTMLFigureAccessible::GetNameInternal(nsAString& aName)
}
Relation
HTMLFigureAccessible::RelationByType(PRUint32 aType)
HTMLFigureAccessible::RelationByType(uint32_t aType)
{
Relation rel = HyperTextAccessibleWrap::RelationByType(aType);
if (aType == nsIAccessibleRelation::RELATION_LABELLED_BY)
@ -782,7 +782,7 @@ HTMLFigcaptionAccessible::NativeRole()
}
Relation
HTMLFigcaptionAccessible::RelationByType(PRUint32 aType)
HTMLFigcaptionAccessible::RelationByType(uint32_t aType)
{
Relation rel = HyperTextAccessibleWrap::RelationByType(aType);
if (aType != nsIAccessibleRelation::RELATION_LABEL_FOR)

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

@ -29,15 +29,15 @@ public:
HTMLCheckboxAccessible(nsIContent* aContent, DocAccessible* aDoc);
// nsIAccessible
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
NS_IMETHOD DoAction(uint8_t index);
// Accessible
virtual mozilla::a11y::role NativeRole();
virtual PRUint64 NativeState();
virtual uint64_t NativeState();
// ActionAccessible
virtual PRUint8 ActionCount();
virtual uint8_t ActionCount();
// Widgets
virtual bool IsWidget() const;
@ -54,9 +54,9 @@ public:
HTMLRadioButtonAccessible(nsIContent* aContent, DocAccessible* aDoc);
// Accessible
virtual PRUint64 NativeState();
virtual void GetPositionAndSizeInternal(PRInt32 *aPosInSet,
PRInt32 *aSetSize);
virtual uint64_t NativeState();
virtual void GetPositionAndSizeInternal(int32_t *aPosInSet,
int32_t *aSetSize);
};
@ -73,17 +73,17 @@ public:
HTMLButtonAccessible(nsIContent* aContent, DocAccessible* aDoc);
// nsIAccessible
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
NS_IMETHOD DoAction(uint8_t index);
// Accessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual mozilla::a11y::role NativeRole();
virtual PRUint64 State();
virtual PRUint64 NativeState();
virtual uint64_t State();
virtual uint64_t NativeState();
// ActionAccessible
virtual PRUint8 ActionCount();
virtual uint8_t ActionCount();
// Widgets
virtual bool IsWidget() const;
@ -104,22 +104,22 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIAccessible
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
NS_IMETHOD DoAction(uint8_t index);
// HyperTextAccessible
virtual already_AddRefed<nsIEditor> GetEditor() const;
// Accessible
virtual void Value(nsString& aValue);
virtual void ApplyARIAState(PRUint64* aState) const;
virtual void ApplyARIAState(uint64_t* aState) const;
virtual nsresult GetNameInternal(nsAString& aName);
virtual mozilla::a11y::role NativeRole();
virtual PRUint64 State();
virtual PRUint64 NativeState();
virtual uint64_t State();
virtual uint64_t NativeState();
// ActionAccessible
virtual PRUint8 ActionCount();
virtual uint8_t ActionCount();
// Widgets
virtual bool IsWidget() const;
@ -151,7 +151,7 @@ public:
// Accessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual mozilla::a11y::role NativeRole();
virtual Relation RelationByType(PRUint32 aType);
virtual Relation RelationByType(uint32_t aType);
protected:
nsIContent* GetLegend();
@ -168,7 +168,7 @@ public:
// Accessible
virtual mozilla::a11y::role NativeRole();
virtual Relation RelationByType(PRUint32 aType);
virtual Relation RelationByType(uint32_t aType);
};
/**
@ -183,7 +183,7 @@ public:
virtual nsresult GetAttributesInternal(nsIPersistentProperties* aAttributes);
virtual nsresult GetNameInternal(nsAString& aName);
virtual mozilla::a11y::role NativeRole();
virtual Relation RelationByType(PRUint32 aType);
virtual Relation RelationByType(uint32_t aType);
protected:
nsIContent* Caption() const;
@ -200,7 +200,7 @@ public:
// Accessible
virtual mozilla::a11y::role NativeRole();
virtual Relation RelationByType(PRUint32 aType);
virtual Relation RelationByType(uint32_t aType);
};
} // namespace a11y

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

@ -48,20 +48,20 @@ HTMLImageMapAccessible::NativeRole()
////////////////////////////////////////////////////////////////////////////////
// HTMLImageMapAccessible: HyperLinkAccessible
PRUint32
uint32_t
HTMLImageMapAccessible::AnchorCount()
{
return ChildCount();
}
Accessible*
HTMLImageMapAccessible::AnchorAt(PRUint32 aAnchorIndex)
HTMLImageMapAccessible::AnchorAt(uint32_t aAnchorIndex)
{
return GetChildAt(aAnchorIndex);
}
already_AddRefed<nsIURI>
HTMLImageMapAccessible::AnchorURIAt(PRUint32 aAnchorIndex)
HTMLImageMapAccessible::AnchorURIAt(uint32_t aAnchorIndex)
{
Accessible* area = GetChildAt(aAnchorIndex);
if (!area)
@ -87,7 +87,7 @@ HTMLImageMapAccessible::UpdateChildAreas(bool aDoFireEvents)
bool doReorderEvent = false;
// Remove areas that are not a valid part of the image map anymore.
for (PRInt32 childIdx = mChildren.Length() - 1; childIdx >= 0; childIdx--) {
for (int32_t childIdx = mChildren.Length() - 1; childIdx >= 0; childIdx--) {
Accessible* area = mChildren.ElementAt(childIdx);
if (area->GetContent()->GetPrimaryFrame())
continue;
@ -102,8 +102,8 @@ HTMLImageMapAccessible::UpdateChildAreas(bool aDoFireEvents)
}
// Insert new areas into the tree.
PRUint32 areaElmCount = imageMapObj->AreaCount();
for (PRUint32 idx = 0; idx < areaElmCount; idx++) {
uint32_t areaElmCount = imageMapObj->AreaCount();
for (uint32_t idx = 0; idx < areaElmCount; idx++) {
nsIContent* areaContent = imageMapObj->GetAreaAt(idx);
Accessible* area = mChildren.SafeElementAt(idx);
@ -198,7 +198,7 @@ HTMLAreaAccessible::IsPrimaryForNode() const
// HTMLAreaAccessible: Accessible public
Accessible*
HTMLAreaAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
HTMLAreaAccessible::ChildAtPoint(int32_t aX, int32_t aY,
EWhichChildAtPoint aWhichChild)
{
// Don't walk into area accessibles.
@ -208,7 +208,7 @@ HTMLAreaAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
////////////////////////////////////////////////////////////////////////////////
// HTMLImageMapAccessible: HyperLinkAccessible
PRUint32
uint32_t
HTMLAreaAccessible::StartOffset()
{
// Image map accessible is not hypertext accessible therefore
@ -219,7 +219,7 @@ HTMLAreaAccessible::StartOffset()
return IndexInParent();
}
PRUint32
uint32_t
HTMLAreaAccessible::EndOffset()
{
return IndexInParent() + 1;

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

@ -29,9 +29,9 @@ public:
virtual a11y::role NativeRole();
// HyperLinkAccessible
virtual PRUint32 AnchorCount();
virtual Accessible* AnchorAt(PRUint32 aAnchorIndex);
virtual already_AddRefed<nsIURI> AnchorURIAt(PRUint32 aAnchorIndex);
virtual uint32_t AnchorCount();
virtual Accessible* AnchorAt(uint32_t aAnchorIndex);
virtual already_AddRefed<nsIURI> AnchorURIAt(uint32_t aAnchorIndex);
/**
* Update area children of the image map.
@ -59,13 +59,13 @@ public:
// Accessible
virtual void Description(nsString& aDescription);
virtual nsresult GetNameInternal(nsAString& aName);
virtual Accessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
EWhichChildAtPoint aWhichChild);
virtual void GetBoundsRect(nsRect& aBounds, nsIFrame** aBoundingFrame);
// HyperLinkAccessible
virtual PRUint32 StartOffset();
virtual PRUint32 EndOffset();
virtual uint32_t StartOffset();
virtual uint32_t EndOffset();
protected:

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

@ -39,13 +39,13 @@ HTMLLinkAccessible::NativeRole()
return roles::LINK;
}
PRUint64
uint64_t
HTMLLinkAccessible::NativeState()
{
return HyperTextAccessibleWrap::NativeState() & ~states::READONLY;
}
PRUint64
uint64_t
HTMLLinkAccessible::NativeLinkState() const
{
nsEventStates eventState = mContent->AsElement()->State();
@ -61,10 +61,10 @@ HTMLLinkAccessible::NativeLinkState() const
return nsCoreUtils::HasClickListener(mContent) ? states::LINKED : 0;
}
PRUint64
uint64_t
HTMLLinkAccessible::NativeInteractiveState() const
{
PRUint64 state = HyperTextAccessibleWrap::NativeInteractiveState();
uint64_t state = HyperTextAccessibleWrap::NativeInteractiveState();
// This is how we indicate it is a named anchor. In other words, this anchor
// can be selected as a location :) There is no other better state to use to
@ -85,14 +85,14 @@ HTMLLinkAccessible::Value(nsString& aValue)
nsContentUtils::GetLinkLocation(mContent->AsElement(), aValue);
}
PRUint8
uint8_t
HTMLLinkAccessible::ActionCount()
{
return IsLinked() ? 1 : HyperTextAccessible::ActionCount();
}
NS_IMETHODIMP
HTMLLinkAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
HTMLLinkAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
{
aName.Truncate();
@ -108,7 +108,7 @@ HTMLLinkAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
}
NS_IMETHODIMP
HTMLLinkAccessible::DoAction(PRUint8 aIndex)
HTMLLinkAccessible::DoAction(uint8_t aIndex)
{
if (!IsLinked())
return HyperTextAccessible::DoAction(aIndex);
@ -135,7 +135,7 @@ HTMLLinkAccessible::IsLink()
}
already_AddRefed<nsIURI>
HTMLLinkAccessible::AnchorURIAt(PRUint32 aAnchorIndex)
HTMLLinkAccessible::AnchorURIAt(uint32_t aAnchorIndex)
{
return aAnchorIndex == 0 ? mContent->GetHrefURI() : nullptr;
}

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

@ -19,22 +19,22 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIAccessible
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 aIndex);
NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
NS_IMETHOD DoAction(uint8_t aIndex);
// Accessible
virtual void Value(nsString& aValue);
virtual a11y::role NativeRole();
virtual PRUint64 NativeState();
virtual PRUint64 NativeLinkState() const;
virtual PRUint64 NativeInteractiveState() const;
virtual uint64_t NativeState();
virtual uint64_t NativeLinkState() const;
virtual uint64_t NativeInteractiveState() const;
// ActionAccessible
virtual PRUint8 ActionCount();
virtual uint8_t ActionCount();
// HyperLinkAccessible
virtual bool IsLink();
virtual already_AddRefed<nsIURI> AnchorURIAt(PRUint32 aAnchorIndex);
virtual already_AddRefed<nsIURI> AnchorURIAt(uint32_t aAnchorIndex);
protected:
enum { eAction_Jump = 0 };

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

@ -31,7 +31,7 @@ HTMLListAccessible::NativeRole()
return roles::LIST;
}
PRUint64
uint64_t
HTMLListAccessible::NativeState()
{
return HyperTextAccessibleWrap::NativeState() | states::READONLY;
@ -75,21 +75,21 @@ HTMLLIAccessible::NativeRole()
return roles::LISTITEM;
}
PRUint64
uint64_t
HTMLLIAccessible::NativeState()
{
return HyperTextAccessibleWrap::NativeState() | states::READONLY;
}
NS_IMETHODIMP
HTMLLIAccessible::GetBounds(PRInt32* aX, PRInt32* aY,
PRInt32* aWidth, PRInt32* aHeight)
HTMLLIAccessible::GetBounds(int32_t* aX, int32_t* aY,
int32_t* aWidth, int32_t* aHeight)
{
nsresult rv = AccessibleWrap::GetBounds(aX, aY, aWidth, aHeight);
if (NS_FAILED(rv) || !mBullet || mBullet->IsInside())
return rv;
PRInt32 bulletX = 0, bulletY = 0, bulletWidth = 0, bulletHeight = 0;
int32_t bulletX = 0, bulletY = 0, bulletWidth = 0, bulletHeight = 0;
rv = mBullet->GetBounds(&bulletX, &bulletY, &bulletWidth, &bulletHeight);
NS_ENSURE_SUCCESS(rv, rv);
@ -185,15 +185,15 @@ HTMLListBulletAccessible::NativeRole()
return roles::STATICTEXT;
}
PRUint64
uint64_t
HTMLListBulletAccessible::NativeState()
{
return LeafAccessible::NativeState() | states::READONLY;
}
void
HTMLListBulletAccessible::AppendTextTo(nsAString& aText, PRUint32 aStartOffset,
PRUint32 aLength)
HTMLListBulletAccessible::AppendTextTo(nsAString& aText, uint32_t aStartOffset,
uint32_t aLength)
{
nsAutoString bulletText;
nsBlockFrame* blockFrame = do_QueryFrame(mContent->GetPrimaryFrame());

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

@ -30,7 +30,7 @@ public:
// Accessible
virtual a11y::role NativeRole();
virtual PRUint64 NativeState();
virtual uint64_t NativeState();
};
@ -50,12 +50,12 @@ public:
virtual void Shutdown();
// nsIAccessible
NS_IMETHOD GetBounds(PRInt32* aX, PRInt32* aY,
PRInt32* aWidth, PRInt32* aHeight);
NS_IMETHOD GetBounds(int32_t* aX, int32_t* aY,
int32_t* aWidth, int32_t* aHeight);
// Accessible
virtual a11y::role NativeRole();
virtual PRUint64 NativeState();
virtual uint64_t NativeState();
// nsHTMLLIAccessible
void UpdateBullet(bool aHasBullet);
@ -86,9 +86,9 @@ public:
// Accessible
virtual ENameValueFlag Name(nsString& aName);
virtual a11y::role NativeRole();
virtual PRUint64 NativeState();
virtual void AppendTextTo(nsAString& aText, PRUint32 aStartOffset = 0,
PRUint32 aLength = PR_UINT32_MAX);
virtual uint64_t NativeState();
virtual void AppendTextTo(nsAString& aText, uint32_t aStartOffset = 0,
uint32_t aLength = PR_UINT32_MAX);
// HTMLListBulletAccessible

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

@ -42,10 +42,10 @@ HTMLSelectListAccessible::
////////////////////////////////////////////////////////////////////////////////
// HTMLSelectListAccessible: Accessible public
PRUint64
uint64_t
HTMLSelectListAccessible::NativeState()
{
PRUint64 state = AccessibleWrap::NativeState();
uint64_t state = AccessibleWrap::NativeState();
if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::multiple))
state |= states::MULTISELECTABLE | states::EXTSELECTABLE;
@ -220,20 +220,20 @@ HTMLSelectOptionAccessible::GetNameInternal(nsAString& aName)
return NS_OK;
}
PRUint64
uint64_t
HTMLSelectOptionAccessible::NativeState()
{
// As a HTMLSelectOptionAccessible we can have the following states:
// SELECTABLE, SELECTED, FOCUSED, FOCUSABLE, OFFSCREEN
// Upcall to Accessible, but skip HyperTextAccessible impl
// because we don't want EDITABLE or SELECTABLE_TEXT
PRUint64 state = Accessible::NativeState();
uint64_t state = Accessible::NativeState();
Accessible* select = GetSelect();
if (!select)
return state;
PRUint64 selectState = select->State();
uint64_t selectState = select->State();
if (selectState & states::INVISIBLE)
return state;
@ -268,8 +268,8 @@ HTMLSelectOptionAccessible::NativeState()
// <select> is not collapsed: compare bounds to calculate OFFSCREEN
Accessible* listAcc = Parent();
if (listAcc) {
PRInt32 optionX, optionY, optionWidth, optionHeight;
PRInt32 listX, listY, listWidth, listHeight;
int32_t optionX, optionY, optionWidth, optionHeight;
int32_t listX, listY, listWidth, listHeight;
GetBounds(&optionX, &optionY, &optionWidth, &optionHeight);
listAcc->GetBounds(&listX, &listY, &listWidth, &listHeight);
if (optionY < listY || optionY + optionHeight > listY + listHeight) {
@ -281,19 +281,19 @@ HTMLSelectOptionAccessible::NativeState()
return state;
}
PRUint64
uint64_t
HTMLSelectOptionAccessible::NativeInteractiveState() const
{
return NativelyUnavailable() ?
states::UNAVAILABLE : states::FOCUSABLE | states::SELECTABLE;
}
PRInt32
int32_t
HTMLSelectOptionAccessible::GetLevelInternal()
{
nsIContent *parentContent = mContent->GetParent();
PRInt32 level =
int32_t level =
parentContent->NodeInfo()->Equals(nsGkAtoms::optgroup) ? 2 : 1;
if (level == 1 && Role() != roles::HEADING)
@ -314,7 +314,7 @@ HTMLSelectOptionAccessible::GetBoundsRect(nsRect& aTotalBounds,
}
NS_IMETHODIMP
HTMLSelectOptionAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
HTMLSelectOptionAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
{
if (aIndex == eAction_Select) {
aName.AssignLiteral("select");
@ -323,14 +323,14 @@ HTMLSelectOptionAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
return NS_ERROR_INVALID_ARG;
}
PRUint8
uint8_t
HTMLSelectOptionAccessible::ActionCount()
{
return 1;
}
NS_IMETHODIMP
HTMLSelectOptionAccessible::DoAction(PRUint8 aIndex)
HTMLSelectOptionAccessible::DoAction(uint8_t aIndex)
{
if (aIndex != eAction_Select)
return NS_ERROR_INVALID_ARG;
@ -377,25 +377,25 @@ HTMLSelectOptGroupAccessible::NativeRole()
return roles::HEADING;
}
PRUint64
uint64_t
HTMLSelectOptGroupAccessible::NativeInteractiveState() const
{
return NativelyUnavailable() ? states::UNAVAILABLE : 0;
}
NS_IMETHODIMP
HTMLSelectOptGroupAccessible::DoAction(PRUint8 index)
HTMLSelectOptGroupAccessible::DoAction(uint8_t index)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
HTMLSelectOptGroupAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
HTMLSelectOptGroupAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
PRUint8
uint8_t
HTMLSelectOptGroupAccessible::ActionCount()
{
return 0;
@ -486,13 +486,13 @@ HTMLComboboxAccessible::Shutdown()
}
}
PRUint64
uint64_t
HTMLComboboxAccessible::NativeState()
{
// As a HTMLComboboxAccessible we can have the following states:
// FOCUSED, FOCUSABLE, HASPOPUP, EXPANDED, COLLAPSED
// Get focus status from base class
PRUint64 state = Accessible::NativeState();
uint64_t state = Accessible::NativeState();
nsIComboboxControlFrame* comboFrame = do_QueryFrame(GetFrame());
if (comboFrame && comboFrame->IsDroppedDown())
@ -529,14 +529,14 @@ HTMLComboboxAccessible::Value(nsString& aValue)
option->Name(aValue);
}
PRUint8
uint8_t
HTMLComboboxAccessible::ActionCount()
{
return 1;
}
NS_IMETHODIMP
HTMLComboboxAccessible::DoAction(PRUint8 aIndex)
HTMLComboboxAccessible::DoAction(uint8_t aIndex)
{
if (aIndex != eAction_Click)
return NS_ERROR_INVALID_ARG;
@ -555,7 +555,7 @@ HTMLComboboxAccessible::DoAction(PRUint8 aIndex)
* Uses the frame to get the state, updated on every click
*/
NS_IMETHODIMP
HTMLComboboxAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
HTMLComboboxAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
{
if (aIndex != HTMLComboboxAccessible::eAction_Click) {
return NS_ERROR_INVALID_ARG;
@ -681,13 +681,13 @@ HTMLComboboxListAccessible::NativeRole()
return roles::COMBOBOX_LIST;
}
PRUint64
uint64_t
HTMLComboboxListAccessible::NativeState()
{
// As a HTMLComboboxListAccessible we can have the following states:
// FOCUSED, FOCUSABLE, FLOATING, INVISIBLE
// Get focus status from base class
PRUint64 state = Accessible::NativeState();
uint64_t state = Accessible::NativeState();
nsIComboboxControlFrame* comboFrame = do_QueryFrame(mParent->GetFrame());
if (comboFrame && comboFrame->IsDroppedDown())

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

@ -43,7 +43,7 @@ public:
// Accessible
virtual a11y::role NativeRole();
virtual PRUint64 NativeState();
virtual uint64_t NativeState();
// SelectAccessible
virtual bool IsSelect();
@ -82,21 +82,21 @@ public:
virtual ~HTMLSelectOptionAccessible() {}
// nsIAccessible
NS_IMETHOD DoAction(PRUint8 index);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(uint8_t index);
NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
NS_IMETHOD SetSelected(bool aSelect);
// Accessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual a11y::role NativeRole();
virtual PRUint64 NativeState();
virtual PRUint64 NativeInteractiveState() const;
virtual uint64_t NativeState();
virtual uint64_t NativeInteractiveState() const;
virtual PRInt32 GetLevelInternal();
virtual int32_t GetLevelInternal();
virtual void GetBoundsRect(nsRect& aTotalBounds, nsIFrame** aBoundingFrame);
// ActionAccessible
virtual PRUint8 ActionCount();
virtual uint8_t ActionCount();
// Widgets
virtual Accessible* ContainerWidget() const;
@ -141,15 +141,15 @@ public:
virtual ~HTMLSelectOptGroupAccessible() {}
// nsIAccessible
NS_IMETHOD DoAction(PRUint8 index);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(uint8_t index);
NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
// Accessible
virtual a11y::role NativeRole();
virtual PRUint64 NativeInteractiveState() const;
virtual uint64_t NativeInteractiveState() const;
// ActionAccessible
virtual PRUint8 ActionCount();
virtual uint8_t ActionCount();
protected:
// Accessible
@ -174,8 +174,8 @@ public:
virtual ~HTMLComboboxAccessible() {}
// nsIAccessible
NS_IMETHOD DoAction(PRUint8 index);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(uint8_t index);
NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
// nsAccessNode
virtual void Shutdown();
@ -184,11 +184,11 @@ public:
virtual void Description(nsString& aDescription);
virtual void Value(nsString& aValue);
virtual a11y::role NativeRole();
virtual PRUint64 NativeState();
virtual uint64_t NativeState();
virtual void InvalidateChildren();
// ActionAccessible
virtual PRUint8 ActionCount();
virtual uint8_t ActionCount();
// Widgets
virtual bool IsWidget() const;
@ -229,7 +229,7 @@ public:
// Accessible
virtual a11y::role NativeRole();
virtual PRUint64 NativeState();
virtual uint64_t NativeState();
virtual void GetBoundsRect(nsRect& aBounds, nsIFrame** aBoundingFrame);
// Widgets

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

@ -73,10 +73,10 @@ HTMLTableCellAccessible::NativeRole()
return roles::CELL;
}
PRUint64
uint64_t
HTMLTableCellAccessible::NativeState()
{
PRUint64 state = HyperTextAccessibleWrap::NativeState();
uint64_t state = HyperTextAccessibleWrap::NativeState();
nsIFrame *frame = mContent->GetPrimaryFrame();
NS_ASSERTION(frame, "No frame for valid cell accessible!");
@ -87,7 +87,7 @@ HTMLTableCellAccessible::NativeState()
return state;
}
PRUint64
uint64_t
HTMLTableCellAccessible::NativeInteractiveState() const
{
return HyperTextAccessibleWrap::NativeInteractiveState() | states::SELECTABLE;
@ -107,11 +107,11 @@ HTMLTableCellAccessible::GetAttributesInternal(nsIPersistentProperties* aAttribu
if (!tableAcc)
return NS_OK;
PRInt32 rowIdx = -1, colIdx = -1;
int32_t rowIdx = -1, colIdx = -1;
rv = GetCellIndexes(rowIdx, colIdx);
NS_ENSURE_SUCCESS(rv, rv);
PRInt32 idx = -1;
int32_t idx = -1;
rv = tableAcc->GetCellIndexAt(rowIdx, colIdx, &idx);
NS_ENSURE_SUCCESS(rv, rv);
@ -166,7 +166,7 @@ HTMLTableCellAccessible::GetTable(nsIAccessibleTable** aTable)
}
NS_IMETHODIMP
HTMLTableCellAccessible::GetColumnIndex(PRInt32* aColumnIndex)
HTMLTableCellAccessible::GetColumnIndex(int32_t* aColumnIndex)
{
NS_ENSURE_ARG_POINTER(aColumnIndex);
*aColumnIndex = -1;
@ -181,7 +181,7 @@ HTMLTableCellAccessible::GetColumnIndex(PRInt32* aColumnIndex)
}
NS_IMETHODIMP
HTMLTableCellAccessible::GetRowIndex(PRInt32* aRowIndex)
HTMLTableCellAccessible::GetRowIndex(int32_t* aRowIndex)
{
NS_ENSURE_ARG_POINTER(aRowIndex);
*aRowIndex = -1;
@ -196,12 +196,12 @@ HTMLTableCellAccessible::GetRowIndex(PRInt32* aRowIndex)
}
NS_IMETHODIMP
HTMLTableCellAccessible::GetColumnExtent(PRInt32* aExtentCount)
HTMLTableCellAccessible::GetColumnExtent(int32_t* aExtentCount)
{
NS_ENSURE_ARG_POINTER(aExtentCount);
*aExtentCount = 1;
PRInt32 rowIdx = -1, colIdx = -1;
int32_t rowIdx = -1, colIdx = -1;
GetCellIndexes(rowIdx, colIdx);
nsCOMPtr<nsIAccessibleTable> table = GetTableAccessible();
@ -211,12 +211,12 @@ HTMLTableCellAccessible::GetColumnExtent(PRInt32* aExtentCount)
}
NS_IMETHODIMP
HTMLTableCellAccessible::GetRowExtent(PRInt32* aExtentCount)
HTMLTableCellAccessible::GetRowExtent(int32_t* aExtentCount)
{
NS_ENSURE_ARG_POINTER(aExtentCount);
*aExtentCount = 1;
PRInt32 rowIdx = -1, colIdx = -1;
int32_t rowIdx = -1, colIdx = -1;
GetCellIndexes(rowIdx, colIdx);
nsCOMPtr<nsIAccessibleTable> table = GetTableAccessible();
@ -258,7 +258,7 @@ HTMLTableCellAccessible::IsSelected(bool* aIsSelected)
if (IsDefunct())
return NS_ERROR_FAILURE;
PRInt32 rowIdx = -1, colIdx = -1;
int32_t rowIdx = -1, colIdx = -1;
GetCellIndexes(rowIdx, colIdx);
nsCOMPtr<nsIAccessibleTable> table = GetTableAccessible();
@ -299,7 +299,7 @@ HTMLTableCellAccessible::GetCellLayout()
}
nsresult
HTMLTableCellAccessible::GetCellIndexes(PRInt32& aRowIndex, PRInt32& aColIndex)
HTMLTableCellAccessible::GetCellIndexes(int32_t& aRowIndex, int32_t& aColIndex)
{
nsITableCellLayout *cellLayout = GetCellLayout();
NS_ENSURE_STATE(cellLayout);
@ -308,7 +308,7 @@ HTMLTableCellAccessible::GetCellIndexes(PRInt32& aRowIndex, PRInt32& aColIndex)
}
nsresult
HTMLTableCellAccessible::GetHeaderCells(PRInt32 aRowOrColumnHeaderCell,
HTMLTableCellAccessible::GetHeaderCells(int32_t aRowOrColumnHeaderCell,
nsIArray** aHeaderCells)
{
// Get header cells from @header attribute.
@ -367,7 +367,7 @@ HTMLTableHeaderCellAccessible::NativeRole()
// Check value of @scope attribute.
static nsIContent::AttrValuesArray scopeValues[] =
{&nsGkAtoms::col, &nsGkAtoms::row, nullptr};
PRInt32 valueIdx =
int32_t valueIdx =
mContent->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::scope,
scopeValues, eCaseMatters);
@ -463,7 +463,7 @@ HTMLTableAccessible::NativeRole()
return roles::TABLE;
}
PRUint64
uint64_t
HTMLTableAccessible::NativeState()
{
return Accessible::NativeState() | states::READONLY;
@ -511,7 +511,7 @@ HTMLTableAccessible::GetAttributesInternal(nsIPersistentProperties* aAttributes)
// HTMLTableAccessible: nsIAccessible implementation
Relation
HTMLTableAccessible::RelationByType(PRUint32 aType)
HTMLTableAccessible::RelationByType(uint32_t aType)
{
Relation rel = AccessibleWrap::RelationByType(aType);
if (aType == nsIAccessibleRelation::RELATION_LABELLED_BY)
@ -539,46 +539,46 @@ HTMLTableAccessible::Summary(nsString& aSummary)
table->GetSummary(aSummary);
}
PRUint32
uint32_t
HTMLTableAccessible::ColCount()
{
nsITableLayout* tableLayout = GetTableLayout();
if (!tableLayout)
return 0;
PRInt32 rowCount = 0, colCount = 0;
int32_t rowCount = 0, colCount = 0;
tableLayout->GetTableSize(rowCount, colCount);
return colCount;
}
PRUint32
uint32_t
HTMLTableAccessible::RowCount()
{
nsITableLayout* tableLayout = GetTableLayout();
if (!tableLayout)
return 0;
PRInt32 rowCount = 0, colCount = 0;
int32_t rowCount = 0, colCount = 0;
tableLayout->GetTableSize(rowCount, colCount);
return rowCount;
}
PRUint32
uint32_t
HTMLTableAccessible::SelectedCellCount()
{
nsITableLayout *tableLayout = GetTableLayout();
if (!tableLayout)
return 0;
PRUint32 count = 0, rowCount = RowCount(), colCount = ColCount();
uint32_t count = 0, rowCount = RowCount(), colCount = ColCount();
nsCOMPtr<nsIDOMElement> domElement;
PRInt32 startRowIndex = 0, startColIndex = 0,
int32_t startRowIndex = 0, startColIndex = 0,
rowSpan, colSpan, actualRowSpan, actualColSpan;
bool isSelected = false;
for (PRUint32 rowIdx = 0; rowIdx < rowCount; rowIdx++) {
for (PRUint32 colIdx = 0; colIdx < colCount; colIdx++) {
for (uint32_t rowIdx = 0; rowIdx < rowCount; rowIdx++) {
for (uint32_t colIdx = 0; colIdx < colCount; colIdx++) {
nsresult rv = tableLayout->GetCellDataAt(rowIdx, colIdx,
*getter_AddRefs(domElement),
startRowIndex, startColIndex,
@ -595,24 +595,24 @@ HTMLTableAccessible::SelectedCellCount()
return count;
}
PRUint32
uint32_t
HTMLTableAccessible::SelectedColCount()
{
PRUint32 count = 0, colCount = ColCount();
uint32_t count = 0, colCount = ColCount();
for (PRUint32 colIdx = 0; colIdx < colCount; colIdx++)
for (uint32_t colIdx = 0; colIdx < colCount; colIdx++)
if (IsColSelected(colIdx))
count++;
return count;
}
PRUint32
uint32_t
HTMLTableAccessible::SelectedRowCount()
{
PRUint32 count = 0, rowCount = RowCount();
uint32_t count = 0, rowCount = RowCount();
for (PRUint32 rowIdx = 0; rowIdx < rowCount; rowIdx++)
for (uint32_t rowIdx = 0; rowIdx < rowCount; rowIdx++)
if (IsRowSelected(rowIdx))
count++;
@ -622,19 +622,19 @@ HTMLTableAccessible::SelectedRowCount()
void
HTMLTableAccessible::SelectedCells(nsTArray<Accessible*>* aCells)
{
PRUint32 rowCount = RowCount(), colCount = ColCount();
uint32_t rowCount = RowCount(), colCount = ColCount();
nsITableLayout *tableLayout = GetTableLayout();
if (!tableLayout)
return;
nsCOMPtr<nsIDOMElement> cellElement;
PRInt32 startRowIndex = 0, startColIndex = 0,
int32_t startRowIndex = 0, startColIndex = 0,
rowSpan, colSpan, actualRowSpan, actualColSpan;
bool isSelected = false;
for (PRUint32 rowIdx = 0; rowIdx < rowCount; rowIdx++) {
for (PRUint32 colIdx = 0; colIdx < colCount; colIdx++) {
for (uint32_t rowIdx = 0; rowIdx < rowCount; rowIdx++) {
for (uint32_t colIdx = 0; colIdx < colCount; colIdx++) {
nsresult rv = tableLayout->GetCellDataAt(rowIdx, colIdx,
*getter_AddRefs(cellElement),
startRowIndex, startColIndex,
@ -653,21 +653,21 @@ HTMLTableAccessible::SelectedCells(nsTArray<Accessible*>* aCells)
}
void
HTMLTableAccessible::SelectedCellIndices(nsTArray<PRUint32>* aCells)
HTMLTableAccessible::SelectedCellIndices(nsTArray<uint32_t>* aCells)
{
nsITableLayout *tableLayout = GetTableLayout();
if (!tableLayout)
return;
PRUint32 rowCount = RowCount(), colCount = ColCount();
uint32_t rowCount = RowCount(), colCount = ColCount();
nsCOMPtr<nsIDOMElement> domElement;
PRInt32 startRowIndex = 0, startColIndex = 0,
int32_t startRowIndex = 0, startColIndex = 0,
rowSpan, colSpan, actualRowSpan, actualColSpan;
bool isSelected = false;
for (PRUint32 rowIdx = 0; rowIdx < rowCount; rowIdx++) {
for (PRUint32 colIdx = 0; colIdx < colCount; colIdx++) {
for (uint32_t rowIdx = 0; rowIdx < rowCount; rowIdx++) {
for (uint32_t colIdx = 0; colIdx < colCount; colIdx++) {
nsresult rv = tableLayout->GetCellDataAt(rowIdx, colIdx,
*getter_AddRefs(domElement),
startRowIndex, startColIndex,
@ -683,25 +683,25 @@ HTMLTableAccessible::SelectedCellIndices(nsTArray<PRUint32>* aCells)
}
void
HTMLTableAccessible::SelectedColIndices(nsTArray<PRUint32>* aCols)
HTMLTableAccessible::SelectedColIndices(nsTArray<uint32_t>* aCols)
{
PRUint32 colCount = ColCount();
for (PRUint32 colIdx = 0; colIdx < colCount; colIdx++)
uint32_t colCount = ColCount();
for (uint32_t colIdx = 0; colIdx < colCount; colIdx++)
if (IsColSelected(colIdx))
aCols->AppendElement(colIdx);
}
void
HTMLTableAccessible::SelectedRowIndices(nsTArray<PRUint32>* aRows)
HTMLTableAccessible::SelectedRowIndices(nsTArray<uint32_t>* aRows)
{
PRUint32 rowCount = RowCount();
for (PRUint32 rowIdx = 0; rowIdx < rowCount; rowIdx++)
uint32_t rowCount = RowCount();
for (uint32_t rowIdx = 0; rowIdx < rowCount; rowIdx++)
if (IsRowSelected(rowIdx))
aRows->AppendElement(rowIdx);
}
Accessible*
HTMLTableAccessible::CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex)
HTMLTableAccessible::CellAt(uint32_t aRowIndex, uint32_t aColumnIndex)
{
nsCOMPtr<nsIDOMElement> cellElement;
GetCellAt(aRowIndex, aColumnIndex, *getter_AddRefs(cellElement));
@ -719,43 +719,43 @@ HTMLTableAccessible::CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex)
return cell == this ? nullptr : cell;
}
PRInt32
HTMLTableAccessible::CellIndexAt(PRUint32 aRowIdx, PRUint32 aColIdx)
int32_t
HTMLTableAccessible::CellIndexAt(uint32_t aRowIdx, uint32_t aColIdx)
{
nsITableLayout* tableLayout = GetTableLayout();
PRInt32 index = -1;
int32_t index = -1;
tableLayout->GetIndexByRowAndColumn(aRowIdx, aColIdx, &index);
return index;
}
PRInt32
HTMLTableAccessible::ColIndexAt(PRUint32 aCellIdx)
int32_t
HTMLTableAccessible::ColIndexAt(uint32_t aCellIdx)
{
nsITableLayout* tableLayout = GetTableLayout();
if (!tableLayout)
return -1;
PRInt32 rowIdx = -1, colIdx = -1;
int32_t rowIdx = -1, colIdx = -1;
tableLayout->GetRowAndColumnByIndex(aCellIdx, &rowIdx, &colIdx);
return colIdx;
}
PRInt32
HTMLTableAccessible::RowIndexAt(PRUint32 aCellIdx)
int32_t
HTMLTableAccessible::RowIndexAt(uint32_t aCellIdx)
{
nsITableLayout* tableLayout = GetTableLayout();
if (!tableLayout)
return -1;
PRInt32 rowIdx = -1, colIdx = -1;
int32_t rowIdx = -1, colIdx = -1;
tableLayout->GetRowAndColumnByIndex(aCellIdx, &rowIdx, &colIdx);
return rowIdx;
}
void
HTMLTableAccessible::RowAndColIndicesAt(PRUint32 aCellIdx, PRInt32* aRowIdx,
PRInt32* aColIdx)
HTMLTableAccessible::RowAndColIndicesAt(uint32_t aCellIdx, int32_t* aRowIdx,
int32_t* aColIdx)
{
nsITableLayout* tableLayout = GetTableLayout();
@ -763,17 +763,17 @@ HTMLTableAccessible::RowAndColIndicesAt(PRUint32 aCellIdx, PRInt32* aRowIdx,
tableLayout->GetRowAndColumnByIndex(aCellIdx, aRowIdx, aColIdx);
}
PRUint32
HTMLTableAccessible::ColExtentAt(PRUint32 aRowIdx, PRUint32 aColIdx)
uint32_t
HTMLTableAccessible::ColExtentAt(uint32_t aRowIdx, uint32_t aColIdx)
{
nsITableLayout* tableLayout = GetTableLayout();
if (!tableLayout)
return 0;
nsCOMPtr<nsIDOMElement> domElement;
PRInt32 startRowIndex, startColIndex, rowSpan, colSpan, actualRowSpan;
int32_t startRowIndex, startColIndex, rowSpan, colSpan, actualRowSpan;
bool isSelected;
PRInt32 columnExtent = 0;
int32_t columnExtent = 0;
DebugOnly<nsresult> rv = tableLayout->
GetCellDataAt(aRowIdx, aColIdx, *getter_AddRefs(domElement),
@ -784,17 +784,17 @@ HTMLTableAccessible::ColExtentAt(PRUint32 aRowIdx, PRUint32 aColIdx)
return columnExtent;
}
PRUint32
HTMLTableAccessible::RowExtentAt(PRUint32 aRowIdx, PRUint32 aColIdx)
uint32_t
HTMLTableAccessible::RowExtentAt(uint32_t aRowIdx, uint32_t aColIdx)
{
nsITableLayout* tableLayout = GetTableLayout();
if (!tableLayout)
return 0;
nsCOMPtr<nsIDOMElement> domElement;
PRInt32 startRowIndex, startColIndex, rowSpan, colSpan, actualColSpan;
int32_t startRowIndex, startColIndex, rowSpan, colSpan, actualColSpan;
bool isSelected;
PRInt32 rowExtent = 0;
int32_t rowExtent = 0;
DebugOnly<nsresult> rv = tableLayout->
GetCellDataAt(aRowIdx, aColIdx, *getter_AddRefs(domElement),
@ -806,12 +806,12 @@ HTMLTableAccessible::RowExtentAt(PRUint32 aRowIdx, PRUint32 aColIdx)
}
bool
HTMLTableAccessible::IsColSelected(PRUint32 aColIdx)
HTMLTableAccessible::IsColSelected(uint32_t aColIdx)
{
bool isSelected = false;
PRUint32 rowCount = RowCount();
for (PRUint32 rowIdx = 0; rowIdx < rowCount; rowIdx++) {
uint32_t rowCount = RowCount();
for (uint32_t rowIdx = 0; rowIdx < rowCount; rowIdx++) {
isSelected = IsCellSelected(rowIdx, aColIdx);
if (!isSelected)
return false;
@ -821,12 +821,12 @@ HTMLTableAccessible::IsColSelected(PRUint32 aColIdx)
}
bool
HTMLTableAccessible::IsRowSelected(PRUint32 aRowIdx)
HTMLTableAccessible::IsRowSelected(uint32_t aRowIdx)
{
bool isSelected = false;
PRUint32 colCount = ColCount();
for (PRUint32 colIdx = 0; colIdx < colCount; colIdx++) {
uint32_t colCount = ColCount();
for (uint32_t colIdx = 0; colIdx < colCount; colIdx++) {
isSelected = IsCellSelected(aRowIdx, colIdx);
if (!isSelected)
return false;
@ -836,14 +836,14 @@ HTMLTableAccessible::IsRowSelected(PRUint32 aRowIdx)
}
bool
HTMLTableAccessible::IsCellSelected(PRUint32 aRowIdx, PRUint32 aColIdx)
HTMLTableAccessible::IsCellSelected(uint32_t aRowIdx, uint32_t aColIdx)
{
nsITableLayout *tableLayout = GetTableLayout();
if (!tableLayout)
return false;
nsCOMPtr<nsIDOMElement> domElement;
PRInt32 startRowIndex = 0, startColIndex = 0,
int32_t startRowIndex = 0, startColIndex = 0,
rowSpan, colSpan, actualRowSpan, actualColSpan;
bool isSelected = false;
@ -855,7 +855,7 @@ HTMLTableAccessible::IsCellSelected(PRUint32 aRowIdx, PRUint32 aColIdx)
}
void
HTMLTableAccessible::SelectRow(PRUint32 aRowIdx)
HTMLTableAccessible::SelectRow(uint32_t aRowIdx)
{
nsresult rv =
RemoveRowsOrColumnsFromSelection(aRowIdx,
@ -868,7 +868,7 @@ HTMLTableAccessible::SelectRow(PRUint32 aRowIdx)
}
void
HTMLTableAccessible::SelectCol(PRUint32 aColIdx)
HTMLTableAccessible::SelectCol(uint32_t aColIdx)
{
nsresult rv =
RemoveRowsOrColumnsFromSelection(aColIdx,
@ -881,7 +881,7 @@ HTMLTableAccessible::SelectCol(PRUint32 aColIdx)
}
void
HTMLTableAccessible::UnselectRow(PRUint32 aRowIdx)
HTMLTableAccessible::UnselectRow(uint32_t aRowIdx)
{
RemoveRowsOrColumnsFromSelection(aRowIdx,
nsISelectionPrivate::TABLESELECTION_ROW,
@ -889,7 +889,7 @@ HTMLTableAccessible::UnselectRow(PRUint32 aRowIdx)
}
void
HTMLTableAccessible::UnselectCol(PRUint32 aColIdx)
HTMLTableAccessible::UnselectCol(uint32_t aColIdx)
{
RemoveRowsOrColumnsFromSelection(aColIdx,
nsISelectionPrivate::TABLESELECTION_COLUMN,
@ -897,7 +897,7 @@ HTMLTableAccessible::UnselectCol(PRUint32 aColIdx)
}
nsresult
HTMLTableAccessible::AddRowOrColumnToSelection(PRInt32 aIndex, PRUint32 aTarget)
HTMLTableAccessible::AddRowOrColumnToSelection(int32_t aIndex, uint32_t aTarget)
{
bool doSelectRow = (aTarget == nsISelectionPrivate::TABLESELECTION_ROW);
@ -905,12 +905,12 @@ HTMLTableAccessible::AddRowOrColumnToSelection(PRInt32 aIndex, PRUint32 aTarget)
NS_ENSURE_STATE(tableLayout);
nsCOMPtr<nsIDOMElement> cellElm;
PRInt32 startRowIdx, startColIdx, rowSpan, colSpan,
int32_t startRowIdx, startColIdx, rowSpan, colSpan,
actualRowSpan, actualColSpan;
bool isSelected = false;
nsresult rv = NS_OK;
PRInt32 count = 0;
int32_t count = 0;
if (doSelectRow)
rv = GetColumnCount(&count);
else
@ -922,9 +922,9 @@ HTMLTableAccessible::AddRowOrColumnToSelection(PRInt32 aIndex, PRUint32 aTarget)
nsRefPtr<nsFrameSelection> tableSelection =
const_cast<nsFrameSelection*>(presShell->ConstFrameSelection());
for (PRInt32 idx = 0; idx < count; idx++) {
PRInt32 rowIdx = doSelectRow ? aIndex : idx;
PRInt32 colIdx = doSelectRow ? idx : aIndex;
for (int32_t idx = 0; idx < count; idx++) {
int32_t rowIdx = doSelectRow ? aIndex : idx;
int32_t colIdx = doSelectRow ? idx : aIndex;
rv = tableLayout->GetCellDataAt(rowIdx, colIdx,
*getter_AddRefs(cellElm),
startRowIdx, startColIdx,
@ -943,8 +943,8 @@ HTMLTableAccessible::AddRowOrColumnToSelection(PRInt32 aIndex, PRUint32 aTarget)
}
nsresult
HTMLTableAccessible::RemoveRowsOrColumnsFromSelection(PRInt32 aIndex,
PRUint32 aTarget,
HTMLTableAccessible::RemoveRowsOrColumnsFromSelection(int32_t aIndex,
uint32_t aTarget,
bool aIsOuter)
{
nsITableLayout *tableLayout = GetTableLayout();
@ -955,14 +955,14 @@ HTMLTableAccessible::RemoveRowsOrColumnsFromSelection(PRInt32 aIndex,
const_cast<nsFrameSelection*>(presShell->ConstFrameSelection());
bool doUnselectRow = (aTarget == nsISelectionPrivate::TABLESELECTION_ROW);
PRInt32 count = 0;
int32_t count = 0;
nsresult rv = doUnselectRow ? GetColumnCount(&count) : GetRowCount(&count);
NS_ENSURE_SUCCESS(rv, rv);
PRInt32 startRowIdx = doUnselectRow ? aIndex : 0;
PRInt32 endRowIdx = doUnselectRow ? aIndex : count - 1;
PRInt32 startColIdx = doUnselectRow ? 0 : aIndex;
PRInt32 endColIdx = doUnselectRow ? count - 1 : aIndex;
int32_t startRowIdx = doUnselectRow ? aIndex : 0;
int32_t endRowIdx = doUnselectRow ? aIndex : count - 1;
int32_t startColIdx = doUnselectRow ? 0 : aIndex;
int32_t endColIdx = doUnselectRow ? count - 1 : aIndex;
if (aIsOuter)
return tableSelection->RestrictCellsToSelection(mContent,
@ -986,10 +986,10 @@ HTMLTableAccessible::GetTableLayout()
}
nsresult
HTMLTableAccessible::GetCellAt(PRInt32 aRowIndex, PRInt32 aColIndex,
HTMLTableAccessible::GetCellAt(int32_t aRowIndex, int32_t aColIndex,
nsIDOMElement*& aCell)
{
PRInt32 startRowIndex = 0, startColIndex = 0,
int32_t startRowIndex = 0, startColIndex = 0,
rowSpan, colSpan, actualRowSpan, actualColSpan;
bool isSelected;
@ -1104,7 +1104,7 @@ HTMLTableAccessible::IsProbablyLayoutTable()
DocAccessible* docAccessible = Document();
if (docAccessible) {
PRUint64 docState = docAccessible->State();
uint64_t docState = docAccessible->State();
if (docState & states::EDITABLE) { // Need to see all elements while document is being edited
RETURN_LAYOUT_ANSWER(false, "In editable document");
}
@ -1193,7 +1193,7 @@ HTMLTableAccessible::IsProbablyLayoutTable()
}
// If only 1 column or only 1 row, it's for layout
PRInt32 columns, rows;
int32_t columns, rows;
GetColumnCount(&columns);
if (columns <=1) {
RETURN_LAYOUT_ANSWER(true, "Has only 1 column");
@ -1233,10 +1233,10 @@ HTMLTableAccessible::IsProbablyLayoutTable()
// Check for styled background color across rows (alternating background
// color is a common feature for data tables).
PRUint32 childCount = ChildCount();
uint32_t childCount = ChildCount();
nscolor rowColor = 0;
nscolor prevRowColor;
for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) {
Accessible* child = GetChildAt(childIdx);
if (child->Role() == roles::ROW) {
prevRowColor = rowColor;
@ -1249,7 +1249,7 @@ HTMLTableAccessible::IsProbablyLayoutTable()
}
// Check for many rows
const PRInt32 kMaxLayoutRows = 20;
const int32_t kMaxLayoutRows = 20;
if (rows > kMaxLayoutRows) { // A ton of rows, this is probably for data
RETURN_LAYOUT_ANSWER(false, ">= kMaxLayoutRows (20) and non-bordered");
}
@ -1259,7 +1259,7 @@ HTMLTableAccessible::IsProbablyLayoutTable()
nsSize documentSize = documentFrame->GetSize();
if (documentSize.width > 0) {
nsSize tableSize = GetFrame()->GetSize();
PRInt32 percentageOfDocWidth = (100 * tableSize.width) / documentSize.width;
int32_t percentageOfDocWidth = (100 * tableSize.width) / documentSize.width;
if (percentageOfDocWidth > 95) {
// 3-4 columns, no borders, not a lot of rows, and 95% of the doc's width
// Probably for layout
@ -1289,7 +1289,7 @@ HTMLTableAccessible::IsProbablyLayoutTable()
////////////////////////////////////////////////////////////////////////////////
Relation
HTMLCaptionAccessible::RelationByType(PRUint32 aType)
HTMLCaptionAccessible::RelationByType(uint32_t aType)
{
Relation rel = HyperTextAccessible::RelationByType(aType);
if (aType == nsIAccessibleRelation::RELATION_LABEL_FOR)

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

@ -39,8 +39,8 @@ public:
// Accessible
virtual void Shutdown();
virtual a11y::role NativeRole();
virtual PRUint64 NativeState();
virtual PRUint64 NativeInteractiveState() const;
virtual uint64_t NativeState();
virtual uint64_t NativeInteractiveState() const;
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
protected:
@ -57,12 +57,12 @@ protected:
/**
* Return row and column indices of the cell.
*/
nsresult GetCellIndexes(PRInt32& aRowIdx, PRInt32& aColIdx);
nsresult GetCellIndexes(int32_t& aRowIdx, int32_t& aColIdx);
/**
* Return an array of row or column header cells.
*/
nsresult GetHeaderCells(PRInt32 aRowOrColumnHeaderCell,
nsresult GetHeaderCells(int32_t aRowOrColumnHeaderCell,
nsIArray **aHeaderCells);
};
@ -105,30 +105,30 @@ public:
// TableAccessible
virtual Accessible* Caption();
virtual void Summary(nsString& aSummary);
virtual PRUint32 ColCount();
virtual PRUint32 RowCount();
virtual Accessible* CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex);
virtual PRInt32 CellIndexAt(PRUint32 aRowIdx, PRUint32 aColIdx);
virtual PRInt32 ColIndexAt(PRUint32 aCellIdx);
virtual PRInt32 RowIndexAt(PRUint32 aCellIdx);
virtual void RowAndColIndicesAt(PRUint32 aCellIdx, PRInt32* aRowIdx,
PRInt32* aColIdx);
virtual PRUint32 ColExtentAt(PRUint32 aRowIdx, PRUint32 aColIdx);
virtual PRUint32 RowExtentAt(PRUint32 aRowIdx, PRUint32 aColIdx);
virtual bool IsColSelected(PRUint32 aColIdx);
virtual bool IsRowSelected(PRUint32 aRowIdx);
virtual bool IsCellSelected(PRUint32 aRowIdx, PRUint32 aColIdx);
virtual PRUint32 SelectedCellCount();
virtual PRUint32 SelectedColCount();
virtual PRUint32 SelectedRowCount();
virtual uint32_t ColCount();
virtual uint32_t RowCount();
virtual Accessible* CellAt(uint32_t aRowIndex, uint32_t aColumnIndex);
virtual int32_t CellIndexAt(uint32_t aRowIdx, uint32_t aColIdx);
virtual int32_t ColIndexAt(uint32_t aCellIdx);
virtual int32_t RowIndexAt(uint32_t aCellIdx);
virtual void RowAndColIndicesAt(uint32_t aCellIdx, int32_t* aRowIdx,
int32_t* aColIdx);
virtual uint32_t ColExtentAt(uint32_t aRowIdx, uint32_t aColIdx);
virtual uint32_t RowExtentAt(uint32_t aRowIdx, uint32_t aColIdx);
virtual bool IsColSelected(uint32_t aColIdx);
virtual bool IsRowSelected(uint32_t aRowIdx);
virtual bool IsCellSelected(uint32_t aRowIdx, uint32_t aColIdx);
virtual uint32_t SelectedCellCount();
virtual uint32_t SelectedColCount();
virtual uint32_t SelectedRowCount();
virtual void SelectedCells(nsTArray<Accessible*>* aCells);
virtual void SelectedCellIndices(nsTArray<PRUint32>* aCells);
virtual void SelectedColIndices(nsTArray<PRUint32>* aCols);
virtual void SelectedRowIndices(nsTArray<PRUint32>* aRows);
virtual void SelectCol(PRUint32 aColIdx);
virtual void SelectRow(PRUint32 aRowIdx);
virtual void UnselectCol(PRUint32 aColIdx);
virtual void UnselectRow(PRUint32 aRowIdx);
virtual void SelectedCellIndices(nsTArray<uint32_t>* aCells);
virtual void SelectedColIndices(nsTArray<uint32_t>* aCols);
virtual void SelectedRowIndices(nsTArray<uint32_t>* aRows);
virtual void SelectCol(uint32_t aColIdx);
virtual void SelectRow(uint32_t aRowIdx);
virtual void UnselectCol(uint32_t aColIdx);
virtual void UnselectRow(uint32_t aRowIdx);
virtual bool IsProbablyLayoutTable();
// nsAccessNode
@ -139,16 +139,16 @@ public:
virtual void Description(nsString& aDescription);
virtual nsresult GetNameInternal(nsAString& aName);
virtual a11y::role NativeRole();
virtual PRUint64 NativeState();
virtual uint64_t NativeState();
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
virtual Relation RelationByType(PRUint32 aRelationType);
virtual Relation RelationByType(uint32_t aRelationType);
// HTMLTableAccessible
/**
* Retun cell element at the given row and column index.
*/
nsresult GetCellAt(PRInt32 aRowIndex, PRInt32 aColIndex,
nsresult GetCellAt(int32_t aRowIndex, int32_t aColIndex,
nsIDOMElement* &aCell);
/**
@ -170,7 +170,7 @@ protected:
* @param aTarget [in] indicates what should be selected, either row or column
* (see nsISelectionPrivate)
*/
nsresult AddRowOrColumnToSelection(PRInt32 aIndex, PRUint32 aTarget);
nsresult AddRowOrColumnToSelection(int32_t aIndex, uint32_t aTarget);
/**
* Removes rows or columns at the given index or outside it from selection.
@ -181,8 +181,8 @@ protected:
* the given one should be unselected or the given one
* should be unselected only
*/
nsresult RemoveRowsOrColumnsFromSelection(PRInt32 aIndex,
PRUint32 aTarget,
nsresult RemoveRowsOrColumnsFromSelection(int32_t aIndex,
uint32_t aTarget,
bool aIsOuter);
/**
@ -213,7 +213,7 @@ public:
// Accessible
virtual a11y::role NativeRole();
virtual Relation RelationByType(PRUint32 aRelationType);
virtual Relation RelationByType(uint32_t aRelationType);
};
} // namespace a11y

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

@ -50,6 +50,9 @@ var AccessFu = {
switch(Utils.MozBuildApp) {
case 'mobile/android':
Services.obs.addObserver(this, 'Accessibility:Settings', false);
Services.obs.addObserver(this, 'Accessibility:NextObject', false);
Services.obs.addObserver(this, 'Accessibility:PreviousObject', false);
Services.obs.addObserver(this, 'Accessibility:CurrentObject', false);
this.touchAdapter = AndroidTouchAdapter;
break;
case 'b2g':
@ -87,10 +90,12 @@ var AccessFu = {
this.addPresenter(new VisualPresenter());
// Implicitly add the Android presenter on Android.
if (Utils.MozBuildApp == 'mobile/android')
this.addPresenter(new AndroidPresenter());
else if (Utils.MozBuildApp == 'b2g')
if (Utils.MozBuildApp == 'mobile/android') {
this._androidPresenter = new AndroidPresenter();
this.addPresenter(this._androidPresenter);
} else if (Utils.MozBuildApp == 'b2g') {
this.addPresenter(new SpeechPresenter());
}
VirtualCursorController.attach(this.chromeWin);
@ -237,6 +242,17 @@ var AccessFu = {
this._processPreferences(JSON.parse(aData).enabled + 0,
JSON.parse(aData).exploreByTouch + 0);
break;
case 'Accessibility:NextObject':
VirtualCursorController.
moveForward(Utils.getCurrentContentDoc(this.chromeWin));
break;
case 'Accessibility:PreviousObject':
VirtualCursorController.
moveBackward(Utils.getCurrentContentDoc(this.chromeWin));
break;
case 'Accessibility:CurrentObject':
this._androidPresenter.accessibilityFocus();
break;
case 'nsPref:changed':
this._processPreferences(this.prefsBranch.getIntPref('activate'),
this.prefsBranch.getIntPref('explorebytouch'));

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

@ -11,6 +11,7 @@ const Cr = Components.results;
Cu.import('resource://gre/modules/accessibility/Utils.jsm');
Cu.import('resource://gre/modules/accessibility/UtteranceGenerator.jsm');
Cu.import('resource://gre/modules/Geometry.jsm');
var EXPORTED_SYMBOLS = ['VisualPresenter',
'AndroidPresenter',
@ -137,12 +138,12 @@ VisualPresenter.prototype = {
},
viewportChanged: function VisualPresenter_viewportChanged() {
if (this._currentObject)
this._highlight(this._currentObject);
if (this._currentContext)
this._highlight(this._currentContext);
},
pivotChanged: function VisualPresenter_pivotChanged(aContext, aReason) {
this._currentObject = aContext.accessible;
this._currentContext = aContext;
if (!aContext.accessible) {
this._hide();
@ -152,7 +153,7 @@ VisualPresenter.prototype = {
try {
aContext.accessible.scrollTo(
Ci.nsIAccessibleScrollType.SCROLL_TYPE_ANYWHERE);
this._highlight(aContext.accessible);
this._highlight(aContext);
} catch (e) {
Logger.error('Failed to get bounds: ' + e);
return;
@ -175,42 +176,17 @@ VisualPresenter.prototype = {
this.highlightBox.style.display = 'none';
},
_highlight: function _highlight(aObject) {
_highlight: function _highlight(aContext) {
let vp = Utils.getViewport(this.chromeWin) || { zoom: 1.0, offsetY: 0 };
let bounds = this._getBounds(aObject, vp.zoom);
let r = aContext.bounds.scale(vp.zoom, vp.zoom).expandToIntegers();
// First hide it to avoid flickering when changing the style.
this.highlightBox.style.display = 'none';
this.highlightBox.style.top = bounds.top + 'px';
this.highlightBox.style.left = bounds.left + 'px';
this.highlightBox.style.width = bounds.width + 'px';
this.highlightBox.style.height = bounds.height + 'px';
this.highlightBox.style.top = (r.top - this.BORDER_PADDING) + 'px';
this.highlightBox.style.left = (r.left - this.BORDER_PADDING) + 'px';
this.highlightBox.style.width = (r.width + this.BORDER_PADDING*2) + 'px';
this.highlightBox.style.height = (r.height + this.BORDER_PADDING*2) + 'px';
this.highlightBox.style.display = 'block';
},
_getBounds: function _getBounds(aObject, aZoom, aStart, aEnd) {
let objX = {}, objY = {}, objW = {}, objH = {};
if (aEnd >= 0 && aStart >= 0 && aEnd != aStart) {
// TODO: Get bounds for text ranges. Leaving this blank until we have
// proper text navigation in the virtual cursor.
}
aObject.getBounds(objX, objY, objW, objH);
// Can't specify relative coords in nsIAccessible.getBounds, so we do it.
let docX = {}, docY = {};
let docRoot = aObject.rootDocument.QueryInterface(Ci.nsIAccessible);
docRoot.getBounds(docX, docY, {}, {});
let rv = {
left: Math.round((objX.value - docX.value - this.BORDER_PADDING) * aZoom),
top: Math.round((objY.value - docY.value - this.BORDER_PADDING) * aZoom),
width: Math.round((objW.value + (this.BORDER_PADDING * 2)) * aZoom),
height: Math.round((objH.value + (this.BORDER_PADDING * 2)) * aZoom)
};
return rv;
}
};
@ -233,6 +209,8 @@ AndroidPresenter.prototype = {
ANDROID_VIEW_HOVER_ENTER: 0x80,
ANDROID_VIEW_HOVER_EXIT: 0x100,
ANDROID_VIEW_SCROLLED: 0x1000,
ANDROID_ANNOUNCEMENT: 0x4000,
ANDROID_VIEW_ACCESSIBILITY_FOCUSED: 0x8000,
attach: function AndroidPresenter_attach(aWindow) {
this.chromeWin = aWindow;
@ -242,8 +220,13 @@ AndroidPresenter.prototype = {
if (!aContext.accessible)
return;
this._currentContext = aContext;
let isExploreByTouch = (aReason == Ci.nsIAccessiblePivot.REASON_POINT &&
Utils.AndroidSdkVersion >= 14);
let focusEventType = (Utils.AndroidSdkVersion >= 16) ?
this.ANDROID_VIEW_ACCESSIBILITY_FOCUSED :
this.ANDROID_VIEW_FOCUSED;
if (isExploreByTouch) {
// This isn't really used by TalkBack so this is a half-hearted attempt
@ -257,6 +240,8 @@ AndroidPresenter.prototype = {
});
}
let vp = Utils.getViewport(this.chromeWin) || { zoom: 1.0, offsetY: 0 };
let bounds = aContext.bounds.scale(vp.zoom, vp.zoom).expandToIntegers();
let output = [];
aContext.newAncestry.forEach(
@ -277,10 +262,9 @@ AndroidPresenter.prototype = {
this.sendMessageToJava({
gecko: {
type: 'Accessibility:Event',
eventType: isExploreByTouch ?
this.ANDROID_VIEW_HOVER_ENTER :
this.ANDROID_VIEW_FOCUSED,
text: output
eventType: (isExploreByTouch) ? this.ANDROID_VIEW_HOVER_ENTER : focusEventType,
text: output,
bounds: bounds
}
});
},
@ -360,7 +344,8 @@ AndroidPresenter.prototype = {
this.sendMessageToJava({
gecko: {
type: 'Accessibility:Event',
eventType: this.ANDROID_VIEW_TEXT_CHANGED,
eventType: (Utils.AndroidSdkVersion >= 16) ?
this.ANDROID_ANNOUNCEMENT : this.ANDROID_VIEW_TEXT_CHANGED,
text: aUtterance,
addedCount: aUtterance.join(' ').length,
removedCount: 0,
@ -369,6 +354,11 @@ AndroidPresenter.prototype = {
});
},
accessibilityFocus: function AndroidPresenter_accessibilityFocus() {
if (this._currentContext)
this.pivotChanged(this._currentContext);
},
sendMessageToJava: function AndroidPresenter_sendMessageTojava(aMessage) {
return Cc['@mozilla.org/android/bridge;1'].
getService(Ci.nsIAndroidBridge).
@ -508,6 +498,25 @@ PresenterContext.prototype = {
return this._subtreePreOrder;
},
get bounds() {
if (!this._bounds) {
let objX = {}, objY = {}, objW = {}, objH = {};
this._accessible.getBounds(objX, objY, objW, objH);
// Can't specify relative coords in nsIAccessible.getBounds, so we do it.
let docX = {}, docY = {};
let docRoot = this._accessible.rootDocument.
QueryInterface(Ci.nsIAccessible);
docRoot.getBounds(docX, docY, {}, {});
this._bounds = new Rect(objX.value, objY.value, objW.value, objH.value).
translate(-docX.value, -docY.value);
}
return this._bounds.clone();
},
_isDefunct: function _isDefunct(aAccessible) {
try {
let extstate = {};

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

@ -394,7 +394,7 @@ var AndroidTouchAdapter = {
let evt = this.chromeWin.document.createEvent('CustomEvent');
evt.initCustomEvent(
'mozAccessFuGesture', true, true,
{type: 'explore', x: aEvent.screenX, y: aEvent.screenY});
{type: 'explore', x: aEvent.screenX, y: aEvent.screenY, touches: [1]});
this.chromeWin.dispatchEvent(evt);
this._lastExploreTime = aEvent.timeStamp;
}

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

@ -149,7 +149,7 @@ AccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
PRUint32 eventType = aEvent->GetEventType();
uint32_t eventType = aEvent->GetEventType();
// ignore everything but focus-changed, value-changed, caret and selection
// events for now.
@ -239,8 +239,8 @@ AccessibleWrap::GetUnignoredChildren(nsTArray<Accessible*>* aChildrenArray)
if (nsAccUtils::MustPrune(this))
return;
PRUint32 childCount = ChildCount();
for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
uint32_t childCount = ChildCount();
for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) {
AccessibleWrap* childAcc =
static_cast<AccessibleWrap*>(GetChildAt(childIdx));

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

@ -244,8 +244,8 @@ GetClosestInterestingAccessible(id anObject)
ConvertCocoaToGeckoPoint (point, geckoPoint);
nsCOMPtr<nsIAccessible> deepestFoundChild;
mGeckoAccessible->GetDeepestChildAtPoint((PRInt32)geckoPoint.x,
(PRInt32)geckoPoint.y,
mGeckoAccessible->GetDeepestChildAtPoint((int32_t)geckoPoint.x,
(int32_t)geckoPoint.y,
getter_AddRefs(deepestFoundChild));
// if we found something, return its native accessible.
@ -349,8 +349,8 @@ GetClosestInterestingAccessible(id anObject)
mGeckoAccessible->GetUnignoredChildren(&childrenArray);
// now iterate through the children array, and get each native accessible.
PRUint32 totalCount = childrenArray.Length();
for (PRUint32 idx = 0; idx < totalCount; idx++) {
uint32_t totalCount = childrenArray.Length();
for (uint32_t idx = 0; idx < totalCount; idx++) {
Accessible* curAccessible = childrenArray.ElementAt(idx);
if (curAccessible) {
mozAccessible *curNative = GetNativeFromGeckoAccessible(curAccessible);
@ -377,7 +377,7 @@ GetClosestInterestingAccessible(id anObject)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
PRInt32 x, y, width, height;
int32_t x, y, width, height;
mGeckoAccessible->GetBounds (&x, &y, &width, &height);
NSPoint p = NSMakePoint (x, y);
@ -400,7 +400,7 @@ GetClosestInterestingAccessible(id anObject)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
PRInt32 x, y, width, height;
int32_t x, y, width, height;
mGeckoAccessible->GetBounds (&x, &y, &width, &height);
return [NSValue valueWithSize:NSMakeSize (width, height)];

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

@ -148,7 +148,7 @@ enum CheckboxValue {
- (int)isChecked
{
PRUint64 state = mGeckoAccessible->NativeState();
uint64_t state = mGeckoAccessible->NativeState();
// check if we're checked or in a mixed state
if (state & states::CHECKED) {

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

@ -29,7 +29,7 @@
if (!mGeckoAccessible || !mGeckoAccessible->IsHyperText())
return nil;
PRUint32 level = mGeckoAccessible->AsHyperText()->GetLevelInternal();
uint32_t level = mGeckoAccessible->AsHyperText()->GetLevelInternal();
return [NSNumber numberWithInt:level];
}

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

@ -213,8 +213,8 @@ ToNSString(id aValue)
return nil;
}
PRInt32 start = range.location;
PRInt32 end = start + range.length;
int32_t start = range.location;
int32_t end = start + range.length;
nsIntRect bounds = mGeckoTextAccessible->GetTextBounds(start, end);
return [NSValue valueWithRect:nsCocoaUtils::GeckoRectToCocoaRect(bounds)];
@ -262,8 +262,8 @@ ToNSString(id aValue)
if (!stringValue)
return;
PRInt32 start = 0;
PRInt32 end = 0;
int32_t start = 0;
int32_t end = 0;
nsresult rv = mGeckoTextAccessible->GetSelectionBounds(0, &start, &end);
NS_ENSURE_SUCCESS(rv,);
@ -344,7 +344,7 @@ ToNSString(id aValue)
- (NSNumber*)caretLineNumber
{
PRInt32 lineNumber = mGeckoTextAccessible ?
int32_t lineNumber = mGeckoTextAccessible ?
mGeckoTextAccessible->CaretLineNumber() - 1 : -1;
return (lineNumber >= 0) ? [NSNumber numberWithInt:lineNumber] : nil;
@ -397,7 +397,7 @@ ToNSString(id aValue)
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
if (mGeckoTextAccessible) {
PRInt32 start, end;
int32_t start, end;
start = end = 0;
nsresult rv = mGeckoTextAccessible->GetSelectionBounds(0, &start, &end);
NS_ENSURE_SUCCESS(rv, 0);
@ -414,7 +414,7 @@ ToNSString(id aValue)
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
if (mGeckoTextAccessible) {
PRInt32 start, end;
int32_t start, end;
start = end = 0;
mGeckoTextAccessible->GetSelectionBounds(0, &start, &end);
if (start != end) {
@ -433,9 +433,9 @@ ToNSString(id aValue)
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
if (mGeckoTextAccessible) {
PRInt32 start = 0;
PRInt32 end = 0;
PRInt32 count = 0;
int32_t start = 0;
int32_t end = 0;
int32_t count = 0;
nsresult rv = mGeckoTextAccessible->GetSelectionCount(&count);
NS_ENSURE_SUCCESS(rv, nil);

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