Merge the nullptr conversion from mozilla-central into mozilla-inbound

This commit is contained in:
Ehsan Akhgari 2012-07-30 10:28:15 -04:00
commit 3ad40dbf10
2537 changed files with 23675 additions and 23675 deletions

View File

@ -16,7 +16,7 @@ static nsresult
NS_ConstructAccessibilityService(nsISupports *aOuter, REFNSIID aIID, void **aResult)
{
nsresult rv;
NS_ASSERTION(aOuter == nsnull, "no aggregation");
NS_ASSERTION(aOuter == nullptr, "no aggregation");
nsIAccessibilityService* accessibility;
rv = NS_GetAccessibilityService(&accessibility);
if (NS_FAILED(rv)) {

View File

@ -238,7 +238,7 @@ PRInt32 AccessibleWrap::mAccWrapDeleted = 0;
AccessibleWrap::
AccessibleWrap(nsIContent* aContent, DocAccessible* aDoc) :
Accessible(aContent, aDoc), mAtkObject(nsnull)
Accessible(aContent, aDoc), mAtkObject(nullptr)
{
#ifdef MAI_LOGGING
++mAccWrapCreated;
@ -265,11 +265,11 @@ AccessibleWrap::ShutdownAtkObject()
{
if (mAtkObject) {
if (IS_MAI_OBJECT(mAtkObject)) {
MAI_ATK_OBJECT(mAtkObject)->accWrap = nsnull;
MAI_ATK_OBJECT(mAtkObject)->accWrap = nullptr;
}
SetMaiHyperlink(nsnull);
SetMaiHyperlink(nullptr);
g_object_unref(mAtkObject);
mAtkObject = nsnull;
mAtkObject = nullptr;
}
}
@ -288,7 +288,7 @@ AccessibleWrap::GetMaiHyperlink(bool aCreate /* = true */)
NS_ASSERTION(quark_mai_hyperlink, "quark_mai_hyperlink not initialized");
NS_ASSERTION(IS_MAI_OBJECT(mAtkObject), "Invalid AtkObject");
MaiHyperlink* maiHyperlink = nsnull;
MaiHyperlink* maiHyperlink = nullptr;
if (quark_mai_hyperlink && IS_MAI_OBJECT(mAtkObject)) {
maiHyperlink = (MaiHyperlink*)g_object_get_qdata(G_OBJECT(mAtkObject),
quark_mai_hyperlink);
@ -319,7 +319,7 @@ AccessibleWrap::SetMaiHyperlink(MaiHyperlink* aMaiHyperlink)
NS_IMETHODIMP
AccessibleWrap::GetNativeInterface(void** aOutAccessible)
{
*aOutAccessible = nsnull;
*aOutAccessible = nullptr;
if (!mAtkObject) {
if (IsDefunct() || !nsAccUtils::IsEmbeddedObject(this)) {
@ -347,7 +347,7 @@ AccessibleWrap::GetNativeInterface(void** aOutAccessible)
AtkObject *
AccessibleWrap::GetAtkObject(void)
{
void *atkObj = nsnull;
void *atkObj = nullptr;
GetNativeInterface(&atkObj);
return static_cast<AtkObject *>(atkObj);
}
@ -357,9 +357,9 @@ AccessibleWrap::GetAtkObject(void)
AtkObject *
AccessibleWrap::GetAtkObject(nsIAccessible* acc)
{
void *atkObjPtr = nsnull;
void *atkObjPtr = nullptr;
acc->GetNativeInterface(&atkObjPtr);
return atkObjPtr ? ATK_OBJECT(atkObjPtr) : nsnull;
return atkObjPtr ? ATK_OBJECT(atkObjPtr) : nullptr;
}
/* private */
@ -620,7 +620,7 @@ finalizeCB(GObject *aObj)
{
if (!IS_MAI_OBJECT(aObj))
return;
NS_ASSERTION(MAI_ATK_OBJECT(aObj)->accWrap == nsnull, "AccWrap NOT null");
NS_ASSERTION(MAI_ATK_OBJECT(aObj)->accWrap == nullptr, "AccWrap NOT null");
#ifdef MAI_LOGGING
++sMaiAtkObjDeleted;
@ -640,7 +640,7 @@ getNameCB(AtkObject* aAtkObj)
{
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
if (!accWrap)
return nsnull;
return nullptr;
nsAutoString uniName;
accWrap->Name(uniName);
@ -657,7 +657,7 @@ getDescriptionCB(AtkObject *aAtkObj)
{
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
if (!accWrap || accWrap->IsDefunct())
return nsnull;
return nullptr;
/* nsIAccessible is responsible for the non-NULL description */
nsAutoString uniDesc;
@ -708,12 +708,12 @@ AtkAttributeSet*
ConvertToAtkAttributeSet(nsIPersistentProperties* aAttributes)
{
if (!aAttributes)
return nsnull;
return nullptr;
AtkAttributeSet *objAttributeSet = nsnull;
AtkAttributeSet *objAttributeSet = nullptr;
nsCOMPtr<nsISimpleEnumerator> propEnum;
nsresult rv = aAttributes->Enumerate(getter_AddRefs(propEnum));
NS_ENSURE_SUCCESS(rv, nsnull);
NS_ENSURE_SUCCESS(rv, nullptr);
bool hasMore;
while (NS_SUCCEEDED(propEnum->HasMoreElements(&hasMore)) && hasMore) {
@ -760,14 +760,14 @@ GetAttributeSet(Accessible* aAccessible)
return ConvertToAtkAttributeSet(attributes);
}
return nsnull;
return nullptr;
}
AtkAttributeSet *
getAttributesCB(AtkObject *aAtkObj)
{
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
return accWrap ? GetAttributeSet(accWrap) : nsnull;
return accWrap ? GetAttributeSet(accWrap) : nullptr;
}
AtkObject *
@ -776,11 +776,11 @@ getParentCB(AtkObject *aAtkObj)
if (!aAtkObj->accessible_parent) {
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
if (!accWrap)
return nsnull;
return nullptr;
Accessible* accParent = accWrap->Parent();
if (!accParent)
return nsnull;
return nullptr;
AtkObject* parent = AccessibleWrap::GetAtkObject(accParent);
if (parent)
@ -805,23 +805,23 @@ refChildCB(AtkObject *aAtkObj, gint aChildIndex)
{
// aChildIndex should not be less than zero
if (aChildIndex < 0) {
return nsnull;
return nullptr;
}
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
if (!accWrap || nsAccUtils::MustPrune(accWrap)) {
return nsnull;
return nullptr;
}
Accessible* accChild = accWrap->GetEmbeddedChildAt(aChildIndex);
if (!accChild)
return nsnull;
return nullptr;
AtkObject* childAtkObj = AccessibleWrap::GetAtkObject(accChild);
NS_ASSERTION(childAtkObj, "Fail to get AtkObj");
if (!childAtkObj)
return nsnull;
return nullptr;
g_object_ref(childAtkObj);
if (aAtkObj != childAtkObj->accessible_parent)
@ -872,7 +872,7 @@ TranslateStates(PRUint64 aState, AtkStateSet* aStateSet)
AtkStateSet *
refStateSetCB(AtkObject *aAtkObj)
{
AtkStateSet *state_set = nsnull;
AtkStateSet *state_set = nullptr;
state_set = ATK_OBJECT_CLASS(parent_class)->ref_state_set(aAtkObj);
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
@ -919,7 +919,7 @@ refRelationSetCB(AtkObject *aAtkObj)
Relation rel(accWrap->RelationByType(relationTypes[i]));
nsTArray<AtkObject*> targets;
Accessible* tempAcc = nsnull;
Accessible* tempAcc = nullptr;
while ((tempAcc = rel.Next()))
targets.AppendElement(AccessibleWrap::GetAtkObject(tempAcc));
@ -938,18 +938,18 @@ refRelationSetCB(AtkObject *aAtkObj)
AccessibleWrap*
GetAccessibleWrap(AtkObject* aAtkObj)
{
NS_ENSURE_TRUE(IS_MAI_OBJECT(aAtkObj), nsnull);
NS_ENSURE_TRUE(IS_MAI_OBJECT(aAtkObj), nullptr);
AccessibleWrap* accWrap = MAI_ATK_OBJECT(aAtkObj)->accWrap;
// Check if the accessible was deconstructed.
if (!accWrap)
return nsnull;
return nullptr;
NS_ENSURE_TRUE(accWrap->GetAtkObject() == aAtkObj, nsnull);
NS_ENSURE_TRUE(accWrap->GetAtkObject() == aAtkObj, nullptr);
AccessibleWrap* appAccWrap = nsAccessNode::GetApplicationAccessible();
if (appAccWrap != accWrap && !accWrap->IsValidObject())
return nsnull;
return nullptr;
return accWrap;
}
@ -1308,7 +1308,7 @@ AccessibleWrap::FireAtkTextChangedEvent(AccEvent* aEvent,
PRUint32 length = event->GetLength();
bool isInserted = event->IsTextInserted();
bool isFromUserInput = aEvent->IsFromUserInput();
char* signal_name = nsnull;
char* signal_name = nullptr;
if (gAvailableAtkSignals == eUnknown)
gAvailableAtkSignals =

View File

@ -28,7 +28,7 @@ using namespace mozilla::a11y;
typedef GType (* AtkGetTypeType) (void);
GType g_atk_hyperlink_impl_type = G_TYPE_INVALID;
static bool sATKChecked = false;
static PRLibrary *sATKLib = nsnull;
static PRLibrary *sATKLib = nullptr;
static const char sATKLibName[] = "libatk-1.0.so.0";
static const char sATKHyperlinkImplGetTypeSymbol[] =
"atk_hyperlink_impl_get_type";
@ -441,7 +441,7 @@ mai_util_get_root(void)
if (gail_get_root)
return gail_get_root();
return nsnull;
return nullptr;
}
return nsAccessNode::GetApplicationAccessible()->GetAtkObject();
@ -652,7 +652,7 @@ ApplicationAccessibleWrap::Unload()
}
// if (sATKLib) {
// PR_UnloadLibrary(sATKLib);
// sATKLib = nsnull;
// sATKLib = nullptr;
// }
}
@ -670,7 +670,7 @@ ApplicationAccessibleWrap::Name(nsString& aName)
NS_IMETHODIMP
ApplicationAccessibleWrap::GetNativeInterface(void** aOutAccessible)
{
*aOutAccessible = nsnull;
*aOutAccessible = nullptr;
if (!mAtkObject) {
mAtkObject =
@ -841,7 +841,7 @@ namespace a11y {
static const char sAccEnv [] = "GNOME_ACCESSIBILITY";
#ifdef MOZ_ENABLE_DBUS
static DBusPendingCall *sPendingCall = nsnull;
static DBusPendingCall *sPendingCall = nullptr;
#endif
void
@ -861,7 +861,7 @@ PreInit()
if (PR_GetEnv(sAccEnv) || !PR_GetEnv("DBUS_SESSION_BUS_ADDRESS"))
return;
DBusConnection* bus = dbus_bus_get(DBUS_BUS_SESSION, nsnull);
DBusConnection* bus = dbus_bus_get(DBUS_BUS_SESSION, nullptr);
if (!bus)
return;
@ -907,14 +907,14 @@ ShouldA11yBeEnabled()
#ifdef MOZ_ENABLE_DBUS
PreInit();
bool dbusSuccess = false;
DBusMessage *reply = nsnull;
DBusMessage *reply = nullptr;
if (!sPendingCall)
goto dbus_done;
dbus_pending_call_block(sPendingCall);
reply = dbus_pending_call_steal_reply(sPendingCall);
dbus_pending_call_unref(sPendingCall);
sPendingCall = nsnull;
sPendingCall = nullptr;
if (!reply ||
dbus_message_get_type(reply) != DBUS_MESSAGE_TYPE_METHOD_RETURN ||
strcmp(dbus_message_get_signature (reply), DBUS_TYPE_VARIANT_AS_STRING))

View File

@ -68,7 +68,7 @@ mai_atk_socket_new(AccessibleWrap* aAccWrap)
{
NS_ENSURE_TRUE(aAccWrap, NULL);
MaiAtkSocket* acc = nsnull;
MaiAtkSocket* acc = nullptr;
acc = static_cast<MaiAtkSocket*>(g_object_new(MAI_TYPE_ATK_SOCKET, NULL));
NS_ENSURE_TRUE(acc, NULL);
@ -81,7 +81,7 @@ static AtkObject*
RefAccessibleAtPoint(AtkComponent* aComponent, gint aX, gint aY,
AtkCoordType aCoordType)
{
NS_ENSURE_TRUE(MAI_IS_ATK_SOCKET(aComponent), nsnull);
NS_ENSURE_TRUE(MAI_IS_ATK_SOCKET(aComponent), nullptr);
return refAccessibleAtPointHelper(MAI_ATK_SOCKET(aComponent)->accWrap,
aX, aY, aCoordType);
@ -145,9 +145,9 @@ AtkSocketAccessible::Shutdown()
{
if (mAtkObject) {
if (MAI_IS_ATK_SOCKET(mAtkObject))
MAI_ATK_SOCKET(mAtkObject)->accWrap = nsnull;
MAI_ATK_SOCKET(mAtkObject)->accWrap = nullptr;
g_object_unref(mAtkObject);
mAtkObject = nsnull;
mAtkObject = nullptr;
}
AccessibleWrap::Shutdown();
}

View File

@ -11,7 +11,7 @@
using namespace mozilla::a11y;
NativeRootAccessibleWrap::NativeRootAccessibleWrap(AtkObject* aAccessible):
RootAccessible(nsnull, nsnull, nsnull)
RootAccessible(nullptr, nullptr, nullptr)
{
// XXX: mark the object as defunct to ensure no single internal method is
// running on it.
@ -24,5 +24,5 @@ NativeRootAccessibleWrap::NativeRootAccessibleWrap(AtkObject* aAccessible):
NativeRootAccessibleWrap::~NativeRootAccessibleWrap()
{
g_object_unref(mAtkObject);
mAtkObject = nsnull;
mAtkObject = nullptr;
}

View File

@ -90,14 +90,14 @@ mai_atk_hyperlink_get_type(void)
MaiHyperlink::MaiHyperlink(Accessible* aHyperLink) :
mHyperlink(aHyperLink),
mMaiAtkHyperlink(nsnull)
mMaiAtkHyperlink(nullptr)
{
}
MaiHyperlink::~MaiHyperlink()
{
if (mMaiAtkHyperlink) {
MAI_ATK_HYPERLINK(mMaiAtkHyperlink)->maiHyperlink = nsnull;
MAI_ATK_HYPERLINK(mMaiAtkHyperlink)->maiHyperlink = nullptr;
g_object_unref(mMaiAtkHyperlink);
}
}
@ -105,19 +105,19 @@ MaiHyperlink::~MaiHyperlink()
AtkHyperlink*
MaiHyperlink::GetAtkHyperlink(void)
{
NS_ENSURE_TRUE(mHyperlink, nsnull);
NS_ENSURE_TRUE(mHyperlink, nullptr);
if (mMaiAtkHyperlink)
return mMaiAtkHyperlink;
if (!mHyperlink->IsLink())
return nsnull;
return nullptr;
mMaiAtkHyperlink =
reinterpret_cast<AtkHyperlink *>
(g_object_new(mai_atk_hyperlink_get_type(), NULL));
NS_ASSERTION(mMaiAtkHyperlink, "OUT OF MEMORY");
NS_ENSURE_TRUE(mMaiAtkHyperlink, nsnull);
NS_ENSURE_TRUE(mMaiAtkHyperlink, nullptr);
/* be sure to initialize it with "this" */
MaiHyperlink::Initialize(mMaiAtkHyperlink, this);
@ -169,7 +169,7 @@ finalizeCB(GObject *aObj)
return;
MaiAtkHyperlink *maiAtkHyperlink = MAI_ATK_HYPERLINK(aObj);
maiAtkHyperlink->maiHyperlink = nsnull;
maiAtkHyperlink->maiHyperlink = nullptr;
/* call parent finalize function */
if (G_OBJECT_CLASS (parent_class)->finalize)
@ -180,15 +180,15 @@ gchar *
getUriCB(AtkHyperlink *aLink, gint aLinkIndex)
{
Accessible* hyperlink = get_accessible_hyperlink(aLink);
NS_ENSURE_TRUE(hyperlink, nsnull);
NS_ENSURE_TRUE(hyperlink, nullptr);
nsCOMPtr<nsIURI> uri = hyperlink->AnchorURIAt(aLinkIndex);
if (!uri)
return nsnull;
return nullptr;
nsCAutoString cautoStr;
nsresult rv = uri->GetSpec(cautoStr);
NS_ENSURE_SUCCESS(rv, nsnull);
NS_ENSURE_SUCCESS(rv, nullptr);
return g_strdup(cautoStr.get());
}
@ -197,10 +197,10 @@ AtkObject *
getObjectCB(AtkHyperlink *aLink, gint aLinkIndex)
{
Accessible* hyperlink = get_accessible_hyperlink(aLink);
NS_ENSURE_TRUE(hyperlink, nsnull);
NS_ENSURE_TRUE(hyperlink, nullptr);
Accessible* anchor = hyperlink->AnchorAt(aLinkIndex);
NS_ENSURE_TRUE(anchor, nsnull);
NS_ENSURE_TRUE(anchor, nullptr);
AtkObject* atkObj = AccessibleWrap::GetAtkObject(anchor);
//no need to add ref it, because it is "get" not "ref"
@ -248,10 +248,10 @@ getAnchorCountCB(AtkHyperlink *aLink)
Accessible*
get_accessible_hyperlink(AtkHyperlink *aHyperlink)
{
NS_ENSURE_TRUE(MAI_IS_ATK_HYPERLINK(aHyperlink), nsnull);
NS_ENSURE_TRUE(MAI_IS_ATK_HYPERLINK(aHyperlink), nullptr);
MaiHyperlink * maiHyperlink =
MAI_ATK_HYPERLINK(aHyperlink)->maiHyperlink;
NS_ENSURE_TRUE(maiHyperlink != nsnull, nsnull);
NS_ENSURE_TRUE(maiHyperlink->GetAtkHyperlink() == aHyperlink, nsnull);
NS_ENSURE_TRUE(maiHyperlink != nullptr, nullptr);
NS_ENSURE_TRUE(maiHyperlink->GetAtkHyperlink() == aHyperlink, nullptr);
return maiHyperlink->GetAccHyperlink();
}

View File

@ -26,7 +26,7 @@ public:
public:
AtkHyperlink *GetAtkHyperlink(void);
Accessible* GetAccHyperlink()
{ return mHyperlink && mHyperlink->IsLink() ? mHyperlink : nsnull; }
{ return mHyperlink && mHyperlink->IsLink() ? mHyperlink : nullptr; }
protected:
Accessible* mHyperlink;

View File

@ -39,11 +39,11 @@ getActionDescriptionCB(AtkAction *aAction, gint aActionIndex)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
if (!accWrap)
return nsnull;
return nullptr;
nsAutoString description;
nsresult rv = accWrap->GetActionDescription(aActionIndex, description);
NS_ENSURE_SUCCESS(rv, nsnull);
NS_ENSURE_SUCCESS(rv, nullptr);
return AccessibleWrap::ReturnString(description);
}
@ -52,11 +52,11 @@ getActionNameCB(AtkAction *aAction, gint aActionIndex)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
if (!accWrap)
return nsnull;
return nullptr;
nsAutoString autoStr;
nsresult rv = accWrap->GetActionName(aActionIndex, autoStr);
NS_ENSURE_SUCCESS(rv, nsnull);
NS_ENSURE_SUCCESS(rv, nullptr);
return AccessibleWrap::ReturnString(autoStr);
}
@ -65,7 +65,7 @@ getKeyBindingCB(AtkAction *aAction, gint aActionIndex)
{
AccessibleWrap* acc = GetAccessibleWrap(ATK_OBJECT(aAction));
if (!acc)
return nsnull;
return nullptr;
// Return all key bindings including access key and keyboard shortcut.
nsAutoString keyBindingsStr;

View File

@ -46,7 +46,7 @@ refAccessibleAtPointHelper(AccessibleWrap* aAccWrap, gint aX, gint aY,
AtkCoordType aCoordType)
{
if (!aAccWrap || aAccWrap->IsDefunct() || nsAccUtils::MustPrune(aAccWrap))
return nsnull;
return nullptr;
// Accessible::ChildAtPoint(x,y) is in screen pixels.
if (aCoordType == ATK_XY_WINDOW) {
@ -59,7 +59,7 @@ refAccessibleAtPointHelper(AccessibleWrap* aAccWrap, gint aX, gint aY,
Accessible* accAtPoint = aAccWrap->ChildAtPoint(aX, aY,
Accessible::eDirectChild);
if (!accAtPoint)
return nsnull;
return nullptr;
AtkObject* atkObj = AccessibleWrap::GetAtkObject(accAtPoint);
if (atkObj)

View File

@ -44,11 +44,11 @@ getDocumentLocaleCB(AtkDocument *aDocument)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aDocument));
if (!accWrap)
return nsnull;
return nullptr;
nsAutoString locale;
accWrap->Language(locale);
return locale.IsEmpty() ? nsnull : AccessibleWrap::ReturnString(locale);
return locale.IsEmpty() ? nullptr : AccessibleWrap::ReturnString(locale);
}
static inline GSList *
@ -69,10 +69,10 @@ getDocumentAttributesCB(AtkDocument *aDocument)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aDocument));
if (!accWrap || !accWrap->IsDoc())
return nsnull;
return nullptr;
// according to atkobject.h, AtkAttributeSet is a GSList
GSList* attributes = nsnull;
GSList* attributes = nullptr;
DocAccessible* document = accWrap->AsDoc();
nsAutoString aURL;
nsresult rv = document->GetURL(aURL);
@ -98,7 +98,7 @@ getDocumentAttributeValueCB(AtkDocument *aDocument,
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aDocument));
if (!accWrap || !accWrap->IsDoc())
return nsnull;
return nullptr;
DocAccessible* document = accWrap->AsDoc();
nsresult rv;
@ -110,9 +110,9 @@ getDocumentAttributeValueCB(AtkDocument *aDocument,
else if (!strcasecmp(aAttrName, kMimeTypeName))
rv = document->GetMimeType(attrValue);
else
return nsnull;
return nullptr;
NS_ENSURE_SUCCESS(rv, nsnull);
return attrValue.IsEmpty() ? nsnull : AccessibleWrap::ReturnString(attrValue);
NS_ENSURE_SUCCESS(rv, nullptr);
return attrValue.IsEmpty() ? nullptr : AccessibleWrap::ReturnString(attrValue);
}
}

View File

@ -14,12 +14,12 @@ getHyperlinkCB(AtkHyperlinkImpl* aImpl)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImpl));
if (!accWrap)
return nsnull;
return nullptr;
NS_ENSURE_TRUE(accWrap->IsLink(), nsnull);
NS_ENSURE_TRUE(accWrap->IsLink(), nullptr);
MaiHyperlink* maiHyperlink = accWrap->GetMaiHyperlink();
NS_ENSURE_TRUE(maiHyperlink, nsnull);
NS_ENSURE_TRUE(maiHyperlink, nullptr);
return maiHyperlink->GetAtkHyperlink();
}
}

View File

@ -17,21 +17,21 @@ getLinkCB(AtkHypertext *aText, gint aLinkIndex)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
if (!accWrap)
return nsnull;
return nullptr;
HyperTextAccessible* hyperText = accWrap->AsHyperText();
NS_ENSURE_TRUE(hyperText, nsnull);
NS_ENSURE_TRUE(hyperText, nullptr);
Accessible* hyperLink = hyperText->GetLinkAt(aLinkIndex);
if (!hyperLink)
return nsnull;
return nullptr;
AtkObject* hyperLinkAtkObj = AccessibleWrap::GetAtkObject(hyperLink);
AccessibleWrap* accChild = GetAccessibleWrap(hyperLinkAtkObj);
NS_ENSURE_TRUE(accChild, nsnull);
NS_ENSURE_TRUE(accChild, nullptr);
MaiHyperlink *maiHyperlink = accChild->GetMaiHyperlink();
NS_ENSURE_TRUE(maiHyperlink, nsnull);
NS_ENSURE_TRUE(maiHyperlink, nullptr);
return maiHyperlink->GetAtkHyperlink();
}

View File

@ -38,11 +38,11 @@ refSelectionCB(AtkSelection *aSelection, gint i)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
if (!accWrap || !accWrap->IsSelect())
return nsnull;
return nullptr;
Accessible* selectedItem = accWrap->GetSelectedItem(i);
if (!selectedItem)
return nsnull;
return nullptr;
AtkObject* atkObj = AccessibleWrap::GetAtkObject(selectedItem);
if (atkObj)

View File

@ -22,17 +22,17 @@ refAtCB(AtkTable *aTable, gint aRow, gint aColumn)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return nsnull;
return nullptr;
nsCOMPtr<nsIAccessibleTable> accTable;
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
getter_AddRefs(accTable));
NS_ENSURE_TRUE(accTable, nsnull);
NS_ENSURE_TRUE(accTable, nullptr);
nsCOMPtr<nsIAccessible> cell;
nsresult rv = accTable->GetCellAt(aRow, aColumn,getter_AddRefs(cell));
if (NS_FAILED(rv) || !cell)
return nsnull;
return nullptr;
AtkObject* cellAtkObj = AccessibleWrap::GetAtkObject(cell);
if (cellAtkObj) {
@ -175,13 +175,13 @@ getCaptionCB(AtkTable* aTable)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return nsnull;
return nullptr;
TableAccessible* table = accWrap->AsTable();
NS_ENSURE_TRUE(table, nsnull);
NS_ENSURE_TRUE(table, nullptr);
Accessible* caption = table->Caption();
return caption ? AccessibleWrap::GetAtkObject(caption) : nsnull;
return caption ? AccessibleWrap::GetAtkObject(caption) : nullptr;
}
static const gchar*
@ -189,16 +189,16 @@ getColumnDescriptionCB(AtkTable *aTable, gint aColumn)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return nsnull;
return nullptr;
nsCOMPtr<nsIAccessibleTable> accTable;
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
getter_AddRefs(accTable));
NS_ENSURE_TRUE(accTable, nsnull);
NS_ENSURE_TRUE(accTable, nullptr);
nsAutoString autoStr;
nsresult rv = accTable->GetColumnDescription(aColumn, autoStr);
NS_ENSURE_SUCCESS(rv, nsnull);
NS_ENSURE_SUCCESS(rv, nullptr);
return AccessibleWrap::ReturnString(autoStr);
}
@ -208,17 +208,17 @@ getColumnHeaderCB(AtkTable *aTable, gint aColumn)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return nsnull;
return nullptr;
nsCOMPtr<nsIAccessibleTable> accTable;
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
getter_AddRefs(accTable));
NS_ENSURE_TRUE(accTable, nsnull);
NS_ENSURE_TRUE(accTable, nullptr);
nsCOMPtr<nsIAccessible> accCell;
accTable->GetCellAt(0, aColumn, getter_AddRefs(accCell));
if (!accCell)
return nsnull;
return nullptr;
// If the cell at the first row is column header then assume it is column
// header for all rows,
@ -236,13 +236,13 @@ getColumnHeaderCB(AtkTable *aTable, gint aColumn)
nsresult rv;
nsCOMPtr<nsIAccessible> accHeaderCell =
do_QueryElementAt(headerCells, 0, &rv);
NS_ENSURE_SUCCESS(rv, nsnull);
NS_ENSURE_SUCCESS(rv, nullptr);
return AccessibleWrap::GetAtkObject(accHeaderCell);
}
}
return nsnull;
return nullptr;
}
static const gchar*
@ -250,16 +250,16 @@ getRowDescriptionCB(AtkTable *aTable, gint aRow)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return nsnull;
return nullptr;
nsCOMPtr<nsIAccessibleTable> accTable;
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
getter_AddRefs(accTable));
NS_ENSURE_TRUE(accTable, nsnull);
NS_ENSURE_TRUE(accTable, nullptr);
nsAutoString autoStr;
nsresult rv = accTable->GetRowDescription(aRow, autoStr);
NS_ENSURE_SUCCESS(rv, nsnull);
NS_ENSURE_SUCCESS(rv, nullptr);
return AccessibleWrap::ReturnString(autoStr);
}
@ -269,17 +269,17 @@ getRowHeaderCB(AtkTable *aTable, gint aRow)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return nsnull;
return nullptr;
nsCOMPtr<nsIAccessibleTable> accTable;
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
getter_AddRefs(accTable));
NS_ENSURE_TRUE(accTable, nsnull);
NS_ENSURE_TRUE(accTable, nullptr);
nsCOMPtr<nsIAccessible> accCell;
accTable->GetCellAt(aRow, 0, getter_AddRefs(accCell));
if (!accCell)
return nsnull;
return nullptr;
// If the cell at the first column is row header then assume it is row
// header for all columns,
@ -297,13 +297,13 @@ getRowHeaderCB(AtkTable *aTable, gint aRow)
nsresult rv;
nsCOMPtr<nsIAccessible> accHeaderCell =
do_QueryElementAt(headerCells, 0, &rv);
NS_ENSURE_SUCCESS(rv, nsnull);
NS_ENSURE_SUCCESS(rv, nullptr);
return AccessibleWrap::GetAtkObject(accHeaderCell);
}
}
return nsnull;
return nullptr;
}
static AtkObject*
@ -313,7 +313,7 @@ getSummaryCB(AtkTable *aTable)
// link an accessible object to specify a summary. There is closes method
// in nsIAccessibleTable::summary to get a summary as a string which is not
// mapped directly to ATK.
return nsnull;
return nullptr;
}
static gint
@ -332,7 +332,7 @@ getSelectedColumnsCB(AtkTable *aTable, gint **aSelected)
PRInt32 *columns = NULL;
nsresult rv = accTable->GetSelectedColumnIndices(&size, &columns);
if (NS_FAILED(rv) || (size == 0) || !columns) {
*aSelected = nsnull;
*aSelected = nullptr;
return 0;
}
@ -367,7 +367,7 @@ getSelectedRowsCB(AtkTable *aTable, gint **aSelected)
PRInt32 *rows = NULL;
nsresult rv = accTable->GetSelectedRowIndices(&size, &rows);
if (NS_FAILED(rv) || (size == 0) || !rows) {
*aSelected = nsnull;
*aSelected = nullptr;
return 0;
}

View File

@ -32,22 +32,22 @@ getTextCB(AtkText *aText, gint aStartOffset, gint aEndOffset)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
if (!accWrap)
return nsnull;
return nullptr;
nsCOMPtr<nsIAccessibleText> accText;
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
getter_AddRefs(accText));
NS_ENSURE_TRUE(accText, nsnull);
NS_ENSURE_TRUE(accText, nullptr);
nsAutoString autoStr;
nsresult rv = accText->GetText(aStartOffset, aEndOffset, autoStr);
NS_ENSURE_SUCCESS(rv, nsnull);
NS_ENSURE_SUCCESS(rv, nullptr);
ConvertTexttoAsterisks(accWrap, autoStr);
NS_ConvertUTF16toUTF8 cautoStr(autoStr);
//copy and return, libspi will free it.
return (cautoStr.get()) ? g_strdup(cautoStr.get()) : nsnull;
return (cautoStr.get()) ? g_strdup(cautoStr.get()) : nullptr;
}
static gchar*
@ -57,12 +57,12 @@ getTextAfterOffsetCB(AtkText *aText, gint aOffset,
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
if (!accWrap)
return nsnull;
return nullptr;
nsCOMPtr<nsIAccessibleText> accText;
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
getter_AddRefs(accText));
NS_ENSURE_TRUE(accText, nsnull);
NS_ENSURE_TRUE(accText, nullptr);
nsAutoString autoStr;
PRInt32 startOffset = 0, endOffset = 0;
@ -72,11 +72,11 @@ getTextAfterOffsetCB(AtkText *aText, gint aOffset,
*aStartOffset = startOffset;
*aEndOffset = endOffset;
NS_ENSURE_SUCCESS(rv, nsnull);
NS_ENSURE_SUCCESS(rv, nullptr);
ConvertTexttoAsterisks(accWrap, autoStr);
NS_ConvertUTF16toUTF8 cautoStr(autoStr);
return (cautoStr.get()) ? g_strdup(cautoStr.get()) : nsnull;
return (cautoStr.get()) ? g_strdup(cautoStr.get()) : nullptr;
}
static gchar*
@ -86,12 +86,12 @@ getTextAtOffsetCB(AtkText *aText, gint aOffset,
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
if (!accWrap)
return nsnull;
return nullptr;
nsCOMPtr<nsIAccessibleText> accText;
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
getter_AddRefs(accText));
NS_ENSURE_TRUE(accText, nsnull);
NS_ENSURE_TRUE(accText, nullptr);
nsAutoString autoStr;
PRInt32 startOffset = 0, endOffset = 0;
@ -101,11 +101,11 @@ getTextAtOffsetCB(AtkText *aText, gint aOffset,
*aStartOffset = startOffset;
*aEndOffset = endOffset;
NS_ENSURE_SUCCESS(rv, nsnull);
NS_ENSURE_SUCCESS(rv, nullptr);
ConvertTexttoAsterisks(accWrap, autoStr);
NS_ConvertUTF16toUTF8 cautoStr(autoStr);
return (cautoStr.get()) ? g_strdup(cautoStr.get()) : nsnull;
return (cautoStr.get()) ? g_strdup(cautoStr.get()) : nullptr;
}
static gunichar
@ -141,12 +141,12 @@ getTextBeforeOffsetCB(AtkText *aText, gint aOffset,
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
if (!accWrap)
return nsnull;
return nullptr;
nsCOMPtr<nsIAccessibleText> accText;
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
getter_AddRefs(accText));
NS_ENSURE_TRUE(accText, nsnull);
NS_ENSURE_TRUE(accText, nullptr);
nsAutoString autoStr;
PRInt32 startOffset = 0, endOffset = 0;
@ -156,11 +156,11 @@ getTextBeforeOffsetCB(AtkText *aText, gint aOffset,
*aStartOffset = startOffset;
*aEndOffset = endOffset;
NS_ENSURE_SUCCESS(rv, nsnull);
NS_ENSURE_SUCCESS(rv, nullptr);
ConvertTexttoAsterisks(accWrap, autoStr);
NS_ConvertUTF16toUTF8 cautoStr(autoStr);
return (cautoStr.get()) ? g_strdup(cautoStr.get()) : nsnull;
return (cautoStr.get()) ? g_strdup(cautoStr.get()) : nullptr;
}
static gint
@ -190,19 +190,19 @@ getRunAttributesCB(AtkText *aText, gint aOffset,
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
if (!accWrap)
return nsnull;
return nullptr;
nsCOMPtr<nsIAccessibleText> accText;
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
getter_AddRefs(accText));
NS_ENSURE_TRUE(accText, nsnull);
NS_ENSURE_TRUE(accText, nullptr);
nsCOMPtr<nsIPersistentProperties> attributes;
PRInt32 startOffset = 0, endOffset = 0;
nsresult rv = accText->GetTextAttributes(false, aOffset,
&startOffset, &endOffset,
getter_AddRefs(attributes));
NS_ENSURE_SUCCESS(rv, nsnull);
NS_ENSURE_SUCCESS(rv, nullptr);
*aStartOffset = startOffset;
*aEndOffset = endOffset;
@ -215,17 +215,17 @@ getDefaultAttributesCB(AtkText *aText)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
if (!accWrap)
return nsnull;
return nullptr;
nsCOMPtr<nsIAccessibleText> accText;
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
getter_AddRefs(accText));
NS_ENSURE_TRUE(accText, nsnull);
NS_ENSURE_TRUE(accText, nullptr);
nsCOMPtr<nsIPersistentProperties> attributes;
nsresult rv = accText->GetDefaultTextAttributes(getter_AddRefs(attributes));
if (NS_FAILED(rv))
return nsnull;
return nullptr;
return ConvertToAtkAttributeSet(attributes);
}
@ -368,12 +368,12 @@ getTextSelectionCB(AtkText *aText, gint aSelectionNum,
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
if (!accWrap)
return nsnull;
return nullptr;
nsCOMPtr<nsIAccessibleText> accText;
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
getter_AddRefs(accText));
NS_ENSURE_TRUE(accText, nsnull);
NS_ENSURE_TRUE(accText, nullptr);
PRInt32 startOffset = 0, endOffset = 0;
nsresult rv = accText->GetSelectionBounds(aSelectionNum,
@ -382,7 +382,7 @@ getTextSelectionCB(AtkText *aText, gint aSelectionNum,
*aStartOffset = startOffset;
*aEndOffset = endOffset;
NS_ENSURE_SUCCESS(rv, nsnull);
NS_ENSURE_SUCCESS(rv, nullptr);
return getTextCB(aText, *aStartOffset, *aEndOffset);
}

View File

@ -26,14 +26,14 @@ struct EnumTypeData
nsIAtom** aValue3 = 0, PRUint64 aState3 = 0) :
mState1(aState1), mState2(aState2), mState3(aState3), mDefaultState(0),
mAttrName(aAttrName), mValue1(aValue1), mValue2(aValue2), mValue3(aValue3),
mNullValue(nsnull)
mNullValue(nullptr)
{ }
EnumTypeData(nsIAtom* aAttrName, PRUint64 aDefaultState,
nsIAtom** aValue1, PRUint64 aState1) :
mState1(aState1), mState2(0), mState3(0), mDefaultState(aDefaultState),
mAttrName(aAttrName), mValue1(aValue1), mValue2(nsnull), mValue3(nsnull),
mNullValue(nsnull)
mAttrName(aAttrName), mValue1(aValue1), mValue2(nullptr), mValue3(nullptr),
mNullValue(nullptr)
{ }
// States applied if corresponding enum values are matched.

View File

@ -23,14 +23,14 @@ AccCollector::~AccCollector()
PRUint32
AccCollector::Count()
{
EnsureNGetIndex(nsnull);
EnsureNGetIndex(nullptr);
return mObjects.Length();
}
Accessible*
AccCollector::GetAccessibleAt(PRUint32 aIndex)
{
Accessible* accessible = mObjects.SafeElementAt(aIndex, nsnull);
Accessible* accessible = mObjects.SafeElementAt(aIndex, nullptr);
if (accessible)
return accessible;
@ -64,7 +64,7 @@ AccCollector::EnsureNGetObject(PRUint32 aIndex)
return mObjects[aIndex];
}
return nsnull;
return nullptr;
}
PRInt32

View File

@ -73,7 +73,7 @@ AccEvent::GetDocAccessible()
if (node)
return GetAccService()->GetDocAccessible(node->OwnerDoc());
return nsnull;
return nullptr;
}
already_AddRefed<nsAccEvent>
@ -114,7 +114,7 @@ AccEvent::GetAccessibleForNode() const
return document->GetAccessible(mNode);
}
return nsnull;
return nullptr;
}
void
@ -326,7 +326,7 @@ AccSelChangeEvent::
SelChangeType aSelChangeType) :
AccEvent(0, aItem, eAutoDetect, eCoalesceSelectionChange),
mWidget(aWidget), mItem(aItem), mSelChangeType(aSelChangeType),
mPreceedingCount(0), mPackedEvent(nsnull)
mPreceedingCount(0), mPackedEvent(nullptr)
{
if (aSelChangeType == eSelectionAdd) {
if (mWidget->GetSelectedItem(1))

View File

@ -411,10 +411,10 @@ public:
template<class Destination>
operator Destination*() {
if (!mRawPtr)
return nsnull;
return nullptr;
return mRawPtr->GetEventGroups() & (1U << Destination::kEventGroup) ?
static_cast<Destination*>(mRawPtr) : nsnull;
static_cast<Destination*>(mRawPtr) : nullptr;
}
private:

View File

@ -10,7 +10,7 @@
using namespace mozilla::a11y;
AccGroupInfo::AccGroupInfo(Accessible* aItem, role aRole) :
mPosInSet(0), mSetSize(0), mParent(nsnull)
mPosInSet(0), mSetSize(0), mParent(nullptr)
{
MOZ_COUNT_CTOR(AccGroupInfo);
Accessible* parent = aItem->Parent();

View File

@ -41,7 +41,7 @@ public:
role != mozilla::a11y::roles::RADIO_MENU_ITEM &&
role != mozilla::a11y::roles::RADIOBUTTON &&
role != mozilla::a11y::roles::PAGETAB)
return nsnull;
return nullptr;
AccGroupInfo* info = new AccGroupInfo(aAccessible, BaseRole(role));
return info;

View File

@ -57,7 +57,7 @@ AccIterator::Next()
}
}
return nsnull;
return nullptr;
}
////////////////////////////////////////////////////////////////////////////////
@ -77,8 +77,8 @@ AccIterator::IteratorState::IteratorState(Accessible* aParent,
RelatedAccIterator::
RelatedAccIterator(DocAccessible* aDocument, nsIContent* aDependentContent,
nsIAtom* aRelAttr) :
mDocument(aDocument), mRelAttr(aRelAttr), mProviders(nsnull),
mBindingParent(nsnull), mIndex(0)
mDocument(aDocument), mRelAttr(aRelAttr), mProviders(nullptr),
mBindingParent(nullptr), mIndex(0)
{
mBindingParent = aDependentContent->GetBindingParent();
nsIAtom* IDAttr = mBindingParent ?
@ -93,7 +93,7 @@ Accessible*
RelatedAccIterator::Next()
{
if (!mProviders)
return nsnull;
return nullptr;
while (mIndex < mProviders->Length()) {
DocAccessible::AttrRelProvider* provider = (*mProviders)[mIndex++];
@ -118,7 +118,7 @@ RelatedAccIterator::Next()
}
}
return nsnull;
return nullptr;
}
@ -139,7 +139,7 @@ HTMLLabelIterator::Next()
{
// Get either <label for="[id]"> element which explicitly points to given
// element, or <label> ancestor which implicitly point to it.
Accessible* label = nsnull;
Accessible* label = nullptr;
while ((label = mRelIter.Next())) {
if (label->GetContent()->Tag() == nsGkAtoms::label)
return label;
@ -147,7 +147,7 @@ HTMLLabelIterator::Next()
// Ignore ancestor label on not widget accessible.
if (mLabelFilter == eSkipAncestorLabel || !mAcc->IsWidget())
return nsnull;
return nullptr;
// Go up tree to get a name of ancestor label if there is one (an ancestor
// <label> implicitly points to us). Don't go up farther than form or
@ -169,7 +169,7 @@ HTMLLabelIterator::Next()
walkUp = walkUp->Parent();
}
return nsnull;
return nullptr;
}
@ -186,13 +186,13 @@ HTMLOutputIterator(DocAccessible* aDocument, nsIContent* aElement) :
Accessible*
HTMLOutputIterator::Next()
{
Accessible* output = nsnull;
Accessible* output = nullptr;
while ((output = mRelIter.Next())) {
if (output->GetContent()->Tag() == nsGkAtoms::output)
return output;
}
return nsnull;
return nullptr;
}
@ -209,13 +209,13 @@ XULLabelIterator::
Accessible*
XULLabelIterator::Next()
{
Accessible* label = nsnull;
Accessible* label = nullptr;
while ((label = mRelIter.Next())) {
if (label->GetContent()->Tag() == nsGkAtoms::label)
return label;
}
return nsnull;
return nullptr;
}
@ -232,13 +232,13 @@ XULDescriptionIterator::
Accessible*
XULDescriptionIterator::Next()
{
Accessible* descr = nsnull;
Accessible* descr = nullptr;
while ((descr = mRelIter.Next())) {
if (descr->GetContent()->Tag() == nsGkAtoms::description)
return descr;
}
return nsnull;
return nullptr;
}
////////////////////////////////////////////////////////////////////////////////
@ -287,7 +287,7 @@ IDRefsIterator::NextElem()
return refContent;
}
return nsnull;
return nullptr;
}
nsIContent*
@ -320,14 +320,14 @@ IDRefsIterator::GetElem(const nsDependentSubstring& aID)
GetAnonymousElementByAttribute(mContent, nsGkAtoms::anonid, aID);
}
return nsnull;
return nullptr;
}
Accessible*
IDRefsIterator::Next()
{
nsIContent* nextElm = NextElem();
return nextElm ? mDoc->GetAccessible(nextElm) : nsnull;
return nextElm ? mDoc->GetAccessible(nextElm) : nullptr;
}
Accessible*
@ -335,6 +335,6 @@ SingleAccIterator::Next()
{
nsRefPtr<Accessible> nextAcc;
mAcc.swap(nextAcc);
return (nextAcc && !nextAcc->IsDefunct()) ? nextAcc : nsnull;
return (nextAcc && !nextAcc->IsDefunct()) ? nextAcc : nullptr;
}

View File

@ -66,7 +66,7 @@ private:
struct IteratorState
{
IteratorState(Accessible* aParent, IteratorState* mParentState = nsnull);
IteratorState(Accessible* aParent, IteratorState* mParentState = nullptr);
Accessible* mParent;
PRInt32 mIndex;

View File

@ -36,10 +36,10 @@ FocusManager::FocusedAccessible() const
if (focusedNode) {
DocAccessible* doc =
GetAccService()->GetDocAccessible(focusedNode->OwnerDoc());
return doc ? doc->GetAccessibleOrContainer(focusedNode) : nsnull;
return doc ? doc->GetAccessibleOrContainer(focusedNode) : nullptr;
}
return nsnull;
return nullptr;
}
bool
@ -60,7 +60,7 @@ FocusManager::IsFocused(const Accessible* aAccessible) const
DocAccessible* doc =
GetAccService()->GetDocAccessible(focusedNode->OwnerDoc());
return aAccessible ==
(doc ? doc->GetAccessibleOrContainer(focusedNode) : nsnull);
(doc ? doc->GetAccessibleOrContainer(focusedNode) : nullptr);
}
}
return false;
@ -117,7 +117,7 @@ FocusManager::NotifyOfDOMFocus(nsISupports* aTarget)
A11YDEBUG_FOCUS_NOTIFICATION_SUPPORTSTARGET("DOM focus", "DOM focus target",
aTarget)
mActiveItem = nsnull;
mActiveItem = nullptr;
nsCOMPtr<nsINode> targetNode(do_QueryInterface(aTarget));
if (targetNode) {
@ -143,7 +143,7 @@ FocusManager::NotifyOfDOMBlur(nsISupports* aTarget)
A11YDEBUG_FOCUS_NOTIFICATION_SUPPORTSTARGET("DOM blur", "DOM blur target",
aTarget)
mActiveItem = nsnull;
mActiveItem = nullptr;
// If DOM document stays focused then fire accessible focus event to process
// the case when no element within this DOM document will be focused.
@ -169,7 +169,7 @@ FocusManager::ActiveItemChanged(Accessible* aItem, bool aCheckIfActive)
if (aItem && aItem == mActiveItem)
return;
mActiveItem = nsnull;
mActiveItem = nullptr;
if (aItem && aCheckIfActive) {
Accessible* widget = aItem->ContainerWidget();
@ -305,7 +305,7 @@ FocusManager::ProcessFocusEvent(AccEvent* aEvent)
fromUserInputFlag);
nsEventShell::FireEvent(menuEndEvent);
mActiveARIAMenubar = nsnull;
mActiveARIAMenubar = nullptr;
}
A11YDEBUG_FOCUS_NOTIFICATION_ACCTARGET("FIRE FOCUS EVENT", "Focus target",
@ -327,7 +327,7 @@ FocusManager::ProcessFocusEvent(AccEvent* aEvent)
nsEventShell::FireEvent(nsIAccessibleEvent::EVENT_SCROLLING_START,
anchorJump, fromUserInputFlag);
}
targetDocument->SetAnchorJump(nsnull);
targetDocument->SetAnchorJump(nullptr);
}
}
@ -342,18 +342,18 @@ FocusManager::FocusedDOMNode() const
// keeps the focus.
if (focusedElm) {
if (nsEventStateManager::IsRemoteTarget(focusedElm))
return nsnull;
return nullptr;
return focusedElm;
}
// Otherwise the focus can be on DOM document.
nsPIDOMWindow* focusedWnd = DOMFocusManager->GetFocusedWindow();
return focusedWnd ? focusedWnd->GetExtantDoc() : nsnull;
return focusedWnd ? focusedWnd->GetExtantDoc() : nullptr;
}
nsIDocument*
FocusManager::FocusedDOMDocument() const
{
nsINode* focusedNode = FocusedDOMNode();
return focusedNode ? focusedNode->OwnerDoc() : nsnull;
return focusedNode ? focusedNode->OwnerDoc() : nullptr;
}

View File

@ -138,7 +138,7 @@ LogDocShellTree(nsIDocument* aDocumentNode)
static void
LogDocState(nsIDocument* aDocumentNode)
{
const char* docState = nsnull;
const char* docState = nullptr;
nsIDocument::ReadyState docStateFlag = aDocumentNode->GetReadyStateEnum();
switch (docStateFlag) {
case nsIDocument::READYSTATE_UNINITIALIZED:
@ -168,7 +168,7 @@ LogPresShell(nsIDocument* aDocumentNode)
nsIPresShell* ps = aDocumentNode->GetShell();
printf("presshell: %p", static_cast<void*>(ps));
nsIScrollableFrame *sf = ps ?
ps->GetRootScrollFrameAsScrollableExternal() : nsnull;
ps->GetRootScrollFrameAsScrollableExternal() : nullptr;
printf(", root scroll frame: %p", static_cast<void*>(sf));
}

View File

@ -71,13 +71,13 @@ void DocLoadEventHandled(AccEvent* aEvent);
* Log the document was created.
*/
void DocCreate(const char* aMsg, nsIDocument* aDocumentNode,
DocAccessible* aDocument = nsnull);
DocAccessible* aDocument = nullptr);
/**
* Log the document was destroyed.
*/
void DocDestroy(const char* aMsg, nsIDocument* aDocumentNode,
DocAccessible* aDocument = nsnull);
DocAccessible* aDocument = nullptr);
/**
* Log the outer document was destroyed.

View File

@ -98,8 +98,8 @@ NotificationController::Shutdown()
mHangingChildDocuments.Clear();
mDocument = nsnull;
mPresShell = nsnull;
mDocument = nullptr;
mPresShell = nullptr;
mTextHash.Clear();
mContentInsertions.Clear();
@ -590,7 +590,7 @@ NotificationController::CoalesceSelChangeEvents(AccSelChangeEvent* aTailEvent,
aThisEvent->mPackedEvent->mEventRule =
AccEvent::eCoalesceSelectionChange;
aThisEvent->mPackedEvent = nsnull;
aThisEvent->mPackedEvent = nullptr;
}
aThisEvent->mEventType =
@ -720,7 +720,7 @@ NotificationController::TextEnumerator(nsCOMPtrHashKey<nsIContent>* aEntry,
}
nsIContent* containerElm = containerNode->IsElement() ?
containerNode->AsElement() : nsnull;
containerNode->AsElement() : nullptr;
nsAutoString text;
textFrame->GetRenderedText(&text);
@ -837,8 +837,8 @@ NotificationController::ContentInsertion::Process()
{
mDocument->ProcessContentInserted(mContainer, &mInsertedContent);
mDocument = nsnull;
mContainer = nsnull;
mDocument = nullptr;
mContainer = nullptr;
mInsertedContent.Clear();
}

View File

@ -57,15 +57,15 @@ public:
TNotification(Class* aInstance, Callback aCallback, Arg* aArg) :
mInstance(aInstance), mCallback(aCallback), mArg(aArg) { }
virtual ~TNotification() { mInstance = nsnull; }
virtual ~TNotification() { mInstance = nullptr; }
virtual void Process()
{
(mInstance->*mCallback)(mArg);
mInstance = nsnull;
mCallback = nsnull;
mArg = nsnull;
mInstance = nullptr;
mCallback = nullptr;
mArg = nullptr;
}
private:
@ -270,7 +270,7 @@ private:
{
public:
ContentInsertion(DocAccessible* aDocument, Accessible* aContainer);
virtual ~ContentInsertion() { mDocument = nsnull; }
virtual ~ContentInsertion() { mDocument = nullptr; }
NS_INLINE_DECL_REFCOUNTING(ContentInsertion)
NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(ContentInsertion)

View File

@ -33,7 +33,7 @@ struct RelationCopyHelper
class Relation
{
public:
Relation() : mFirstIter(nsnull), mLastIter(nsnull) { }
Relation() : mFirstIter(nullptr), mLastIter(nullptr) { }
Relation(const RelationCopyHelper aRelation) :
mFirstIter(aRelation.mFirstIter), mLastIter(aRelation.mLastIter) { }
@ -41,11 +41,11 @@ public:
Relation(AccIterable* aIter) : mFirstIter(aIter), mLastIter(aIter) { }
Relation(Accessible* aAcc) :
mFirstIter(nsnull), mLastIter(nsnull)
mFirstIter(nullptr), mLastIter(nullptr)
{ AppendTarget(aAcc); }
Relation(DocAccessible* aDocument, nsIContent* aContent) :
mFirstIter(nsnull), mLastIter(nsnull)
mFirstIter(nullptr), mLastIter(nullptr)
{ AppendTarget(aDocument, aContent); }
Relation& operator = (const RelationCopyHelper& aRH)
@ -101,14 +101,14 @@ public:
*/
inline Accessible* Next()
{
Accessible* target = nsnull;
Accessible* target = nullptr;
// a trick nsAutoPtr deletes what it used to point to when assigned to
while (mFirstIter && !(target = mFirstIter->Next()))
mFirstIter = mFirstIter->mNextIter;
if (!mFirstIter)
mLastIter = nsnull;
mLastIter = nullptr;
return target;
}

View File

@ -17,7 +17,7 @@ StyleInfo::StyleInfo(dom::Element* aElement, nsIPresShell* aPresShell) :
{
mStyleContext =
nsComputedDOMStyle::GetStyleContextForElementNoFlush(aElement,
nsnull,
nullptr,
aPresShell);
}

View File

@ -72,8 +72,8 @@ TextAttrsMgr::GetAttributes(nsIPersistentProperties* aAttributes,
if (!rootFrame)
return;
nsIContent *offsetNode = nsnull, *offsetElm = nsnull;
nsIFrame *frame = nsnull;
nsIContent *offsetNode = nullptr, *offsetElm = nullptr;
nsIFrame *frame = nullptr;
if (mOffsetAcc) {
offsetNode = mOffsetAcc->GetContent();
offsetElm = nsCoreUtils::GetDOMElementFor(offsetNode);

View File

@ -30,7 +30,7 @@ public:
* Constructor. Used to expose default text attributes.
*/
TextAttrsMgr(HyperTextAccessible* aHyperTextAcc) :
mOffsetAcc(nsnull), mHyperTextAcc(aHyperTextAcc),
mOffsetAcc(nullptr), mHyperTextAcc(aHyperTextAcc),
mOffsetAccIdx(-1), mIncludeDefAttrs(true) { }
/**
@ -64,8 +64,8 @@ public:
* @param aEndHTOffset [out, optional] end hyper text offset
*/
void GetAttributes(nsIPersistentProperties* aAttributes,
PRInt32* aStartHTOffset = nsnull,
PRInt32* aEndHTOffset = nsnull);
PRInt32* aStartHTOffset = nullptr,
PRInt32* aEndHTOffset = nullptr);
protected:
/**

View File

@ -27,11 +27,11 @@ public:
private:
TextUpdater(DocAccessible* aDocument, TextLeafAccessible* aTextLeaf) :
mDocument(aDocument), mTextLeaf(aTextLeaf), mHyperText(nsnull),
mDocument(aDocument), mTextLeaf(aTextLeaf), mHyperText(nullptr),
mTextOffset(-1) { }
~TextUpdater()
{ mDocument = nsnull; mTextLeaf = nsnull; mHyperText = nsnull; }
{ mDocument = nullptr; mTextLeaf = nullptr; mHyperText = nullptr; }
/**
* Update text of the text leaf accessible, fire text change and value change

View File

@ -647,7 +647,7 @@ aria::GetRoleMap(nsINode* aNode)
!content->GetAttr(kNameSpaceID_None, nsGkAtoms::role, roles) ||
roles.IsEmpty()) {
// We treat role="" as if the role attribute is absent (per aria spec:8.1.1)
return nsnull;
return nullptr;
}
nsWhitespaceTokenizer tokenizer(roles);

View File

@ -215,7 +215,7 @@ namespace aria {
* ARIA role if the role attribute provides a space delimited list of roles.
*
* @param aNode [in] the DOM node to get the role map entry for
* @return a pointer to the role map entry for the ARIA role, or nsnull
* @return a pointer to the role map entry for the ARIA role, or nullptr
* if none
*/
nsRoleMapEntry* GetRoleMap(nsINode* aNode);

View File

@ -35,7 +35,7 @@ ClearCacheEntry(const void* aKey, nsRefPtr<T>& aAccessible, void* aUserArg)
static void
ClearCache(AccessibleHashtable& aCache)
{
aCache.Enumerate(ClearCacheEntry<Accessible>, nsnull);
aCache.Enumerate(ClearCacheEntry<Accessible>, nullptr);
}
/**

View File

@ -42,7 +42,7 @@ DocAccessible*
nsAccDocManager::GetDocAccessible(nsIDocument *aDocument)
{
if (!aDocument)
return nsnull;
return nullptr;
// Ensure CacheChildren is called before we query cache.
nsAccessNode::GetApplicationAccessible()->EnsureChildren();
@ -352,22 +352,22 @@ nsAccDocManager::CreateDocOrRootAccessible(nsIDocument* aDocument)
// docshell.
if (aDocument->IsInitialDocument() || !aDocument->IsVisible() ||
aDocument->IsResourceDoc() || !aDocument->IsActive())
return nsnull;
return nullptr;
// Ignore documents without presshell and not having root frame.
nsIPresShell* presShell = aDocument->GetShell();
if (!presShell || !presShell->GetRootFrame())
return nsnull;
return nullptr;
// Do not create document accessible until role content is loaded, otherwise
// we get accessible document with wrong role.
nsIContent *rootElm = nsCoreUtils::GetRoleContent(aDocument);
if (!rootElm)
return nsnull;
return nullptr;
bool isRootDoc = nsCoreUtils::IsRootDocument(aDocument);
DocAccessible* parentDocAcc = nsnull;
DocAccessible* parentDocAcc = nullptr;
if (!isRootDoc) {
// XXXaaronl: ideally we would traverse the presshell chain. Since there's
// no easy way to do that, we cheat and use the document hierarchy.
@ -375,7 +375,7 @@ nsAccDocManager::CreateDocOrRootAccessible(nsIDocument* aDocument)
NS_ASSERTION(parentDocAcc,
"Can't create an accessible for the document!");
if (!parentDocAcc)
return nsnull;
return nullptr;
}
// We only create root accessibles for the true root, otherwise create a
@ -390,7 +390,7 @@ nsAccDocManager::CreateDocOrRootAccessible(nsIDocument* aDocument)
// Initialize the document accessible.
if (!docAcc->Init()) {
docAcc->Shutdown();
return nsnull;
return nullptr;
}
docAcc->SetRoleMapEntry(aria::GetRoleMap(aDocument));
@ -399,7 +399,7 @@ nsAccDocManager::CreateDocOrRootAccessible(nsIDocument* aDocument)
Accessible* appAcc = nsAccessNode::GetApplicationAccessible();
if (!appAcc->AppendChild(docAcc)) {
docAcc->Shutdown();
return nsnull;
return nullptr;
}
// Fire reorder event to notify new accessible document has been attached to
@ -444,7 +444,7 @@ nsAccDocManager::GetFirstEntryInDocCache(const nsIDocument* aKey,
void
nsAccDocManager::ClearDocCache()
{
DocAccessible* docAcc = nsnull;
DocAccessible* docAcc = nullptr;
while (mDocAccessibleCache.EnumerateRead(GetFirstEntryInDocCache, static_cast<void*>(&docAcc))) {
if (docAcc)
docAcc->Shutdown();

View File

@ -40,7 +40,7 @@ public:
*/
DocAccessible* GetDocAccessible(const nsIPresShell* aPresShell)
{
return aPresShell ? GetDocAccessible(aPresShell->GetDocument()) : nsnull;
return aPresShell ? GetDocAccessible(aPresShell->GetDocument()) : nullptr;
}
/**

View File

@ -18,7 +18,7 @@
struct WalkState
{
WalkState(nsIContent *aContent) :
content(aContent), childIdx(0), prevState(nsnull) {}
content(aContent), childIdx(0), prevState(nullptr) {}
nsCOMPtr<nsIContent> content;
nsCOMPtr<nsINodeList> childList;
@ -33,7 +33,7 @@ struct WalkState
nsAccTreeWalker::
nsAccTreeWalker(DocAccessible* aDoc, nsIContent* aContent,
bool aWalkAnonContent, bool aWalkCache) :
mDoc(aDoc), mWalkCache(aWalkCache), mState(nsnull)
mDoc(aDoc), mWalkCache(aWalkCache), mState(nullptr)
{
NS_ASSERTION(aContent, "No node for the accessible tree walker!");
@ -64,7 +64,7 @@ Accessible*
nsAccTreeWalker::NextChildInternal(bool aNoWalkUp)
{
if (!mState || !mState->content)
return nsnull;
return nullptr;
if (!mState->childList)
mState->childList = mState->content->GetChildren(mChildFilter);
@ -98,7 +98,7 @@ nsAccTreeWalker::NextChildInternal(bool aNoWalkUp)
// No more children, get back to the parent.
PopState();
return aNoWalkUp ? nsnull : NextChildInternal(false);
return aNoWalkUp ? nullptr : NextChildInternal(false);
}
void

View File

@ -202,14 +202,14 @@ nsAccUtils::GetARIAToken(dom::Element* aElement, nsIAtom* aAttr)
static nsIContent::AttrValuesArray tokens[] =
{ &nsGkAtoms::_false, &nsGkAtoms::_true,
&nsGkAtoms::mixed, nsnull};
&nsGkAtoms::mixed, nullptr};
PRInt32 idx = aElement->FindAttrValueIn(kNameSpaceID_None,
aAttr, tokens, eCaseMatters);
if (idx >= 0)
return *(tokens[idx]);
return nsnull;
return nullptr;
}
Accessible*
@ -225,22 +225,22 @@ nsAccUtils::GetAncestorWithRole(Accessible* aDescendant, PRUint32 aRole)
if (parent == document)
break;
}
return nsnull;
return nullptr;
}
Accessible*
nsAccUtils::GetSelectableContainer(Accessible* aAccessible, PRUint64 aState)
{
if (!aAccessible)
return nsnull;
return nullptr;
if (!(aState & states::SELECTABLE))
return nsnull;
return nullptr;
Accessible* parent = aAccessible;
while ((parent = parent->Parent()) && !parent->IsSelect()) {
if (Role(parent) == nsIAccessibleRole::ROLE_PANE)
return nsnull;
return nullptr;
}
return parent;
}
@ -262,7 +262,7 @@ nsAccUtils::GetTextAccessibleFromSelection(nsISelection* aSelection)
nsCOMPtr<nsIDOMNode> focusDOMNode;
aSelection->GetFocusNode(getter_AddRefs(focusDOMNode));
if (!focusDOMNode)
return nsnull;
return nullptr;
PRInt32 focusOffset = 0;
aSelection->GetFocusOffset(&focusOffset);
@ -275,10 +275,10 @@ nsAccUtils::GetTextAccessibleFromSelection(nsISelection* aSelection)
DocAccessible* doc =
GetAccService()->GetDocAccessible(resultNode->OwnerDoc());
Accessible* accessible = doc ?
doc->GetAccessibleOrContainer(resultNode) : nsnull;
doc->GetAccessibleOrContainer(resultNode) : nullptr;
if (!accessible) {
NS_NOTREACHED("No nsIAccessibleText for selection change event!");
return nsnull;
return nullptr;
}
do {
@ -290,7 +290,7 @@ nsAccUtils::GetTextAccessibleFromSelection(nsISelection* aSelection)
} while (accessible);
NS_NOTREACHED("We must reach document accessible implementing nsIAccessibleText!");
return nsnull;
return nullptr;
}
nsresult

View File

@ -126,7 +126,7 @@ public:
* @param aDescendant [in] descendant to start search with
* @param aRole [in] role to find matching ancestor for
* @return the ancestor accessible with the given role, or
* nsnull if no match is found
* nullptr if no match is found
*/
static Accessible* GetAncestorWithRole(Accessible* aDescendant,
PRUint32 aRole);

View File

@ -28,7 +28,7 @@ using namespace mozilla::a11y;
* see http://lxr.mozilla.org/seamonkey/source/accessible/accessible-docs.html
*/
ApplicationAccessible* nsAccessNode::gApplicationAccessible = nsnull;
ApplicationAccessible* nsAccessNode::gApplicationAccessible = nullptr;
/*
* Class nsAccessNode
@ -78,8 +78,8 @@ void nsAccessNode::LastRelease()
void
nsAccessNode::Shutdown()
{
mContent = nsnull;
mDoc = nsnull;
mContent = nullptr;
mDoc = nullptr;
}
ApplicationAccessible*
@ -100,7 +100,7 @@ nsAccessNode::GetApplicationAccessible()
if (NS_FAILED(rv)) {
gApplicationAccessible->Shutdown();
NS_RELEASE(gApplicationAccessible);
return nsnull;
return nullptr;
}
}
@ -129,23 +129,23 @@ nsAccessNode::RootAccessible() const
nsCoreUtils::GetDocShellTreeItemFor(mContent);
NS_ASSERTION(docShellTreeItem, "No docshell tree item for mContent");
if (!docShellTreeItem) {
return nsnull;
return nullptr;
}
nsCOMPtr<nsIDocShellTreeItem> root;
docShellTreeItem->GetRootTreeItem(getter_AddRefs(root));
NS_ASSERTION(root, "No root content tree item");
if (!root) {
return nsnull;
return nullptr;
}
DocAccessible* docAcc = nsAccUtils::GetDocAccessibleFor(root);
return docAcc ? docAcc->AsRoot() : nsnull;
return docAcc ? docAcc->AsRoot() : nullptr;
}
nsIFrame*
nsAccessNode::GetFrame() const
{
return mContent ? mContent->GetPrimaryFrame() : nsnull;
return mContent ? mContent->GetPrimaryFrame() : nullptr;
}
bool
@ -162,7 +162,7 @@ nsAccessNode::Language(nsAString& aLanguage)
if (!mDoc)
return;
nsCoreUtils::GetLanguageFor(mContent, nsnull, aLanguage);
nsCoreUtils::GetLanguageFor(mContent, nullptr, aLanguage);
if (aLanguage.IsEmpty()) { // Nothing found, so use document's language
mContent->OwnerDoc()->GetHeaderData(nsGkAtoms::headerContentLanguage,
aLanguage);

View File

@ -78,7 +78,7 @@ public:
virtual nsINode* GetNode() const { return mContent; }
nsIContent* GetContent() const { return mContent; }
virtual nsIDocument* GetDocumentNode() const
{ return mContent ? mContent->OwnerDoc() : nsnull; }
{ return mContent ? mContent->OwnerDoc() : nullptr; }
/**
* Return node type information of DOM node associated with the accessible.

View File

@ -81,7 +81,7 @@ using namespace mozilla::a11y;
// nsAccessibilityService
////////////////////////////////////////////////////////////////////////////////
nsAccessibilityService *nsAccessibilityService::gAccessibilityService = nsnull;
nsAccessibilityService *nsAccessibilityService::gAccessibilityService = nullptr;
bool nsAccessibilityService::gIsShutdown = true;
nsAccessibilityService::nsAccessibilityService() :
@ -93,7 +93,7 @@ nsAccessibilityService::nsAccessibilityService() :
nsAccessibilityService::~nsAccessibilityService()
{
NS_ASSERTION(gIsShutdown, "Accessibility wasn't shutdown!");
gAccessibilityService = nsnull;
gAccessibilityService = nullptr;
}
////////////////////////////////////////////////////////////////////////////////
@ -163,7 +163,7 @@ nsAccessibilityService::GetRootDocumentAccessible(nsIPresShell* aPresShell,
GetDocAccessible(documentNode) : GetDocAccessibleFromCache(documentNode);
}
}
return nsnull;
return nullptr;
}
already_AddRefed<Accessible>
@ -311,7 +311,7 @@ nsAccessibilityService::CreateHTMLObjectFrameAccessible(nsObjectFrame* aFrame,
// element DOMNode.
if (aFrame->GetRect().IsEmpty())
return nsnull;
return nullptr;
// 1) for object elements containing either HTML or TXT documents
@ -330,7 +330,7 @@ nsAccessibilityService::CreateHTMLObjectFrameAccessible(nsObjectFrame* aFrame,
pluginInstance) {
#ifdef XP_WIN
// Note: pluginPort will be null if windowless.
HWND pluginPort = nsnull;
HWND pluginPort = nullptr;
aFrame->GetPluginPort(&pluginPort);
Accessible* accessible =
@ -342,7 +342,7 @@ nsAccessibilityService::CreateHTMLObjectFrameAccessible(nsObjectFrame* aFrame,
#elif MOZ_ACCESSIBILITY_ATK
if (!AtkSocketAccessible::gCanEmbed)
return nsnull;
return nullptr;
nsCString plugId;
nsresult rv = pluginInstance->GetValueFromPlugin(
@ -362,7 +362,7 @@ nsAccessibilityService::CreateHTMLObjectFrameAccessible(nsObjectFrame* aFrame,
// 3) for images and imagemaps, or anything else with a child frame
// we have the object frame, get the image frame
nsIFrame* frame = aFrame->GetFirstPrincipalChild();
return frame ? frame->CreateAccessible() : nsnull;
return frame ? frame->CreateAccessible() : nullptr;
}
already_AddRefed<Accessible>
@ -611,7 +611,7 @@ nsAccessibilityService::GetAccessibleFor(nsIDOMNode *aNode,
nsIAccessible **aAccessible)
{
NS_ENSURE_ARG_POINTER(aAccessible);
*aAccessible = nsnull;
*aAccessible = nullptr;
if (!aNode)
return NS_OK;
@ -798,7 +798,7 @@ nsAccessibilityService::GetAccessibleFromCache(nsIDOMNode* aNode,
nsIAccessible** aAccessible)
{
NS_ENSURE_ARG_POINTER(aAccessible);
*aAccessible = nsnull;
*aAccessible = nullptr;
if (!aNode)
return NS_OK;
@ -829,7 +829,7 @@ nsAccessibilityService::CreateAccessiblePivot(nsIAccessible* aRoot,
{
NS_ENSURE_ARG_POINTER(aPivot);
NS_ENSURE_ARG(aRoot);
*aPivot = nsnull;
*aPivot = nullptr;
nsRefPtr<Accessible> accessibleRoot(do_QueryObject(aRoot));
NS_ENSURE_TRUE(accessibleRoot, NS_ERROR_INVALID_ARG);
@ -871,7 +871,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
bool* aIsSubtreeHidden)
{
if (!aDoc || !aNode || gIsShutdown)
return nsnull;
return nullptr;
if (aIsSubtreeHidden)
*aIsSubtreeHidden = false;
@ -893,17 +893,17 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
// We have a content node.
if (!aNode->IsInDoc()) {
NS_WARNING("Creating accessible for node with no document");
return nsnull;
return nullptr;
}
if (aNode->OwnerDoc() != aDoc->GetDocumentNode()) {
NS_ERROR("Creating accessible for wrong document");
return nsnull;
return nullptr;
}
nsCOMPtr<nsIContent> content(do_QueryInterface(aNode));
if (!content)
return nsnull;
return nullptr;
// Frames can be deallocated when we flush layout, or when we call into code
// that can flush layout, either directly, or via DOM manipulation, or some
@ -917,7 +917,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
if (aIsSubtreeHidden && !weakFrame.GetFrame())
*aIsSubtreeHidden = true;
return nsnull;
return nullptr;
}
if (weakFrame.GetFrame()->GetContent() != content) {
@ -933,7 +933,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
NS_ASSERTION(imageFrame && content->IsHTML() && content->Tag() == nsGkAtoms::area,
"Unknown case of not main content for the frame!");
#endif
return nsnull;
return nullptr;
}
#ifdef DEBUG
@ -946,7 +946,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
GetAccService()->GetDocAccessible(aNode->OwnerDoc());
if (!docAcc) {
NS_NOTREACHED("Node has no host document accessible!");
return nsnull;
return nullptr;
}
// Attempt to create an accessible based on what we know.
@ -955,21 +955,21 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
// Create accessible for visible text frames.
if (content->IsNodeOfType(nsINode::eTEXT)) {
nsAutoString text;
weakFrame->GetRenderedText(&text, nsnull, nsnull, 0, PR_UINT32_MAX);
weakFrame->GetRenderedText(&text, nullptr, nullptr, 0, PR_UINT32_MAX);
if (text.IsEmpty()) {
if (aIsSubtreeHidden)
*aIsSubtreeHidden = true;
return nsnull;
return nullptr;
}
newAcc = weakFrame->CreateAccessible();
if (docAcc->BindToDocument(newAcc, nsnull)) {
if (docAcc->BindToDocument(newAcc, nullptr)) {
newAcc->AsTextLeaf()->SetText(text);
return newAcc;
}
return nsnull;
return nullptr;
}
bool isHTML = content->IsHTML();
@ -987,13 +987,13 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
if (aIsSubtreeHidden)
*aIsSubtreeHidden = true;
return nsnull;
return nullptr;
}
newAcc = new HyperTextAccessibleWrap(content, docAcc);
if (docAcc->BindToDocument(newAcc, aria::GetRoleMap(aNode)))
return newAcc;
return nsnull;
return nullptr;
}
nsRoleMapEntry* roleMapEntry = aria::GetRoleMap(aNode);
@ -1001,9 +1001,9 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
// Ignore presentation role if element is focusable (focus event shouldn't
// be ever lost and should be sensible).
if (content->IsFocusable())
roleMapEntry = nsnull;
roleMapEntry = nullptr;
else
return nsnull;
return nullptr;
}
if (weakFrame.IsAlive() && !newAcc && isHTML) { // HTML accessibles
@ -1022,7 +1022,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
// unless they are inside a table, but they may still get generic
// accessibles
nsIContent *tableContent = content;
while ((tableContent = tableContent->GetParent()) != nsnull) {
while ((tableContent = tableContent->GetParent()) != nullptr) {
nsIFrame *tableFrame = tableContent->GetPrimaryFrame();
if (!tableFrame)
continue;
@ -1053,7 +1053,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
// presentation if they aren't focusable and have not explicit ARIA
// role (don't create accessibles for them unless they need to fire
// focus events).
return nsnull;
return nullptr;
}
// otherwise create ARIA based accessible.
@ -1118,7 +1118,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
if (aIsSubtreeHidden)
*aIsSubtreeHidden = true;
return nsnull;
return nullptr;
}
// Try using frame to do it.
@ -1173,7 +1173,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
}
}
return docAcc->BindToDocument(newAcc, roleMapEntry) ? newAcc : nsnull;
return docAcc->BindToDocument(newAcc, roleMapEntry) ? newAcc : nullptr;
}
////////////////////////////////////////////////////////////////////////////////
@ -1195,7 +1195,7 @@ nsAccessibilityService::Init()
observerService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);
static const PRUnichar kInitIndicator[] = { '1', 0 };
observerService->NotifyObservers(nsnull, "a11y-init-or-shutdown", kInitIndicator);
observerService->NotifyObservers(nullptr, "a11y-init-or-shutdown", kInitIndicator);
#ifdef DEBUG
logging::CheckEnv();
@ -1224,7 +1224,7 @@ nsAccessibilityService::Shutdown()
observerService->RemoveObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID);
static const PRUnichar kShutdownIndicator[] = { '0', 0 };
observerService->NotifyObservers(nsnull, "a11y-init-or-shutdown", kShutdownIndicator);
observerService->NotifyObservers(nullptr, "a11y-init-or-shutdown", kShutdownIndicator);
}
// Stop accessible document loader.
@ -1271,12 +1271,12 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
{
nsCOMPtr<nsIAccessibleProvider> accessibleProvider(do_QueryInterface(aContent));
if (!accessibleProvider)
return nsnull;
return nullptr;
PRInt32 type;
nsresult rv = accessibleProvider->GetAccessibleType(&type);
if (NS_FAILED(rv))
return nsnull;
return nullptr;
if (type == nsIAccessibleProvider::OuterDoc) {
Accessible* accessible = new OuterDocAccessible(aContent, aDoc);
@ -1284,12 +1284,12 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
return accessible;
}
Accessible* accessible = nsnull;
Accessible* accessible = nullptr;
switch (type)
{
#ifdef MOZ_XUL
case nsIAccessibleProvider::NoAccessible:
return nsnull;
return nullptr;
// XUL controls
case nsIAccessibleProvider::XULAlert:
@ -1333,7 +1333,7 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
// Don't include nameless images in accessible tree.
if (!aContent->HasAttr(kNameSpaceID_None,
nsGkAtoms::tooltiptext))
return nsnull;
return nullptr;
accessible = new ImageAccessibleWrap(aContent, aDoc);
break;
@ -1382,7 +1382,7 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
nsIContent *parent = aContent->GetParent();
if (parent && parent->NodeInfo()->Equals(nsGkAtoms::menu,
kNameSpaceID_XUL))
return nsnull;
return nullptr;
#endif
accessible = new XULMenupopupAccessible(aContent, aDoc);
break;
@ -1543,7 +1543,7 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
break;
default:
return nsnull;
return nullptr;
}
NS_IF_ADDREF(accessible);
@ -1657,7 +1657,7 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
return accessible;
}
return nsnull;
return nullptr;
}
////////////////////////////////////////////////////////////////////////////////
@ -1670,18 +1670,18 @@ nsAccessibilityService::AddNativeRootAccessible(void* aAtkAccessible)
ApplicationAccessible* applicationAcc =
nsAccessNode::GetApplicationAccessible();
if (!applicationAcc)
return nsnull;
return nullptr;
nsRefPtr<NativeRootAccessibleWrap> nativeRootAcc =
new NativeRootAccessibleWrap(static_cast<AtkObject*>(aAtkAccessible));
if (!nativeRootAcc)
return nsnull;
return nullptr;
if (applicationAcc->AppendChild(nativeRootAcc))
return nativeRootAcc;
#endif
return nsnull;
return nullptr;
}
void
@ -1707,7 +1707,7 @@ nsresult
NS_GetAccessibilityService(nsIAccessibilityService** aResult)
{
NS_ENSURE_TRUE(aResult, NS_ERROR_NULL_POINTER);
*aResult = nsnull;
*aResult = nullptr;
if (nsAccessibilityService::gAccessibilityService) {
NS_ADDREF(*aResult = nsAccessibilityService::gAccessibilityService);
@ -1761,7 +1761,7 @@ nsAccessibilityService::CreateAccessibleForDeckChild(nsIFrame* aFrame,
}
}
return nsnull;
return nullptr;
}
#ifdef MOZ_XUL
@ -1771,12 +1771,12 @@ nsAccessibilityService::CreateAccessibleForXULTree(nsIContent* aContent,
{
nsCOMPtr<nsITreeBoxObject> treeBoxObj = nsCoreUtils::GetTreeBoxObject(aContent);
if (!treeBoxObj)
return nsnull;
return nullptr;
nsCOMPtr<nsITreeColumns> treeColumns;
treeBoxObj->GetColumns(getter_AddRefs(treeColumns));
if (!treeColumns)
return nsnull;
return nullptr;
PRInt32 count = 0;
treeColumns->GetCount(&count);

View File

@ -197,7 +197,7 @@ public:
* frame and its subtree is hidden
*/
Accessible* GetOrCreateAccessible(nsINode* aNode, DocAccessible* aDoc,
bool* aIsSubtreeHidden = nsnull);
bool* aIsSubtreeHidden = nullptr);
private:
// nsAccessibilityService creation is controlled by friend

View File

@ -26,7 +26,7 @@ class RuleCache
{
public:
RuleCache(nsIAccessibleTraversalRule* aRule) : mRule(aRule),
mAcceptRoles(nsnull) { }
mAcceptRoles(nullptr) { }
~RuleCache () {
if (mAcceptRoles)
nsMemory::Free(mAcceptRoles);
@ -45,7 +45,7 @@ private:
// nsAccessiblePivot
nsAccessiblePivot::nsAccessiblePivot(Accessible* aRoot) :
mRoot(aRoot), mPosition(nsnull),
mRoot(aRoot), mPosition(nullptr),
mStartOffset(-1), mEndOffset(-1)
{
NS_ASSERTION(aRoot, "A root accessible is required");
@ -269,7 +269,7 @@ nsAccessiblePivot::MoveLast(nsIAccessibleTraversalRule* aRule, bool* aResult)
*aResult = false;
nsresult rv = NS_OK;
Accessible* lastAccessible = mRoot;
Accessible* accessible = nsnull;
Accessible* accessible = nullptr;
// First got to the last accessible in pre-order
while (lastAccessible->HasChildren())
@ -321,7 +321,7 @@ nsAccessiblePivot::MoveToPoint(nsIAccessibleTraversalRule* aRule,
return NS_ERROR_NOT_IN_TREE;
RuleCache cache(aRule);
Accessible* match = nsnull;
Accessible* match = nullptr;
Accessible* child = mRoot->ChildAtPoint(aX, aY, Accessible::eDeepestChild);
while (child && mRoot != child) {
PRUint16 filtered = nsIAccessibleTraversalRule::FILTER_IGNORE;
@ -330,7 +330,7 @@ nsAccessiblePivot::MoveToPoint(nsIAccessibleTraversalRule* aRule,
// Ignore any matching nodes that were below this one
if (filtered & nsIAccessibleTraversalRule::FILTER_IGNORE_SUBTREE)
match = nsnull;
match = nullptr;
// Match if no node below this is a match
if ((filtered & nsIAccessibleTraversalRule::FILTER_MATCH) && !match) {
@ -412,7 +412,7 @@ nsAccessiblePivot::SearchBackward(Accessible* aAccessible,
// Initial position could be unset, in that case return null.
if (!aAccessible)
return nsnull;
return nullptr;
RuleCache cache(aRule);
Accessible* accessible = aAccessible;
@ -421,7 +421,7 @@ nsAccessiblePivot::SearchBackward(Accessible* aAccessible,
if (aSearchCurrent) {
*aResult = cache.ApplyFilter(accessible, &filtered);
NS_ENSURE_SUCCESS(*aResult, nsnull);
NS_ENSURE_SUCCESS(*aResult, nullptr);
if (filtered & nsIAccessibleTraversalRule::FILTER_MATCH)
return accessible;
}
@ -434,16 +434,16 @@ nsAccessiblePivot::SearchBackward(Accessible* aAccessible,
continue;
*aResult = cache.ApplyFilter(accessible, &filtered);
NS_ENSURE_SUCCESS(*aResult, nsnull);
NS_ENSURE_SUCCESS(*aResult, nullptr);
Accessible* lastChild = nsnull;
Accessible* lastChild = nullptr;
while (!(filtered & nsIAccessibleTraversalRule::FILTER_IGNORE_SUBTREE) &&
(lastChild = accessible->LastChild())) {
parent = accessible;
accessible = lastChild;
idxInParent = accessible->IndexInParent();
*aResult = cache.ApplyFilter(accessible, &filtered);
NS_ENSURE_SUCCESS(*aResult, nsnull);
NS_ENSURE_SUCCESS(*aResult, nullptr);
}
if (filtered & nsIAccessibleTraversalRule::FILTER_MATCH)
@ -454,13 +454,13 @@ nsAccessiblePivot::SearchBackward(Accessible* aAccessible,
break;
*aResult = cache.ApplyFilter(accessible, &filtered);
NS_ENSURE_SUCCESS(*aResult, nsnull);
NS_ENSURE_SUCCESS(*aResult, nullptr);
if (filtered & nsIAccessibleTraversalRule::FILTER_MATCH)
return accessible;
}
return nsnull;
return nullptr;
}
Accessible*
@ -478,23 +478,23 @@ nsAccessiblePivot::SearchForward(Accessible* aAccessible,
PRUint16 filtered = nsIAccessibleTraversalRule::FILTER_IGNORE;
*aResult = cache.ApplyFilter(accessible, &filtered);
NS_ENSURE_SUCCESS(*aResult, nsnull);
NS_ENSURE_SUCCESS(*aResult, nullptr);
if (aSearchCurrent && (filtered & nsIAccessibleTraversalRule::FILTER_MATCH))
return accessible;
while (true) {
Accessible* firstChild = nsnull;
Accessible* firstChild = nullptr;
while (!(filtered & nsIAccessibleTraversalRule::FILTER_IGNORE_SUBTREE) &&
(firstChild = accessible->FirstChild())) {
accessible = firstChild;
*aResult = cache.ApplyFilter(accessible, &filtered);
NS_ENSURE_SUCCESS(*aResult, nsnull);
NS_ENSURE_SUCCESS(*aResult, nullptr);
if (filtered & nsIAccessibleTraversalRule::FILTER_MATCH)
return accessible;
}
Accessible* sibling = nsnull;
Accessible* sibling = nullptr;
Accessible* temp = accessible;
do {
if (temp == mRoot)
@ -511,13 +511,13 @@ nsAccessiblePivot::SearchForward(Accessible* aAccessible,
accessible = sibling;
*aResult = cache.ApplyFilter(accessible, &filtered);
NS_ENSURE_SUCCESS(*aResult, nsnull);
NS_ENSURE_SUCCESS(*aResult, nullptr);
if (filtered & nsIAccessibleTraversalRule::FILTER_MATCH)
return accessible;
}
return nsnull;
return nullptr;
}
bool

View File

@ -44,9 +44,9 @@ void nsCaretAccessible::Shutdown()
// doc selection listeners they registered in this nsCaretAccessible
ClearControlSelectionListener(); // Clear the selection listener for the currently focused control
mLastTextAccessible = nsnull;
mLastUsedSelection = nsnull;
mRootAccessible = nsnull;
mLastTextAccessible = nullptr;
mLastUsedSelection = nullptr;
mRootAccessible = nullptr;
}
nsresult nsCaretAccessible::ClearControlSelectionListener()
@ -54,7 +54,7 @@ nsresult nsCaretAccessible::ClearControlSelectionListener()
nsCOMPtr<nsISelectionController> controller =
GetSelectionControllerForNode(mCurrentControl);
mCurrentControl = nsnull;
mCurrentControl = nullptr;
if (!controller)
return NS_OK;
@ -88,7 +88,7 @@ nsCaretAccessible::SetControlSelectionListener(nsIContent *aCurrentNode)
ClearControlSelectionListener();
mCurrentControl = aCurrentNode;
mLastTextAccessible = nsnull;
mLastTextAccessible = nullptr;
// When focus moves such that the caret is part of a new frame selection
// this removes the old selection listener and attaches a new one for
@ -222,7 +222,7 @@ nsCaretAccessible::NormalSelectionChanged(nsISelection* aSelection)
PRInt32 rangeCount = 0;
aSelection->GetRangeCount(&rangeCount);
if (rangeCount == 0) {
mLastTextAccessible = nsnull;
mLastTextAccessible = nullptr;
return; // No selection
}
@ -277,7 +277,7 @@ nsCaretAccessible::GetCaretRect(nsIWidget **aOutWidget)
{
nsIntRect caretRect;
NS_ENSURE_TRUE(aOutWidget, caretRect);
*aOutWidget = nsnull;
*aOutWidget = nullptr;
NS_ENSURE_TRUE(mRootAccessible, caretRect);
if (!mLastTextAccessible) {
@ -337,21 +337,21 @@ already_AddRefed<nsISelectionController>
nsCaretAccessible::GetSelectionControllerForNode(nsIContent *aContent)
{
if (!aContent)
return nsnull;
return nullptr;
nsIPresShell *presShell = aContent->OwnerDoc()->GetShell();
if (!presShell)
return nsnull;
return nullptr;
nsIFrame *frame = aContent->GetPrimaryFrame();
if (!frame)
return nsnull;
return nullptr;
nsPresContext *presContext = presShell->GetPresContext();
if (!presContext)
return nsnull;
return nullptr;
nsISelectionController *controller = nsnull;
nsISelectionController *controller = nullptr;
frame->GetSelectionController(presContext, &controller);
return controller;
}

View File

@ -66,7 +66,7 @@ nsCoreUtils::DispatchClickEvent(nsITreeBoxObject *aTreeBoxObj,
if (!document)
return;
nsIPresShell *presShell = nsnull;
nsIPresShell *presShell = nullptr;
presShell = document->GetShell();
if (!presShell)
return;
@ -195,7 +195,7 @@ nsCoreUtils::GetDOMElementFor(nsIContent *aContent)
if (aContent->IsNodeOfType(nsINode::eTEXT))
return aContent->GetParent();
return nsnull;
return nullptr;
}
nsINode *
@ -405,10 +405,10 @@ already_AddRefed<nsIDocShellTreeItem>
nsCoreUtils::GetDocShellTreeItemFor(nsINode *aNode)
{
if (!aNode)
return nsnull;
return nullptr;
nsCOMPtr<nsISupports> container = aNode->OwnerDoc()->GetContainer();
nsIDocShellTreeItem *docShellTreeItem = nsnull;
nsIDocShellTreeItem *docShellTreeItem = nullptr;
if (container)
CallQueryInterface(container, &docShellTreeItem);
@ -489,13 +489,13 @@ nsCoreUtils::GetDOMNodeForContainer(nsIDocShellTreeItem *aContainer)
shell->GetContentViewer(getter_AddRefs(cv));
if (!cv)
return nsnull;
return nullptr;
nsIDocument* doc = cv->GetDocument();
if (!doc)
return nsnull;
return nullptr;
nsIDOMNode* node = nsnull;
nsIDOMNode* node = nullptr;
CallQueryInterface(doc, &node);
return node;
}
@ -554,9 +554,9 @@ nsCoreUtils::GetTreeBodyBoxObject(nsITreeBoxObject *aTreeBoxObj)
aTreeBoxObj->GetTreeBody(getter_AddRefs(tcElm));
nsCOMPtr<nsIDOMXULElement> tcXULElm(do_QueryInterface(tcElm));
if (!tcXULElm)
return nsnull;
return nullptr;
nsIBoxObject *boxObj = nsnull;
nsIBoxObject *boxObj = nullptr;
tcXULElm->GetBoxObject(&boxObj);
return boxObj;
}
@ -582,7 +582,7 @@ nsCoreUtils::GetTreeBoxObject(nsIContent *aContent)
currentContent = currentContent->GetParent();
}
return nsnull;
return nullptr;
}
already_AddRefed<nsITreeColumn>
@ -591,7 +591,7 @@ nsCoreUtils::GetFirstSensibleColumn(nsITreeBoxObject *aTree)
nsCOMPtr<nsITreeColumns> cols;
aTree->GetColumns(getter_AddRefs(cols));
if (!cols)
return nsnull;
return nullptr;
nsCOMPtr<nsITreeColumn> column;
cols->GetFirstColumn(getter_AddRefs(column));
@ -640,7 +640,7 @@ nsCoreUtils::GetSensibleColumnAt(nsITreeBoxObject *aTree, PRUint32 aIndex)
column = GetNextSensibleColumn(column);
}
return nsnull;
return nullptr;
}
already_AddRefed<nsITreeColumn>

View File

@ -87,7 +87,7 @@ public:
* Return DOM element related with the given node, i.e.
* a) itself if it is DOM element
* b) parent element if it is text node
* c) otherwise nsnull
* c) otherwise nullptr
*
* @param aNode [in] the given DOM node
*/
@ -124,7 +124,7 @@ public:
*/
static bool IsAncestorOf(nsINode *aPossibleAncestorNode,
nsINode *aPossibleDescendantNode,
nsINode *aRootNode = nsnull);
nsINode *aRootNode = nullptr);
/**
* Helper method to scroll range into view, used for implementation of
@ -325,7 +325,7 @@ public:
NS_DECL_NSIDOMDOMSTRINGLIST
bool Add(const nsAString& aName) {
return mNames.AppendElement(aName) != nsnull;
return mNames.AppendElement(aName) != nullptr;
}
private:

View File

@ -28,7 +28,7 @@ nsEventShell::FireEvent(AccEvent* aEvent)
accessible->HandleAccEvent(aEvent);
sEventTargetNode = nsnull;
sEventTargetNode = nullptr;
}
void

View File

@ -45,7 +45,7 @@ nsTextEquivUtils::GetNameFromSubtree(Accessible* aAccessible,
}
}
gInitiatorAcc = nsnull;
gInitiatorAcc = nullptr;
return NS_OK;
}
@ -61,7 +61,7 @@ nsTextEquivUtils::GetTextEquivFromIDRefs(Accessible* aAccessible,
if (!content)
return NS_OK;
nsIContent* refContent = nsnull;
nsIContent* refContent = nullptr;
IDRefsIterator iter(aAccessible->Document(), content, aIDRefsAttr);
while ((refContent = iter.NextElem())) {
if (!aTextEquiv.IsEmpty())
@ -107,7 +107,7 @@ nsTextEquivUtils::AppendTextEquivFromContent(Accessible* aInitiatorAcc,
if (goThroughDOMSubtree)
rv = AppendFromDOMNode(aContent, aString);
gInitiatorAcc = nsnull;
gInitiatorAcc = nullptr;
return rv;
}

View File

@ -44,7 +44,7 @@ NS_IMPL_ISUPPORTS_INHERITED1(ARIAGridAccessible,
void
ARIAGridAccessible::Shutdown()
{
mTable = nsnull;
mTable = nullptr;
AccessibleWrap::Shutdown();
}
@ -60,7 +60,7 @@ ARIAGridAccessible::ColCount()
return 0;
AccIterator cellIter(row, filters::GetCell);
Accessible* cell = nsnull;
Accessible* cell = nullptr;
PRUint32 colCount = 0;
while ((cell = cellIter.Next()))
@ -85,7 +85,7 @@ ARIAGridAccessible::CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex)
{
Accessible* row = GetRowAt(aRowIndex);
if (!row)
return nsnull;
return nullptr;
return GetCellInRowAt(row, aColumnIndex);
}
@ -118,7 +118,7 @@ ARIAGridAccessible::IsRowSelected(PRUint32 aRowIdx)
if (!nsAccUtils::IsARIASelected(row)) {
AccIterator cellIter(row, filters::GetCell);
Accessible* cell = nsnull;
Accessible* cell = nullptr;
while ((cell = cellIter.Next())) {
if (!nsAccUtils::IsARIASelected(cell))
return false;
@ -150,7 +150,7 @@ ARIAGridAccessible::SelectedCellCount()
PRUint32 count = 0, colCount = ColCount();
AccIterator rowIter(this, filters::GetRow);
Accessible* row = nsnull;
Accessible* row = nullptr;
while ((row = rowIter.Next())) {
if (nsAccUtils::IsARIASelected(row)) {
@ -159,7 +159,7 @@ ARIAGridAccessible::SelectedCellCount()
}
AccIterator cellIter(row, filters::GetCell);
Accessible* cell = nsnull;
Accessible* cell = nullptr;
while ((cell = cellIter.Next())) {
if (nsAccUtils::IsARIASelected(cell))
@ -192,7 +192,7 @@ ARIAGridAccessible::SelectedColCount()
continue;
AccIterator cellIter(row, filters::GetCell);
Accessible* cell = nsnull;
Accessible* cell = nullptr;
for (PRUint32 colIdx = 0;
(cell = cellIter.Next()) && colIdx < colCount; colIdx++)
if (isColSelArray[colIdx] && !nsAccUtils::IsARIASelected(cell)) {
@ -210,7 +210,7 @@ ARIAGridAccessible::SelectedRowCount()
PRUint32 count = 0;
AccIterator rowIter(this, filters::GetRow);
Accessible* row = nsnull;
Accessible* row = nullptr;
while ((row = rowIter.Next())) {
if (nsAccUtils::IsARIASelected(row)) {
@ -243,10 +243,10 @@ ARIAGridAccessible::SelectedCells(nsTArray<Accessible*>* aCells)
{
AccIterator rowIter(this, filters::GetRow);
Accessible* row = nsnull;
Accessible* row = nullptr;
while ((row = rowIter.Next())) {
AccIterator cellIter(row, filters::GetCell);
Accessible* cell = nsnull;
Accessible* cell = nullptr;
if (nsAccUtils::IsARIASelected(row)) {
while ((cell = cellIter.Next()))
@ -268,7 +268,7 @@ ARIAGridAccessible::SelectedCellIndices(nsTArray<PRUint32>* aCells)
PRUint32 colCount = ColCount();
AccIterator rowIter(this, filters::GetRow);
Accessible* row = nsnull;
Accessible* row = nullptr;
for (PRUint32 rowIdx = 0; (row = rowIter.Next()); rowIdx++) {
if (nsAccUtils::IsARIASelected(row)) {
for (PRUint32 colIdx = 0; colIdx < colCount; colIdx++)
@ -278,7 +278,7 @@ ARIAGridAccessible::SelectedCellIndices(nsTArray<PRUint32>* aCells)
}
AccIterator cellIter(row, filters::GetCell);
Accessible* cell = nsnull;
Accessible* cell = nullptr;
for (PRUint32 colIdx = 0; (cell = cellIter.Next()); colIdx++) {
if (nsAccUtils::IsARIASelected(cell))
aCells->AppendElement(rowIdx * colCount + colIdx);
@ -307,7 +307,7 @@ ARIAGridAccessible::SelectedColIndices(nsTArray<PRUint32>* aCols)
continue;
AccIterator cellIter(row, filters::GetCell);
Accessible* cell = nsnull;
Accessible* cell = nullptr;
for (PRUint32 colIdx = 0;
(cell = cellIter.Next()) && colIdx < colCount; colIdx++)
if (isColSelArray[colIdx] && !nsAccUtils::IsARIASelected(cell)) {
@ -324,7 +324,7 @@ void
ARIAGridAccessible::SelectedRowIndices(nsTArray<PRUint32>* aRows)
{
AccIterator rowIter(this, filters::GetRow);
Accessible* row = nsnull;
Accessible* row = nullptr;
for (PRUint32 rowIdx = 0; (row = rowIter.Next()); rowIdx++) {
if (nsAccUtils::IsARIASelected(row)) {
aRows->AppendElement(rowIdx);
@ -354,7 +354,7 @@ ARIAGridAccessible::SelectRow(PRUint32 aRowIdx)
{
AccIterator rowIter(this, filters::GetRow);
Accessible* row = nsnull;
Accessible* row = nullptr;
for (PRInt32 rowIdx = 0; (row = rowIter.Next()); rowIdx++) {
nsresult rv = SetARIASelected(row, rowIdx == aRowIdx);
NS_ASSERTION(NS_SUCCEEDED(rv), "SetARIASelected() Shouldn't fail!");
@ -366,7 +366,7 @@ ARIAGridAccessible::SelectCol(PRUint32 aColIdx)
{
AccIterator rowIter(this, filters::GetRow);
Accessible* row = nsnull;
Accessible* row = nullptr;
while ((row = rowIter.Next())) {
// Unselect all cells in the row.
nsresult rv = SetARIASelected(row, false);
@ -393,7 +393,7 @@ ARIAGridAccessible::UnselectCol(PRUint32 aColIdx)
{
AccIterator rowIter(this, filters::GetRow);
Accessible* row = nsnull;
Accessible* row = nullptr;
while ((row = rowIter.Next())) {
Accessible* cell = GetCellInRowAt(row, aColIdx);
if (cell)
@ -486,7 +486,7 @@ ARIAGridAccessible::SetARIASelected(Accessible* aAccessible,
// aria-selected from cell accessible.
if (role == roles::ROW) {
AccIterator cellIter(aAccessible, filters::GetCell);
Accessible* cell = nsnull;
Accessible* cell = nullptr;
while ((cell = cellIter.Next())) {
rv = SetARIASelected(cell, false, false);
@ -508,7 +508,7 @@ ARIAGridAccessible::SetARIASelected(Accessible* aAccessible,
NS_ENSURE_SUCCESS(rv, rv);
AccIterator cellIter(row, filters::GetCell);
Accessible* cell = nsnull;
Accessible* cell = nullptr;
while ((cell = cellIter.Next())) {
if (cell != aAccessible) {
rv = SetARIASelected(cell, true, false);
@ -549,7 +549,7 @@ NS_IMETHODIMP
ARIAGridCellAccessible::GetTable(nsIAccessibleTable** aTable)
{
NS_ENSURE_ARG_POINTER(aTable);
*aTable = nsnull;
*aTable = nullptr;
Accessible* thisRow = Parent();
if (!thisRow || thisRow->Role() != roles::ROW)
@ -653,7 +653,7 @@ NS_IMETHODIMP
ARIAGridCellAccessible::GetColumnHeaderCells(nsIArray** aHeaderCells)
{
NS_ENSURE_ARG_POINTER(aHeaderCells);
*aHeaderCells = nsnull;
*aHeaderCells = nullptr;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -672,7 +672,7 @@ NS_IMETHODIMP
ARIAGridCellAccessible::GetRowHeaderCells(nsIArray** aHeaderCells)
{
NS_ENSURE_ARG_POINTER(aHeaderCells);
*aHeaderCells = nsnull;
*aHeaderCells = nullptr;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -793,6 +793,6 @@ ARIAGridCellAccessible::GetAttributesInternal(nsIPersistentProperties* aAttribut
void
ARIAGridCellAccessible::Shutdown()
{
mTableCell = nsnull;
mTableCell = nullptr;
HyperTextAccessibleWrap::Shutdown();
}

View File

@ -109,7 +109,7 @@ Accessible::QueryInterface(REFNSIID aIID, void** aInstancePtr)
{
// Custom-built QueryInterface() knows when we support nsIAccessibleSelectable
// based on role attribute and aria-multiselectable
*aInstancePtr = nsnull;
*aInstancePtr = nullptr;
if (aIID.Equals(NS_GET_IID(nsXPCOMCycleCollectionParticipant))) {
*aInstancePtr = NS_CYCLE_COLLECTION_PARTICIPANT(Accessible);
@ -159,8 +159,8 @@ Accessible::QueryInterface(REFNSIID aIID, void** aInstancePtr)
Accessible::Accessible(nsIContent* aContent, DocAccessible* aDoc) :
nsAccessNodeWrap(aContent, aDoc),
mParent(nsnull), mIndexInParent(-1), mFlags(eChildrenUninitialized),
mIndexOfEmbeddedChild(-1), mRoleMapEntry(nsnull)
mParent(nullptr), mIndexInParent(-1), mFlags(eChildrenUninitialized),
mIndexOfEmbeddedChild(-1), mRoleMapEntry(nullptr)
{
#ifdef NS_DEBUG_X
{
@ -214,7 +214,7 @@ NS_IMETHODIMP
Accessible::GetDOMNode(nsIDOMNode** aDOMNode)
{
NS_ENSURE_ARG_POINTER(aDOMNode);
*aDOMNode = nsnull;
*aDOMNode = nullptr;
nsINode *node = GetNode();
if (node)
@ -329,7 +329,7 @@ Accessible::Description(nsString& aDescription)
if (isXUL) {
// Try XUL <description control="[id]">description text</description>
XULDescriptionIterator iter(Document(), mContent);
Accessible* descr = nsnull;
Accessible* descr = nullptr;
while ((descr = iter.Next()))
nsTextEquivUtils::AppendTextEquivFromContent(this, descr->GetContent(),
&aDescription);
@ -368,7 +368,7 @@ Accessible::AccessKey() const
{
PRUint32 key = nsCoreUtils::GetAccessKeyFor(mContent);
if (!key && mContent->IsElement()) {
Accessible* label = nsnull;
Accessible* label = nullptr;
// Copy access key from label node.
if (mContent->IsHTML()) {
@ -454,7 +454,7 @@ NS_IMETHODIMP
Accessible::GetNextSibling(nsIAccessible** aNextSibling)
{
NS_ENSURE_ARG_POINTER(aNextSibling);
*aNextSibling = nsnull;
*aNextSibling = nullptr;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -469,7 +469,7 @@ NS_IMETHODIMP
Accessible::GetPreviousSibling(nsIAccessible ** aPreviousSibling)
{
NS_ENSURE_ARG_POINTER(aPreviousSibling);
*aPreviousSibling = nsnull;
*aPreviousSibling = nullptr;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -484,7 +484,7 @@ NS_IMETHODIMP
Accessible::GetFirstChild(nsIAccessible** aFirstChild)
{
NS_ENSURE_ARG_POINTER(aFirstChild);
*aFirstChild = nsnull;
*aFirstChild = nullptr;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -498,7 +498,7 @@ NS_IMETHODIMP
Accessible::GetLastChild(nsIAccessible** aLastChild)
{
NS_ENSURE_ARG_POINTER(aLastChild);
*aLastChild = nsnull;
*aLastChild = nullptr;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -511,7 +511,7 @@ NS_IMETHODIMP
Accessible::GetChildAt(PRInt32 aChildIndex, nsIAccessible** aChild)
{
NS_ENSURE_ARG_POINTER(aChild);
*aChild = nsnull;
*aChild = nullptr;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -534,7 +534,7 @@ NS_IMETHODIMP
Accessible::GetChildren(nsIArray** aOutChildren)
{
NS_ENSURE_ARG_POINTER(aOutChildren);
*aOutChildren = nsnull;
*aOutChildren = nullptr;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -637,7 +637,7 @@ Accessible::VisibilityState()
!(frame->GetStateBits() & NS_FRAME_OUT_OF_FLOW) &&
frame->GetRect().IsEmpty()) {
nsAutoString renderedText;
frame->GetRenderedText(&renderedText, nsnull, nsnull, 0, 1);
frame->GetRenderedText(&renderedText, nullptr, nullptr, 0, 1);
if (renderedText.IsEmpty())
return vstates;
@ -746,7 +746,7 @@ NS_IMETHODIMP
Accessible::GetFocusedChild(nsIAccessible** aChild)
{
NS_ENSURE_ARG_POINTER(aChild);
*aChild = nsnull;
*aChild = nullptr;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -762,7 +762,7 @@ Accessible::FocusedChild()
if (focus && (focus == this || focus->Parent() == this))
return focus;
return nsnull;
return nullptr;
}
Accessible*
@ -770,12 +770,12 @@ Accessible::ChildAtPoint(PRInt32 aX, PRInt32 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 nsnull.
// we return |this| if the point is within it, otherwise nullptr.
PRInt32 x = 0, y = 0, width = 0, height = 0;
nsresult rv = GetBounds(&x, &y, &width, &height);
NS_ENSURE_SUCCESS(rv, nsnull);
NS_ENSURE_SUCCESS(rv, nullptr);
Accessible* fallbackAnswer = nsnull;
Accessible* fallbackAnswer = nullptr;
if (aX >= x && aX < x + width && aY >= y && aY < y + height)
fallbackAnswer = this;
@ -789,10 +789,10 @@ Accessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
// for DOM parent but GetFrameForPoint() should be called for containing block
// to get an out of flow element.
DocAccessible* accDocument = Document();
NS_ENSURE_TRUE(accDocument, nsnull);
NS_ENSURE_TRUE(accDocument, nullptr);
nsIFrame *frame = accDocument->GetFrame();
NS_ENSURE_TRUE(frame, nsnull);
NS_ENSURE_TRUE(frame, nullptr);
nsPresContext *presContext = frame->PresContext();
@ -803,7 +803,7 @@ Accessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
nsIPresShell* presShell = presContext->PresShell();
nsIFrame *foundFrame = presShell->GetFrameForPoint(frame, offset);
nsIContent* content = nsnull;
nsIContent* content = nullptr;
if (!foundFrame || !(content = foundFrame->GetContent()))
return fallbackAnswer;
@ -872,7 +872,7 @@ Accessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
nsIAccessible** aAccessible)
{
NS_ENSURE_ARG_POINTER(aAccessible);
*aAccessible = nsnull;
*aAccessible = nullptr;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -887,7 +887,7 @@ Accessible::GetDeepestChildAtPoint(PRInt32 aX, PRInt32 aY,
nsIAccessible** aAccessible)
{
NS_ENSURE_ARG_POINTER(aAccessible);
*aAccessible = nsnull;
*aAccessible = nullptr;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -934,7 +934,7 @@ Accessible::GetBounds(PRInt32* aX, PRInt32* aY,
// Another frame, same node
nsRect unionRectTwips;
nsIFrame* boundingFrame = nsnull;
nsIFrame* boundingFrame = nullptr;
GetBoundsRect(unionRectTwips, &boundingFrame); // Unions up all primary frames for this node and all siblings after it
NS_ENSURE_STATE(boundingFrame);
@ -1035,7 +1035,7 @@ Accessible::GetHTMLName(nsAString& aLabel)
{
nsAutoString label;
Accessible* labelAcc = nsnull;
Accessible* labelAcc = nullptr;
HTMLLabelIterator iter(Document(), this);
while ((labelAcc = iter.Next())) {
nsresult rv = nsTextEquivUtils::
@ -1097,7 +1097,7 @@ Accessible::GetXULName(nsAString& aLabel)
if (NS_FAILED(rv) || label.IsEmpty()) {
label.Truncate();
Accessible* labelAcc = nsnull;
Accessible* labelAcc = nullptr;
XULLabelIterator iter(Document(), mContent);
while ((labelAcc = iter.Next())) {
nsCOMPtr<nsIDOMXULLabelElement> xulLabel =
@ -1155,7 +1155,7 @@ Accessible::HandleAccEvent(AccEvent* aEvent)
observers->HasMoreElements(&hasObservers);
if (hasObservers) {
nsRefPtr<nsAccEvent> evnt(aEvent->CreateXPCOMObject());
return obsService->NotifyObservers(evnt, NS_ACCESSIBLE_EVENT_TOPIC, nsnull);
return obsService->NotifyObservers(evnt, NS_ACCESSIBLE_EVENT_TOPIC, nullptr);
}
return NS_OK;
@ -1472,7 +1472,7 @@ Accessible::State()
} else {
// If focus is in a child of the tab panel surely the tab is selected!
Relation rel = RelationByType(nsIAccessibleRelation::RELATION_LABEL_FOR);
Accessible* relTarget = nsnull;
Accessible* relTarget = nullptr;
while ((relTarget = rel.Next())) {
if (relTarget->Role() == roles::PROPERTYPAGE &&
FocusMgr()->IsFocusWithin(relTarget))
@ -1551,7 +1551,7 @@ Accessible::ApplyARIAState(PRUint64* aState) const
if (mContent->HasAttr(kNameSpaceID_None, mContent->GetIDAttributeName())) {
// If has a role & ID and aria-activedescendant on the container, assume focusable
nsIContent *ancestorContent = mContent;
while ((ancestorContent = ancestorContent->GetParent()) != nsnull) {
while ((ancestorContent = ancestorContent->GetParent()) != nullptr) {
if (ancestorContent->HasAttr(kNameSpaceID_None, nsGkAtoms::aria_activedescendant)) {
// ancestor has activedescendant property, this content could be active
*aState |= states::FOCUSABLE;
@ -1564,7 +1564,7 @@ Accessible::ApplyARIAState(PRUint64* aState) const
if (*aState & states::FOCUSABLE) {
// Special case: aria-disabled propagates from ancestors down to any focusable descendant
nsIContent *ancestorContent = mContent;
while ((ancestorContent = ancestorContent->GetParent()) != nsnull) {
while ((ancestorContent = ancestorContent->GetParent()) != nullptr) {
if (ancestorContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::aria_disabled,
nsGkAtoms::_true, eCaseMatters)) {
// ancestor has aria-disabled property, this is disabled
@ -1723,7 +1723,7 @@ Accessible::ARIATransformRole(role aRole)
return roles::COMBOBOX_LIST;
Relation rel = RelationByType(nsIAccessibleRelation::RELATION_NODE_CHILD_OF);
Accessible* targetAcc = nsnull;
Accessible* targetAcc = nullptr;
while ((targetAcc = rel.Next()))
if (targetAcc->Role() == roles::COMBOBOX)
return roles::COMBOBOX_LIST;
@ -1880,7 +1880,7 @@ Accessible::GetAtomicRegion() const
while (loopContent && !loopContent->GetAttr(kNameSpaceID_None, nsGkAtoms::aria_atomic, atomic))
loopContent = loopContent->GetParent();
return atomic.EqualsLiteral("true") ? loopContent : nsnull;
return atomic.EqualsLiteral("true") ? loopContent : nullptr;
}
// nsIAccessible getRelationByType()
@ -1889,7 +1889,7 @@ Accessible::GetRelationByType(PRUint32 aType,
nsIAccessibleRelation** aRelation)
{
NS_ENSURE_ARG_POINTER(aRelation);
*aRelation = nsnull;
*aRelation = nullptr;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -2058,7 +2058,7 @@ NS_IMETHODIMP
Accessible::GetRelations(nsIArray **aRelations)
{
NS_ENSURE_ARG_POINTER(aRelations);
*aRelations = nsnull;
*aRelations = nullptr;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -2163,7 +2163,7 @@ NS_IMETHODIMP
Accessible::GetSelectedChildren(nsIArray** aSelectedAccessibles)
{
NS_ENSURE_ARG_POINTER(aSelectedAccessibles);
*aSelectedAccessibles = nsnull;
*aSelectedAccessibles = nullptr;
if (IsDefunct() || !IsSelect())
return NS_ERROR_FAILURE;
@ -2184,7 +2184,7 @@ NS_IMETHODIMP
Accessible::RefSelection(PRInt32 aIndex, nsIAccessible** aSelected)
{
NS_ENSURE_ARG_POINTER(aSelected);
*aSelected = nsnull;
*aSelected = nullptr;
if (IsDefunct() || !IsSelect())
return NS_ERROR_FAILURE;
@ -2337,7 +2337,7 @@ NS_IMETHODIMP
Accessible::GetAnchor(PRInt32 aIndex, nsIAccessible** aAccessible)
{
NS_ENSURE_ARG_POINTER(aAccessible);
*aAccessible = nsnull;
*aAccessible = nullptr;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -2484,10 +2484,10 @@ Accessible::BindToParent(Accessible* aParent, PRUint32 aIndexInParent)
void
Accessible::UnbindFromParent()
{
mParent = nsnull;
mParent = nullptr;
mIndexInParent = -1;
mIndexOfEmbeddedChild = -1;
mGroupInfo = nsnull;
mGroupInfo = nullptr;
}
void
@ -2499,7 +2499,7 @@ Accessible::InvalidateChildren()
child->UnbindFromParent();
}
mEmbeddedObjCollector = nsnull;
mEmbeddedObjCollector = nullptr;
mChildren.Clear();
SetChildrenFlag(eChildrenUninitialized);
}
@ -2537,7 +2537,7 @@ Accessible::InsertChildAt(PRUint32 aIndex, Accessible* aChild)
if (nsAccUtils::IsText(aChild))
SetChildrenFlag(eMixedChildren);
mEmbeddedObjCollector = nsnull;
mEmbeddedObjCollector = nullptr;
aChild->BindToParent(this, aIndex);
return true;
@ -2566,7 +2566,7 @@ Accessible::RemoveChild(Accessible* aChild)
aChild->UnbindFromParent();
mChildren.RemoveElementAt(index);
mEmbeddedObjCollector = nsnull;
mEmbeddedObjCollector = nullptr;
return true;
}
@ -2574,9 +2574,9 @@ Accessible::RemoveChild(Accessible* aChild)
Accessible*
Accessible::GetChildAt(PRUint32 aIndex)
{
Accessible* child = mChildren.SafeElementAt(aIndex, nsnull);
Accessible* child = mChildren.SafeElementAt(aIndex, nullptr);
if (!child)
return nsnull;
return nullptr;
#ifdef DEBUG
Accessible* realParent = child->mParent;
@ -2624,7 +2624,7 @@ Accessible::GetEmbeddedChildAt(PRUint32 aIndex)
if (!mEmbeddedObjCollector)
mEmbeddedObjCollector = new EmbeddedObjCollector(this);
return mEmbeddedObjCollector ?
mEmbeddedObjCollector->GetAccessibleAt(aIndex) : nsnull;
mEmbeddedObjCollector->GetAccessibleAt(aIndex) : nullptr;
}
return GetChildAt(aIndex);
@ -2659,7 +2659,7 @@ Accessible::StartOffset()
{
NS_PRECONDITION(IsLink(), "StartOffset is called not on hyper link!");
HyperTextAccessible* hyperText = mParent ? mParent->AsHyperText() : nsnull;
HyperTextAccessible* hyperText = mParent ? mParent->AsHyperText() : nullptr;
return hyperText ? hyperText->GetChildOffset(this) : 0;
}
@ -2668,7 +2668,7 @@ Accessible::EndOffset()
{
NS_PRECONDITION(IsLink(), "EndOffset is called on not hyper link!");
HyperTextAccessible* hyperText = mParent ? mParent->AsHyperText() : nsnull;
HyperTextAccessible* hyperText = mParent ? mParent->AsHyperText() : nullptr;
return hyperText ? (hyperText->GetChildOffset(this) + 1) : 0;
}
@ -2691,7 +2691,7 @@ Accessible*
Accessible::AnchorAt(PRUint32 aAnchorIndex)
{
NS_PRECONDITION(IsLink(), "GetAnchor is called on not hyper link!");
return aAnchorIndex == 0 ? this : nsnull;
return aAnchorIndex == 0 ? this : nullptr;
}
already_AddRefed<nsIURI>
@ -2700,7 +2700,7 @@ Accessible::AnchorURIAt(PRUint32 aAnchorIndex)
NS_PRECONDITION(IsLink(), "AnchorURIAt is called on not hyper link!");
if (aAnchorIndex != 0)
return nsnull;
return nullptr;
// Check if it's a simple xlink.
if (nsCoreUtils::IsXLink(mContent)) {
@ -2709,14 +2709,14 @@ Accessible::AnchorURIAt(PRUint32 aAnchorIndex)
nsCOMPtr<nsIURI> baseURI = mContent->GetBaseURI();
nsCOMPtr<nsIDocument> document = mContent->OwnerDoc();
nsIURI* anchorURI = nsnull;
nsIURI* anchorURI = nullptr;
NS_NewURI(&anchorURI, href,
document ? document->GetDocumentCharacterSet().get() : nsnull,
document ? document->GetDocumentCharacterSet().get() : nullptr,
baseURI);
return anchorURI;
}
return nsnull;
return nullptr;
}
@ -2742,14 +2742,14 @@ Accessible::SelectedItems()
{
nsCOMPtr<nsIMutableArray> selectedItems = do_CreateInstance(NS_ARRAY_CONTRACTID);
if (!selectedItems)
return nsnull;
return nullptr;
AccIterator iter(this, filters::GetSelected, AccIterator::eTreeNav);
nsIAccessible* selected = nsnull;
nsIAccessible* selected = nullptr;
while ((selected = iter.Next()))
selectedItems->AppendElement(selected, false);
nsIMutableArray* items = nsnull;
nsIMutableArray* items = nullptr;
selectedItems.forget(&items);
return items;
}
@ -2759,7 +2759,7 @@ Accessible::SelectedItemCount()
{
PRUint32 count = 0;
AccIterator iter(this, filters::GetSelected, AccIterator::eTreeNav);
Accessible* selected = nsnull;
Accessible* selected = nullptr;
while ((selected = iter.Next()))
++count;
@ -2770,7 +2770,7 @@ Accessible*
Accessible::GetSelectedItem(PRUint32 aIndex)
{
AccIterator iter(this, filters::GetSelected, AccIterator::eTreeNav);
Accessible* selected = nsnull;
Accessible* selected = nullptr;
PRUint32 index = 0;
while ((selected = iter.Next()) && index < aIndex)
@ -2784,7 +2784,7 @@ Accessible::IsItemSelected(PRUint32 aIndex)
{
PRUint32 index = 0;
AccIterator iter(this, filters::GetSelectable, AccIterator::eTreeNav);
Accessible* selected = nsnull;
Accessible* selected = nullptr;
while ((selected = iter.Next()) && index < aIndex)
index++;
@ -2797,7 +2797,7 @@ Accessible::AddItemToSelection(PRUint32 aIndex)
{
PRUint32 index = 0;
AccIterator iter(this, filters::GetSelectable, AccIterator::eTreeNav);
Accessible* selected = nsnull;
Accessible* selected = nullptr;
while ((selected = iter.Next()) && index < aIndex)
index++;
@ -2812,7 +2812,7 @@ Accessible::RemoveItemFromSelection(PRUint32 aIndex)
{
PRUint32 index = 0;
AccIterator iter(this, filters::GetSelectable, AccIterator::eTreeNav);
Accessible* selected = nsnull;
Accessible* selected = nullptr;
while ((selected = iter.Next()) && index < aIndex)
index++;
@ -2826,7 +2826,7 @@ bool
Accessible::SelectAll()
{
bool success = false;
Accessible* selectable = nsnull;
Accessible* selectable = nullptr;
AccIterator iter(this, filters::GetSelectable, AccIterator::eTreeNav);
while((selectable = iter.Next())) {
@ -2840,7 +2840,7 @@ bool
Accessible::UnselectAll()
{
bool success = false;
Accessible* selected = nsnull;
Accessible* selected = nullptr;
AccIterator iter(this, filters::GetSelected, AccIterator::eTreeNav);
while ((selected = iter.Next())) {
@ -2889,7 +2889,7 @@ Accessible::CurrentItem()
return document->GetAccessible(activeDescendantElm);
}
}
return nsnull;
return nullptr;
}
void
@ -2921,7 +2921,7 @@ Accessible::ContainerWidget() const
break;
}
}
return nsnull;
return nullptr;
}
////////////////////////////////////////////////////////////////////////////////
@ -2935,7 +2935,7 @@ Accessible::CacheChildren()
nsAccTreeWalker walker(doc, mContent, CanHaveAnonChildren());
Accessible* child = nsnull;
Accessible* child = nullptr;
while ((child = walker.NextChild()) && AppendChild(child));
}
@ -2950,7 +2950,7 @@ Accessible::TestChildCache(Accessible* aCachedChild) const
return;
}
Accessible* child = nsnull;
Accessible* child = nullptr;
for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
child = mChildren[childIdx];
if (child == aCachedChild)
@ -2988,13 +2988,13 @@ Accessible::GetSiblingAtOffset(PRInt32 aOffset, nsresult* aError) const
if (aError)
*aError = NS_ERROR_UNEXPECTED;
return nsnull;
return nullptr;
}
if (aError &&
mIndexInParent + aOffset >= static_cast<PRInt32>(mParent->ChildCount())) {
*aError = NS_OK; // fail peacefully
return nsnull;
return nullptr;
}
Accessible* child = mParent->GetChildAt(mIndexInParent + aOffset);
@ -3012,21 +3012,21 @@ Accessible::GetFirstAvailableAccessible(nsINode *aStartNode) const
return accessible;
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(aStartNode->OwnerDoc());
NS_ENSURE_TRUE(domDoc, nsnull);
NS_ENSURE_TRUE(domDoc, nullptr);
nsCOMPtr<nsIDOMNode> currentNode = do_QueryInterface(aStartNode);
nsCOMPtr<nsIDOMNode> rootNode = do_QueryInterface(GetNode());
nsCOMPtr<nsIDOMTreeWalker> walker;
domDoc->CreateTreeWalker(rootNode,
nsIDOMNodeFilter::SHOW_ELEMENT | nsIDOMNodeFilter::SHOW_TEXT,
nsnull, false, getter_AddRefs(walker));
NS_ENSURE_TRUE(walker, nsnull);
nullptr, false, getter_AddRefs(walker));
NS_ENSURE_TRUE(walker, nullptr);
walker->SetCurrentNode(currentNode);
while (true) {
walker->NextNode(getter_AddRefs(currentNode));
if (!currentNode)
return nsnull;
return nullptr;
nsCOMPtr<nsINode> node(do_QueryInterface(currentNode));
Accessible* accessible = mDoc->GetAccessible(node);
@ -3034,7 +3034,7 @@ Accessible::GetFirstAvailableAccessible(nsINode *aStartNode) const
return accessible;
}
return nsnull;
return nullptr;
}
nsresult

View File

@ -151,7 +151,7 @@ public:
*/
inline already_AddRefed<nsIDOMNode> DOMNode() const
{
nsIDOMNode *DOMNode = nsnull;
nsIDOMNode *DOMNode = nullptr;
if (GetNode())
CallQueryInterface(GetNode(), &DOMNode);
return DOMNode;
@ -321,7 +321,7 @@ public:
* For a newly created accessible, specify which role map entry should be used.
*
* @param aRoleMapEntry The ARIA nsRoleMapEntry* for the accessible, or
* nsnull if none.
* nullptr if none.
*/
virtual void SetRoleMapEntry(nsRoleMapEntry* aRoleMapEntry);
@ -399,7 +399,7 @@ public:
inline Accessible* LastChild()
{
PRUint32 childCount = ChildCount();
return childCount != 0 ? GetChildAt(childCount - 1) : nsnull;
return childCount != 0 ? GetChildAt(childCount - 1) : nullptr;
}
@ -524,7 +524,7 @@ public:
inline bool IsRoot() const { return mFlags & eRootAccessible; }
mozilla::a11y::RootAccessible* AsRoot();
virtual mozilla::a11y::TableAccessible* AsTable() { return nsnull; }
virtual mozilla::a11y::TableAccessible* AsTable() { return nullptr; }
inline bool IsTextLeaf() const { return mFlags & eTextLeafAccessible; }
mozilla::a11y::TextLeafAccessible* AsTextLeaf();
@ -721,7 +721,7 @@ protected:
* Return sibling accessible at the given offset.
*/
virtual Accessible* GetSiblingAtOffset(PRInt32 aOffset,
nsresult *aError = nsnull) const;
nsresult *aError = nullptr) const;
/**
* Flags used to describe the state and type of children.
@ -826,7 +826,7 @@ protected:
* @param aContent [in, optional] element to click
* @param aActionIndex [in, optional] index of accessible action
*/
void DoCommand(nsIContent *aContent = nsnull, PRUint32 aActionIndex = 0);
void DoCommand(nsIContent *aContent = nullptr, PRUint32 aActionIndex = 0);
/**
* Dispatch click event.

View File

@ -23,7 +23,7 @@
using namespace mozilla::a11y;
ApplicationAccessible::ApplicationAccessible() :
AccessibleWrap(nsnull, nsnull)
AccessibleWrap(nullptr, nullptr)
{
mFlags |= eApplicationAccessible;
}
@ -41,7 +41,7 @@ NS_IMETHODIMP
ApplicationAccessible::GetParent(nsIAccessible** aAccessible)
{
NS_ENSURE_ARG_POINTER(aAccessible);
*aAccessible = nsnull;
*aAccessible = nullptr;
return NS_OK;
}
@ -49,7 +49,7 @@ NS_IMETHODIMP
ApplicationAccessible::GetNextSibling(nsIAccessible** aNextSibling)
{
NS_ENSURE_ARG_POINTER(aNextSibling);
*aNextSibling = nsnull;
*aNextSibling = nullptr;
return NS_OK;
}
@ -57,7 +57,7 @@ NS_IMETHODIMP
ApplicationAccessible::GetPreviousSibling(nsIAccessible** aPreviousSibling)
{
NS_ENSURE_ARG_POINTER(aPreviousSibling);
*aPreviousSibling = nsnull;
*aPreviousSibling = nullptr;
return NS_OK;
}
@ -113,7 +113,7 @@ NS_IMETHODIMP
ApplicationAccessible::GetAttributes(nsIPersistentProperties** aAttributes)
{
NS_ENSURE_ARG_POINTER(aAttributes);
*aAttributes = nsnull;
*aAttributes = nullptr;
return NS_OK;
}
@ -127,7 +127,7 @@ Accessible*
ApplicationAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
EWhichChildAtPoint aWhichChild)
{
return nsnull;
return nullptr;
}
Accessible*
@ -137,7 +137,7 @@ ApplicationAccessible::FocusedChild()
if (focus && focus->Parent() == this)
return focus;
return nsnull;
return nullptr;
}
Relation
@ -277,7 +277,7 @@ ApplicationAccessible::Init()
void
ApplicationAccessible::Shutdown()
{
mAppInfo = nsnull;
mAppInfo = nullptr;
}
bool
@ -339,7 +339,7 @@ ApplicationAccessible::CacheChildren()
do_GetService(NS_WINDOWMEDIATOR_CONTRACTID);
nsCOMPtr<nsISimpleEnumerator> windowEnumerator;
nsresult rv = windowMediator->GetEnumerator(nsnull,
nsresult rv = windowMediator->GetEnumerator(nullptr,
getter_AddRefs(windowEnumerator));
if (NS_FAILED(rv))
return;
@ -369,7 +369,7 @@ ApplicationAccessible::GetSiblingAtOffset(PRInt32 aOffset,
if (aError)
*aError = NS_OK; // fail peacefully
return nsnull;
return nullptr;
}
////////////////////////////////////////////////////////////////////////////////
@ -379,7 +379,7 @@ NS_IMETHODIMP
ApplicationAccessible::GetDOMNode(nsIDOMNode** aDOMNode)
{
NS_ENSURE_ARG_POINTER(aDOMNode);
*aDOMNode = nsnull;
*aDOMNode = nullptr;
return NS_OK;
}
@ -387,7 +387,7 @@ NS_IMETHODIMP
ApplicationAccessible::GetDocument(nsIAccessibleDocument** aDocument)
{
NS_ENSURE_ARG_POINTER(aDocument);
*aDocument = nsnull;
*aDocument = nullptr;
return NS_OK;
}
@ -395,7 +395,7 @@ NS_IMETHODIMP
ApplicationAccessible::GetRootDocument(nsIAccessibleDocument** aRootDocument)
{
NS_ENSURE_ARG_POINTER(aRootDocument);
*aRootDocument = nsnull;
*aRootDocument = nullptr;
return NS_OK;
}

View File

@ -91,7 +91,7 @@ protected:
// Accessible
virtual void CacheChildren();
virtual Accessible* GetSiblingAtOffset(PRInt32 aOffset,
nsresult *aError = nsnull) const;
nsresult *aError = nullptr) const;
private:
nsCOMPtr<nsIXULAppInfo> mAppInfo;

View File

@ -61,7 +61,7 @@ LeafAccessible::CacheChildren()
LinkableAccessible::
LinkableAccessible(nsIContent* aContent, DocAccessible* aDoc) :
AccessibleWrap(aContent, aDoc),
mActionAcc(nsnull),
mActionAcc(nullptr),
mIsLink(false),
mIsOnclick(false)
{
@ -152,7 +152,7 @@ LinkableAccessible::Shutdown()
{
mIsLink = false;
mIsOnclick = false;
mActionAcc = nsnull;
mActionAcc = nullptr;
AccessibleWrap::Shutdown();
}
@ -170,7 +170,7 @@ LinkableAccessible::AnchorURIAt(PRUint32 aAnchorIndex)
return mActionAcc->AnchorURIAt(aAnchorIndex);
}
return nsnull;
return nullptr;
}
////////////////////////////////////////////////////////////////////////////////
@ -183,7 +183,7 @@ LinkableAccessible::BindToParent(Accessible* aParent,
AccessibleWrap::BindToParent(aParent, aIndexInParent);
// Cache action content.
mActionAcc = nsnull;
mActionAcc = nullptr;
mIsLink = false;
mIsOnclick = false;
@ -214,7 +214,7 @@ LinkableAccessible::BindToParent(Accessible* aParent,
void
LinkableAccessible::UnbindFromParent()
{
mActionAcc = nsnull;
mActionAcc = nullptr;
mIsLink = false;
mIsOnclick = false;

View File

@ -81,7 +81,7 @@ DocAccessible::
HyperTextAccessibleWrap(aRootContent, this),
mDocument(aDocument), mScrollPositionChangedTicks(0),
mLoadState(eTreeConstructionPending), mLoadEventType(0),
mVirtualCursor(nsnull),
mVirtualCursor(nullptr),
mPresShell(aPresShell)
{
mFlags |= eDocAccessible;
@ -368,7 +368,7 @@ DocAccessible::TakeFocus()
NS_ENSURE_STATE(fm);
nsCOMPtr<nsIDOMElement> newFocus;
return fm->MoveFocus(mDocument->GetWindow(), nsnull,
return fm->MoveFocus(mDocument->GetWindow(), nullptr,
nsIFocusManager::MOVEFOCUS_ROOT, 0,
getter_AddRefs(newFocus));
}
@ -459,7 +459,7 @@ DocAccessible::GetWindowHandle(void** aWindow)
NS_IMETHODIMP
DocAccessible::GetWindow(nsIDOMWindow** aDOMWin)
{
*aDOMWin = nsnull;
*aDOMWin = nullptr;
if (!mDocument) {
return NS_ERROR_FAILURE; // Accessible is Shutdown()
}
@ -477,7 +477,7 @@ NS_IMETHODIMP
DocAccessible::GetDOMDocument(nsIDOMDocument** aDOMDocument)
{
NS_ENSURE_ARG_POINTER(aDOMDocument);
*aDOMDocument = nsnull;
*aDOMDocument = nullptr;
if (mDocument)
CallQueryInterface(mDocument, aDOMDocument);
@ -489,7 +489,7 @@ NS_IMETHODIMP
DocAccessible::GetParentDocument(nsIAccessibleDocument** aDocument)
{
NS_ENSURE_ARG_POINTER(aDocument);
*aDocument = nsnull;
*aDocument = nullptr;
if (!IsDefunct())
NS_IF_ADDREF(*aDocument = ParentDocument());
@ -514,7 +514,7 @@ DocAccessible::GetChildDocumentAt(PRUint32 aIndex,
nsIAccessibleDocument** aDocument)
{
NS_ENSURE_ARG_POINTER(aDocument);
*aDocument = nsnull;
*aDocument = nullptr;
if (IsDefunct())
return NS_OK;
@ -528,7 +528,7 @@ NS_IMETHODIMP
DocAccessible::GetVirtualCursor(nsIAccessiblePivot** aVirtualCursor)
{
NS_ENSURE_ARG_POINTER(aVirtualCursor);
*aVirtualCursor = nsnull;
*aVirtualCursor = nullptr;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -552,24 +552,24 @@ DocAccessible::GetEditor() const
// the html:body (for HTML document case) or document element is editable.
if (!mDocument->HasFlag(NODE_IS_EDITABLE) &&
!mContent->HasFlag(NODE_IS_EDITABLE))
return nsnull;
return nullptr;
nsCOMPtr<nsISupports> container = mDocument->GetContainer();
nsCOMPtr<nsIEditingSession> editingSession(do_GetInterface(container));
if (!editingSession)
return nsnull; // No editing session interface
return nullptr; // No editing session interface
nsCOMPtr<nsIEditor> editor;
editingSession->GetEditorForWindow(mDocument->GetWindow(), getter_AddRefs(editor));
if (!editor)
return nsnull;
return nullptr;
bool isEditable = false;
editor->GetIsDocumentEditable(&isEditable);
if (isEditable)
return editor.forget();
return nsnull;
return nullptr;
}
// DocAccessible public method
@ -582,7 +582,7 @@ DocAccessible::GetAccessible(nsINode* aNode) const
// document accessible.
if (!accessible) {
if (GetNode() != aNode)
return nsnull;
return nullptr;
accessible = const_cast<DocAccessible*>(this);
}
@ -637,11 +637,11 @@ DocAccessible::Shutdown()
logging::DocDestroy("document shutdown", mDocument, this);
#endif
mPresShell->SetAccDocument(nsnull);
mPresShell->SetAccDocument(nullptr);
if (mNotificationController) {
mNotificationController->Shutdown();
mNotificationController = nsnull;
mNotificationController = nullptr;
}
RemoveEventListeners();
@ -651,7 +651,7 @@ DocAccessible::Shutdown()
// some reason for MSAA, refer to bug 757392 for details).
mFlags |= eIsDefunct;
nsCOMPtr<nsIDocument> kungFuDeathGripDoc = mDocument;
mDocument = nsnull;
mDocument = nullptr;
if (mParent) {
DocAccessible* parentDocument = mParent->Document();
@ -671,10 +671,10 @@ DocAccessible::Shutdown()
if (mVirtualCursor) {
mVirtualCursor->RemoveObserver(this);
mVirtualCursor = nsnull;
mVirtualCursor = nullptr;
}
mPresShell = nsnull; // Avoid reentrancy
mPresShell = nullptr; // Avoid reentrancy
mDependentIDsHash.Clear();
mNodeToAccessibleMap.Clear();
@ -688,7 +688,7 @@ DocAccessible::Shutdown()
nsIFrame*
DocAccessible::GetFrame() const
{
nsIFrame* root = nsnull;
nsIFrame* root = nullptr;
if (mPresShell)
root = mPresShell->GetRootFrame();
@ -702,7 +702,7 @@ DocAccessible::GetBoundsRect(nsRect& aBounds, nsIFrame** aRelativeFrame)
*aRelativeFrame = GetFrame();
nsIDocument *document = mDocument;
nsIDocument *parentDoc = nsnull;
nsIDocument *parentDoc = nullptr;
while (document) {
nsIPresShell *presShell = document->GetShell();
@ -812,7 +812,7 @@ DocAccessible::RemoveEventListeners()
if (mScrollWatchTimer) {
mScrollWatchTimer->Cancel();
mScrollWatchTimer = nsnull;
mScrollWatchTimer = nullptr;
NS_RELEASE_THIS(); // Kung fu death grip
}
@ -842,7 +842,7 @@ DocAccessible::ScrollTimerCallback(nsITimer* aTimer, void* aClosure)
docAcc->mScrollPositionChangedTicks = 0;
if (docAcc->mScrollWatchTimer) {
docAcc->mScrollWatchTimer->Cancel();
docAcc->mScrollWatchTimer = nsnull;
docAcc->mScrollWatchTimer = nullptr;
NS_RELEASE(docAcc); // Release kung fu death grip
}
}
@ -978,7 +978,7 @@ DocAccessible::AttributeWillChange(nsIDocument* aDocument,
if (aAttribute == nsGkAtoms::aria_checked ||
aAttribute == nsGkAtoms::aria_pressed) {
mARIAAttrOldValue = (aModType != nsIDOMMutationEvent::ADDITION) ?
nsAccUtils::GetARIAToken(aElement, aAttribute) : nsnull;
nsAccUtils::GetARIAToken(aElement, aAttribute) : nullptr;
}
}
@ -1335,18 +1335,18 @@ void*
DocAccessible::GetNativeWindow() const
{
if (!mPresShell)
return nsnull;
return nullptr;
nsIViewManager* vm = mPresShell->GetViewManager();
if (!vm)
return nsnull;
return nullptr;
nsCOMPtr<nsIWidget> widget;
vm->GetRootWidget(getter_AddRefs(widget));
if (widget)
return widget->GetNativeData(NS_NATIVE_WINDOW);
return nsnull;
return nullptr;
}
Accessible*
@ -1364,17 +1364,17 @@ DocAccessible::GetAccessibleByUniqueIDInSubtree(void* aUniqueID)
return child;
}
return nsnull;
return nullptr;
}
Accessible*
DocAccessible::GetAccessibleOrContainer(nsINode* aNode)
{
if (!aNode || !aNode->IsInDoc())
return nsnull;
return nullptr;
nsINode* currNode = aNode;
Accessible* accessible = nsnull;
Accessible* accessible = nullptr;
while (!(accessible = GetAccessible(currNode)) &&
(currNode = currNode->GetNodeParent()));
@ -1419,7 +1419,7 @@ DocAccessible::UnbindFromDocument(Accessible* aAccessible)
// Fire focus event on accessible having DOM focus if active item was removed
// from the tree.
if (FocusMgr()->IsActiveItem(aAccessible)) {
FocusMgr()->ActiveItemChanged(nsnull);
FocusMgr()->ActiveItemChanged(nullptr);
A11YDEBUG_FOCUS_ACTIVEITEMCHANGE_CAUSE("tree shutdown", aAccessible)
}
@ -1515,7 +1515,7 @@ DocAccessible::CacheChildren()
nsAccTreeWalker walker(this, mDocument->GetRootElement(),
CanHaveAnonChildren());
Accessible* child = nsnull;
Accessible* child = nullptr;
while ((child = walker.NextChild()) && AppendChild(child));
}

View File

@ -155,7 +155,7 @@ public:
* Return the parent document.
*/
DocAccessible* ParentDocument() const
{ return mParent ? mParent->Document() : nsnull; }
{ return mParent ? mParent->Document() : nullptr; }
/**
* Return the child document count.
@ -167,7 +167,7 @@ public:
* Return the child document at the given index.
*/
DocAccessible* GetChildDocumentAt(PRUint32 aIndex) const
{ return mChildDocuments.SafeElementAt(aIndex, nsnull); }
{ return mChildDocuments.SafeElementAt(aIndex, nullptr); }
/**
* Non-virtual method to fire a delayed event after a 0 length timeout.
@ -262,7 +262,7 @@ public:
*/
Accessible* GetContainerAccessible(nsINode* aNode)
{
return aNode ? GetAccessibleOrContainer(aNode->GetNodeParent()) : nsnull;
return aNode ? GetAccessibleOrContainer(aNode->GetNodeParent()) : nullptr;
}
/**
@ -273,13 +273,13 @@ public:
* while it's called for XUL elements (where XBL is used widely).
*/
bool IsDependentID(const nsAString& aID) const
{ return mDependentIDsHash.Get(aID, nsnull); }
{ return mDependentIDsHash.Get(aID, nullptr); }
/**
* Initialize the newly created accessible and put it into document caches.
*
* @param aAccessible [in] created accessible
* @param aRoleMapEntry [in] the role map entry role the ARIA role or nsnull
* @param aRoleMapEntry [in] the role map entry role the ARIA role or nullptr
* if none
*/
bool BindToDocument(Accessible* aAccessible, nsRoleMapEntry* aRoleMapEntry);
@ -377,7 +377,7 @@ protected:
* @param aRelAttr [in, optional] relation attribute
*/
void AddDependentIDsFor(Accessible* aRelProvider,
nsIAtom* aRelAttr = nsnull);
nsIAtom* aRelAttr = nullptr);
/**
* Remove dependent IDs pointed by accessible element by relation attribute
@ -388,7 +388,7 @@ protected:
* @param aRelAttr [in, optional] relation attribute
*/
void RemoveDependentIDsFor(Accessible* aRelProvider,
nsIAtom* aRelAttr = nsnull);
nsIAtom* aRelAttr = nullptr);
/**
* Update or recreate an accessible depending on a changed attribute.
@ -593,7 +593,7 @@ inline DocAccessible*
Accessible::AsDoc()
{
return mFlags & eDocAccessible ?
static_cast<DocAccessible*>(this) : nsnull;
static_cast<DocAccessible*>(this) : nullptr;
}
#endif

View File

@ -50,7 +50,7 @@ NS_IMPL_RELEASE_INHERITED(HyperTextAccessible, AccessibleWrap)
nsresult
HyperTextAccessible::QueryInterface(REFNSIID aIID, void** aInstancePtr)
{
*aInstancePtr = nsnull;
*aInstancePtr = nullptr;
// ARIA roles that these interfaces are not appropriate for.
if (!IsTextRole())
@ -241,23 +241,23 @@ HyperTextAccessible::GetPosAndText(PRInt32& aStartOffset, PRInt32& aEndOffset,
endOffset = kMaxTextLength; // Max end offset
}
else if (startOffset > endOffset) {
return nsnull;
return nullptr;
}
nsIFrame *startFrame = nsnull;
nsIFrame *startFrame = nullptr;
if (aEndFrame) {
*aEndFrame = nsnull;
*aEndFrame = nullptr;
}
if (aBoundsRect) {
aBoundsRect->SetEmpty();
}
if (aStartAcc)
*aStartAcc = nsnull;
*aStartAcc = nullptr;
if (aEndAcc)
*aEndAcc = nsnull;
*aEndAcc = nullptr;
nsIntRect unionRect;
Accessible* lastAccessible = nsnull;
Accessible* lastAccessible = nullptr;
gfxSkipChars skipChars;
gfxSkipCharsIterator iter;
@ -281,7 +281,7 @@ HyperTextAccessible::GetPosAndText(PRInt32& aStartOffset, PRInt32& aEndOffset,
PRUint32 ourRenderedStart = 0;
PRInt32 ourContentStart = 0;
if (frame->GetType() == nsGkAtoms::textFrame) {
nsresult rv = frame->GetRenderedText(nsnull, &skipChars, &iter);
nsresult rv = frame->GetRenderedText(nullptr, &skipChars, &iter);
if (NS_SUCCEEDED(rv)) {
ourRenderedStart = iter.GetSkippedOffset();
ourContentStart = iter.GetOriginalOffset();
@ -503,14 +503,14 @@ HyperTextAccessible::DOMPointToHypertextOffset(nsINode* aNode,
bool aIsEndOffset)
{
if (!aHyperTextOffset)
return nsnull;
return nullptr;
*aHyperTextOffset = 0;
if (!aNode)
return nsnull;
return nullptr;
PRUint32 addTextOffset = 0;
nsINode* findNode = nsnull;
nsINode* findNode = nullptr;
if (aNodeOffset == -1) {
findNode = aNode;
@ -520,9 +520,9 @@ HyperTextAccessible::DOMPointToHypertextOffset(nsINode* aNode,
// Text offset will be added at the end, if we find the offset in this hypertext
// We want the "skipped" offset into the text (rendered text without the extra whitespace)
nsIFrame *frame = aNode->AsContent()->GetPrimaryFrame();
NS_ENSURE_TRUE(frame, nsnull);
NS_ENSURE_TRUE(frame, nullptr);
nsresult rv = ContentToRenderedOffset(frame, aNodeOffset, &addTextOffset);
NS_ENSURE_SUCCESS(rv, nsnull);
NS_ENSURE_SUCCESS(rv, nullptr);
// Get the child node and
findNode = aNode;
@ -542,7 +542,7 @@ HyperTextAccessible::DOMPointToHypertextOffset(nsINode* aNode,
// There are no children, which means this is an empty nsIAccessibleText, in which
// case we can only be at hypertext offset 0
*aHyperTextOffset = 0;
return nsnull;
return nullptr;
}
findNode = aNode; // Case #2: there are no children
}
@ -550,7 +550,7 @@ HyperTextAccessible::DOMPointToHypertextOffset(nsINode* aNode,
// Get accessible for this findNode, or if that node isn't accessible, use the
// accessible for the next DOM node which has one (based on forward depth first search)
Accessible* descendantAcc = nsnull;
Accessible* descendantAcc = nullptr;
if (findNode) {
nsCOMPtr<nsIContent> findContent(do_QueryInterface(findNode));
if (findContent && findContent->IsHTML() &&
@ -561,13 +561,13 @@ HyperTextAccessible::DOMPointToHypertextOffset(nsINode* aNode,
eIgnoreCase)) {
// This <br> is the hacky "bogus node" used when there is no text in a control
*aHyperTextOffset = 0;
return nsnull;
return nullptr;
}
descendantAcc = GetFirstAvailableAccessible(findNode);
}
// From the descendant, go up and get the immediate child of this hypertext
Accessible* childAccAtOffset = nsnull;
Accessible* childAccAtOffset = nullptr;
while (descendantAcc) {
Accessible* parentAcc = descendantAcc->Parent();
if (parentAcc == this) {
@ -605,7 +605,7 @@ HyperTextAccessible::DOMPointToHypertextOffset(nsINode* aNode,
PRUint32 childCount = ChildCount();
PRUint32 childIdx = 0;
Accessible* childAcc = nsnull;
Accessible* childAcc = nullptr;
for (; childIdx < childCount; childIdx++) {
childAcc = mChildren[childIdx];
if (childAcc == childAccAtOffset)
@ -617,7 +617,7 @@ HyperTextAccessible::DOMPointToHypertextOffset(nsINode* aNode,
if (childIdx < childCount) {
*aHyperTextOffset += addTextOffset;
NS_ASSERTION(childAcc == childAccAtOffset,
"These should be equal whenever we exit loop and childAcc != nsnull");
"These should be equal whenever we exit loop and childAcc != nullptr");
if (childIdx < childCount - 1 ||
addTextOffset < nsAccUtils::TextLength(childAccAtOffset)) {
@ -626,7 +626,7 @@ HyperTextAccessible::DOMPointToHypertextOffset(nsINode* aNode,
}
}
return nsnull;
return nullptr;
}
nsresult
@ -658,9 +658,9 @@ HyperTextAccessible::HypertextOffsetsToDOMRange(PRInt32 aStartHTOffset,
nsRefPtr<Accessible> startAcc, endAcc;
PRInt32 startOffset = aStartHTOffset, endOffset = aEndHTOffset;
nsIFrame *startFrame = nsnull, *endFrame = nsnull;
nsIFrame *startFrame = nullptr, *endFrame = nullptr;
startFrame = GetPosAndText(startOffset, endOffset, nsnull, &endFrame, nsnull,
startFrame = GetPosAndText(startOffset, endOffset, nullptr, &endFrame, nullptr,
getter_AddRefs(startAcc), getter_AddRefs(endAcc));
if (!startAcc || !endAcc)
return NS_ERROR_FAILURE;
@ -739,7 +739,7 @@ HyperTextAccessible::GetRelativeOffset(nsIPresShell* aPresShell,
if (!pos.mResultContent)
return -1;
// If finalAccessible is nsnull, then DOMPointToHypertextOffset() searched
// If finalAccessible is nullptr, then DOMPointToHypertextOffset() searched
// through the hypertext children without finding the node/offset position.
Accessible* finalAccessible =
DOMPointToHypertextOffset(pos.mResultContent, pos.mContentOffset,
@ -751,7 +751,7 @@ HyperTextAccessible::GetRelativeOffset(nsIPresShell* aPresShell,
hyperTextOffset = 0;
}
else if (aAmount == eSelectBeginLine) {
Accessible* firstChild = mChildren.SafeElementAt(0, nsnull);
Accessible* firstChild = mChildren.SafeElementAt(0, nullptr);
// For line selection with needsStart, set start of line exactly to line break
if (pos.mContentOffset == 0 && firstChild &&
firstChild->Role() == roles::STATICTEXT &&
@ -868,7 +868,7 @@ HyperTextAccessible::GetTextHelper(EGetTextType aType, AccessibleTextBoundary aB
case BOUNDARY_ATTRIBUTE_RANGE:
{
nsresult rv = GetTextAttributes(false, aOffset,
aStartOffset, aEndOffset, nsnull);
aStartOffset, aEndOffset, nullptr);
NS_ENSURE_SUCCESS(rv, rv);
return GetText(*aStartOffset, *aEndOffset, aText);
@ -883,8 +883,8 @@ HyperTextAccessible::GetTextHelper(EGetTextType aType, AccessibleTextBoundary aB
// Convert offsets to frame-relative
nsRefPtr<Accessible> startAcc;
nsIFrame *startFrame = GetPosAndText(startOffset, endOffset, nsnull, nsnull,
nsnull, getter_AddRefs(startAcc));
nsIFrame *startFrame = GetPosAndText(startOffset, endOffset, nullptr, nullptr,
nullptr, getter_AddRefs(startAcc));
if (!startFrame) {
PRInt32 textLength = CharacterCount();
@ -926,8 +926,8 @@ HyperTextAccessible::GetTextHelper(EGetTextType aType, AccessibleTextBoundary aB
// For BOUNDARY_LINE_END, make sure we start of this line
startOffset = endOffset = finalStartOffset + (aBoundaryType == BOUNDARY_LINE_END);
nsRefPtr<Accessible> endAcc;
nsIFrame *endFrame = GetPosAndText(startOffset, endOffset, nsnull, nsnull,
nsnull, getter_AddRefs(endAcc));
nsIFrame *endFrame = GetPosAndText(startOffset, endOffset, nullptr, nullptr,
nullptr, getter_AddRefs(endAcc));
if (endAcc && endAcc->Role() == roles::STATICTEXT) {
// Static text like list bullets will ruin our forward calculation,
// since the caret cannot be in the static text. Start just after the static text.
@ -935,8 +935,8 @@ HyperTextAccessible::GetTextHelper(EGetTextType aType, AccessibleTextBoundary aB
(aBoundaryType == BOUNDARY_LINE_END) +
nsAccUtils::TextLength(endAcc);
endFrame = GetPosAndText(startOffset, endOffset, nsnull, nsnull,
nsnull, getter_AddRefs(endAcc));
endFrame = GetPosAndText(startOffset, endOffset, nullptr, nullptr,
nullptr, getter_AddRefs(endAcc));
}
if (!endFrame) {
return NS_ERROR_FAILURE;
@ -1041,7 +1041,7 @@ HyperTextAccessible::GetTextAttributes(bool aIncludeDefAttrs,
return NS_ERROR_FAILURE;
if (aAttributes) {
*aAttributes = nsnull;
*aAttributes = nullptr;
nsCOMPtr<nsIPersistentProperties> attributes =
do_CreateInstance(NS_PERSISTENTPROPERTIES_CONTRACTID);
@ -1084,7 +1084,7 @@ HyperTextAccessible::GetTextAttributes(bool aIncludeDefAttrs,
// Set 'misspelled' text attribute.
rv = GetSpellTextAttribute(accAtOffset->GetNode(), nodeOffset,
&startOffset, &endOffset,
aAttributes ? *aAttributes : nsnull);
aAttributes ? *aAttributes : nullptr);
NS_ENSURE_SUCCESS(rv, rv);
}
@ -1099,7 +1099,7 @@ NS_IMETHODIMP
HyperTextAccessible::GetDefaultTextAttributes(nsIPersistentProperties** aAttributes)
{
NS_ENSURE_ARG_POINTER(aAttributes);
*aAttributes = nsnull;
*aAttributes = nullptr;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -1207,7 +1207,7 @@ HyperTextAccessible::GetRangeExtents(PRInt32 aStartOffset, PRInt32 aEndOffset,
{
nsIntRect boundsRect;
nsIFrame *endFrameUnused;
if (!GetPosAndText(aStartOffset, aEndOffset, nsnull, &endFrameUnused, &boundsRect) ||
if (!GetPosAndText(aStartOffset, aEndOffset, nullptr, &endFrameUnused, &boundsRect) ||
boundsRect.IsEmpty()) {
return NS_ERROR_FAILURE;
}
@ -1322,7 +1322,7 @@ NS_IMETHODIMP
HyperTextAccessible::GetLinkAt(PRInt32 aIndex, nsIAccessibleHyperLink** aLink)
{
NS_ENSURE_ARG_POINTER(aLink);
*aLink = nsnull;
*aLink = nullptr;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -1475,14 +1475,14 @@ HyperTextAccessible::GetEditor() const
ancestor = ancestor->Parent();
}
return nsnull;
return nullptr;
}
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem =
nsCoreUtils::GetDocShellTreeItemFor(mContent);
nsCOMPtr<nsIEditingSession> editingSession(do_GetInterface(docShellTreeItem));
if (!editingSession)
return nsnull; // No editing session interface
return nullptr; // No editing session interface
nsCOMPtr<nsIEditor> editor;
nsIDocument* docNode = mDoc->GetDocumentNode();
@ -1535,7 +1535,7 @@ HyperTextAccessible::SetSelectionRange(PRInt32 aStartPos, PRInt32 aEndPos)
NS_ENSURE_TRUE(docNode, NS_ERROR_FAILURE);
nsCOMPtr<nsPIDOMWindow> window = docNode->GetWindow();
nsCOMPtr<nsIDOMElement> result;
DOMFocusManager->MoveFocus(window, nsnull, nsIFocusManager::MOVEFOCUS_CARET,
DOMFocusManager->MoveFocus(window, nullptr, nsIFocusManager::MOVEFOCUS_CARET,
nsIFocusManager::FLAG_BYMOVEFOCUS, getter_AddRefs(result));
}
@ -1633,7 +1633,7 @@ HyperTextAccessible::CaretLineNumber()
PRInt32 lineNumber = 1;
nsAutoLineIterator lineIterForCaret;
nsIContent *hyperTextContent = IsContent() ? mContent.get() : nsnull;
nsIContent *hyperTextContent = IsContent() ? mContent.get() : nullptr;
while (caretFrame) {
if (hyperTextContent == caretFrame->GetContent()) {
return lineNumber; // Must be in a single line hyper text, there is no line iterator
@ -1675,7 +1675,7 @@ already_AddRefed<nsFrameSelection>
HyperTextAccessible::FrameSelection()
{
nsIFrame* frame = GetFrame();
return frame ? frame->GetFrameSelection() : nsnull;
return frame ? frame->GetFrameSelection() : nullptr;
}
void
@ -2002,13 +2002,13 @@ HyperTextAccessible::ContentToRenderedOffset(nsIFrame* aFrame, PRInt32 aContentO
}
NS_ASSERTION(aFrame->GetType() == nsGkAtoms::textFrame,
"Need text frame for offset conversion");
NS_ASSERTION(aFrame->GetPrevContinuation() == nsnull,
NS_ASSERTION(aFrame->GetPrevContinuation() == nullptr,
"Call on primary frame only");
gfxSkipChars skipChars;
gfxSkipCharsIterator iter;
// Only get info up to original offset, we know that will be larger than skipped offset
nsresult rv = aFrame->GetRenderedText(nsnull, &skipChars, &iter, 0, aContentOffset);
nsresult rv = aFrame->GetRenderedText(nullptr, &skipChars, &iter, 0, aContentOffset);
NS_ENSURE_SUCCESS(rv, rv);
PRUint32 ourRenderedStart = iter.GetSkippedOffset();
@ -2029,13 +2029,13 @@ HyperTextAccessible::RenderedToContentOffset(nsIFrame* aFrame, PRUint32 aRendere
NS_ASSERTION(aFrame->GetType() == nsGkAtoms::textFrame,
"Need text frame for offset conversion");
NS_ASSERTION(aFrame->GetPrevContinuation() == nsnull,
NS_ASSERTION(aFrame->GetPrevContinuation() == nullptr,
"Call on primary frame only");
gfxSkipChars skipChars;
gfxSkipCharsIterator iter;
// We only need info up to skipped offset -- that is what we're converting to original offset
nsresult rv = aFrame->GetRenderedText(nsnull, &skipChars, &iter, 0, aRenderedOffset);
nsresult rv = aFrame->GetRenderedText(nullptr, &skipChars, &iter, 0, aRenderedOffset);
NS_ENSURE_SUCCESS(rv, rv);
PRUint32 ourRenderedStart = iter.GetSkippedOffset();
@ -2199,7 +2199,7 @@ HyperTextAccessible::RangeBoundToHypertextOffset(nsRange* aRange,
bool aIsStartHTOffset,
PRInt32* aHTOffset)
{
nsINode* node = nsnull;
nsINode* node = nullptr;
PRInt32 nodeOffset = 0;
if (aIsStartBound) {

View File

@ -131,7 +131,7 @@ public:
*
* @return the accessible child which contained the offset, if
* it is within the current HyperTextAccessible,
* otherwise nsnull
* otherwise nullptr
*/
Accessible* DOMPointToHypertextOffset(nsINode *aNode,
PRInt32 aNodeOffset,
@ -178,7 +178,7 @@ public:
* @return false if offset at the given shift is out of range
*/
bool GetCharAt(PRInt32 aOffset, EGetTextType aShift, nsAString& aChar,
PRInt32* aStartOffset = nsnull, PRInt32* aEndOffset = nsnull);
PRInt32* aStartOffset = nullptr, PRInt32* aEndOffset = nullptr);
/**
* Return text offset of the given child accessible within hypertext
@ -224,7 +224,7 @@ public:
nsIntRect GetTextBounds(PRInt32 aStartOffset, PRInt32 aEndOffset)
{
nsIntRect bounds;
GetPosAndText(aStartOffset, aEndOffset, nsnull, nsnull, &bounds);
GetPosAndText(aStartOffset, aEndOffset, nullptr, nullptr, &bounds);
return bounds;
}
@ -321,11 +321,11 @@ protected:
* @return the start frame for this substring
*/
nsIFrame* GetPosAndText(PRInt32& aStartOffset, PRInt32& aEndOffset,
nsAString *aText = nsnull,
nsIFrame **aEndFrame = nsnull,
nsIntRect *aBoundsRect = nsnull,
Accessible** aStartAcc = nsnull,
Accessible** aEndAcc = nsnull);
nsAString *aText = nullptr,
nsIFrame **aEndFrame = nullptr,
nsIntRect *aBoundsRect = nullptr,
Accessible** aStartAcc = nullptr,
Accessible** aEndAcc = nullptr);
nsIntRect GetBoundsForString(nsIFrame *aFrame, PRUint32 aStartRenderedOffset, PRUint32 aEndRenderedOffset);
@ -400,7 +400,7 @@ inline HyperTextAccessible*
Accessible::AsHyperText()
{
return mFlags & eHyperTextAccessible ?
static_cast<HyperTextAccessible*>(this) : nsnull;
static_cast<HyperTextAccessible*>(this) : nullptr;
}
#endif

View File

@ -200,7 +200,7 @@ ImageAccessible::GetLongDescURI() const
nsGenericHTMLElement::FromContent(mContent);
if (element) {
nsCOMPtr<nsIURI> uri;
element->GetURIAttr(nsGkAtoms::longdesc, nsnull, getter_AddRefs(uri));
element->GetURIAttr(nsGkAtoms::longdesc, nullptr, getter_AddRefs(uri));
return uri.forget();
}
}
@ -215,13 +215,13 @@ ImageAccessible::GetLongDescURI() const
nsGenericHTMLElement::FromContent(target);
nsCOMPtr<nsIURI> uri;
element->GetURIAttr(nsGkAtoms::href, nsnull, getter_AddRefs(uri));
element->GetURIAttr(nsGkAtoms::href, nullptr, getter_AddRefs(uri));
return uri.forget();
}
}
}
return nsnull;
return nullptr;
}
bool

View File

@ -84,7 +84,7 @@ inline mozilla::a11y::ImageAccessible*
Accessible::AsImage()
{
return IsImage() ?
static_cast<mozilla::a11y::ImageAccessible*>(this) : nsnull;
static_cast<mozilla::a11y::ImageAccessible*>(this) : nullptr;
}
#endif

View File

@ -52,15 +52,15 @@ OuterDocAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
{
PRInt32 docX = 0, docY = 0, docWidth = 0, docHeight = 0;
nsresult rv = GetBounds(&docX, &docY, &docWidth, &docHeight);
NS_ENSURE_SUCCESS(rv, nsnull);
NS_ENSURE_SUCCESS(rv, nullptr);
if (aX < docX || aX >= docX + docWidth || aY < docY || aY >= docY + docHeight)
return nsnull;
return nullptr;
// Always return the inner doc as direct child accessible unless bounds
// outside of it.
Accessible* child = GetChildAt(0);
NS_ENSURE_TRUE(child, nsnull);
NS_ENSURE_TRUE(child, nullptr);
if (aWhichChild == eDeepestChild)
return child->ChildAtPoint(aX, aY, eDeepestChild);
@ -128,7 +128,7 @@ OuterDocAccessible::Shutdown()
logging::OuterDocDestroy(this);
#endif
Accessible* childAcc = mChildren.SafeElementAt(0, nsnull);
Accessible* childAcc = mChildren.SafeElementAt(0, nullptr);
if (childAcc) {
#ifdef DEBUG
if (logging::IsEnabled(logging::eDocDestroy)) {
@ -188,7 +188,7 @@ OuterDocAccessible::AppendChild(Accessible* aAccessible)
bool
OuterDocAccessible::RemoveChild(Accessible* aAccessible)
{
Accessible* child = mChildren.SafeElementAt(0, nsnull);
Accessible* child = mChildren.SafeElementAt(0, nullptr);
if (child != aAccessible) {
NS_ERROR("Wrong child to remove!");
return false;

View File

@ -236,7 +236,7 @@ RootAccessible::RemoveEventListeners()
if (mCaretAccessible) {
mCaretAccessible->Shutdown();
mCaretAccessible = nsnull;
mCaretAccessible = nullptr;
}
return NS_OK;
@ -371,7 +371,7 @@ RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
return;
}
Accessible* treeItemAcc = nsnull;
Accessible* treeItemAcc = nullptr;
#ifdef MOZ_XUL
// If it's a tree element, need the currently selected item.
if (treeAcc) {
@ -442,7 +442,7 @@ RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
Accessible* widget =
accessible->IsWidget() ? accessible : accessible->ContainerWidget();
if (widget && widget->IsAutoCompletePopup()) {
FocusMgr()->ActiveItemChanged(nsnull);
FocusMgr()->ActiveItemChanged(nullptr);
A11YDEBUG_FOCUS_ACTIVEITEMCHANGE_CAUSE("DOMMenuItemInactive", accessible)
}
}
@ -466,7 +466,7 @@ RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
nsEventShell::FireEvent(nsIAccessibleEvent::EVENT_MENU_END,
accessible, eFromUserInput);
FocusMgr()->ActiveItemChanged(nsnull);
FocusMgr()->ActiveItemChanged(nullptr);
A11YDEBUG_FOCUS_ACTIVEITEMCHANGE_CAUSE("DOMMenuBarInactive", accessible)
}
else if (eventType.EqualsLiteral("ValueChange")) {
@ -609,7 +609,7 @@ RootAccessible::HandlePopupHidingEvent(nsINode* aPopupNode)
// HTML select is target of popuphidding event. Otherwise get container
// widget. No container widget means this is either tooltip or menupopup.
// No events in the former case.
Accessible* widget = nsnull;
Accessible* widget = nullptr;
if (popup->IsCombobox()) {
widget = popup;
} else {
@ -657,7 +657,7 @@ RootAccessible::HandlePopupHidingEvent(nsINode* aPopupNode)
// Restore focus to where it was.
if (notifyOf & kNotifyOfFocus) {
FocusMgr()->ActiveItemChanged(nsnull);
FocusMgr()->ActiveItemChanged(nullptr);
A11YDEBUG_FOCUS_ACTIVEITEMCHANGE_CAUSE("popuphiding", popup)
}

View File

@ -90,7 +90,7 @@ inline mozilla::a11y::RootAccessible*
Accessible::AsRoot()
{
return mFlags & eRootAccessible ?
static_cast<mozilla::a11y::RootAccessible*>(this) : nsnull;
static_cast<mozilla::a11y::RootAccessible*>(this) : nullptr;
}
#endif

View File

@ -26,7 +26,7 @@ public:
/**
* Return the caption accessible if any for this table.
*/
virtual Accessible* Caption() { return nsnull; }
virtual Accessible* Caption() { return nullptr; }
/**
* Get the summary for this table.
@ -46,7 +46,7 @@ public:
/**
* Return the accessible for the cell at the given row and column indices.
*/
virtual Accessible* CellAt(PRUint32 aRowIdx, PRUint32 aColIdx) { return nsnull; }
virtual Accessible* CellAt(PRUint32 aRowIdx, PRUint32 aColIdx) { return nullptr; }
/**
* Return the index of the cell at the given row and column.

View File

@ -48,7 +48,7 @@ inline mozilla::a11y::TextLeafAccessible*
Accessible::AsTextLeaf()
{
return mFlags & eTextLeafAccessible ?
static_cast<mozilla::a11y::TextLeafAccessible*>(this) : nsnull;
static_cast<mozilla::a11y::TextLeafAccessible*>(this) : nullptr;
}
#endif

View File

@ -513,14 +513,14 @@ HTMLTextFieldAccessible::GetEditor() const
{
nsCOMPtr<nsIDOMNSEditableElement> editableElt(do_QueryInterface(mContent));
if (!editableElt)
return nsnull;
return nullptr;
// nsGenericHTMLElement::GetEditor has a security check.
// Make sure we're not restricted by the permissions of
// whatever script is currently running.
nsCOMPtr<nsIJSContextStack> stack =
do_GetService("@mozilla.org/js/xpc/ContextStack;1");
bool pushed = stack && NS_SUCCEEDED(stack->Push(nsnull));
bool pushed = stack && NS_SUCCEEDED(stack->Push(nullptr));
nsCOMPtr<nsIEditor> editor;
editableElt->GetEditor(getter_AddRefs(editor));
@ -546,7 +546,7 @@ HTMLTextFieldAccessible::IsWidget() const
Accessible*
HTMLTextFieldAccessible::ContainerWidget() const
{
return mParent && mParent->Role() == roles::AUTOCOMPLETE ? mParent : nsnull;
return mParent && mParent->Role() == roles::AUTOCOMPLETE ? mParent : nullptr;
}
@ -633,7 +633,7 @@ HTMLGroupboxAccessible::GetLegend()
}
}
return nsnull;
return nullptr;
}
nsresult
@ -762,7 +762,7 @@ HTMLFigureAccessible::Caption() const
}
}
return nsnull;
return nullptr;
}
////////////////////////////////////////////////////////////////////////////////

View File

@ -65,10 +65,10 @@ HTMLImageMapAccessible::AnchorURIAt(PRUint32 aAnchorIndex)
{
Accessible* area = GetChildAt(aAnchorIndex);
if (!area)
return nsnull;
return nullptr;
nsIContent* linkContent = area->GetContent();
return linkContent ? linkContent->GetHrefURI() : nsnull;
return linkContent ? linkContent->GetHrefURI() : nullptr;
}
////////////////////////////////////////////////////////////////////////////////

View File

@ -83,7 +83,7 @@ inline mozilla::a11y::HTMLImageMapAccessible*
Accessible::AsImageMap()
{
return IsImageMapAccessible() ?
static_cast<mozilla::a11y::HTMLImageMapAccessible*>(this) : nsnull;
static_cast<mozilla::a11y::HTMLImageMapAccessible*>(this) : nullptr;
}
#endif

View File

@ -137,7 +137,7 @@ HTMLLinkAccessible::IsLink()
already_AddRefed<nsIURI>
HTMLLinkAccessible::AnchorURIAt(PRUint32 aAnchorIndex)
{
return aAnchorIndex == 0 ? mContent->GetHrefURI() : nsnull;
return aAnchorIndex == 0 ? mContent->GetHrefURI() : nullptr;
}
////////////////////////////////////////////////////////////////////////////////

View File

@ -44,15 +44,15 @@ HTMLListAccessible::NativeState()
HTMLLIAccessible::
HTMLLIAccessible(nsIContent* aContent, DocAccessible* aDoc) :
HyperTextAccessibleWrap(aContent, aDoc), mBullet(nsnull)
HyperTextAccessibleWrap(aContent, aDoc), mBullet(nullptr)
{
mFlags |= eHTMLListItemAccessible;
nsBlockFrame* blockFrame = do_QueryFrame(GetFrame());
if (blockFrame && blockFrame->HasBullet()) {
mBullet = new HTMLListBulletAccessible(mContent, mDoc);
if (!Document()->BindToDocument(mBullet, nsnull))
mBullet = nsnull;
if (!Document()->BindToDocument(mBullet, nullptr))
mBullet = nullptr;
}
}
@ -61,7 +61,7 @@ NS_IMPL_ISUPPORTS_INHERITED0(HTMLLIAccessible, HyperTextAccessible)
void
HTMLLIAccessible::Shutdown()
{
mBullet = nsnull;
mBullet = nullptr;
HyperTextAccessibleWrap::Shutdown();
}
@ -112,13 +112,13 @@ HTMLLIAccessible::UpdateBullet(bool aHasBullet)
DocAccessible* document = Document();
if (aHasBullet) {
mBullet = new HTMLListBulletAccessible(mContent, mDoc);
if (document->BindToDocument(mBullet, nsnull)) {
if (document->BindToDocument(mBullet, nullptr)) {
InsertChildAt(0, mBullet);
}
} else {
RemoveChild(mBullet);
document->UnbindFromDocument(mBullet);
mBullet = nsnull;
mBullet = nullptr;
}
// XXXtodo: fire show/hide and reorder events. That's hard to make it
@ -149,7 +149,7 @@ nsIFrame*
HTMLListBulletAccessible::GetFrame() const
{
nsBlockFrame* blockFrame = do_QueryFrame(mContent->GetPrimaryFrame());
return blockFrame ? blockFrame->GetBullet() : nsnull;
return blockFrame ? blockFrame->GetBullet() : nullptr;
}
bool

View File

@ -106,7 +106,7 @@ inline mozilla::a11y::HTMLLIAccessible*
Accessible::AsHTMLListItem()
{
return mFlags & eHTMLListItemAccessible ?
static_cast<mozilla::a11y::HTMLLIAccessible*>(this) : nsnull;
static_cast<mozilla::a11y::HTMLLIAccessible*>(this) : nullptr;
}
#endif

View File

@ -114,7 +114,7 @@ HTMLSelectListAccessible::CurrentItem()
return document->GetAccessible(activeOptionNode);
}
}
return nsnull;
return nullptr;
}
void
@ -358,7 +358,7 @@ HTMLSelectOptionAccessible::SetSelected(bool aSelect)
Accessible*
HTMLSelectOptionAccessible::ContainerWidget() const
{
return mParent && mParent->IsListControl() ? mParent : nsnull;
return mParent && mParent->IsListControl() ? mParent : nullptr;
}
////////////////////////////////////////////////////////////////////////////////
@ -464,7 +464,7 @@ HTMLComboboxAccessible::CacheChildren()
new HTMLComboboxListAccessible(mParent, mContent, mDoc);
// Initialize and put into cache.
if (!Document()->BindToDocument(mListAccessible, nsnull))
if (!Document()->BindToDocument(mListAccessible, nullptr))
return;
}
@ -482,7 +482,7 @@ HTMLComboboxAccessible::Shutdown()
if (mListAccessible) {
mListAccessible->Shutdown();
mListAccessible = nsnull;
mListAccessible = nullptr;
}
}
@ -601,7 +601,7 @@ HTMLComboboxAccessible::AreItemsOperable() const
Accessible*
HTMLComboboxAccessible::CurrentItem()
{
return AreItemsOperable() ? mListAccessible->CurrentItem() : nsnull;
return AreItemsOperable() ? mListAccessible->CurrentItem() : nullptr;
}
void
@ -620,7 +620,7 @@ HTMLComboboxAccessible::SelectedOption() const
nsIFrame* frame = GetFrame();
nsIComboboxControlFrame* comboboxFrame = do_QueryFrame(frame);
if (!comboboxFrame)
return nsnull;
return nullptr;
nsIListControlFrame* listControlFrame =
do_QueryFrame(comboboxFrame->GetDropDown());
@ -633,7 +633,7 @@ HTMLComboboxAccessible::SelectedOption() const
}
}
return nsnull;
return nullptr;
}
@ -663,7 +663,7 @@ HTMLComboboxListAccessible::GetFrame() const
}
}
return nsnull;
return nullptr;
}
bool
@ -705,7 +705,7 @@ HTMLComboboxListAccessible::NativeState()
void
HTMLComboboxListAccessible::GetBoundsRect(nsRect& aBounds, nsIFrame** aBoundingFrame)
{
*aBoundingFrame = nsnull;
*aBoundingFrame = nullptr;
Accessible* comboAcc = Parent();
if (!comboAcc)
@ -723,7 +723,7 @@ HTMLComboboxListAccessible::GetBoundsRect(nsRect& aBounds, nsIFrame** aBoundingF
}
nsIFrame* frame = content->GetPrimaryFrame();
if (!frame) {
*aBoundingFrame = nsnull;
*aBoundingFrame = nullptr;
return;
}

View File

@ -113,7 +113,7 @@ private:
return combobox && combobox->IsCombobox() ? combobox : mParent.get();
}
return nsnull;
return nullptr;
}
/**
@ -123,10 +123,10 @@ private:
{
if (mParent && mParent->IsListControl()) {
Accessible* combobox = mParent->Parent();
return combobox && combobox->IsCombobox() ? combobox : nsnull;
return combobox && combobox->IsCombobox() ? combobox : nullptr;
}
return nsnull;
return nullptr;
}
};

View File

@ -62,7 +62,7 @@ NS_IMPL_ISUPPORTS_INHERITED1(HTMLTableCellAccessible,
void
HTMLTableCellAccessible::Shutdown()
{
mTableCell = nsnull;
mTableCell = nullptr;
HyperTextAccessibleWrap::Shutdown();
}
@ -153,7 +153,7 @@ NS_IMETHODIMP
HTMLTableCellAccessible::GetTable(nsIAccessibleTable** aTable)
{
NS_ENSURE_ARG_POINTER(aTable);
*aTable = nsnull;
*aTable = nullptr;
if (IsDefunct())
return NS_OK;
@ -228,7 +228,7 @@ NS_IMETHODIMP
HTMLTableCellAccessible::GetColumnHeaderCells(nsIArray** aHeaderCells)
{
NS_ENSURE_ARG_POINTER(aHeaderCells);
*aHeaderCells = nsnull;
*aHeaderCells = nullptr;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -240,7 +240,7 @@ NS_IMETHODIMP
HTMLTableCellAccessible::GetRowHeaderCells(nsIArray** aHeaderCells)
{
NS_ENSURE_ARG_POINTER(aHeaderCells);
*aHeaderCells = nsnull;
*aHeaderCells = nullptr;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -276,13 +276,13 @@ HTMLTableCellAccessible::GetTableAccessible()
while ((parent = parent->Parent())) {
roles::Role role = parent->Role();
if (role == roles::TABLE || role == roles::TREE_TABLE) {
nsIAccessibleTable* tableAcc = nsnull;
nsIAccessibleTable* tableAcc = nullptr;
CallQueryInterface(parent, &tableAcc);
return tableAcc;
}
}
return nsnull;
return nullptr;
}
nsITableCellLayout*
@ -291,7 +291,7 @@ HTMLTableCellAccessible::GetCellLayout()
nsIFrame *frame = mContent->GetPrimaryFrame();
NS_ASSERTION(frame, "The frame cannot be obtaied for HTML table cell.");
if (!frame)
return nsnull;
return nullptr;
nsITableCellLayout *cellLayout = do_QueryFrame(frame);
return cellLayout;
@ -365,7 +365,7 @@ HTMLTableHeaderCellAccessible::NativeRole()
{
// Check value of @scope attribute.
static nsIContent::AttrValuesArray scopeValues[] =
{&nsGkAtoms::col, &nsGkAtoms::row, nsnull};
{&nsGkAtoms::col, &nsGkAtoms::row, nullptr};
PRInt32 valueIdx =
mContent->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::scope,
scopeValues, eCaseMatters);
@ -428,7 +428,7 @@ NS_IMPL_ISUPPORTS_INHERITED1(HTMLTableAccessible, Accessible,
void
HTMLTableAccessible::Shutdown()
{
mTable = nsnull;
mTable = nullptr;
AccessibleWrap::Shutdown();
}
@ -445,7 +445,7 @@ HTMLTableAccessible::CacheChildren()
// visible.
nsAccTreeWalker walker(mDoc, mContent, CanHaveAnonChildren());
Accessible* child = nsnull;
Accessible* child = nullptr;
while ((child = walker.NextChild())) {
if (child->Role() == roles::CAPTION) {
InsertChildAt(0, child);
@ -525,8 +525,8 @@ HTMLTableAccessible::RelationByType(PRUint32 aType)
Accessible*
HTMLTableAccessible::Caption()
{
Accessible* child = mChildren.SafeElementAt(0, nsnull);
return child && child->Role() == roles::CAPTION ? child : nsnull;
Accessible* child = mChildren.SafeElementAt(0, nullptr);
return child && child->Role() == roles::CAPTION ? child : nullptr;
}
void
@ -705,17 +705,17 @@ HTMLTableAccessible::CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex)
nsCOMPtr<nsIDOMElement> cellElement;
GetCellAt(aRowIndex, aColumnIndex, *getter_AddRefs(cellElement));
if (!cellElement)
return nsnull;
return nullptr;
nsCOMPtr<nsIContent> cellContent(do_QueryInterface(cellElement));
if (!cellContent)
return nsnull;
return nullptr;
Accessible* cell = mDoc->GetAccessible(cellContent);
// XXX bug 576838: crazy tables (like table6 in tables/test_table2.html) may
// return itself as a cell what makes Orca hang.
return cell == this ? nsnull : cell;
return cell == this ? nullptr : cell;
}
PRInt32
@ -978,7 +978,7 @@ HTMLTableAccessible::GetTableLayout()
{
nsIFrame *frame = mContent->GetPrimaryFrame();
if (!frame)
return nsnull;
return nullptr;
nsITableLayout *tableLayout = do_QueryFrame(frame);
return tableLayout;

View File

@ -684,7 +684,7 @@ GetClosestInterestingAccessible(id anObject)
[self invalidateChildren];
mGeckoAccessible = nsnull;
mGeckoAccessible = nullptr;
NS_OBJC_END_TRY_ABORT_BLOCK;
}

View File

@ -344,9 +344,9 @@ enum CheckboxValue {
return nil;
nsDeckFrame* deckFrame = do_QueryFrame(mGeckoAccessible->GetFrame());
nsIFrame* selectedFrame = deckFrame ? deckFrame->GetSelectedBox() : nsnull;
nsIFrame* selectedFrame = deckFrame ? deckFrame->GetSelectedBox() : nullptr;
Accessible* selectedAcc = nsnull;
Accessible* selectedAcc = nullptr;
if (selectedFrame) {
nsINode* node = selectedFrame->GetContent();
selectedAcc = mGeckoAccessible->Document()->GetAccessible(node);

View File

@ -318,7 +318,7 @@ ToNSString(id aValue)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
mGeckoTextAccessible = nsnull;
mGeckoTextAccessible = nullptr;
NS_IF_RELEASE(mGeckoEditableTextAccessible);
[super expire];

View File

@ -465,7 +465,7 @@ __try {
// CHECKABLE -> MARQUEED
PRUint32 msaaState = 0;
nsAccUtils::To32States(xpAccessible->State(), &msaaState, nsnull);
nsAccUtils::To32States(xpAccessible->State(), &msaaState, nullptr);
pvarState->lVal = msaaState;
} __except(FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
return S_OK;
@ -871,7 +871,7 @@ __try {
VariantInit(pvarEndUpAt);
Accessible* navAccessible = nsnull;
Accessible* navAccessible = nullptr;
PRUint32 xpRelation = 0;
switch(navDir) {
@ -1620,7 +1620,7 @@ AccessibleWrap::GetHWNDFor(Accessible* aAccessible)
if (aAccessible) {
DocAccessible* document = aAccessible->Document();
if(!document)
return nsnull;
return nullptr;
// Popup lives in own windows, use its HWND until the popup window is
// hidden to make old JAWS versions work with collapsed comboboxes (see
@ -1645,7 +1645,7 @@ AccessibleWrap::GetHWNDFor(Accessible* aAccessible)
return static_cast<HWND>(document->GetNativeWindow());
}
return nsnull;
return nullptr;
}
HRESULT
@ -1719,7 +1719,7 @@ AccessibleWrap::NativeAccessible(nsIAccessible* aAccessible)
return NULL;
}
IAccessible* msaaAccessible = nsnull;
IAccessible* msaaAccessible = nullptr;
aAccessible->GetNativeInterface(reinterpret_cast<void**>(&msaaAccessible));
return static_cast<IDispatch*>(msaaAccessible);
}
@ -1728,14 +1728,14 @@ Accessible*
AccessibleWrap::GetXPAccessibleFor(const VARIANT& aVarChild)
{
if (aVarChild.vt != VT_I4)
return nsnull;
return nullptr;
// if its us real easy - this seems to always be the case
if (aVarChild.lVal == CHILDID_SELF)
return this;
if (nsAccUtils::MustPrune(this))
return nsnull;
return nullptr;
// If lVal negative then it is treated as child ID and we should look for
// accessible through whole accessible subtree including subdocuments.
@ -1757,7 +1757,7 @@ AccessibleWrap::GetXPAccessibleFor(const VARIANT& aVarChild)
// Check whether the accessible for the given ID is a child of ARIA
// document.
Accessible* parent = child ? child->Parent() : nsnull;
Accessible* parent = child ? child->Parent() : nullptr;
while (parent && parent != document) {
if (parent == this)
return child;
@ -1766,7 +1766,7 @@ AccessibleWrap::GetXPAccessibleFor(const VARIANT& aVarChild)
}
}
return nsnull;
return nullptr;
}
// Gecko child indices are 0-based in contrast to indices used in MSAA.

View File

@ -25,7 +25,7 @@ NS_IMETHODIMP
ApplicationAccessibleWrap::GetAttributes(nsIPersistentProperties** aAttributes)
{
NS_ENSURE_ARG_POINTER(aAttributes);
*aAttributes = nsnull;
*aAttributes = nullptr;
nsCOMPtr<nsIPersistentProperties> attributes =
do_CreateInstance(NS_PERSISTENTPROPERTIES_CONTRACTID);

View File

@ -751,7 +751,7 @@ CAccessibleTable::GetSelectedItems(long **aItems, long *aItemsCount,
return E_FAIL;
PRUint32 size = 0;
PRInt32 *items = nsnull;
PRInt32 *items = nullptr;
nsresult rv = NS_OK;
switch (aType) {

View File

@ -228,7 +228,7 @@ DocAccessibleWrap::Shutdown()
::DestroyWindow(static_cast<HWND>(mHWND));
}
mHWND = nsnull;
mHWND = nullptr;
}
DocAccessible::Shutdown();

View File

@ -43,7 +43,7 @@ TextLeafAccessibleWrap::Release()
STDMETHODIMP
TextLeafAccessibleWrap::QueryInterface(REFIID iid, void** ppv)
{
*ppv = nsnull;
*ppv = nullptr;
if (IID_IUnknown == iid) {
*ppv = static_cast<ISimpleDOMText*>(this);
@ -177,11 +177,11 @@ TextLeafAccessibleWrap::GetPointFromOffset(nsIFrame* aContainingFrame,
bool aPreferNext,
nsPoint& aOutPoint)
{
nsIFrame *textFrame = nsnull;
nsIFrame *textFrame = nullptr;
PRInt32 outOffset;
aContainingFrame->GetChildFrameContainingOffset(aOffset, aPreferNext, &outOffset, &textFrame);
if (!textFrame) {
return nsnull;
return nullptr;
}
textFrame->GetPointFromOffset(aOffset, &aOutPoint);

View File

@ -19,7 +19,7 @@ using namespace mozilla::a11y;
ia2AccessibleRelation::ia2AccessibleRelation(PRUint32 aType, Relation* aRel) :
mType(aType), mReferences(0)
{
Accessible* target = nsnull;
Accessible* target = nullptr;
while ((target = aRel->Next()))
mTargets.AppendElement(target);
}

View File

@ -28,7 +28,7 @@
using namespace mozilla;
using namespace mozilla::a11y;
AccTextChangeEvent* nsAccessNodeWrap::gTextEvent = nsnull;
AccTextChangeEvent* nsAccessNodeWrap::gTextEvent = nullptr;
////////////////////////////////////////////////////////////////////////////////
// nsAccessNodeWrap
@ -66,7 +66,7 @@ nsAccessNodeWrap::QueryNativeInterface(REFIID aIID, void** aInstancePtr)
STDMETHODIMP nsAccessNodeWrap::QueryInterface(REFIID iid, void** ppv)
{
*ppv = nsnull;
*ppv = nullptr;
if (IID_IUnknown == iid) {
*ppv = static_cast<ISimpleDOMNode*>(this);
@ -84,7 +84,7 @@ STDMETHODIMP nsAccessNodeWrap::QueryInterface(REFIID iid, void** ppv)
STDMETHODIMP
nsAccessNodeWrap::QueryService(REFGUID guidService, REFIID iid, void** ppv)
{
*ppv = nsnull;
*ppv = nullptr;
// Provide a special service ID for getting the accessible for the browser tab
// document that contains this accessible object. If this accessible object
@ -175,8 +175,8 @@ STDMETHODIMP nsAccessNodeWrap::get_nodeInfo(
/* [out] */ unsigned short __RPC_FAR *aNodeType)
{
__try{
*aNodeName = nsnull;
*aNodeValue = nsnull;
*aNodeName = nullptr;
*aNodeValue = nullptr;
nsINode* node = GetNode();
if (!node)
@ -235,7 +235,7 @@ __try{
*aNumAttribs = static_cast<unsigned short>(numAttribs);
for (PRUint32 index = 0; index < numAttribs; index++) {
aNameSpaceIDs[index] = 0; aAttribValues[index] = aAttribNames[index] = nsnull;
aNameSpaceIDs[index] = 0; aAttribValues[index] = aAttribNames[index] = nullptr;
nsAutoString attributeValue;
const nsAttrName* name = mContent->GetAttrNameAt(index);
@ -267,7 +267,7 @@ __try {
PRInt32 index;
for (index = 0; index < aNumAttribs; index++) {
aAttribValues[index] = nsnull;
aAttribValues[index] = nullptr;
if (aAttribNames[index]) {
nsAutoString attributeValue, nameSpaceURI;
nsAutoString attributeName(nsDependentString(static_cast<PRUnichar*>(aAttribNames[index])));
@ -378,7 +378,7 @@ nsAccessNodeWrap::MakeAccessNode(nsINode *aNode)
ISimpleDOMNode *iNode = NULL;
Accessible* acc = mDoc->GetAccessible(aNode);
if (acc) {
IAccessible *msaaAccessible = nsnull;
IAccessible *msaaAccessible = nullptr;
acc->GetNativeInterface((void**)&msaaAccessible); // addrefs
msaaAccessible->QueryInterface(IID_ISimpleDOMNode, (void**)&iNode); // addrefs
msaaAccessible->Release(); // Release IAccessible
@ -477,7 +477,7 @@ nsAccessNodeWrap::get_childAt(unsigned aChildIndex,
ISimpleDOMNode __RPC_FAR *__RPC_FAR *aNode)
{
__try {
*aNode = nsnull;
*aNode = nullptr;
nsINode* node = GetNode();
if (!node)
@ -494,7 +494,7 @@ STDMETHODIMP
nsAccessNodeWrap::get_innerHTML(BSTR __RPC_FAR *aInnerHTML)
{
__try {
*aInnerHTML = nsnull;
*aInnerHTML = nullptr;
nsCOMPtr<nsIDOMHTMLElement> htmlElement = do_QueryInterface(GetNode());
if (!htmlElement)

View File

@ -30,7 +30,7 @@ void
nsHTMLWin32ObjectOwnerAccessible::Shutdown()
{
AccessibleWrap::Shutdown();
mNativeAccessible = nsnull;
mNativeAccessible = nullptr;
}
////////////////////////////////////////////////////////////////////////////////
@ -66,7 +66,7 @@ nsHTMLWin32ObjectOwnerAccessible::CacheChildren()
////////////////////////////////////////////////////////////////////////////////
nsHTMLWin32ObjectAccessible::nsHTMLWin32ObjectAccessible(void* aHwnd) :
LeafAccessible(nsnull, nsnull)
LeafAccessible(nullptr, nullptr)
{
// XXX: Mark it as defunct to make sure no single Accessible method is
// running on it. We need to allow accessible without DOM nodes.

View File

@ -29,13 +29,13 @@ nsWinUtils::GetComputedStyleDeclaration(nsIContent* aContent)
{
nsIContent* elm = nsCoreUtils::GetDOMElementFor(aContent);
if (!elm)
return nsnull;
return nullptr;
// Returns number of items in style declaration
nsCOMPtr<nsIDOMWindow> window =
do_QueryInterface(elm->OwnerDoc()->GetWindow());
if (!window)
return nsnull;
return nullptr;
nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl;
nsCOMPtr<nsIDOMElement> domElement(do_QueryInterface(elm));

View File

@ -29,7 +29,7 @@ using namespace mozilla::a11y;
// nsXFormsAccessibleBase
////////////////////////////////////////////////////////////////////////////////
nsIXFormsUtilityService *nsXFormsAccessibleBase::sXFormsService = nsnull;
nsIXFormsUtilityService *nsXFormsAccessibleBase::sXFormsService = nullptr;
nsXFormsAccessibleBase::nsXFormsAccessibleBase()
{
@ -271,7 +271,7 @@ nsXFormsEditableAccessible::GetEditor() const
nsXFormsSelectableAccessible::
nsXFormsSelectableAccessible(nsIContent* aContent, DocAccessible* aDoc) :
nsXFormsEditableAccessible(aContent, aDoc), mIsSelect1Element(nsnull)
nsXFormsEditableAccessible(aContent, aDoc), mIsSelect1Element(nullptr)
{
mIsSelect1Element =
mContent->NodeInfo()->Equals(nsGkAtoms::select1);
@ -289,7 +289,7 @@ nsXFormsSelectableAccessible::SelectedItems()
nsCOMPtr<nsIMutableArray> selectedItems =
do_CreateInstance(NS_ARRAY_CONTRACTID);
if (!selectedItems)
return nsnull;
return nullptr;
nsresult rv;
nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
@ -299,14 +299,14 @@ nsXFormsSelectableAccessible::SelectedItems()
rv = sXFormsService->GetSelectedItemForSelect1(DOMNode,
getter_AddRefs(itemDOMNode));
if (NS_FAILED(rv) || !itemDOMNode || !mDoc)
return nsnull;
return nullptr;
nsCOMPtr<nsINode> itemNode(do_QueryInterface(itemDOMNode));
nsIAccessible* item = mDoc->GetAccessible(itemNode);
if (item)
selectedItems->AppendElement(item, false);
nsIMutableArray* items = nsnull;
nsIMutableArray* items = nullptr;
selectedItems.forget(&items);
return items;
}
@ -315,7 +315,7 @@ nsXFormsSelectableAccessible::SelectedItems()
rv = sXFormsService->GetSelectedItemsForSelect(DOMNode,
getter_AddRefs(itemNodeList));
if (NS_FAILED(rv) || !itemNodeList || !mDoc)
return nsnull;
return nullptr;
PRUint32 length = 0;
itemNodeList->GetLength(&length);
@ -324,7 +324,7 @@ nsXFormsSelectableAccessible::SelectedItems()
nsCOMPtr<nsIDOMNode> itemDOMNode;
itemNodeList->Item(index, getter_AddRefs(itemDOMNode));
if (!itemDOMNode)
return nsnull;
return nullptr;
nsCOMPtr<nsINode> itemNode(do_QueryInterface(itemDOMNode));
nsIAccessible* item = mDoc->GetAccessible(itemNode);
@ -332,7 +332,7 @@ nsXFormsSelectableAccessible::SelectedItems()
selectedItems->AppendElement(item, false);
}
nsIMutableArray* items = nsnull;
nsIMutableArray* items = nullptr;
selectedItems.forget(&items);
return items;
}
@ -390,7 +390,7 @@ nsXFormsSelectableAccessible::RemoveItemFromSelection(PRUint32 aIndex)
sXFormsService->GetSelectedItemForSelect1(DOMNode,
getter_AddRefs(selItemDOMNode));
if (selItemDOMNode == itemDOMNode)
sXFormsService->SetSelectedItemForSelect1(DOMNode, nsnull);
sXFormsService->SetSelectedItemForSelect1(DOMNode, nullptr);
return true;
}
@ -403,13 +403,13 @@ Accessible*
nsXFormsSelectableAccessible::GetSelectedItem(PRUint32 aIndex)
{
if (!mDoc)
return nsnull;
return nullptr;
nsresult rv;
nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
if (mIsSelect1Element) {
if (aIndex != 0)
return nsnull;
return nullptr;
nsCOMPtr<nsIDOMNode> itemDOMNode;
rv = sXFormsService->GetSelectedItemForSelect1(DOMNode,
@ -418,14 +418,14 @@ nsXFormsSelectableAccessible::GetSelectedItem(PRUint32 aIndex)
nsCOMPtr<nsINode> itemNode(do_QueryInterface(itemDOMNode));
return mDoc->GetAccessible(itemNode);
}
return nsnull;
return nullptr;
}
nsCOMPtr<nsIDOMNodeList> itemNodeList;
rv = sXFormsService->GetSelectedItemsForSelect(DOMNode,
getter_AddRefs(itemNodeList));
if (NS_FAILED(rv) || !itemNodeList)
return nsnull;
return nullptr;
nsCOMPtr<nsIDOMNode> itemDOMNode;
itemNodeList->Item(aIndex, getter_AddRefs(itemDOMNode));
@ -459,7 +459,7 @@ nsXFormsSelectableAccessible::UnselectAll()
{
nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
if (mIsSelect1Element)
sXFormsService->SetSelectedItemForSelect1(DOMNode, nsnull);
sXFormsService->SetSelectedItemForSelect1(DOMNode, nullptr);
sXFormsService->ClearSelectionForSelect(DOMNode);
return true;
@ -500,7 +500,7 @@ nsXFormsSelectableAccessible::GetItemByIndex(PRUint32* aIndex,
}
}
return nsnull;
return nullptr;
}

View File

@ -71,7 +71,7 @@ protected:
// are hidden and therefore aren't accessible.
//
// @param aContainerNode - node that contains item elements
void CacheSelectChildren(nsIDOMNode *aContainerNode = nsnull);
void CacheSelectChildren(nsIDOMNode *aContainerNode = nullptr);
};
@ -140,7 +140,7 @@ public:
protected:
nsIContent* GetItemByIndex(PRUint32* aIndex,
Accessible* aAccessible = nsnull);
Accessible* aAccessible = nullptr);
bool mIsSelect1Element;
};

View File

@ -31,7 +31,7 @@ NS_IMETHODIMP
nsAccEvent::GetAccessible(nsIAccessible** aAccessible)
{
NS_ENSURE_ARG_POINTER(aAccessible);
*aAccessible = nsnull;
*aAccessible = nullptr;
NS_IF_ADDREF(*aAccessible = mEvent->GetAccessible());
return NS_OK;
@ -41,7 +41,7 @@ NS_IMETHODIMP
nsAccEvent::GetDOMNode(nsIDOMNode** aDOMNode)
{
NS_ENSURE_ARG_POINTER(aDOMNode);
*aDOMNode = nsnull;
*aDOMNode = nullptr;
nsINode* node = mEvent->GetNode();
if (node)

View File

@ -18,7 +18,7 @@ nsAccessibleRelation::nsAccessibleRelation(PRUint32 aType,
mType(aType)
{
mTargets = do_CreateInstance(NS_ARRAY_CONTRACTID);
nsIAccessible* targetAcc = nsnull;
nsIAccessible* targetAcc = nullptr;
while ((targetAcc = aRel->Next()))
mTargets->AppendElement(targetAcc, false);
}

View File

@ -18,7 +18,7 @@ nsresult
xpcAccessibleTable::GetCaption(nsIAccessible** aCaption)
{
NS_ENSURE_ARG_POINTER(aCaption);
*aCaption = nsnull;
*aCaption = nullptr;
if (!mTable)
return NS_ERROR_FAILURE;
@ -57,7 +57,7 @@ xpcAccessibleTable::GetCellAt(PRInt32 aRowIdx, PRInt32 aColIdx,
nsIAccessible** aCell)
{
NS_ENSURE_ARG_POINTER(aCell);
*aCell = nsnull;
*aCell = nullptr;
if (!mTable)
return NS_ERROR_FAILURE;
@ -250,7 +250,7 @@ nsresult
xpcAccessibleTable::GetSelectedCells(nsIArray** aSelectedCells)
{
NS_ENSURE_ARG_POINTER(aSelectedCells);
*aSelectedCells = nsnull;
*aSelectedCells = nullptr;
if (!mTable)
return NS_ERROR_FAILURE;

View File

@ -58,5 +58,5 @@ XULAlertAccessible::ContainerWidget() const
// If a part of colorpicker widget.
if (mParent && mParent->IsMenuButton())
return mParent;
return nsnull;
return nullptr;
}

View File

@ -77,7 +77,7 @@ XULColorPickerTileAccessible::ContainerWidget() const
if (grandParent && grandParent->IsMenuButton())
return grandParent;
}
return nsnull;
return nullptr;
}
////////////////////////////////////////////////////////////////////////////////
@ -125,7 +125,7 @@ XULColorPickerAccessible::IsActiveWidget() const
bool
XULColorPickerAccessible::AreItemsOperable() const
{
Accessible* menuPopup = mChildren.SafeElementAt(0, nsnull);
Accessible* menuPopup = mChildren.SafeElementAt(0, nullptr);
if (menuPopup) {
nsMenuPopupFrame* menuPopupFrame = do_QueryFrame(menuPopup->GetFrame());
return menuPopupFrame && menuPopupFrame->IsOpen();
@ -143,7 +143,7 @@ XULColorPickerAccessible::CacheChildren()
nsAccTreeWalker walker(mDoc, mContent, true);
Accessible* child = nsnull;
Accessible* child = nullptr;
while ((child = walker.NextChild())) {
PRUint32 role = child->Role();

View File

@ -210,7 +210,7 @@ already_AddRefed<nsIURI>
XULLinkAccessible::AnchorURIAt(PRUint32 aAnchorIndex)
{
if (aAnchorIndex != 0)
return nsnull;
return nullptr;
nsAutoString href;
mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::href, href);
@ -218,7 +218,7 @@ XULLinkAccessible::AnchorURIAt(PRUint32 aAnchorIndex)
nsCOMPtr<nsIURI> baseURI = mContent->GetBaseURI();
nsIDocument* document = mContent->OwnerDoc();
nsIURI* anchorURI = nsnull;
nsIURI* anchorURI = nullptr;
NS_NewURI(&anchorURI, href,
document->GetDocumentCharacterSet().get(),
baseURI);

View File

@ -143,7 +143,7 @@ bool
XULButtonAccessible::AreItemsOperable() const
{
if (IsMenuButton()) {
Accessible* menuPopup = mChildren.SafeElementAt(0, nsnull);
Accessible* menuPopup = mChildren.SafeElementAt(0, nullptr);
if (menuPopup) {
nsMenuPopupFrame* menuPopupFrame = do_QueryFrame(menuPopup->GetFrame());
return menuPopupFrame->IsOpen();
@ -157,7 +157,7 @@ XULButtonAccessible::ContainerWidget() const
{
if (IsMenuButton() && mParent && mParent->IsAutoComplete())
return mParent;
return nsnull;
return nullptr;
}
////////////////////////////////////////////////////////////////////////////////
@ -186,12 +186,12 @@ XULButtonAccessible::CacheChildren()
if (!isMenu && !isMenuButton)
return;
Accessible* menupopup = nsnull;
Accessible* button = nsnull;
Accessible* menupopup = nullptr;
Accessible* button = nullptr;
nsAccTreeWalker walker(mDoc, mContent, true);
Accessible* child = nsnull;
Accessible* child = nullptr;
while ((child = walker.NextChild())) {
roles::Role role = child->Role();
@ -226,7 +226,7 @@ bool
XULButtonAccessible::ContainsMenu()
{
static nsIContent::AttrValuesArray strings[] =
{&nsGkAtoms::menu, &nsGkAtoms::menuButton, nsnull};
{&nsGkAtoms::menu, &nsGkAtoms::menuButton, nullptr};
return mContent->FindAttrValueIn(kNameSpaceID_None,
nsGkAtoms::type,
@ -443,7 +443,7 @@ XULGroupboxAccessible::RelationByType(PRUint32 aType)
// Ensure that it's our label
Relation reverseRel =
childAcc->RelationByType(nsIAccessibleRelation::RELATION_LABEL_FOR);
Accessible* testGroupbox = nsnull;
Accessible* testGroupbox = nullptr;
while ((testGroupbox = reverseRel.Next()))
if (testGroupbox == this) {
// The <label> points back to this groupbox
@ -811,7 +811,7 @@ XULTextFieldAccessible::GetEditor() const
nsCOMPtr<nsIContent> inputField = GetInputField();
nsCOMPtr<nsIDOMNSEditableElement> editableElt(do_QueryInterface(inputField));
if (!editableElt)
return nsnull;
return nullptr;
nsCOMPtr<nsIEditor> editor;
editableElt->GetEditor(getter_AddRefs(editor));
@ -833,7 +833,7 @@ XULTextFieldAccessible::CacheChildren()
nsAccTreeWalker walker(mDoc, inputContent, false);
Accessible* child = nsnull;
Accessible* child = nullptr;
while ((child = walker.NextChild()) && AppendChild(child));
}
@ -845,7 +845,7 @@ XULTextFieldAccessible::FrameSelection()
{
nsCOMPtr<nsIContent> inputContent(GetInputField());
nsIFrame* frame = inputContent->GetPrimaryFrame();
return frame ? frame->GetFrameSelection() : nsnull;
return frame ? frame->GetFrameSelection() : nullptr;
}
////////////////////////////////////////////////////////////////////////////////
@ -868,7 +868,7 @@ XULTextFieldAccessible::GetInputField() const
NS_ASSERTION(inputFieldDOMNode, "No input field for XULTextFieldAccessible");
nsIContent* inputField = nsnull;
nsIContent* inputField = nullptr;
if (inputFieldDOMNode)
CallQueryInterface(inputFieldDOMNode, &inputField);

View File

@ -136,7 +136,7 @@ XULListboxAccessible::QueryInterface(REFNSIID aIID, void** aInstancePtr)
void
XULListboxAccessible::Shutdown()
{
mTable = nsnull;
mTable = nullptr;
XULSelectControlAccessible::Shutdown();
}
@ -209,7 +209,7 @@ XULListboxAccessible::NativeRole()
PRUint32
XULListboxAccessible::ColCount()
{
nsIContent* headContent = nsnull;
nsIContent* headContent = nullptr;
for (nsIContent* childContent = mContent->GetFirstChild(); childContent;
childContent = childContent->GetNextSibling()) {
if (childContent->NodeInfo()->Equals(nsGkAtoms::listcols,
@ -249,19 +249,19 @@ XULListboxAccessible::CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex)
{
nsCOMPtr<nsIDOMXULSelectControlElement> control =
do_QueryInterface(mContent);
NS_ENSURE_TRUE(control, nsnull);
NS_ENSURE_TRUE(control, nullptr);
nsCOMPtr<nsIDOMXULSelectControlItemElement> item;
control->GetItemAtIndex(aRowIndex, getter_AddRefs(item));
if (!item)
return nsnull;
return nullptr;
nsCOMPtr<nsIContent> itemContent(do_QueryInterface(item));
if (!itemContent)
return nsnull;
return nullptr;
Accessible* row = mDoc->GetAccessible(itemContent);
NS_ENSURE_TRUE(row, nsnull);
NS_ENSURE_TRUE(row, nullptr);
return row->GetChildAt(aColumnIndex);
}
@ -560,12 +560,12 @@ XULListboxAccessible::ContainerWidget() const
if (inputNode) {
Accessible* input =
mDoc->GetAccessible(inputNode);
return input ? input->ContainerWidget() : nsnull;
return input ? input->ContainerWidget() : nullptr;
}
}
}
}
return nsnull;
return nullptr;
}
////////////////////////////////////////////////////////////////////////////////
@ -588,19 +588,19 @@ Accessible*
XULListitemAccessible::GetListAccessible()
{
if (IsDefunct())
return nsnull;
return nullptr;
nsCOMPtr<nsIDOMXULSelectControlItemElement> listItem =
do_QueryInterface(mContent);
if (!listItem)
return nsnull;
return nullptr;
nsCOMPtr<nsIDOMXULSelectControlElement> list;
listItem->GetControl(getter_AddRefs(list));
nsCOMPtr<nsIContent> listContent(do_QueryInterface(list));
if (!listContent)
return nsnull;
return nullptr;
return mDoc->GetAccessible(listContent);
}
@ -745,7 +745,7 @@ NS_IMETHODIMP
XULListCellAccessible::GetTable(nsIAccessibleTable** aTable)
{
NS_ENSURE_ARG_POINTER(aTable);
*aTable = nsnull;
*aTable = nullptr;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -848,7 +848,7 @@ NS_IMETHODIMP
XULListCellAccessible::GetColumnHeaderCells(nsIArray** aHeaderCells)
{
NS_ENSURE_ARG_POINTER(aHeaderCells);
*aHeaderCells = nsnull;
*aHeaderCells = nullptr;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -858,7 +858,7 @@ XULListCellAccessible::GetColumnHeaderCells(nsIArray** aHeaderCells)
NS_ENSURE_STATE(table); // we expect to be in a listbox (table)
// Get column header cell from XUL listhead.
Accessible* list = nsnull;
Accessible* list = nullptr;
nsRefPtr<Accessible> tableAcc(do_QueryObject(table));
PRUint32 tableChildCount = tableAcc->ChildCount();
@ -897,7 +897,7 @@ NS_IMETHODIMP
XULListCellAccessible::GetRowHeaderCells(nsIArray** aHeaderCells)
{
NS_ENSURE_ARG_POINTER(aHeaderCells);
*aHeaderCells = nsnull;
*aHeaderCells = nullptr;
if (IsDefunct())
return NS_ERROR_FAILURE;
@ -937,7 +937,7 @@ XULListCellAccessible::IsSelected(bool* aIsSelected)
void
XULListCellAccessible::Shutdown()
{
mTableCell = nsnull;
mTableCell = nullptr;
HyperTextAccessibleWrap::Shutdown();
}

View File

@ -60,7 +60,7 @@ XULMenuitemAccessible::NativeState()
// Checkable/checked?
static nsIContent::AttrValuesArray strings[] =
{ &nsGkAtoms::radio, &nsGkAtoms::checkbox, nsnull };
{ &nsGkAtoms::radio, &nsGkAtoms::checkbox, nullptr };
if (mContent->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::type, strings,
eCaseMatters) >= 0) {
@ -374,7 +374,7 @@ XULMenuitemAccessible::ContainerWidget() const
// shouldn't be a real case.
}
}
return nsnull;
return nullptr;
}
@ -536,11 +536,11 @@ XULMenupopupAccessible::ContainerWidget() const
Accessible* menuPopup =
document->GetAccessible(menuPopupFrame->GetContent());
if (!menuPopup) // shouldn't be a real case
return nsnull;
return nullptr;
nsMenuFrame* menuFrame = menuPopupFrame->GetParentMenu();
if (!menuFrame) // context menu or popups
return nsnull;
return nullptr;
nsMenuParent* menuParent = menuFrame->GetMenuParent();
if (!menuParent) // menulist or menubutton
@ -553,13 +553,13 @@ XULMenupopupAccessible::ContainerWidget() const
// different kind of popups like panel or tooltip
if (!menuParent->IsMenu())
return nsnull;
return nullptr;
menuPopupFrame = static_cast<nsMenuPopupFrame*>(menuParent);
}
NS_NOTREACHED("Shouldn't be a real case.");
return nsnull;
return nullptr;
}
////////////////////////////////////////////////////////////////////////////////
@ -612,7 +612,7 @@ XULMenubarAccessible::CurrentItem()
return mDoc->GetAccessible(menuItemNode);
}
}
return nsnull;
return nullptr;
}
void

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