Skip to content
This repository has been archived by the owner on Oct 3, 2020. It is now read-only.

Commit

Permalink
Merge mozilla-central and tracemonkey.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Leary committed Jun 27, 2011
2 parents 0b5f6a5 + 037c30c commit 394c554
Show file tree
Hide file tree
Showing 2,120 changed files with 36,193 additions and 72,924 deletions.
17 changes: 13 additions & 4 deletions accessible/src/atk/nsAccessibleWrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,10 +450,9 @@ nsAccessibleWrap::CreateMaiInterfaces(void)
interfacesBits |= 1 << MAI_INTERFACE_IMAGE;
}

// HyperLinkAccessible
if (IsHyperLink()) {
interfacesBits |= 1 << MAI_INTERFACE_HYPERLINK_IMPL;
}
// HyperLinkAccessible
if (IsLink())
interfacesBits |= 1 << MAI_INTERFACE_HYPERLINK_IMPL;

if (!nsAccUtils::MustPrune(this)) { // These interfaces require children
//nsIAccessibleHypertext
Expand Down Expand Up @@ -1077,6 +1076,16 @@ nsAccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
}
} break;

case nsIAccessibleEvent::EVENT_NAME_CHANGE:
{
nsString newName;
accessible->GetName(newName);
NS_ConvertUTF16toUTF8 utf8Name(newName);
if (!utf8Name.Equals(atkObj->name))
atk_object_set_name(atkObj, utf8Name.get());

break;
}
case nsIAccessibleEvent::EVENT_VALUE_CHANGE:
{
MAI_LOG_DEBUG(("\n\nReceived: EVENT_VALUE_CHANGE\n"));
Expand Down
2 changes: 1 addition & 1 deletion accessible/src/atk/nsApplicationAccessibleWrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ nsApplicationAccessibleWrap::AppendChild(nsAccessible *aChild)
PRBool
nsApplicationAccessibleWrap::RemoveChild(nsAccessible* aChild)
{
PRInt32 index = aChild->GetIndexInParent();
PRInt32 index = aChild->IndexInParent();

AtkObject *atkAccessible = nsAccessibleWrap::GetAtkObject(aChild);
atk_object_set_parent(atkAccessible, NULL);
Expand Down
20 changes: 9 additions & 11 deletions accessible/src/atk/nsMaiHyperlink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,16 @@ MaiHyperlink::~MaiHyperlink()
}
}

AtkHyperlink *
AtkHyperlink*
MaiHyperlink::GetAtkHyperlink(void)
{
NS_ENSURE_TRUE(mHyperlink, nsnull);
NS_ENSURE_TRUE(mHyperlink, nsnull);

if (mMaiAtkHyperlink)
return mMaiAtkHyperlink;
if (mMaiAtkHyperlink)
return mMaiAtkHyperlink;

if (!mHyperlink->IsHyperLink())
return nsnull;
if (!mHyperlink->IsLink())
return nsnull;

mMaiAtkHyperlink =
reinterpret_cast<AtkHyperlink *>
Expand Down Expand Up @@ -215,9 +215,7 @@ getUriCB(AtkHyperlink *aLink, gint aLinkIndex)
nsAccessible* hyperlink = get_accessible_hyperlink(aLink);
NS_ENSURE_TRUE(hyperlink, nsnull);

MaiAtkHyperlink *maiAtkHyperlink = MAI_ATK_HYPERLINK(aLink);

nsCOMPtr<nsIURI> uri = hyperlink->GetAnchorURI(aLinkIndex);
nsCOMPtr<nsIURI> uri = hyperlink->AnchorURIAt(aLinkIndex);
if (!uri)
return nsnull;

Expand All @@ -234,7 +232,7 @@ getObjectCB(AtkHyperlink *aLink, gint aLinkIndex)
nsAccessible* hyperlink = get_accessible_hyperlink(aLink);
NS_ENSURE_TRUE(hyperlink, nsnull);

nsAccessible* anchor = hyperlink->GetAnchor(aLinkIndex);
nsAccessible* anchor = hyperlink->AnchorAt(aLinkIndex);
NS_ENSURE_TRUE(anchor, nsnull);

AtkObject *atkObj = nsAccessibleWrap::GetAtkObject(anchor);
Expand Down Expand Up @@ -266,7 +264,7 @@ isValidCB(AtkHyperlink *aLink)
nsAccessible* hyperlink = get_accessible_hyperlink(aLink);
NS_ENSURE_TRUE(hyperlink, FALSE);

return static_cast<gboolean>(hyperlink->IsValid());
return static_cast<gboolean>(hyperlink->IsLinkValid());
}

gint
Expand Down
5 changes: 2 additions & 3 deletions accessible/src/atk/nsMaiHyperlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ class MaiHyperlink

public:
AtkHyperlink *GetAtkHyperlink(void);
nsAccessible* GetAccHyperlink(void) {
return mHyperlink && mHyperlink->IsHyperLink() ? mHyperlink : nsnull;
}
nsAccessible* GetAccHyperlink()
{ return mHyperlink && mHyperlink->IsLink() ? mHyperlink : nsnull; }

protected:
nsAccessible* mHyperlink;
Expand Down
6 changes: 3 additions & 3 deletions accessible/src/atk/nsMaiInterfaceComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,16 @@ refAccessibleAtPointHelper(nsAccessibleWrap* aAccWrap, gint aX, gint aY,
if (!aAccWrap || aAccWrap->IsDefunct() || nsAccUtils::MustPrune(aAccWrap))
return nsnull;

// nsAccessible::GetChildAtPoint(x,y) is in screen pixels.
// nsAccessible::ChildAtPoint(x,y) is in screen pixels.
if (aCoordType == ATK_XY_WINDOW) {
nsIntPoint winCoords =
nsCoreUtils::GetScreenCoordsForWindow(aAccWrap->GetNode());
aX += winCoords.x;
aY += winCoords.y;
}

nsAccessible* accAtPoint = aAccWrap->GetChildAtPoint(aX, aY,
nsAccessible::eDirectChild);
nsAccessible* accAtPoint = aAccWrap->ChildAtPoint(aX, aY,
nsAccessible::eDirectChild);
if (!accAtPoint)
return nsnull;

Expand Down
17 changes: 8 additions & 9 deletions accessible/src/atk/nsMaiInterfaceHyperlinkImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,15 @@ hyperlinkImplInterfaceInitCB(AtkHyperlinkImplIface *aIface)
}

AtkHyperlink*
getHyperlinkCB(AtkHyperlinkImpl *aImpl)
getHyperlinkCB(AtkHyperlinkImpl* aImpl)
{
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aImpl));
if (!accWrap)
return nsnull;
nsAccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImpl));
if (!accWrap)
return nsnull;

NS_ENSURE_TRUE(accWrap->IsHyperLink(), nsnull);

MaiHyperlink *maiHyperlink = accWrap->GetMaiHyperlink();
NS_ENSURE_TRUE(maiHyperlink, nsnull);
return maiHyperlink->GetAtkHyperlink();
NS_ENSURE_TRUE(accWrap->IsLink(), nsnull);

MaiHyperlink* maiHyperlink = accWrap->GetMaiHyperlink();
NS_ENSURE_TRUE(maiHyperlink, nsnull);
return maiHyperlink->GetAtkHyperlink();
}
2 changes: 1 addition & 1 deletion accessible/src/base/AccGroupInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ AccGroupInfo::AccGroupInfo(nsAccessible* aItem, PRUint32 aRole) :
if (!parent)
return;

PRInt32 indexInParent = aItem->GetIndexInParent();
PRInt32 indexInParent = aItem->IndexInParent();
PRInt32 level = nsAccUtils::GetARIAOrDefaultLevel(aItem);

// Compute position in set.
Expand Down
1 change: 1 addition & 0 deletions accessible/src/base/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ EXPORTS = \
nsAccessible.h \
nsAccessNode.h \
nsARIAMap.h \
States.h \
$(NULL)

# we don't want the shared lib, but we want to force the creation of a static lib.
Expand Down
8 changes: 4 additions & 4 deletions accessible/src/base/NotificationController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,14 +515,14 @@ NotificationController::CoalesceTextChangeEventsFor(AccShowEvent* aTailEvent,
if (!textEvent)
return;

if (aTailEvent->mAccessible->GetIndexInParent() ==
aThisEvent->mAccessible->GetIndexInParent() + 1) {
if (aTailEvent->mAccessible->IndexInParent() ==
aThisEvent->mAccessible->IndexInParent() + 1) {
// If tail target was inserted after this target, i.e. tail target is next
// sibling of this target.
aTailEvent->mAccessible->AppendTextTo(textEvent->mModifiedText);

} else if (aTailEvent->mAccessible->GetIndexInParent() ==
aThisEvent->mAccessible->GetIndexInParent() -1) {
} else if (aTailEvent->mAccessible->IndexInParent() ==
aThisEvent->mAccessible->IndexInParent() -1) {
// If tail target was inserted before this target, i.e. tail target is
// previous sibling of this target.
nsAutoString startText;
Expand Down
4 changes: 2 additions & 2 deletions accessible/src/base/nsARIAGridAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@ nsARIAGridCellAccessible::GetColumnIndex(PRInt32 *aColumnIndex)

*aColumnIndex = 0;

PRInt32 indexInRow = GetIndexInParent();
PRInt32 indexInRow = IndexInParent();
for (PRInt32 idx = 0; idx < indexInRow; idx++) {
nsAccessible* cell = row->GetChildAt(idx);
PRUint32 role = cell->Role();
Expand Down Expand Up @@ -1013,7 +1013,7 @@ nsARIAGridCellAccessible::GetRowIndex(PRInt32 *aRowIndex)

*aRowIndex = 0;

PRInt32 indexInTable = row->GetIndexInParent();
PRInt32 indexInTable = row->IndexInParent();
for (PRInt32 idx = 0; idx < indexInTable; idx++) {
row = table->GetChildAt(idx);
if (row->Role() == nsIAccessibleRole::ROLE_ROW)
Expand Down
10 changes: 5 additions & 5 deletions accessible/src/base/nsAccDocManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#include "nsIChannel.h"
#include "nsIContentViewer.h"
#include "nsIDOMDocument.h"
#include "nsIEventListenerManager.h"
#include "nsEventListenerManager.h"
#include "nsIDOMEventTarget.h"
#include "nsIDOMWindow.h"
#include "nsIInterfaceRequestorUtils.h"
Expand Down Expand Up @@ -391,16 +391,16 @@ nsAccDocManager::AddListeners(nsIDocument *aDocument,
PRBool aAddDOMContentLoadedListener)
{
nsPIDOMWindow *window = aDocument->GetWindow();
nsPIDOMEventTarget *target = window->GetChromeEventHandler();
nsIEventListenerManager* elm = target->GetListenerManager(PR_TRUE);
nsIDOMEventTarget *target = window->GetChromeEventHandler();
nsEventListenerManager* elm = target->GetListenerManager(PR_TRUE);
elm->AddEventListenerByType(this, NS_LITERAL_STRING("pagehide"),
NS_EVENT_FLAG_CAPTURE, nsnull);
NS_EVENT_FLAG_CAPTURE);

NS_LOG_ACCDOCCREATE_TEXT(" added 'pagehide' listener")

if (aAddDOMContentLoadedListener) {
elm->AddEventListenerByType(this, NS_LITERAL_STRING("DOMContentLoaded"),
NS_EVENT_FLAG_CAPTURE, nsnull);
NS_EVENT_FLAG_CAPTURE);
NS_LOG_ACCDOCCREATE_TEXT(" added 'DOMContentLoaded' listener")
}
}
Expand Down
Loading

0 comments on commit 394c554

Please sign in to comment.