зеркало из https://github.com/mozilla/gecko-dev.git
Merge m-c to b-s.
This commit is contained in:
Коммит
f9980f36f1
1
.hgtags
1
.hgtags
|
@ -69,3 +69,4 @@ a95d426422816513477e5863add1b00ac7041dcb AURORA_BASE_20110412
|
|||
5eb553dd2ceae5f88d80f27afc5ef3935c5d43b0 AURORA_BASE_20110705
|
||||
41b84b87c816403e1b74963d8094cff0406c989e AURORA_BASE_20110816
|
||||
c0983049bcaa9551e5f276d5a77ce154c151e0b0 AURORA_BASE_20110927
|
||||
462c726144bc1fb45b61e774f64ac5d61b4e047c UPDATE_PACKAGING_R15
|
||||
|
|
|
@ -38,6 +38,8 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "mozilla/Util.h"
|
||||
|
||||
#include "nsAccessible.h"
|
||||
#include "nsAccessibleWrap.h"
|
||||
|
||||
|
@ -69,6 +71,7 @@
|
|||
#include "nsMaiInterfaceDocument.h"
|
||||
#include "nsMaiInterfaceImage.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::a11y;
|
||||
|
||||
nsAccessibleWrap::EAvailableAtkSignals nsAccessibleWrap::gAvailableAtkSignals =
|
||||
|
@ -344,7 +347,7 @@ void nsAccessibleWrap::SetMaiHyperlink(MaiHyperlink* aMaiHyperlink)
|
|||
NS_ASSERTION(quark_mai_hyperlink, "quark_mai_hyperlink not initialized");
|
||||
NS_ASSERTION(IS_MAI_OBJECT(mAtkObject), "Invalid AtkObject");
|
||||
if (quark_mai_hyperlink && IS_MAI_OBJECT(mAtkObject)) {
|
||||
MaiHyperlink* maiHyperlink = GetMaiHyperlink(PR_FALSE);
|
||||
MaiHyperlink* maiHyperlink = GetMaiHyperlink(false);
|
||||
if (!maiHyperlink && !aMaiHyperlink) {
|
||||
return; // Never set and we're shutting down
|
||||
}
|
||||
|
@ -522,7 +525,7 @@ GetMaiAtkType(PRUint16 interfacesBits)
|
|||
atkTypeName,
|
||||
&tinfo, GTypeFlags(0));
|
||||
|
||||
for (PRUint32 index = 0; index < NS_ARRAY_LENGTH(atk_if_infos); index++) {
|
||||
for (PRUint32 index = 0; index < ArrayLength(atk_if_infos); index++) {
|
||||
if (interfacesBits & (1 << index)) {
|
||||
g_type_add_interface_static(type,
|
||||
GetAtkTypeForMai((MaiInterfaceType)index),
|
||||
|
@ -963,7 +966,7 @@ refRelationSetCB(AtkObject *aAtkObj)
|
|||
nsIAccessibleRelation::RELATION_DESCRIPTION_FOR,
|
||||
};
|
||||
|
||||
for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(relationTypes); i++) {
|
||||
for (PRUint32 i = 0; i < ArrayLength(relationTypes); i++) {
|
||||
AtkRelationType atkType = static_cast<AtkRelationType>(relationTypes[i]);
|
||||
AtkRelation* atkRelation =
|
||||
atk_relation_set_get_relation_by_type(relation_set, atkType);
|
||||
|
@ -1060,7 +1063,7 @@ nsAccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
|
|||
atk_focus_tracker_notify(atkObj);
|
||||
// Fire state change event for focus
|
||||
nsRefPtr<AccEvent> stateChangeEvent =
|
||||
new AccStateChangeEvent(accessible, states::FOCUSED, PR_TRUE);
|
||||
new AccStateChangeEvent(accessible, states::FOCUSED, true);
|
||||
return FireAtkStateChangeEvent(stateChangeEvent, atkObj);
|
||||
}
|
||||
} break;
|
||||
|
@ -1212,10 +1215,10 @@ nsAccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
|
|||
break;
|
||||
|
||||
case nsIAccessibleEvent::EVENT_SHOW:
|
||||
return FireAtkShowHideEvent(aEvent, atkObj, PR_TRUE);
|
||||
return FireAtkShowHideEvent(aEvent, atkObj, true);
|
||||
|
||||
case nsIAccessibleEvent::EVENT_HIDE:
|
||||
return FireAtkShowHideEvent(aEvent, atkObj, PR_FALSE);
|
||||
return FireAtkShowHideEvent(aEvent, atkObj, false);
|
||||
|
||||
/*
|
||||
* Because dealing with menu is very different between nsIAccessible
|
||||
|
@ -1236,7 +1239,7 @@ nsAccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
|
|||
MAI_LOG_DEBUG(("\n\nReceived: EVENT_WINDOW_ACTIVATED\n"));
|
||||
nsRootAccessible *rootAcc =
|
||||
static_cast<nsRootAccessible *>(accessible);
|
||||
rootAcc->mActivated = PR_TRUE;
|
||||
rootAcc->mActivated = true;
|
||||
guint id = g_signal_lookup ("activate", MAI_TYPE_ATK_OBJECT);
|
||||
g_signal_emit(atkObj, id, 0);
|
||||
|
||||
|
@ -1249,7 +1252,7 @@ nsAccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
|
|||
MAI_LOG_DEBUG(("\n\nReceived: EVENT_WINDOW_DEACTIVATED\n"));
|
||||
nsRootAccessible *rootAcc =
|
||||
static_cast<nsRootAccessible *>(accessible);
|
||||
rootAcc->mActivated = PR_FALSE;
|
||||
rootAcc->mActivated = false;
|
||||
guint id = g_signal_lookup ("deactivate", MAI_TYPE_ATK_OBJECT);
|
||||
g_signal_emit(atkObj, id, 0);
|
||||
} break;
|
||||
|
@ -1296,14 +1299,14 @@ nsAccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
|
|||
case nsIAccessibleEvent::EVENT_MENUPOPUP_START:
|
||||
MAI_LOG_DEBUG(("\n\nReceived: EVENT_MENUPOPUP_START\n"));
|
||||
atk_focus_tracker_notify(atkObj); // fire extra focus event
|
||||
atk_object_notify_state_change(atkObj, ATK_STATE_VISIBLE, PR_TRUE);
|
||||
atk_object_notify_state_change(atkObj, ATK_STATE_SHOWING, PR_TRUE);
|
||||
atk_object_notify_state_change(atkObj, ATK_STATE_VISIBLE, true);
|
||||
atk_object_notify_state_change(atkObj, ATK_STATE_SHOWING, true);
|
||||
break;
|
||||
|
||||
case nsIAccessibleEvent::EVENT_MENUPOPUP_END:
|
||||
MAI_LOG_DEBUG(("\n\nReceived: EVENT_MENUPOPUP_END\n"));
|
||||
atk_object_notify_state_change(atkObj, ATK_STATE_VISIBLE, PR_FALSE);
|
||||
atk_object_notify_state_change(atkObj, ATK_STATE_SHOWING, PR_FALSE);
|
||||
atk_object_notify_state_change(atkObj, ATK_STATE_VISIBLE, false);
|
||||
atk_object_notify_state_change(atkObj, ATK_STATE_SHOWING, false);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -756,7 +756,7 @@ bool
|
|||
nsApplicationAccessibleWrap::AppendChild(nsAccessible *aChild)
|
||||
{
|
||||
if (!nsApplicationAccessible::AppendChild(aChild))
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
AtkObject *atkAccessible = nsAccessibleWrap::GetAtkObject(aChild);
|
||||
atk_object_set_parent(atkAccessible, mAtkObject);
|
||||
|
@ -776,7 +776,7 @@ nsApplicationAccessibleWrap::AppendChild(nsAccessible *aChild)
|
|||
g_timeout_add(0, fireRootAccessibleAddedCB, eventData);
|
||||
}
|
||||
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
nsDocAccessibleWrap::
|
||||
nsDocAccessibleWrap(nsIDocument *aDocument, nsIContent *aRootContent,
|
||||
nsIWeakReference *aShell) :
|
||||
nsDocAccessible(aDocument, aRootContent, aShell), mActivated(PR_FALSE)
|
||||
nsDocAccessible(aDocument, aRootContent, aShell), mActivated(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -257,7 +257,7 @@ getRunAttributesCB(AtkText *aText, gint aOffset,
|
|||
|
||||
nsCOMPtr<nsIPersistentProperties> attributes;
|
||||
PRInt32 startOffset = 0, endOffset = 0;
|
||||
nsresult rv = accText->GetTextAttributes(PR_FALSE, aOffset,
|
||||
nsresult rv = accText->GetTextAttributes(false, aOffset,
|
||||
&startOffset, &endOffset,
|
||||
getter_AddRefs(attributes));
|
||||
NS_ENSURE_SUCCESS(rv, nsnull);
|
||||
|
|
|
@ -103,7 +103,7 @@ AccEvent::GetDocAccessible()
|
|||
{
|
||||
nsINode *node = GetNode();
|
||||
if (node)
|
||||
return GetAccService()->GetDocAccessible(node->GetOwnerDoc());
|
||||
return GetAccService()->GetDocAccessible(node->OwnerDoc());
|
||||
|
||||
return nsnull;
|
||||
}
|
||||
|
@ -161,7 +161,7 @@ AccEvent::CaptureIsFromUserInput(EIsFromUserInput aIsFromUserInput)
|
|||
#endif
|
||||
|
||||
if (aIsFromUserInput != eAutoDetect) {
|
||||
mIsFromUserInput = aIsFromUserInput == eFromUserInput ? PR_TRUE : PR_FALSE;
|
||||
mIsFromUserInput = aIsFromUserInput == eFromUserInput ? true : false;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -278,10 +278,10 @@ IDRefsIterator::IDRefsIterator(nsIContent* aContent, nsIAtom* aIDRefsAttr) :
|
|||
return;
|
||||
|
||||
if (aContent->IsInAnonymousSubtree()) {
|
||||
mXBLDocument = do_QueryInterface(aContent->GetOwnerDoc());
|
||||
mXBLDocument = do_QueryInterface(aContent->OwnerDoc());
|
||||
mBindingParent = do_QueryInterface(aContent->GetBindingParent());
|
||||
} else {
|
||||
mDocument = aContent->GetOwnerDoc();
|
||||
mDocument = aContent->OwnerDoc();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ FocusManager::IsFocused(const nsAccessible* aAccessible) const
|
|||
// peculiarity we would end up with plain implementation based on
|
||||
// FocusedAccessible() method call. Make sure this issue is fixed in
|
||||
// bug 638465.
|
||||
if (focusedNode->GetOwnerDoc() == aAccessible->GetNode()->GetOwnerDoc()) {
|
||||
if (focusedNode->OwnerDoc() == aAccessible->GetNode()->OwnerDoc()) {
|
||||
return aAccessible ==
|
||||
GetAccService()->GetAccessibleOrContainer(focusedNode, nsnull);
|
||||
}
|
||||
|
@ -145,7 +145,7 @@ FocusManager::NotifyOfDOMFocus(nsISupports* aTarget)
|
|||
nsCOMPtr<nsINode> targetNode(do_QueryInterface(aTarget));
|
||||
if (targetNode) {
|
||||
nsDocAccessible* document =
|
||||
GetAccService()->GetDocAccessible(targetNode->GetOwnerDoc());
|
||||
GetAccService()->GetDocAccessible(targetNode->OwnerDoc());
|
||||
if (document) {
|
||||
// Set selection listener for focused element.
|
||||
if (targetNode->IsElement()) {
|
||||
|
@ -171,8 +171,8 @@ FocusManager::NotifyOfDOMBlur(nsISupports* aTarget)
|
|||
// If DOM document stays focused then fire accessible focus event to process
|
||||
// the case when no element within this DOM document will be focused.
|
||||
nsCOMPtr<nsINode> targetNode(do_QueryInterface(aTarget));
|
||||
if (targetNode && targetNode->GetOwnerDoc() == FocusedDOMDocument()) {
|
||||
nsIDocument* DOMDoc = targetNode->GetOwnerDoc();
|
||||
if (targetNode && targetNode->OwnerDoc() == FocusedDOMDocument()) {
|
||||
nsIDocument* DOMDoc = targetNode->OwnerDoc();
|
||||
nsDocAccessible* document =
|
||||
GetAccService()->GetDocAccessible(DOMDoc);
|
||||
if (document) {
|
||||
|
@ -216,7 +216,7 @@ FocusManager::ForceFocusEvent()
|
|||
nsINode* focusedNode = FocusedDOMNode();
|
||||
if (focusedNode) {
|
||||
nsDocAccessible* document =
|
||||
GetAccService()->GetDocAccessible(focusedNode->GetOwnerDoc());
|
||||
GetAccService()->GetDocAccessible(focusedNode->OwnerDoc());
|
||||
if (document) {
|
||||
document->HandleNotification<FocusManager, nsINode>
|
||||
(this, &FocusManager::ProcessDOMFocus, focusedNode);
|
||||
|
@ -246,7 +246,7 @@ FocusManager::ProcessDOMFocus(nsINode* aTarget)
|
|||
"Notification target", aTarget)
|
||||
|
||||
nsDocAccessible* document =
|
||||
GetAccService()->GetDocAccessible(aTarget->GetOwnerDoc());
|
||||
GetAccService()->GetDocAccessible(aTarget->OwnerDoc());
|
||||
|
||||
nsAccessible* target = document->GetAccessibleOrContainer(aTarget);
|
||||
if (target) {
|
||||
|
|
|
@ -210,8 +210,10 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
|
|||
if (!mDocument->HasLoadState(nsDocAccessible::eTreeConstructed)) {
|
||||
// If document is not bound to parent at this point then the document is not
|
||||
// ready yet (process notifications later).
|
||||
if (!mDocument->IsBoundToParent())
|
||||
if (!mDocument->IsBoundToParent()) {
|
||||
mObservingState = eRefreshObserving;
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_NOTIFICATIONS
|
||||
printf("\ninitial tree created, document: %p, document node: %p\n",
|
||||
|
@ -316,6 +318,10 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
|
|||
for (PRUint32 idx = 0; idx < eventCount; idx++) {
|
||||
AccEvent* accEvent = events[idx];
|
||||
if (accEvent->mEventRule != AccEvent::eDoNotEmit) {
|
||||
nsAccessible* target = accEvent->GetAccessible();
|
||||
if (!target || target->IsDefunct())
|
||||
continue;
|
||||
|
||||
// Dispatch the focus event if target is still focused.
|
||||
if (accEvent->mEventType == nsIAccessibleEvent::EVENT_FOCUS) {
|
||||
FocusMgr()->ProcessFocusEvent(accEvent);
|
||||
|
@ -374,7 +380,7 @@ NotificationController::CoalesceEvents()
|
|||
// is supported. Ignore events from different documents since we don't
|
||||
// coalesce them.
|
||||
if (!thisEvent->mNode ||
|
||||
thisEvent->mNode->GetOwnerDoc() != tailEvent->mNode->GetOwnerDoc())
|
||||
thisEvent->mNode->OwnerDoc() != tailEvent->mNode->OwnerDoc())
|
||||
continue;
|
||||
|
||||
// Coalesce earlier event for the same target.
|
||||
|
|
|
@ -355,7 +355,7 @@ private:
|
|||
static PLDHashNumber HashKey(KeyTypePointer aKey)
|
||||
{ return NS_PTR_TO_INT32(aKey) >> 2; }
|
||||
|
||||
enum { ALLOW_MEMMOVE = PR_TRUE };
|
||||
enum { ALLOW_MEMMOVE = true };
|
||||
|
||||
protected:
|
||||
nsCOMPtr<T> mKey;
|
||||
|
|
|
@ -80,7 +80,7 @@ TextUpdater::DoUpdate(const nsAString& aNewText, const nsAString& aOldText,
|
|||
}
|
||||
|
||||
// Get the text leaf accessible offset and invalidate cached offsets after it.
|
||||
mTextOffset = mHyperText->GetChildOffset(mTextLeaf, PR_TRUE);
|
||||
mTextOffset = mHyperText->GetChildOffset(mTextLeaf, true);
|
||||
NS_ASSERTION(mTextOffset != -1,
|
||||
"Text leaf hasn't offset within hyper text!");
|
||||
|
||||
|
@ -111,14 +111,14 @@ TextUpdater::DoUpdate(const nsAString& aNewText, const nsAString& aOldText,
|
|||
if (strLen1 > 0) {
|
||||
// Fire text change event for removal.
|
||||
nsRefPtr<AccEvent> textRemoveEvent =
|
||||
new AccTextChangeEvent(mHyperText, mTextOffset, str1, PR_FALSE);
|
||||
new AccTextChangeEvent(mHyperText, mTextOffset, str1, false);
|
||||
mDocument->FireDelayedAccessibleEvent(textRemoveEvent);
|
||||
}
|
||||
|
||||
if (strLen2 > 0) {
|
||||
// Fire text change event for insertion.
|
||||
nsRefPtr<AccEvent> textInsertEvent =
|
||||
new AccTextChangeEvent(mHyperText, mTextOffset, str2, PR_TRUE);
|
||||
new AccTextChangeEvent(mHyperText, mTextOffset, str2, true);
|
||||
mDocument->FireDelayedAccessibleEvent(textInsertEvent);
|
||||
}
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ private:
|
|||
{
|
||||
nsRefPtr<AccEvent> event =
|
||||
new AccTextChangeEvent(mHyperText, mTextOffset + aAddlOffset,
|
||||
aText, PR_TRUE);
|
||||
aText, true);
|
||||
aEvents.AppendElement(event);
|
||||
}
|
||||
|
||||
|
@ -103,7 +103,7 @@ private:
|
|||
{
|
||||
nsRefPtr<AccEvent> event =
|
||||
new AccTextChangeEvent(mHyperText, mTextOffset + aAddlOffset,
|
||||
aText, PR_FALSE);
|
||||
aText, false);
|
||||
aEvents.AppendElement(event);
|
||||
}
|
||||
|
||||
|
|
|
@ -319,7 +319,7 @@ NS_IMETHODIMP
|
|||
nsARIAGridAccessible::IsColumnSelected(PRInt32 aColumn, bool *aIsSelected)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsSelected);
|
||||
*aIsSelected = PR_FALSE;
|
||||
*aIsSelected = false;
|
||||
|
||||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -342,7 +342,7 @@ nsARIAGridAccessible::IsColumnSelected(PRInt32 aColumn, bool *aIsSelected)
|
|||
}
|
||||
} while ((row = rowIter.Next()));
|
||||
|
||||
*aIsSelected = PR_TRUE;
|
||||
*aIsSelected = true;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -350,7 +350,7 @@ NS_IMETHODIMP
|
|||
nsARIAGridAccessible::IsRowSelected(PRInt32 aRow, bool *aIsSelected)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsSelected);
|
||||
*aIsSelected = PR_FALSE;
|
||||
*aIsSelected = false;
|
||||
|
||||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -367,7 +367,7 @@ nsARIAGridAccessible::IsRowSelected(PRInt32 aRow, bool *aIsSelected)
|
|||
}
|
||||
}
|
||||
|
||||
*aIsSelected = PR_TRUE;
|
||||
*aIsSelected = true;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -376,7 +376,7 @@ nsARIAGridAccessible::IsCellSelected(PRInt32 aRow, PRInt32 aColumn,
|
|||
bool *aIsSelected)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsSelected);
|
||||
*aIsSelected = PR_FALSE;
|
||||
*aIsSelected = false;
|
||||
|
||||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -392,7 +392,7 @@ nsARIAGridAccessible::IsCellSelected(PRInt32 aRow, PRInt32 aColumn,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
*aIsSelected = PR_TRUE;
|
||||
*aIsSelected = true;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -461,7 +461,7 @@ nsARIAGridAccessible::GetSelectedRowCount(PRUint32* aCount)
|
|||
bool isRowSelected = true;
|
||||
do {
|
||||
if (!nsAccUtils::IsARIASelected(cell)) {
|
||||
isRowSelected = PR_FALSE;
|
||||
isRowSelected = false;
|
||||
break;
|
||||
}
|
||||
} while ((cell = cellIter.Next()));
|
||||
|
@ -496,14 +496,14 @@ nsARIAGridAccessible::GetSelectedCells(nsIArray **aCells)
|
|||
|
||||
if (nsAccUtils::IsARIASelected(row)) {
|
||||
while ((cell = cellIter.Next()))
|
||||
selCells->AppendElement(static_cast<nsIAccessible *>(cell), PR_FALSE);
|
||||
selCells->AppendElement(static_cast<nsIAccessible *>(cell), false);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
while ((cell = cellIter.Next())) {
|
||||
if (nsAccUtils::IsARIASelected(cell))
|
||||
selCells->AppendElement(static_cast<nsIAccessible *>(cell), PR_FALSE);
|
||||
selCells->AppendElement(static_cast<nsIAccessible *>(cell), false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -608,7 +608,7 @@ nsARIAGridAccessible::GetSelectedRowIndices(PRUint32 *arowCount,
|
|||
bool isRowSelected = true;
|
||||
do {
|
||||
if (!nsAccUtils::IsARIASelected(cell)) {
|
||||
isRowSelected = PR_FALSE;
|
||||
isRowSelected = false;
|
||||
break;
|
||||
}
|
||||
} while ((cell = cellIter.Next()));
|
||||
|
@ -661,13 +661,13 @@ nsARIAGridAccessible::SelectColumn(PRInt32 aColumn)
|
|||
nsAccessible *row = nsnull;
|
||||
while ((row = rowIter.Next())) {
|
||||
// Unselect all cells in the row.
|
||||
nsresult rv = SetARIASelected(row, PR_FALSE);
|
||||
nsresult rv = SetARIASelected(row, false);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Select cell at the column index.
|
||||
nsAccessible *cell = GetCellInRowAt(row, aColumn);
|
||||
if (cell) {
|
||||
rv = SetARIASelected(cell, PR_TRUE);
|
||||
rv = SetARIASelected(cell, true);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
}
|
||||
|
@ -684,7 +684,7 @@ nsARIAGridAccessible::UnselectRow(PRInt32 aRow)
|
|||
nsAccessible *row = GetRowAt(aRow);
|
||||
NS_ENSURE_ARG(row);
|
||||
|
||||
return SetARIASelected(row, PR_FALSE);
|
||||
return SetARIASelected(row, false);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -701,7 +701,7 @@ nsARIAGridAccessible::UnselectColumn(PRInt32 aColumn)
|
|||
while ((row = rowIter.Next())) {
|
||||
nsAccessible *cell = GetCellInRowAt(row, aColumn);
|
||||
if (cell) {
|
||||
nsresult rv = SetARIASelected(cell, PR_FALSE);
|
||||
nsresult rv = SetARIASelected(cell, false);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
}
|
||||
|
@ -713,7 +713,7 @@ NS_IMETHODIMP
|
|||
nsARIAGridAccessible::IsProbablyForLayout(bool *aIsProbablyForLayout)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsProbablyForLayout);
|
||||
*aIsProbablyForLayout = PR_FALSE;
|
||||
*aIsProbablyForLayout = false;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -725,7 +725,7 @@ bool
|
|||
nsARIAGridAccessible::IsValidRow(PRInt32 aRow)
|
||||
{
|
||||
if (aRow < 0)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
PRInt32 rowCount = 0;
|
||||
GetRowCount(&rowCount);
|
||||
|
@ -736,7 +736,7 @@ bool
|
|||
nsARIAGridAccessible::IsValidColumn(PRInt32 aColumn)
|
||||
{
|
||||
if (aColumn < 0)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
PRInt32 colCount = 0;
|
||||
GetColumnCount(&colCount);
|
||||
|
@ -747,12 +747,12 @@ bool
|
|||
nsARIAGridAccessible::IsValidRowNColumn(PRInt32 aRow, PRInt32 aColumn)
|
||||
{
|
||||
if (aRow < 0 || aColumn < 0)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
PRInt32 rowCount = 0;
|
||||
GetRowCount(&rowCount);
|
||||
if (aRow >= rowCount)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
PRInt32 colCount = 0;
|
||||
GetColumnCount(&colCount);
|
||||
|
@ -822,7 +822,7 @@ nsARIAGridAccessible::SetARIASelected(nsAccessible *aAccessible,
|
|||
nsAccessible *cell = nsnull;
|
||||
|
||||
while ((cell = cellIter.Next())) {
|
||||
rv = SetARIASelected(cell, PR_FALSE, PR_FALSE);
|
||||
rv = SetARIASelected(cell, false, false);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -838,14 +838,14 @@ nsARIAGridAccessible::SetARIASelected(nsAccessible *aAccessible,
|
|||
|
||||
if (row && row->Role() == nsIAccessibleRole::ROLE_ROW &&
|
||||
nsAccUtils::IsARIASelected(row)) {
|
||||
rv = SetARIASelected(row, PR_FALSE, PR_FALSE);
|
||||
rv = SetARIASelected(row, false, false);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
AccIterator cellIter(row, filters::GetCell);
|
||||
nsAccessible *cell = nsnull;
|
||||
while ((cell = cellIter.Next())) {
|
||||
if (cell != aAccessible) {
|
||||
rv = SetARIASelected(cell, PR_TRUE, PR_FALSE);
|
||||
rv = SetARIASelected(cell, true, false);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
}
|
||||
|
@ -882,7 +882,7 @@ nsARIAGridAccessible::GetSelectedColumnsArray(PRUint32 *acolumnCount,
|
|||
nsTArray<bool> isColSelArray(selColCount);
|
||||
isColSelArray.AppendElements(selColCount);
|
||||
for (PRInt32 i = 0; i < selColCount; i++)
|
||||
isColSelArray[i] = PR_TRUE;
|
||||
isColSelArray[i] = true;
|
||||
|
||||
do {
|
||||
if (nsAccUtils::IsARIASelected(row))
|
||||
|
@ -893,9 +893,9 @@ nsARIAGridAccessible::GetSelectedColumnsArray(PRUint32 *acolumnCount,
|
|||
AccIterator cellIter(row, filters::GetCell);
|
||||
nsAccessible *cell = nsnull;
|
||||
for (colIdx = 0; (cell = cellIter.Next()); colIdx++) {
|
||||
if (isColSelArray.SafeElementAt(colIdx, PR_FALSE) &&
|
||||
if (isColSelArray.SafeElementAt(colIdx, false) &&
|
||||
!nsAccUtils::IsARIASelected(cell)) {
|
||||
isColSelArray[colIdx] = PR_FALSE;
|
||||
isColSelArray[colIdx] = false;
|
||||
selColCount--;
|
||||
}
|
||||
}
|
||||
|
@ -1095,7 +1095,7 @@ NS_IMETHODIMP
|
|||
nsARIAGridCellAccessible::IsSelected(bool *aIsSelected)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsSelected);
|
||||
*aIsSelected = PR_FALSE;
|
||||
*aIsSelected = false;
|
||||
|
||||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -1107,7 +1107,7 @@ nsARIAGridCellAccessible::IsSelected(bool *aIsSelected)
|
|||
if (!nsAccUtils::IsARIASelected(row) && !nsAccUtils::IsARIASelected(this))
|
||||
return NS_OK;
|
||||
|
||||
*aIsSelected = PR_TRUE;
|
||||
*aIsSelected = true;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -613,11 +613,11 @@ nsStateMapEntry nsARIAMap::gWAIStateMap[] = {
|
|||
|
||||
// eARIACheckableBool
|
||||
nsStateMapEntry(&nsGkAtoms::aria_checked, kBoolType,
|
||||
states::CHECKABLE, states::CHECKED, 0, PR_TRUE),
|
||||
states::CHECKABLE, states::CHECKED, 0, true),
|
||||
|
||||
// eARIACheckableMixed
|
||||
nsStateMapEntry(&nsGkAtoms::aria_checked, kMixedType,
|
||||
states::CHECKABLE, states::CHECKED, 0, PR_TRUE),
|
||||
states::CHECKABLE, states::CHECKED, 0, true),
|
||||
|
||||
// eARIACheckedMixed
|
||||
nsStateMapEntry(&nsGkAtoms::aria_checked, kMixedType,
|
||||
|
@ -641,7 +641,7 @@ nsStateMapEntry nsARIAMap::gWAIStateMap[] = {
|
|||
|
||||
// eARIAMultiline
|
||||
nsStateMapEntry(&nsGkAtoms::aria_multiline, kBoolType,
|
||||
0, states::MULTI_LINE, states::SINGLE_LINE, PR_TRUE),
|
||||
0, states::MULTI_LINE, states::SINGLE_LINE, true),
|
||||
|
||||
// eARIAMultiSelectable
|
||||
nsStateMapEntry(&nsGkAtoms::aria_multiselectable, kBoolType,
|
||||
|
@ -662,7 +662,7 @@ nsStateMapEntry nsARIAMap::gWAIStateMap[] = {
|
|||
|
||||
// eARIAReadonlyOrEditable
|
||||
nsStateMapEntry(&nsGkAtoms::aria_readonly, kBoolType,
|
||||
0, states::READONLY, states::EDITABLE, PR_TRUE),
|
||||
0, states::READONLY, states::EDITABLE, true),
|
||||
|
||||
// eARIARequired
|
||||
nsStateMapEntry(&nsGkAtoms::aria_required, kBoolType,
|
||||
|
@ -670,7 +670,7 @@ nsStateMapEntry nsARIAMap::gWAIStateMap[] = {
|
|||
|
||||
// eARIASelectable
|
||||
nsStateMapEntry(&nsGkAtoms::aria_selected, kBoolType,
|
||||
states::SELECTABLE, states::SELECTED, 0, PR_TRUE)
|
||||
states::SELECTABLE, states::SELECTED, 0, true)
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -739,7 +739,7 @@ PRUint32 nsARIAMap::gWAIUnivAttrMapLength = NS_ARRAY_LENGTH(nsARIAMap::gWAIUnivA
|
|||
|
||||
nsStateMapEntry::nsStateMapEntry() :
|
||||
mAttributeName(nsnull),
|
||||
mIsToken(PR_FALSE),
|
||||
mIsToken(false),
|
||||
mPermanentState(0),
|
||||
mValue1(nsnull),
|
||||
mState1(0),
|
||||
|
@ -748,7 +748,7 @@ nsStateMapEntry::nsStateMapEntry() :
|
|||
mValue3(nsnull),
|
||||
mState3(0),
|
||||
mDefaultState(0),
|
||||
mDefinedIfAbsent(PR_FALSE)
|
||||
mDefinedIfAbsent(false)
|
||||
{}
|
||||
|
||||
nsStateMapEntry::nsStateMapEntry(nsIAtom** aAttrName, eStateValueType aType,
|
||||
|
@ -757,7 +757,7 @@ nsStateMapEntry::nsStateMapEntry(nsIAtom** aAttrName, eStateValueType aType,
|
|||
PRUint64 aFalseState,
|
||||
bool aDefinedIfAbsent) :
|
||||
mAttributeName(aAttrName),
|
||||
mIsToken(PR_TRUE),
|
||||
mIsToken(true),
|
||||
mPermanentState(aPermanentState),
|
||||
mValue1("false"),
|
||||
mState1(aFalseState),
|
||||
|
@ -778,11 +778,11 @@ nsStateMapEntry::nsStateMapEntry(nsIAtom** aAttrName,
|
|||
const char* aValue1, PRUint64 aState1,
|
||||
const char* aValue2, PRUint64 aState2,
|
||||
const char* aValue3, PRUint64 aState3) :
|
||||
mAttributeName(aAttrName), mIsToken(PR_FALSE), mPermanentState(0),
|
||||
mAttributeName(aAttrName), mIsToken(false), mPermanentState(0),
|
||||
mValue1(aValue1), mState1(aState1),
|
||||
mValue2(aValue2), mState2(aState2),
|
||||
mValue3(aValue3), mState3(aState3),
|
||||
mDefaultState(0), mDefinedIfAbsent(PR_FALSE)
|
||||
mDefaultState(0), mDefinedIfAbsent(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -791,11 +791,11 @@ nsStateMapEntry::nsStateMapEntry(nsIAtom** aAttrName,
|
|||
const char* aValue1, PRUint64 aState1,
|
||||
const char* aValue2, PRUint64 aState2,
|
||||
const char* aValue3, PRUint64 aState3) :
|
||||
mAttributeName(aAttrName), mIsToken(PR_TRUE), mPermanentState(0),
|
||||
mAttributeName(aAttrName), mIsToken(true), mPermanentState(0),
|
||||
mValue1(aValue1), mState1(aState1),
|
||||
mValue2(aValue2), mState2(aState2),
|
||||
mValue3(aValue3), mState3(aState3),
|
||||
mDefaultState(0), mDefinedIfAbsent(PR_TRUE)
|
||||
mDefaultState(0), mDefinedIfAbsent(true)
|
||||
{
|
||||
if (aDefaultStateRule == eUseFirstState)
|
||||
mDefaultState = aState1;
|
||||
|
@ -807,7 +807,7 @@ nsStateMapEntry::MapToStates(nsIContent* aContent, PRUint64* aState,
|
|||
{
|
||||
// Return true if we should continue.
|
||||
if (aStateMapEntryID == eARIANone)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
const nsStateMapEntry& entry = nsARIAMap::gWAIStateMap[aStateMapEntryID];
|
||||
|
||||
|
@ -820,7 +820,7 @@ nsStateMapEntry::MapToStates(nsIContent* aContent, PRUint64* aState,
|
|||
*aState |= entry.mPermanentState;
|
||||
if (entry.mState1)
|
||||
*aState |= entry.mState1;
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// We only have attribute state mappings for NMTOKEN (and boolean) based
|
||||
|
@ -838,7 +838,7 @@ nsStateMapEntry::MapToStates(nsIContent* aContent, PRUint64* aState,
|
|||
|
||||
if (entry.mPermanentState)
|
||||
*aState &= ~entry.mPermanentState;
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (entry.mPermanentState)
|
||||
|
@ -847,27 +847,27 @@ nsStateMapEntry::MapToStates(nsIContent* aContent, PRUint64* aState,
|
|||
|
||||
nsAutoString attrValue;
|
||||
if (!aContent->GetAttr(kNameSpaceID_None, *entry.mAttributeName, attrValue))
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
|
||||
// Apply states for matched value. If no values was matched then apply default
|
||||
// states.
|
||||
bool applyDefaultStates = true;
|
||||
if (entry.mValue1) {
|
||||
if (attrValue.EqualsASCII(entry.mValue1)) {
|
||||
applyDefaultStates = PR_FALSE;
|
||||
applyDefaultStates = false;
|
||||
|
||||
if (entry.mState1)
|
||||
*aState |= entry.mState1;
|
||||
} else if (entry.mValue2) {
|
||||
if (attrValue.EqualsASCII(entry.mValue2)) {
|
||||
applyDefaultStates = PR_FALSE;
|
||||
applyDefaultStates = false;
|
||||
|
||||
if (entry.mState2)
|
||||
*aState |= entry.mState2;
|
||||
|
||||
} else if (entry.mValue3) {
|
||||
if (attrValue.EqualsASCII(entry.mValue3)) {
|
||||
applyDefaultStates = PR_FALSE;
|
||||
applyDefaultStates = false;
|
||||
|
||||
if (entry.mState3)
|
||||
*aState |= entry.mState3;
|
||||
|
@ -882,5 +882,5 @@ nsStateMapEntry::MapToStates(nsIContent* aContent, PRUint64* aState,
|
|||
*aState |= entry.mDefaultState;
|
||||
}
|
||||
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -119,12 +119,12 @@ nsAccDocManager::Init()
|
|||
do_GetService(NS_DOCUMENTLOADER_SERVICE_CONTRACTID);
|
||||
|
||||
if (!progress)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
progress->AddProgressListener(static_cast<nsIWebProgressListener*>(this),
|
||||
nsIWebProgress::NOTIFY_STATE_DOCUMENT);
|
||||
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -341,7 +341,7 @@ nsAccDocManager::AddListeners(nsIDocument *aDocument,
|
|||
{
|
||||
nsPIDOMWindow *window = aDocument->GetWindow();
|
||||
nsIDOMEventTarget *target = window->GetChromeEventHandler();
|
||||
nsEventListenerManager* elm = target->GetListenerManager(PR_TRUE);
|
||||
nsEventListenerManager* elm = target->GetListenerManager(true);
|
||||
elm->AddEventListenerByType(this, NS_LITERAL_STRING("pagehide"),
|
||||
NS_EVENT_FLAG_CAPTURE);
|
||||
|
||||
|
|
|
@ -152,10 +152,10 @@ nsAccTreeWalker::PushState(nsIContent* aContent)
|
|||
{
|
||||
WalkState* nextToLastState = new WalkState(aContent);
|
||||
if (!nextToLastState)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
nextToLastState->prevState = mState;
|
||||
mState = nextToLastState;
|
||||
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -330,9 +330,9 @@ nsAccUtils::HasDefinedARIAToken(nsIContent *aContent, nsIAtom *aAtom)
|
|||
nsGkAtoms::_empty, eCaseMatters) ||
|
||||
aContent->AttrValueIs(kNameSpaceID_None, aAtom,
|
||||
nsGkAtoms::_undefined, eCaseMatters)) {
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
}
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsIAtom*
|
||||
|
@ -593,13 +593,13 @@ nsAccUtils::GetLiveAttrValue(PRUint32 aRule, nsAString& aValue)
|
|||
switch (aRule) {
|
||||
case eOffLiveAttr:
|
||||
aValue = NS_LITERAL_STRING("off");
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
case ePoliteLiveAttr:
|
||||
aValue = NS_LITERAL_STRING("polite");
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_A11Y
|
||||
|
@ -613,14 +613,14 @@ nsAccUtils::IsTextInterfaceSupportCorrect(nsAccessible *aAccessible)
|
|||
if (accDoc) {
|
||||
// Don't test for accessible docs, it makes us create accessibles too
|
||||
// early and fire mutation events before we need to
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
PRInt32 childCount = aAccessible->GetChildCount();
|
||||
for (PRint32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
nsAccessible *child = GetChildAt(childIdx);
|
||||
if (IsText(child)) {
|
||||
foundText = PR_TRUE;
|
||||
foundText = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -629,10 +629,10 @@ nsAccUtils::IsTextInterfaceSupportCorrect(nsAccessible *aAccessible)
|
|||
// found text child node
|
||||
nsCOMPtr<nsIAccessibleText> text = do_QueryObject(aAccessible);
|
||||
if (!text)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -726,7 +726,7 @@ nsAccUtils::GetHeaderCellsFor(nsIAccessibleTable *aTable,
|
|||
role == nsIAccessibleRole::ROLE_COLUMNHEADER;
|
||||
|
||||
if (isHeader)
|
||||
cells->AppendElement(cell, PR_FALSE);
|
||||
cells->AppendElement(cell, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ public:
|
|||
* property is not present, or is "" or "undefined". Do not call
|
||||
* this method for properties of type string, decimal, IDREF or IDREFS.
|
||||
*
|
||||
* Return PR_TRUE if the ARIA property is defined, otherwise PR_FALSE
|
||||
* Return true if the ARIA property is defined, otherwise false
|
||||
*/
|
||||
static bool HasDefinedARIAToken(nsIContent *aContent, nsIAtom *aAtom);
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ nsAccessNode::
|
|||
mContent(aContent), mWeakShell(aShell)
|
||||
{
|
||||
#ifdef DEBUG_A11Y
|
||||
mIsInitialized = PR_FALSE;
|
||||
mIsInitialized = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -138,7 +138,7 @@ nsAccessNode::IsDefunct() const
|
|||
bool
|
||||
nsAccessNode::Init()
|
||||
{
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
@ -201,7 +201,7 @@ void nsAccessNode::InitXPAccessibility()
|
|||
prefBranch->GetBoolPref("browser.formfill.enable", &gIsFormFillEnabled);
|
||||
}
|
||||
|
||||
NotifyA11yInitOrShutdown(PR_TRUE);
|
||||
NotifyA11yInitOrShutdown(true);
|
||||
}
|
||||
|
||||
// nsAccessNode protected static
|
||||
|
@ -235,7 +235,7 @@ void nsAccessNode::ShutdownXPAccessibility()
|
|||
NS_RELEASE(gApplicationAccessible);
|
||||
}
|
||||
|
||||
NotifyA11yInitOrShutdown(PR_FALSE);
|
||||
NotifyA11yInitOrShutdown(false);
|
||||
}
|
||||
|
||||
already_AddRefed<nsIPresShell>
|
||||
|
@ -262,7 +262,7 @@ nsDocAccessible *
|
|||
nsAccessNode::GetDocAccessible() const
|
||||
{
|
||||
return mContent ?
|
||||
GetAccService()->GetDocAccessible(mContent->GetOwnerDoc()) : nsnull;
|
||||
GetAccService()->GetDocAccessible(mContent->OwnerDoc()) : nsnull;
|
||||
}
|
||||
|
||||
nsRootAccessible*
|
||||
|
@ -437,7 +437,7 @@ nsAccessNode::GetCurrentFocus()
|
|||
nsCOMPtr<nsIDOMElement> focusedElement;
|
||||
nsCOMPtr<nsIFocusManager> fm = do_GetService(FOCUSMANAGER_CONTRACTID);
|
||||
if (fm)
|
||||
fm->GetFocusedElementForWindow(win, PR_TRUE, getter_AddRefs(focusedWindow),
|
||||
fm->GetFocusedElementForWindow(win, true, getter_AddRefs(focusedWindow),
|
||||
getter_AddRefs(focusedElement));
|
||||
|
||||
nsINode *focusedNode = nsnull;
|
||||
|
@ -465,10 +465,8 @@ nsAccessNode::GetLanguage(nsAString& aLanguage)
|
|||
nsCoreUtils::GetLanguageFor(mContent, nsnull, aLanguage);
|
||||
|
||||
if (aLanguage.IsEmpty()) { // Nothing found, so use document's language
|
||||
nsIDocument *doc = mContent->GetOwnerDoc();
|
||||
if (doc) {
|
||||
doc->GetHeaderData(nsGkAtoms::headerContentLanguage, aLanguage);
|
||||
}
|
||||
mContent->OwnerDoc()->GetHeaderData(nsGkAtoms::headerContentLanguage,
|
||||
aLanguage);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -152,7 +152,7 @@ public:
|
|||
virtual nsINode* GetNode() const { return mContent; }
|
||||
nsIContent* GetContent() const { return mContent; }
|
||||
virtual nsIDocument* GetDocumentNode() const
|
||||
{ return mContent ? mContent->GetOwnerDoc() : nsnull; }
|
||||
{ return mContent ? mContent->OwnerDoc() : nsnull; }
|
||||
|
||||
/**
|
||||
* Return node type information of DOM node associated with the accessible.
|
||||
|
|
|
@ -36,6 +36,8 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "mozilla/Util.h"
|
||||
|
||||
// NOTE: alphabetically ordered
|
||||
#include "nsAccessibilityService.h"
|
||||
#include "nsCoreUtils.h"
|
||||
|
@ -111,6 +113,7 @@
|
|||
#include "mozilla/FunctionTimer.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::a11y;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -654,7 +657,7 @@ nsAccessibilityService::GetAccessibleFor(nsIDOMNode *aNode,
|
|||
NS_IMETHODIMP
|
||||
nsAccessibilityService::GetStringRole(PRUint32 aRole, nsAString& aString)
|
||||
{
|
||||
if ( aRole >= NS_ARRAY_LENGTH(kRoleNames)) {
|
||||
if ( aRole >= ArrayLength(kRoleNames)) {
|
||||
aString.AssignLiteral("unknown");
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -785,10 +788,10 @@ NS_IMETHODIMP
|
|||
nsAccessibilityService::GetStringEventType(PRUint32 aEventType,
|
||||
nsAString& aString)
|
||||
{
|
||||
NS_ASSERTION(nsIAccessibleEvent::EVENT_LAST_ENTRY == NS_ARRAY_LENGTH(kEventTypeNames),
|
||||
NS_ASSERTION(nsIAccessibleEvent::EVENT_LAST_ENTRY == ArrayLength(kEventTypeNames),
|
||||
"nsIAccessibleEvent constants are out of sync to kEventTypeNames");
|
||||
|
||||
if (aEventType >= NS_ARRAY_LENGTH(kEventTypeNames)) {
|
||||
if (aEventType >= ArrayLength(kEventTypeNames)) {
|
||||
aString.AssignLiteral("unknown");
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -802,7 +805,7 @@ NS_IMETHODIMP
|
|||
nsAccessibilityService::GetStringRelationType(PRUint32 aRelationType,
|
||||
nsAString& aString)
|
||||
{
|
||||
if (aRelationType >= NS_ARRAY_LENGTH(kRelationTypeNames)) {
|
||||
if (aRelationType >= ArrayLength(kRelationTypeNames)) {
|
||||
aString.AssignLiteral("unknown");
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -861,7 +864,7 @@ nsAccessibilityService::GetAccessible(nsINode* aNode)
|
|||
{
|
||||
NS_PRECONDITION(aNode, "Getting an accessible for null node! Crash.");
|
||||
|
||||
nsDocAccessible* document = GetDocAccessible(aNode->GetOwnerDoc());
|
||||
nsDocAccessible* document = GetDocAccessible(aNode->OwnerDoc());
|
||||
return document ? document->GetAccessible(aNode) : nsnull;
|
||||
}
|
||||
|
||||
|
@ -873,7 +876,7 @@ nsAccessibilityService::GetAccessibleOrContainer(nsINode* aNode,
|
|||
return nsnull;
|
||||
|
||||
// XXX: weak shell is ignored until multiple shell documents are supported.
|
||||
nsDocAccessible* document = GetDocAccessible(aNode->GetOwnerDoc());
|
||||
nsDocAccessible* document = GetDocAccessible(aNode->OwnerDoc());
|
||||
return document ? document->GetAccessibleOrContainer(aNode) : nsnull;
|
||||
}
|
||||
|
||||
|
@ -881,24 +884,24 @@ static bool HasRelatedContent(nsIContent *aContent)
|
|||
{
|
||||
nsAutoString id;
|
||||
if (!aContent || !nsCoreUtils::GetID(aContent, id) || id.IsEmpty()) {
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// If the given ID is referred by relation attribute then create an accessible
|
||||
// for it. Take care of HTML elements only for now.
|
||||
if (aContent->IsHTML() &&
|
||||
nsAccUtils::GetDocAccessibleFor(aContent)->IsDependentID(id))
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
|
||||
nsIContent *ancestorContent = aContent;
|
||||
while ((ancestorContent = ancestorContent->GetParent()) != nsnull) {
|
||||
if (ancestorContent->HasAttr(kNameSpaceID_None, nsGkAtoms::aria_activedescendant)) {
|
||||
// ancestor has activedescendant property, this content could be active
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
nsAccessible*
|
||||
|
@ -933,7 +936,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
|
|||
return nsnull;
|
||||
}
|
||||
|
||||
if (aNode->GetOwnerDoc() != aPresShell->GetDocument()) {
|
||||
if (aNode->OwnerDoc() != aPresShell->GetDocument()) {
|
||||
NS_ERROR("Creating accessible for wrong pres shell");
|
||||
return nsnull;
|
||||
}
|
||||
|
@ -980,7 +983,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
|
|||
#endif
|
||||
|
||||
nsDocAccessible* docAcc =
|
||||
GetAccService()->GetDocAccessible(aNode->GetOwnerDoc());
|
||||
GetAccService()->GetDocAccessible(aNode->OwnerDoc());
|
||||
if (!docAcc) {
|
||||
NS_NOTREACHED("Node has no host document accessible!");
|
||||
return nsnull;
|
||||
|
@ -1099,20 +1102,20 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
|
|||
}
|
||||
|
||||
// otherwise create ARIA based accessible.
|
||||
tryTagNameOrFrame = PR_FALSE;
|
||||
tryTagNameOrFrame = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (tableContent->Tag() == nsGkAtoms::table) {
|
||||
// Stop before we are fooled by any additional table ancestors
|
||||
// This table cell frameis part of a separate ancestor table.
|
||||
tryTagNameOrFrame = PR_FALSE;
|
||||
tryTagNameOrFrame = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!tableContent)
|
||||
tryTagNameOrFrame = PR_FALSE;
|
||||
tryTagNameOrFrame = false;
|
||||
}
|
||||
|
||||
if (roleMapEntry) {
|
||||
|
@ -1227,21 +1230,21 @@ nsAccessibilityService::Init()
|
|||
{
|
||||
// Initialize accessible document manager.
|
||||
if (!nsAccDocManager::Init())
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
// Add observers.
|
||||
nsCOMPtr<nsIObserverService> observerService =
|
||||
mozilla::services::GetObserverService();
|
||||
if (!observerService)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
observerService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, PR_FALSE);
|
||||
observerService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);
|
||||
|
||||
// Initialize accessibility.
|
||||
nsAccessNodeWrap::InitAccessibility();
|
||||
|
||||
gIsShutdown = PR_FALSE;
|
||||
return PR_TRUE;
|
||||
gIsShutdown = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1263,7 +1266,7 @@ nsAccessibilityService::Shutdown()
|
|||
|
||||
NS_ASSERTION(!gIsShutdown, "Accessibility was shutdown already");
|
||||
|
||||
gIsShutdown = PR_TRUE;
|
||||
gIsShutdown = true;
|
||||
|
||||
nsAccessNodeWrap::ShutdownAccessibility();
|
||||
}
|
||||
|
|
|
@ -273,7 +273,7 @@ private:
|
|||
* A universal ARIA property is one that can be defined on any element even if there is no role.
|
||||
*
|
||||
* @param aContent The content node to test
|
||||
* @return PR_TRUE if there is a universal ARIA property set on the node
|
||||
* @return true if there is a universal ARIA property set on the node
|
||||
*/
|
||||
bool HasUniversalAriaProperty(nsIContent *aContent);
|
||||
|
||||
|
|
|
@ -272,7 +272,7 @@ nsAccessible::GetName(nsAString& aName)
|
|||
}
|
||||
|
||||
if (rv != NS_OK_EMPTY_NAME)
|
||||
aName.SetIsVoid(PR_TRUE);
|
||||
aName.SetIsVoid(true);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -542,7 +542,7 @@ nsAccessible::GetChildren(nsIArray **aOutChildren)
|
|||
|
||||
for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
nsIAccessible* child = GetChildAt(childIdx);
|
||||
children->AppendElement(child, PR_FALSE);
|
||||
children->AppendElement(child, false);
|
||||
}
|
||||
|
||||
NS_ADDREF(*aOutChildren = children);
|
||||
|
@ -552,7 +552,7 @@ nsAccessible::GetChildren(nsIArray **aOutChildren)
|
|||
bool
|
||||
nsAccessible::GetAllowsAnonChildAccessibles()
|
||||
{
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* readonly attribute long childCount; */
|
||||
|
@ -597,25 +597,25 @@ nsAccessible::IsVisible(bool* aIsOffscreen)
|
|||
// otherwise it will be marked states::OFFSCREEN. The states::INVISIBLE flag
|
||||
// is for elements which are programmatically hidden.
|
||||
|
||||
*aIsOffscreen = PR_TRUE;
|
||||
*aIsOffscreen = true;
|
||||
if (IsDefunct())
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
const PRUint16 kMinPixels = 12;
|
||||
// Set up the variables we need, return false if we can't get at them all
|
||||
nsCOMPtr<nsIPresShell> shell(GetPresShell());
|
||||
if (!shell)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
nsIFrame *frame = GetFrame();
|
||||
if (!frame) {
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// If visibility:hidden or visibility:collapsed then mark with STATE_INVISIBLE
|
||||
if (!frame->GetStyleVisibility()->IsVisible())
|
||||
{
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// We don't use the more accurate GetBoundsRect, because that is more expensive
|
||||
|
@ -649,14 +649,14 @@ nsAccessible::IsVisible(bool* aIsOffscreen)
|
|||
if (isEmpty && !(frame->GetStateBits() & NS_FRAME_OUT_OF_FLOW)) {
|
||||
// Consider zero area objects hidden unless they are absolutely positioned
|
||||
// or floating and may have descendants that have a non-zero size
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// The frame intersects the viewport, but we need to check the parent view chain :(
|
||||
bool isVisible = nsCoreUtils::CheckVisibilityInParentChain(frame);
|
||||
if (isVisible && rectVisibility == nsRectVisibility_kVisible) {
|
||||
*aIsOffscreen = PR_FALSE;
|
||||
*aIsOffscreen = false;
|
||||
}
|
||||
return isVisible;
|
||||
}
|
||||
|
@ -1036,10 +1036,10 @@ NS_IMETHODIMP nsAccessible::SetSelected(bool aSelect)
|
|||
if (aSelect) {
|
||||
return mContent->SetAttr(kNameSpaceID_None,
|
||||
nsGkAtoms::aria_selected,
|
||||
NS_LITERAL_STRING("true"), PR_TRUE);
|
||||
NS_LITERAL_STRING("true"), true);
|
||||
}
|
||||
return mContent->UnsetAttr(kNameSpaceID_None,
|
||||
nsGkAtoms::aria_selected, PR_TRUE);
|
||||
nsGkAtoms::aria_selected, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1060,7 +1060,7 @@ NS_IMETHODIMP nsAccessible::TakeSelection()
|
|||
nsCOMPtr<nsIAccessibleSelectable> selectable = do_QueryInterface(multiSelect);
|
||||
selectable->ClearSelection();
|
||||
}
|
||||
return SetSelected(PR_TRUE);
|
||||
return SetSelected(true);
|
||||
}
|
||||
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -1099,7 +1099,7 @@ nsAccessible::TakeFocus()
|
|||
focusContent = ancestorContent;
|
||||
focusContent->SetAttr(kNameSpaceID_None,
|
||||
nsGkAtoms::aria_activedescendant,
|
||||
id, PR_TRUE);
|
||||
id, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1376,7 +1376,7 @@ nsAccessible::GetAttributesInternal(nsIPersistentProperties *aAttributes)
|
|||
// However, nodes in outer documents override nodes in inner documents:
|
||||
// Outer doc author may want to override properties on a widget they used in an iframe
|
||||
nsIContent *startContent = mContent;
|
||||
while (PR_TRUE) {
|
||||
while (true) {
|
||||
NS_ENSURE_STATE(startContent);
|
||||
nsIDocument *doc = startContent->GetDocument();
|
||||
nsIContent* rootContent = nsCoreUtils::GetRoleContent(doc);
|
||||
|
@ -1748,7 +1748,7 @@ nsAccessible::SetCurrentValue(double aValue)
|
|||
nsAutoString newValue;
|
||||
newValue.AppendFloat(aValue);
|
||||
return mContent->SetAttr(kNameSpaceID_None,
|
||||
nsGkAtoms::aria_valuenow, newValue, PR_TRUE);
|
||||
nsGkAtoms::aria_valuenow, newValue, true);
|
||||
}
|
||||
|
||||
/* void setName (in DOMString name); */
|
||||
|
@ -2101,7 +2101,7 @@ nsAccessible::RelationByType(PRUint32 aType)
|
|||
} else {
|
||||
// In XUL, use first <button default="true" .../> in the document
|
||||
nsCOMPtr<nsIDOMXULDocument> xulDoc =
|
||||
do_QueryInterface(mContent->GetOwnerDoc());
|
||||
do_QueryInterface(mContent->OwnerDoc());
|
||||
nsCOMPtr<nsIDOMXULButtonElement> buttonEl;
|
||||
if (xulDoc) {
|
||||
nsCOMPtr<nsIDOMNodeList> possibleDefaultButtons;
|
||||
|
@ -2176,7 +2176,7 @@ nsAccessible::GetRelations(nsIArray **aRelations)
|
|||
PRUint32 targets = 0;
|
||||
relation->GetTargetsCount(&targets);
|
||||
if (targets)
|
||||
relations->AppendElement(relation, PR_FALSE);
|
||||
relations->AppendElement(relation, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2302,7 +2302,7 @@ NS_IMETHODIMP nsAccessible::RemoveChildFromSelection(PRInt32 aIndex)
|
|||
NS_IMETHODIMP nsAccessible::IsChildSelected(PRInt32 aIndex, bool *aIsSelected)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsSelected);
|
||||
*aIsSelected = PR_FALSE;
|
||||
*aIsSelected = false;
|
||||
|
||||
if (IsDefunct() || !IsSelect())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -2327,7 +2327,7 @@ NS_IMETHODIMP
|
|||
nsAccessible::SelectAllSelection(bool* aIsMultiSelect)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsMultiSelect);
|
||||
*aIsMultiSelect = PR_FALSE;
|
||||
*aIsMultiSelect = false;
|
||||
|
||||
if (IsDefunct() || !IsSelect())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -2420,7 +2420,7 @@ NS_IMETHODIMP
|
|||
nsAccessible::GetValid(bool *aValid)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aValid);
|
||||
*aValid = PR_FALSE;
|
||||
*aValid = false;
|
||||
|
||||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -2434,7 +2434,7 @@ NS_IMETHODIMP
|
|||
nsAccessible::GetSelected(bool *aSelected)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aSelected);
|
||||
*aSelected = PR_FALSE;
|
||||
*aSelected = false;
|
||||
|
||||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -2569,26 +2569,26 @@ bool
|
|||
nsAccessible::AppendChild(nsAccessible* aChild)
|
||||
{
|
||||
if (!aChild)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
if (!mChildren.AppendElement(aChild))
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
if (!nsAccUtils::IsEmbeddedObject(aChild))
|
||||
SetChildrenFlag(eMixedChildren);
|
||||
|
||||
aChild->BindToParent(this, mChildren.Length() - 1);
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
nsAccessible::InsertChildAt(PRUint32 aIndex, nsAccessible* aChild)
|
||||
{
|
||||
if (!aChild)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
if (!mChildren.InsertElementAt(aIndex, aChild))
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
for (PRUint32 idx = aIndex + 1; idx < mChildren.Length(); idx++) {
|
||||
NS_ASSERTION(mChildren[idx]->mIndexInParent == idx - 1, "Accessible child index doesn't match");
|
||||
|
@ -2601,23 +2601,23 @@ nsAccessible::InsertChildAt(PRUint32 aIndex, nsAccessible* aChild)
|
|||
mEmbeddedObjCollector = nsnull;
|
||||
|
||||
aChild->BindToParent(this, aIndex);
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
nsAccessible::RemoveChild(nsAccessible* aChild)
|
||||
{
|
||||
if (!aChild)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
if (aChild->mParent != this || aChild->mIndexInParent == -1)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
PRUint32 index = static_cast<PRUint32>(aChild->mIndexInParent);
|
||||
if (index >= mChildren.Length() || mChildren[index] != aChild) {
|
||||
NS_ERROR("Child is bound to parent but parent hasn't this child at its index!");
|
||||
aChild->UnbindFromParent();
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
for (PRUint32 idx = index + 1; idx < mChildren.Length(); idx++) {
|
||||
|
@ -2629,7 +2629,7 @@ nsAccessible::RemoveChild(nsAccessible* aChild)
|
|||
mChildren.RemoveElementAt(index);
|
||||
mEmbeddedObjCollector = nsnull;
|
||||
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsAccessible*
|
||||
|
@ -2769,7 +2769,7 @@ nsAccessible::AnchorURIAt(PRUint32 aAnchorIndex)
|
|||
mContent->GetAttr(kNameSpaceID_XLink, nsGkAtoms::href, href);
|
||||
|
||||
nsCOMPtr<nsIURI> baseURI = mContent->GetBaseURI();
|
||||
nsCOMPtr<nsIDocument> document = mContent->GetOwnerDoc();
|
||||
nsCOMPtr<nsIDocument> document = mContent->OwnerDoc();
|
||||
nsIURI* anchorURI = nsnull;
|
||||
NS_NewURI(&anchorURI, href,
|
||||
document ? document->GetDocumentCharacterSet().get() : nsnull,
|
||||
|
@ -2808,7 +2808,7 @@ nsAccessible::SelectedItems()
|
|||
AccIterator iter(this, filters::GetSelected, AccIterator::eTreeNav);
|
||||
nsIAccessible* selected = nsnull;
|
||||
while ((selected = iter.Next()))
|
||||
selectedItems->AppendElement(selected, PR_FALSE);
|
||||
selectedItems->AppendElement(selected, false);
|
||||
|
||||
nsIMutableArray* items = nsnull;
|
||||
selectedItems.forget(&items);
|
||||
|
@ -2863,7 +2863,7 @@ nsAccessible::AddItemToSelection(PRUint32 aIndex)
|
|||
index++;
|
||||
|
||||
if (selected)
|
||||
selected->SetSelected(PR_TRUE);
|
||||
selected->SetSelected(true);
|
||||
|
||||
return static_cast<bool>(selected);
|
||||
}
|
||||
|
@ -2878,7 +2878,7 @@ nsAccessible::RemoveItemFromSelection(PRUint32 aIndex)
|
|||
index++;
|
||||
|
||||
if (selected)
|
||||
selected->SetSelected(PR_FALSE);
|
||||
selected->SetSelected(false);
|
||||
|
||||
return static_cast<bool>(selected);
|
||||
}
|
||||
|
@ -2892,7 +2892,7 @@ nsAccessible::SelectAll()
|
|||
AccIterator iter(this, filters::GetSelectable, AccIterator::eTreeNav);
|
||||
while((selectable = iter.Next())) {
|
||||
success = true;
|
||||
selectable->SetSelected(PR_TRUE);
|
||||
selectable->SetSelected(true);
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
@ -2906,7 +2906,7 @@ nsAccessible::UnselectAll()
|
|||
AccIterator iter(this, filters::GetSelected, AccIterator::eTreeNav);
|
||||
while ((selected = iter.Next())) {
|
||||
success = true;
|
||||
selected->SetSelected(PR_FALSE);
|
||||
selected->SetSelected(false);
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
@ -2942,7 +2942,7 @@ nsAccessible::CurrentItem()
|
|||
nsAutoString id;
|
||||
if (mContent->GetAttr(kNameSpaceID_None,
|
||||
nsGkAtoms::aria_activedescendant, id)) {
|
||||
nsIDocument* DOMDoc = mContent->GetOwnerDoc();
|
||||
nsIDocument* DOMDoc = mContent->OwnerDoc();
|
||||
dom::Element* activeDescendantElm = DOMDoc->GetElementById(id);
|
||||
if (activeDescendantElm) {
|
||||
nsDocAccessible* document = GetDocAccessible();
|
||||
|
@ -3057,7 +3057,7 @@ nsAccessible::GetFirstAvailableAccessible(nsINode *aStartNode) const
|
|||
if (accessible)
|
||||
return accessible;
|
||||
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(aStartNode->GetOwnerDoc());
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(aStartNode->OwnerDoc());
|
||||
NS_ENSURE_TRUE(domDoc, nsnull);
|
||||
|
||||
nsCOMPtr<nsIDOMNode> currentNode = do_QueryInterface(aStartNode);
|
||||
|
@ -3065,7 +3065,7 @@ nsAccessible::GetFirstAvailableAccessible(nsINode *aStartNode) const
|
|||
nsCOMPtr<nsIDOMTreeWalker> walker;
|
||||
domDoc->CreateTreeWalker(rootNode,
|
||||
nsIDOMNodeFilter::SHOW_ELEMENT | nsIDOMNodeFilter::SHOW_TEXT,
|
||||
nsnull, PR_FALSE, getter_AddRefs(walker));
|
||||
nsnull, false, getter_AddRefs(walker));
|
||||
NS_ENSURE_TRUE(walker, nsnull);
|
||||
|
||||
walker->SetCurrentNode(currentNode);
|
||||
|
|
|
@ -318,7 +318,7 @@ bool
|
|||
nsApplicationAccessible::Init()
|
||||
{
|
||||
mAppInfo = do_GetService("@mozilla.org/xre/app-info;1");
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -95,8 +95,8 @@ nsLinkableAccessible::
|
|||
nsLinkableAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
|
||||
nsAccessibleWrap(aContent, aShell),
|
||||
mActionAcc(nsnull),
|
||||
mIsLink(PR_FALSE),
|
||||
mIsOnclick(PR_FALSE)
|
||||
mIsLink(false),
|
||||
mIsOnclick(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -186,8 +186,8 @@ nsLinkableAccessible::AccessKey() const
|
|||
void
|
||||
nsLinkableAccessible::Shutdown()
|
||||
{
|
||||
mIsLink = PR_FALSE;
|
||||
mIsOnclick = PR_FALSE;
|
||||
mIsLink = false;
|
||||
mIsOnclick = false;
|
||||
mActionAcc = nsnull;
|
||||
nsAccessibleWrap::Shutdown();
|
||||
}
|
||||
|
@ -220,11 +220,11 @@ nsLinkableAccessible::BindToParent(nsAccessible* aParent,
|
|||
|
||||
// Cache action content.
|
||||
mActionAcc = nsnull;
|
||||
mIsLink = PR_FALSE;
|
||||
mIsOnclick = PR_FALSE;
|
||||
mIsLink = false;
|
||||
mIsOnclick = false;
|
||||
|
||||
if (nsCoreUtils::HasClickListener(mContent)) {
|
||||
mIsOnclick = PR_TRUE;
|
||||
mIsOnclick = true;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -235,14 +235,14 @@ nsLinkableAccessible::BindToParent(nsAccessible* aParent,
|
|||
while ((walkUpAcc = walkUpAcc->Parent()) && !walkUpAcc->IsDoc()) {
|
||||
if (walkUpAcc->Role() == nsIAccessibleRole::ROLE_LINK &&
|
||||
walkUpAcc->State() & states::LINKED) {
|
||||
mIsLink = PR_TRUE;
|
||||
mIsLink = true;
|
||||
mActionAcc = walkUpAcc;
|
||||
return;
|
||||
}
|
||||
|
||||
if (nsCoreUtils::HasClickListener(walkUpAcc->GetContent())) {
|
||||
mActionAcc = walkUpAcc;
|
||||
mIsOnclick = PR_TRUE;
|
||||
mIsOnclick = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -226,6 +226,10 @@ nsCaretAccessible::NotifySelectionChanged(nsIDOMDocument* aDOMDocument,
|
|||
printf("\nSelection changed, selection type: %s, notification %s\n",
|
||||
(isNormalSelection ? "normal" : "spellcheck"),
|
||||
(isIgnored ? "ignored" : "pending"));
|
||||
} else {
|
||||
bool isIgnored = !document || !document->IsContentLoaded();
|
||||
printf("\nSelection changed, selection type: unknown, notification %s\n",
|
||||
(isIgnored ? "ignored" : "pending"));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -382,11 +386,7 @@ nsCaretAccessible::GetSelectionControllerForNode(nsIContent *aContent)
|
|||
if (!aContent)
|
||||
return nsnull;
|
||||
|
||||
nsIDocument *document = aContent->GetOwnerDoc();
|
||||
if (!document)
|
||||
return nsnull;
|
||||
|
||||
nsIPresShell *presShell = document->GetShell();
|
||||
nsIPresShell *presShell = aContent->OwnerDoc()->GetShell();
|
||||
if (!presShell)
|
||||
return nsnull;
|
||||
|
||||
|
|
|
@ -77,9 +77,9 @@ static NS_DEFINE_IID(kRangeCID, NS_RANGE_CID);
|
|||
bool
|
||||
nsCoreUtils::HasClickListener(nsIContent *aContent)
|
||||
{
|
||||
NS_ENSURE_TRUE(aContent, PR_FALSE);
|
||||
NS_ENSURE_TRUE(aContent, false);
|
||||
nsEventListenerManager* listenerManager =
|
||||
aContent->GetListenerManager(PR_FALSE);
|
||||
aContent->GetListenerManager(false);
|
||||
|
||||
return listenerManager &&
|
||||
(listenerManager->HasListenersFor(NS_LITERAL_STRING("click")) ||
|
||||
|
@ -157,13 +157,13 @@ nsCoreUtils::DispatchMouseEvent(PRUint32 aEventType,
|
|||
{
|
||||
nsIFrame *frame = aContent->GetPrimaryFrame();
|
||||
if (!frame)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
// Compute x and y coordinates.
|
||||
nsPoint point;
|
||||
nsCOMPtr<nsIWidget> widget = frame->GetNearestWidget(point);
|
||||
if (!widget)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
nsSize size = frame->GetSize();
|
||||
|
||||
|
@ -174,7 +174,7 @@ nsCoreUtils::DispatchMouseEvent(PRUint32 aEventType,
|
|||
|
||||
// Fire mouse event.
|
||||
DispatchMouseEvent(aEventType, x, y, aContent, frame, aPresShell, widget);
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -182,7 +182,7 @@ nsCoreUtils::DispatchMouseEvent(PRUint32 aEventType, PRInt32 aX, PRInt32 aY,
|
|||
nsIContent *aContent, nsIFrame *aFrame,
|
||||
nsIPresShell *aPresShell, nsIWidget *aRootWidget)
|
||||
{
|
||||
nsMouseEvent event(PR_TRUE, aEventType, aRootWidget,
|
||||
nsMouseEvent event(true, aEventType, aRootWidget,
|
||||
nsMouseEvent::eReal, nsMouseEvent::eNormal);
|
||||
|
||||
event.refPoint = nsIntPoint(aX, aY);
|
||||
|
@ -207,11 +207,7 @@ nsCoreUtils::GetAccessKeyFor(nsIContent *aContent)
|
|||
if (!aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::accesskey))
|
||||
return 0;
|
||||
|
||||
nsCOMPtr<nsIDocument> doc = aContent->GetOwnerDoc();
|
||||
if (!doc)
|
||||
return 0;
|
||||
|
||||
nsCOMPtr<nsIPresShell> presShell = doc->GetShell();
|
||||
nsCOMPtr<nsIPresShell> presShell = aContent->OwnerDoc()->GetShell();
|
||||
if (!presShell)
|
||||
return 0;
|
||||
|
||||
|
@ -285,16 +281,16 @@ nsCoreUtils::IsAncestorOf(nsINode *aPossibleAncestorNode,
|
|||
nsINode *aPossibleDescendantNode,
|
||||
nsINode *aRootNode)
|
||||
{
|
||||
NS_ENSURE_TRUE(aPossibleAncestorNode && aPossibleDescendantNode, PR_FALSE);
|
||||
NS_ENSURE_TRUE(aPossibleAncestorNode && aPossibleDescendantNode, false);
|
||||
|
||||
nsINode *parentNode = aPossibleDescendantNode;
|
||||
while ((parentNode = parentNode->GetNodeParent()) &&
|
||||
parentNode != aRootNode) {
|
||||
if (parentNode == aPossibleAncestorNode)
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -340,7 +336,7 @@ nsCoreUtils::ScrollSubstringTo(nsIFrame *aFrame,
|
|||
selection->AddRange(scrollToRange);
|
||||
|
||||
privSel->ScrollIntoView(nsISelectionController::SELECTION_ANCHOR_REGION,
|
||||
PR_TRUE, aVPercent, aHPercent);
|
||||
true, aVPercent, aHPercent);
|
||||
|
||||
selection->CollapseToStart();
|
||||
|
||||
|
@ -439,11 +435,7 @@ nsCoreUtils::GetDocShellTreeItemFor(nsINode *aNode)
|
|||
if (!aNode)
|
||||
return nsnull;
|
||||
|
||||
nsIDocument *doc = aNode->GetOwnerDoc();
|
||||
NS_ASSERTION(doc, "No document for node passed in");
|
||||
NS_ENSURE_TRUE(doc, nsnull);
|
||||
|
||||
nsCOMPtr<nsISupports> container = doc->GetContainer();
|
||||
nsCOMPtr<nsISupports> container = aNode->OwnerDoc()->GetContainer();
|
||||
nsIDocShellTreeItem *docShellTreeItem = nsnull;
|
||||
if (container)
|
||||
CallQueryInterface(container, &docShellTreeItem);
|
||||
|
@ -505,7 +497,7 @@ nsCoreUtils::IsErrorPage(nsIDocument *aDocument)
|
|||
bool isAboutScheme = false;
|
||||
uri->SchemeIs("about", &isAboutScheme);
|
||||
if (!isAboutScheme)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
nsCAutoString path;
|
||||
uri->GetPath(path);
|
||||
|
@ -551,7 +543,7 @@ bool
|
|||
nsCoreUtils::GetID(nsIContent *aContent, nsAString& aID)
|
||||
{
|
||||
nsIAtom *idAttribute = aContent->GetIDAttributeName();
|
||||
return idAttribute ? aContent->GetAttr(kNameSpaceID_None, idAttribute, aID) : PR_FALSE;
|
||||
return idAttribute ? aContent->GetAttr(kNameSpaceID_None, idAttribute, aID) : false;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -564,18 +556,18 @@ nsCoreUtils::GetUIntAttr(nsIContent *aContent, nsIAtom *aAttr, PRInt32 *aUInt)
|
|||
PRInt32 integer = value.ToInteger(&error);
|
||||
if (NS_SUCCEEDED(error) && integer > 0) {
|
||||
*aUInt = integer;
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
nsCoreUtils::IsXLink(nsIContent *aContent)
|
||||
{
|
||||
if (!aContent)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
return aContent->AttrValueIs(kNameSpaceID_XLink, nsGkAtoms::type,
|
||||
nsGkAtoms::simple, eCaseMatters) &&
|
||||
|
@ -603,11 +595,8 @@ nsCoreUtils::GetComputedStyleDeclaration(const nsAString& aPseudoElt,
|
|||
return nsnull;
|
||||
|
||||
// Returns number of items in style declaration
|
||||
nsIDocument* document = content->GetOwnerDoc();
|
||||
if (!document)
|
||||
return nsnull;
|
||||
|
||||
nsCOMPtr<nsIDOMWindow> window = do_QueryInterface(document->GetWindow());
|
||||
nsCOMPtr<nsIDOMWindow> window =
|
||||
do_QueryInterface(content->OwnerDoc()->GetWindow());
|
||||
if (!window)
|
||||
return nsnull;
|
||||
|
||||
|
|
|
@ -150,7 +150,7 @@ public:
|
|||
* aPossibleAncestorNode
|
||||
* @param aRootNode [in, optional] the root node that search
|
||||
* search should be performed within
|
||||
* @return PR_TRUE if aPossibleAncestorNode is an ancestor of
|
||||
* @return true if aPossibleAncestorNode is an ancestor of
|
||||
* aPossibleDescendantNode
|
||||
*/
|
||||
static bool IsAncestorOf(nsINode *aPossibleAncestorNode,
|
||||
|
@ -254,8 +254,7 @@ public:
|
|||
*/
|
||||
static nsIPresShell *GetPresShellFor(nsINode *aNode)
|
||||
{
|
||||
nsIDocument *document = aNode->GetOwnerDoc();
|
||||
return document ? document->GetShell() : nsnull;
|
||||
return aNode->OwnerDoc()->GetShell();
|
||||
}
|
||||
static already_AddRefed<nsIWeakReference> GetWeakShellFor(nsINode *aNode)
|
||||
{
|
||||
|
@ -274,7 +273,7 @@ public:
|
|||
* Get the ID for an element, in some types of XML this may not be the ID attribute
|
||||
* @param aContent Node to get the ID for
|
||||
* @param aID Where to put ID string
|
||||
* @return PR_TRUE if there is an ID set for this node
|
||||
* @return true if there is an ID set for this node
|
||||
*/
|
||||
static bool GetID(nsIContent *aContent, nsAString& aID);
|
||||
|
||||
|
@ -289,7 +288,7 @@ public:
|
|||
* Check if the given element is XLink.
|
||||
*
|
||||
* @param aContent the given element
|
||||
* @return PR_TRUE if the given element is XLink
|
||||
* @return true if the given element is XLink
|
||||
*/
|
||||
static bool IsXLink(nsIContent *aContent);
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
#include "nsIXULDocument.h"
|
||||
#endif
|
||||
|
||||
namespace dom = mozilla::dom;
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::a11y;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -587,7 +587,7 @@ nsDocAccessible::Init()
|
|||
nsCOMPtr<nsIPresShell> shell(GetPresShell());
|
||||
mNotificationController = new NotificationController(this, shell);
|
||||
if (!mNotificationController)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
// Mark the document accessible as loaded if its DOM document was loaded at
|
||||
// this point (this can happen because a11y is started late or DOM document
|
||||
|
@ -596,7 +596,7 @@ nsDocAccessible::Init()
|
|||
mLoadState |= eDOMLoaded;
|
||||
|
||||
AddEventListeners();
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -879,7 +879,7 @@ NS_IMETHODIMP nsDocAccessible::Observe(nsISupports *aSubject, const char *aTopic
|
|||
// accessible object. See the AccStateChangeEvent constructor for details
|
||||
// about this exceptional case.
|
||||
nsRefPtr<AccEvent> event =
|
||||
new AccStateChangeEvent(this, states::EDITABLE, PR_TRUE);
|
||||
new AccStateChangeEvent(this, states::EDITABLE, true);
|
||||
FireDelayedAccessibleEvent(event);
|
||||
}
|
||||
|
||||
|
@ -1182,7 +1182,7 @@ nsDocAccessible::ARIAActiveDescendantChanged(nsIContent* aElm)
|
|||
if (FocusMgr()->HasDOMFocus(aElm)) {
|
||||
nsAutoString id;
|
||||
if (aElm->GetAttr(kNameSpaceID_None, nsGkAtoms::aria_activedescendant, id)) {
|
||||
nsIDocument* DOMDoc = aElm->GetOwnerDoc();
|
||||
nsIDocument* DOMDoc = aElm->OwnerDoc();
|
||||
dom::Element* activeDescendantElm = DOMDoc->GetElementById(id);
|
||||
if (activeDescendantElm) {
|
||||
nsAccessible* activeDescendant = GetAccessible(activeDescendantElm);
|
||||
|
@ -1213,7 +1213,7 @@ void nsDocAccessible::ContentStateChanged(nsIDocument* aDocument,
|
|||
|
||||
if (aStateMask.HasState(NS_EVENT_STATE_INVALID)) {
|
||||
nsRefPtr<AccEvent> event =
|
||||
new AccStateChangeEvent(aContent, states::INVALID, PR_TRUE);
|
||||
new AccStateChangeEvent(aContent, states::INVALID, true);
|
||||
FireDelayedAccessibleEvent(event);
|
||||
}
|
||||
}
|
||||
|
@ -1492,7 +1492,7 @@ nsDocAccessible::NotifyOfLoading(bool aIsReloading)
|
|||
// Fire state busy change event. Use delayed event since we don't care
|
||||
// actually if event isn't delivered when the document goes away like a shot.
|
||||
nsRefPtr<AccEvent> stateEvent =
|
||||
new AccStateChangeEvent(mDocument, states::BUSY, PR_TRUE);
|
||||
new AccStateChangeEvent(mDocument, states::BUSY, true);
|
||||
FireDelayedAccessibleEvent(stateEvent);
|
||||
}
|
||||
|
||||
|
@ -1547,7 +1547,7 @@ nsDocAccessible::ProcessLoad()
|
|||
|
||||
// Fire busy state change event.
|
||||
nsRefPtr<AccEvent> stateEvent =
|
||||
new AccStateChangeEvent(this, states::BUSY, PR_FALSE);
|
||||
new AccStateChangeEvent(this, states::BUSY, false);
|
||||
nsEventShell::FireEvent(stateEvent);
|
||||
}
|
||||
|
||||
|
@ -1730,33 +1730,26 @@ nsDocAccessible::FireDelayedAccessibleEvent(AccEvent* aEvent)
|
|||
void
|
||||
nsDocAccessible::ProcessPendingEvent(AccEvent* aEvent)
|
||||
{
|
||||
nsAccessible* accessible = aEvent->GetAccessible();
|
||||
if (!accessible)
|
||||
return;
|
||||
|
||||
PRUint32 eventType = aEvent->GetEventType();
|
||||
if (eventType == nsIAccessibleEvent::EVENT_TEXT_CARET_MOVED) {
|
||||
nsCOMPtr<nsIAccessibleText> accessibleText = do_QueryObject(accessible);
|
||||
nsHyperTextAccessible* hyperText = aEvent->GetAccessible()->AsHyperText();
|
||||
PRInt32 caretOffset;
|
||||
if (accessibleText &&
|
||||
NS_SUCCEEDED(accessibleText->GetCaretOffset(&caretOffset))) {
|
||||
if (hyperText &&
|
||||
NS_SUCCEEDED(hyperText->GetCaretOffset(&caretOffset))) {
|
||||
#ifdef DEBUG_A11Y
|
||||
PRUnichar chAtOffset;
|
||||
accessibleText->GetCharacterAtOffset(caretOffset, &chAtOffset);
|
||||
hyperText->GetCharacterAtOffset(caretOffset, &chAtOffset);
|
||||
printf("\nCaret moved to %d with char %c", caretOffset, chAtOffset);
|
||||
#endif
|
||||
nsRefPtr<AccEvent> caretMoveEvent =
|
||||
new AccCaretMoveEvent(accessible, caretOffset);
|
||||
if (!caretMoveEvent)
|
||||
return;
|
||||
|
||||
new AccCaretMoveEvent(hyperText, caretOffset);
|
||||
nsEventShell::FireEvent(caretMoveEvent);
|
||||
|
||||
PRInt32 selectionCount;
|
||||
accessibleText->GetSelectionCount(&selectionCount);
|
||||
hyperText->GetSelectionCount(&selectionCount);
|
||||
if (selectionCount) { // There's a selection so fire selection change as well
|
||||
nsEventShell::FireEvent(nsIAccessibleEvent::EVENT_TEXT_SELECTION_CHANGED,
|
||||
accessible);
|
||||
hyperText);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1765,7 +1758,7 @@ nsDocAccessible::ProcessPendingEvent(AccEvent* aEvent)
|
|||
|
||||
// Post event processing
|
||||
if (eventType == nsIAccessibleEvent::EVENT_HIDE)
|
||||
ShutdownChildrenInSubtree(accessible);
|
||||
ShutdownChildrenInSubtree(aEvent->GetAccessible());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -188,13 +188,13 @@ nsOuterDocAccessible::AppendChild(nsAccessible *aAccessible)
|
|||
mChildren[0]->Shutdown();
|
||||
|
||||
if (!nsAccessible::AppendChild(aAccessible))
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
NS_LOG_ACCDOCCREATE("append document to outerdoc",
|
||||
aAccessible->GetDocumentNode())
|
||||
NS_LOG_ACCDOCCREATE_ACCADDRESS("outerdoc", this)
|
||||
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -203,7 +203,7 @@ nsOuterDocAccessible::RemoveChild(nsAccessible *aAccessible)
|
|||
nsAccessible *child = mChildren.SafeElementAt(0, nsnull);
|
||||
if (child != aAccessible) {
|
||||
NS_ERROR("Wrong child to remove!");
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
NS_LOG_ACCDOCDESTROY_FOR("remove document from outerdoc",
|
||||
|
|
|
@ -35,6 +35,8 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "mozilla/Util.h"
|
||||
|
||||
#define CreateEvent CreateEventA
|
||||
#include "nsIDOMDocument.h"
|
||||
|
||||
|
@ -83,7 +85,7 @@
|
|||
#include "nsIXULWindow.h"
|
||||
#endif
|
||||
|
||||
namespace dom = mozilla::dom;
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::a11y;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -255,10 +257,10 @@ nsresult nsRootAccessible::AddEventListeners()
|
|||
|
||||
if (nstarget) {
|
||||
for (const char* const* e = docEvents,
|
||||
* const* e_end = docEvents + NS_ARRAY_LENGTH(docEvents);
|
||||
* const* e_end = ArrayEnd(docEvents);
|
||||
e < e_end; ++e) {
|
||||
nsresult rv = nstarget->AddEventListener(NS_ConvertASCIItoUTF16(*e),
|
||||
this, PR_TRUE, PR_TRUE, 2);
|
||||
this, true, true, 2);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
}
|
||||
|
@ -275,9 +277,9 @@ nsresult nsRootAccessible::RemoveEventListeners()
|
|||
nsCOMPtr<nsIDOMEventTarget> target(do_QueryInterface(mDocument));
|
||||
if (target) {
|
||||
for (const char* const* e = docEvents,
|
||||
* const* e_end = docEvents + NS_ARRAY_LENGTH(docEvents);
|
||||
* const* e_end = ArrayEnd(docEvents);
|
||||
e < e_end; ++e) {
|
||||
nsresult rv = target->RemoveEventListener(NS_ConvertASCIItoUTF16(*e), this, PR_TRUE);
|
||||
nsresult rv = target->RemoveEventListener(NS_ConvertASCIItoUTF16(*e), this, true);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
}
|
||||
|
@ -322,7 +324,7 @@ nsRootAccessible::HandleEvent(nsIDOMEvent* aDOMEvent)
|
|||
return NS_OK;
|
||||
|
||||
nsDocAccessible* document =
|
||||
GetAccService()->GetDocAccessible(origTargetNode->GetOwnerDoc());
|
||||
GetAccService()->GetDocAccessible(origTargetNode->OwnerDoc());
|
||||
|
||||
if (document) {
|
||||
#ifdef DEBUG_NOTIFICATIONS
|
||||
|
@ -676,7 +678,7 @@ nsRootAccessible::HandlePopupShownEvent(nsAccessible* aAccessible)
|
|||
if (comboboxRole == nsIAccessibleRole::ROLE_COMBOBOX ||
|
||||
comboboxRole == nsIAccessibleRole::ROLE_AUTOCOMPLETE) {
|
||||
nsRefPtr<AccEvent> event =
|
||||
new AccStateChangeEvent(combobox, states::EXPANDED, PR_TRUE);
|
||||
new AccStateChangeEvent(combobox, states::EXPANDED, true);
|
||||
if (event)
|
||||
nsEventShell::FireEvent(event);
|
||||
}
|
||||
|
@ -782,7 +784,7 @@ nsRootAccessible::HandlePopupHidingEvent(nsINode* aPopupNode)
|
|||
// Fire expanded state change event.
|
||||
if (notifyOf & kNotifyOfState) {
|
||||
nsRefPtr<AccEvent> event =
|
||||
new AccStateChangeEvent(widget, states::EXPANDED, PR_FALSE);
|
||||
new AccStateChangeEvent(widget, states::EXPANDED, false);
|
||||
document->FireDelayedAccessibleEvent(event);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -234,7 +234,7 @@ nsTextAttrsMgr::GetRange(const nsTArray<nsITextAttr*>& aTextAttrArray,
|
|||
for (PRUint32 attrIdx = 0; attrIdx < attrLen; attrIdx++) {
|
||||
nsITextAttr *textAttr = aTextAttrArray[attrIdx];
|
||||
if (!textAttr->Equal(currElm)) {
|
||||
offsetFound = PR_TRUE;
|
||||
offsetFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -262,7 +262,7 @@ nsTextAttrsMgr::GetRange(const nsTArray<nsITextAttr*>& aTextAttrArray,
|
|||
// Alter the end offset when text attribute changes its value and stop
|
||||
// the search.
|
||||
if (!textAttr->Equal(currElm)) {
|
||||
offsetFound = PR_TRUE;
|
||||
offsetFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -336,19 +336,19 @@ nsCSSTextAttr::GetValueFor(nsIContent *aContent, nsAutoString *aValue)
|
|||
nsCOMPtr<nsIDOMCSSStyleDeclaration> currStyleDecl =
|
||||
nsCoreUtils::GetComputedStyleDeclaration(EmptyString(), aContent);
|
||||
if (!currStyleDecl)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
NS_ConvertASCIItoUTF16 cssName(gCSSTextAttrsMap[mIndex].mCSSName);
|
||||
|
||||
nsresult rv = currStyleDecl->GetPropertyValue(cssName, *aValue);
|
||||
if (NS_FAILED(rv))
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
|
||||
const char *cssValue = gCSSTextAttrsMap[mIndex].mCSSValue;
|
||||
if (cssValue != kAnyValue && !aValue->EqualsASCII(cssValue))
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -379,7 +379,7 @@ nsBGColorTextAttr::GetValueFor(nsIContent *aContent, nscolor *aValue)
|
|||
{
|
||||
nsIFrame *frame = aContent->GetPrimaryFrame();
|
||||
if (!frame)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
return GetColor(frame, aValue);
|
||||
}
|
||||
|
@ -407,20 +407,20 @@ nsBGColorTextAttr::GetColor(nsIFrame *aFrame, nscolor *aColor)
|
|||
|
||||
if (NS_GET_A(styleBackground->mBackgroundColor) > 0) {
|
||||
*aColor = styleBackground->mBackgroundColor;
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
nsIFrame *parentFrame = aFrame->GetParent();
|
||||
if (!parentFrame) {
|
||||
*aColor = aFrame->PresContext()->DefaultBackgroundColor();
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Each frame of parents chain for the initially passed 'aFrame' has
|
||||
// transparent background color. So background color isn't changed from
|
||||
// 'mRootFrame' to initially passed 'aFrame'.
|
||||
if (parentFrame == mRootFrame)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
return GetColor(parentFrame, aColor);
|
||||
}
|
||||
|
@ -436,11 +436,11 @@ nsFontSizeTextAttr::nsFontSizeTextAttr(nsIFrame *aRootFrame, nsIFrame *aFrame) :
|
|||
mDC = aRootFrame->PresContext()->DeviceContext();
|
||||
|
||||
mRootNativeValue = GetFontSize(aRootFrame);
|
||||
mIsRootDefined = PR_TRUE;
|
||||
mIsRootDefined = true;
|
||||
|
||||
if (aFrame) {
|
||||
mNativeValue = GetFontSize(aFrame);
|
||||
mIsDefined = PR_TRUE;
|
||||
mIsDefined = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -449,10 +449,10 @@ nsFontSizeTextAttr::GetValueFor(nsIContent *aContent, nscoord *aValue)
|
|||
{
|
||||
nsIFrame *frame = aContent->GetPrimaryFrame();
|
||||
if (!frame)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
*aValue = GetFontSize(frame);
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -493,11 +493,11 @@ nsFontWeightTextAttr::nsFontWeightTextAttr(nsIFrame *aRootFrame,
|
|||
nsTextAttr<PRInt32>(aFrame == nsnull)
|
||||
{
|
||||
mRootNativeValue = GetFontWeight(aRootFrame);
|
||||
mIsRootDefined = PR_TRUE;
|
||||
mIsRootDefined = true;
|
||||
|
||||
if (aFrame) {
|
||||
mNativeValue = GetFontWeight(aFrame);
|
||||
mIsDefined = PR_TRUE;
|
||||
mIsDefined = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -506,10 +506,10 @@ nsFontWeightTextAttr::GetValueFor(nsIContent *aContent, PRInt32 *aValue)
|
|||
{
|
||||
nsIFrame *frame = aContent->GetPrimaryFrame();
|
||||
if (!frame)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
*aValue = GetFontWeight(frame);
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -188,10 +188,10 @@ public:
|
|||
}
|
||||
|
||||
if (!isDefined)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
Format(*nativeValue, aValue);
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool Equal(nsIContent *aContent)
|
||||
|
@ -200,7 +200,7 @@ public:
|
|||
bool isDefined = GetValueFor(aContent, &nativeValue);
|
||||
|
||||
if (!mIsDefined && !isDefined)
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
|
||||
if (mIsDefined && isDefined)
|
||||
return nativeValue == mNativeValue;
|
||||
|
|
|
@ -120,7 +120,7 @@ nsTextEquivUtils::AppendTextEquivFromContent(nsAccessible *aInitiatorAcc,
|
|||
|
||||
nsCOMPtr<nsIWeakReference> shell = nsCoreUtils::GetWeakShellFor(aContent);
|
||||
if (!shell) {
|
||||
NS_ASSERTION(PR_TRUE, "There is no presshell!");
|
||||
NS_ASSERTION(true, "There is no presshell!");
|
||||
gInitiatorAcc = nsnull;
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
@ -139,7 +139,7 @@ nsTextEquivUtils::AppendTextEquivFromContent(nsAccessible *aInitiatorAcc,
|
|||
GetAccService()->GetAccessibleInWeakShell(aContent, shell);
|
||||
if (accessible) {
|
||||
rv = AppendFromAccessible(accessible, aString);
|
||||
goThroughDOMSubtree = PR_FALSE;
|
||||
goThroughDOMSubtree = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -167,7 +167,7 @@ nsTextEquivUtils::AppendTextEquivFromTextContent(nsIContent *aContent,
|
|||
const nsStyleDisplay* display = frame->GetStyleDisplay();
|
||||
if (display->IsBlockOutside() ||
|
||||
display->mDisplay == NS_STYLE_DISPLAY_TABLE_CELL) {
|
||||
isHTMLBlock = PR_TRUE;
|
||||
isHTMLBlock = true;
|
||||
if (!aString->IsEmpty()) {
|
||||
aString->Append(PRUnichar(' '));
|
||||
}
|
||||
|
@ -250,7 +250,7 @@ nsTextEquivUtils::AppendFromAccessible(nsAccessible *aAccessible,
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (rv != NS_OK_NO_NAME_CLAUSE_HANDLED)
|
||||
isEmptyTextEquiv = PR_FALSE;
|
||||
isEmptyTextEquiv = false;
|
||||
|
||||
// Implementation of g) step of text equivalent computation guide. Go down
|
||||
// into subtree if accessible allows "text equivalent from subtree rule" or
|
||||
|
@ -262,7 +262,7 @@ nsTextEquivUtils::AppendFromAccessible(nsAccessible *aAccessible,
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (rv != NS_OK_NO_NAME_CLAUSE_HANDLED)
|
||||
isEmptyTextEquiv = PR_FALSE;
|
||||
isEmptyTextEquiv = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -382,13 +382,13 @@ nsTextEquivUtils::AppendString(nsAString *aString,
|
|||
{
|
||||
// Insert spaces to insure that words from controls aren't jammed together.
|
||||
if (aTextEquivalent.IsEmpty())
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
if (!aString->IsEmpty())
|
||||
aString->Append(PRUnichar(' '));
|
||||
|
||||
aString->Append(aTextEquivalent);
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -201,7 +201,7 @@ nsHTMLRadioButtonAccessible::GetPositionAndSizeInternal(PRInt32 *aPosInSet,
|
|||
if (form) {
|
||||
form->GetElementsByTagNameNS(nsURI, tagName, getter_AddRefs(inputs));
|
||||
} else {
|
||||
nsIDocument* doc = mContent->GetOwnerDoc();
|
||||
nsIDocument* doc = mContent->OwnerDoc();
|
||||
nsCOMPtr<nsIDOMDocument> document(do_QueryInterface(doc));
|
||||
if (document)
|
||||
document->GetElementsByTagNameNS(nsURI, tagName, getter_AddRefs(inputs));
|
||||
|
|
|
@ -167,7 +167,7 @@ nsHTMLImageAccessible::DoAction(PRUint8 aIndex)
|
|||
nsresult rv = element->GetLongDesc(longDesc);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsIDocument* document = mContent->GetOwnerDoc();
|
||||
nsIDocument* document = mContent->OwnerDoc();
|
||||
nsCOMPtr<nsPIDOMWindow> piWindow = document->GetWindow();
|
||||
nsCOMPtr<nsIDOMWindow> win = do_QueryInterface(piWindow);
|
||||
NS_ENSURE_TRUE(win, NS_ERROR_FAILURE);
|
||||
|
@ -225,7 +225,7 @@ bool
|
|||
nsHTMLImageAccessible::HasLongDesc()
|
||||
{
|
||||
if (IsDefunct())
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
return mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::longdesc);
|
||||
}
|
||||
|
@ -234,7 +234,7 @@ bool
|
|||
nsHTMLImageAccessible::IsValidLongDescIndex(PRUint8 aIndex)
|
||||
{
|
||||
if (!HasLongDesc())
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
return aIndex == nsLinkableAccessible::ActionCount();
|
||||
}
|
||||
|
|
|
@ -182,7 +182,7 @@ bool
|
|||
nsHTMLLinkAccessible::IsLinked()
|
||||
{
|
||||
if (IsDefunct())
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
nsEventStates state = mContent->AsElement()->State();
|
||||
return state.HasAtLeastOneOfStates(NS_EVENT_STATE_VISITED |
|
||||
|
|
|
@ -356,7 +356,7 @@ nsHTMLSelectOptionAccessible::GetPositionAndSizeInternal(PRInt32 *aPosInSet,
|
|||
if (childContent->NodeInfo()->Equals(mContent->NodeInfo())) {
|
||||
if (!isContentFound) {
|
||||
if (childContent == mContent)
|
||||
isContentFound = PR_TRUE;
|
||||
isContentFound = true;
|
||||
|
||||
posInSet++;
|
||||
}
|
||||
|
|
|
@ -248,7 +248,7 @@ NS_IMETHODIMP
|
|||
nsHTMLTableCellAccessible::IsSelected(bool *aIsSelected)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsSelected);
|
||||
*aIsSelected = PR_FALSE;
|
||||
*aIsSelected = false;
|
||||
|
||||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -328,7 +328,7 @@ nsHTMLTableCellAccessible::GetHeaderCells(PRInt32 aRowOrColumnHeaderCell,
|
|||
|
||||
if (headerCell && headerCell->Role() == desiredRole)
|
||||
headerCells->AppendElement(static_cast<nsIAccessible*>(headerCell),
|
||||
PR_FALSE);
|
||||
false);
|
||||
} while ((headerCellElm = iter.NextElem()));
|
||||
|
||||
NS_ADDREF(*aHeaderCells = headerCells);
|
||||
|
@ -700,7 +700,7 @@ nsHTMLTableAccessible::GetSelectedCells(nsIArray **aCells)
|
|||
nsCOMPtr<nsIContent> cellContent(do_QueryInterface(cellElement));
|
||||
nsAccessible *cell =
|
||||
GetAccService()->GetAccessibleInWeakShell(cellContent, mWeakShell);
|
||||
selCells->AppendElement(static_cast<nsIAccessible*>(cell), PR_FALSE);
|
||||
selCells->AppendElement(static_cast<nsIAccessible*>(cell), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -751,10 +751,10 @@ nsHTMLTableAccessible::GetSelectedCellIndices(PRUint32 *aNumCells,
|
|||
|
||||
if (NS_SUCCEEDED(rv) && startRowIndex == rowIndex &&
|
||||
startColIndex == columnIndex && isSelected) {
|
||||
states[index] = PR_TRUE;
|
||||
states[index] = true;
|
||||
(*aNumCells)++;
|
||||
} else {
|
||||
states[index] = PR_FALSE;
|
||||
states[index] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1015,7 +1015,7 @@ NS_IMETHODIMP
|
|||
nsHTMLTableAccessible::IsColumnSelected(PRInt32 aColumn, bool *aIsSelected)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsSelected);
|
||||
*aIsSelected = PR_FALSE;
|
||||
*aIsSelected = false;
|
||||
|
||||
PRInt32 colCount = 0;
|
||||
nsresult rv = GetColumnCount(&colCount);
|
||||
|
@ -1045,7 +1045,7 @@ NS_IMETHODIMP
|
|||
nsHTMLTableAccessible::IsRowSelected(PRInt32 aRow, bool *aIsSelected)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsSelected);
|
||||
*aIsSelected = PR_FALSE;
|
||||
*aIsSelected = false;
|
||||
|
||||
PRInt32 rowCount = 0;
|
||||
nsresult rv = GetRowCount(&rowCount);
|
||||
|
@ -1076,7 +1076,7 @@ nsHTMLTableAccessible::IsCellSelected(PRInt32 aRow, PRInt32 aColumn,
|
|||
bool *aIsSelected)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsSelected);
|
||||
*aIsSelected = PR_FALSE;
|
||||
*aIsSelected = false;
|
||||
|
||||
nsITableLayout *tableLayout = GetTableLayout();
|
||||
NS_ENSURE_STATE(tableLayout);
|
||||
|
@ -1104,7 +1104,7 @@ nsHTMLTableAccessible::SelectRow(PRInt32 aRow)
|
|||
nsresult rv =
|
||||
RemoveRowsOrColumnsFromSelection(aRow,
|
||||
nsISelectionPrivate::TABLESELECTION_ROW,
|
||||
PR_TRUE);
|
||||
true);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return AddRowOrColumnToSelection(aRow,
|
||||
|
@ -1120,7 +1120,7 @@ nsHTMLTableAccessible::SelectColumn(PRInt32 aColumn)
|
|||
nsresult rv =
|
||||
RemoveRowsOrColumnsFromSelection(aColumn,
|
||||
nsISelectionPrivate::TABLESELECTION_COLUMN,
|
||||
PR_TRUE);
|
||||
true);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return AddRowOrColumnToSelection(aColumn,
|
||||
|
@ -1136,7 +1136,7 @@ nsHTMLTableAccessible::UnselectRow(PRInt32 aRow)
|
|||
return
|
||||
RemoveRowsOrColumnsFromSelection(aRow,
|
||||
nsISelectionPrivate::TABLESELECTION_ROW,
|
||||
PR_FALSE);
|
||||
false);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -1148,7 +1148,7 @@ nsHTMLTableAccessible::UnselectColumn(PRInt32 aColumn)
|
|||
return
|
||||
RemoveRowsOrColumnsFromSelection(aColumn,
|
||||
nsISelectionPrivate::TABLESELECTION_COLUMN,
|
||||
PR_FALSE);
|
||||
false);
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -1305,29 +1305,29 @@ nsHTMLTableAccessible::HasDescendant(const nsAString& aTagName,
|
|||
bool aAllowEmpty)
|
||||
{
|
||||
nsCOMPtr<nsIDOMElement> tableElt(do_QueryInterface(mContent));
|
||||
NS_ENSURE_TRUE(tableElt, PR_FALSE);
|
||||
NS_ENSURE_TRUE(tableElt, false);
|
||||
|
||||
nsCOMPtr<nsIDOMNodeList> nodeList;
|
||||
tableElt->GetElementsByTagName(aTagName, getter_AddRefs(nodeList));
|
||||
NS_ENSURE_TRUE(nodeList, PR_FALSE);
|
||||
NS_ENSURE_TRUE(nodeList, false);
|
||||
|
||||
nsCOMPtr<nsIDOMNode> foundItem;
|
||||
nodeList->Item(0, getter_AddRefs(foundItem));
|
||||
if (!foundItem)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
if (aAllowEmpty)
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
|
||||
// Make sure that the item we found has contents and either has multiple
|
||||
// children or the found item is not a whitespace-only text node.
|
||||
nsCOMPtr<nsIContent> foundItemContent = do_QueryInterface(foundItem);
|
||||
if (foundItemContent->GetChildCount() > 1)
|
||||
return PR_TRUE; // Treat multiple child nodes as non-empty
|
||||
return true; // Treat multiple child nodes as non-empty
|
||||
|
||||
nsIContent *innerItemContent = foundItemContent->GetChildAt(0);
|
||||
if (innerItemContent && !innerItemContent->TextIsOnlyWhitespace())
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
|
||||
// If we found more than one node then return true not depending on
|
||||
// aAllowEmpty flag.
|
||||
|
@ -1387,6 +1387,12 @@ nsHTMLTableAccessible::IsProbablyForLayout(bool *aIsProbablyForLayout)
|
|||
RETURN_LAYOUT_ANSWER(false, "Has role attribute, weak role, and role is table");
|
||||
}
|
||||
|
||||
// Check if datatable attribute has "0" value.
|
||||
if (mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::datatable,
|
||||
NS_LITERAL_STRING("0"), eCaseMatters)) {
|
||||
RETURN_LAYOUT_ANSWER(true, "Has datatable = 0 attribute, it's for layout");
|
||||
}
|
||||
|
||||
// Check for legitimate data table attributes.
|
||||
nsAutoString summary;
|
||||
if (mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::summary, summary) &&
|
||||
|
@ -1493,7 +1499,7 @@ nsHTMLTableAccessible::IsProbablyForLayout(bool *aIsProbablyForLayout)
|
|||
|
||||
lastRowColor = color;
|
||||
styleDecl->GetPropertyValue(NS_LITERAL_STRING("background-color"), color);
|
||||
if (rowCount > 0 && PR_FALSE == lastRowColor.Equals(color)) {
|
||||
if (rowCount > 0 && false == lastRowColor.Equals(color)) {
|
||||
RETURN_LAYOUT_ANSWER(false, "2 styles of row background color, non-bordered");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
|
||||
#include "nsIClipboard.h"
|
||||
#include "nsContentCID.h"
|
||||
#include "nsFocusManager.h"
|
||||
#include "nsIDOMCharacterData.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMRange.h"
|
||||
|
@ -215,7 +216,7 @@ nsIntRect nsHyperTextAccessible::GetBoundsForString(nsIFrame *aFrame, PRUint32 a
|
|||
PRInt32 startContentOffsetInFrame;
|
||||
// Get the right frame continuation -- not really a child, but a sibling of
|
||||
// the primary frame passed in
|
||||
rv = aFrame->GetChildFrameContainingOffset(startContentOffset, PR_FALSE,
|
||||
rv = aFrame->GetChildFrameContainingOffset(startContentOffset, false,
|
||||
&startContentOffsetInFrame, &frame);
|
||||
NS_ENSURE_SUCCESS(rv, screenRect);
|
||||
|
||||
|
@ -366,7 +367,7 @@ nsHyperTextAccessible::GetPosAndText(PRInt32& aStartOffset, PRInt32& aEndOffset,
|
|||
else {
|
||||
contentOffset = startOffset;
|
||||
}
|
||||
frame->GetChildFrameContainingOffset(contentOffset, PR_TRUE,
|
||||
frame->GetChildFrameContainingOffset(contentOffset, true,
|
||||
&outStartLineUnused, &frame);
|
||||
if (aEndFrame) {
|
||||
*aEndFrame = frame; // We ended in the current frame
|
||||
|
@ -908,17 +909,9 @@ nsresult nsHyperTextAccessible::GetTextHelper(EGetTextType aType, nsAccessibleTe
|
|||
// or the start of a new line. Getting text at the line should provide the line with the visual caret,
|
||||
// otherwise screen readers will announce the wrong line as the user presses up or down arrow and land
|
||||
// at the end of a line.
|
||||
nsCOMPtr<nsISelection> domSel;
|
||||
nsresult rv = GetSelections(nsISelectionController::SELECTION_NORMAL,
|
||||
nsnull, getter_AddRefs(domSel));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsISelectionPrivate> privateSelection(do_QueryInterface(domSel));
|
||||
nsRefPtr<nsFrameSelection> frameSelection;
|
||||
rv = privateSelection->GetFrameSelection(getter_AddRefs(frameSelection));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (frameSelection->GetHint() == nsFrameSelection::HINTLEFT) {
|
||||
nsRefPtr<nsFrameSelection> frameSelection = FrameSelection();
|
||||
if (frameSelection &&
|
||||
frameSelection->GetHint() == nsFrameSelection::HINTLEFT) {
|
||||
-- aOffset; // We are at the start of a line
|
||||
}
|
||||
}
|
||||
|
@ -937,7 +930,7 @@ nsresult nsHyperTextAccessible::GetTextHelper(EGetTextType aType, nsAccessibleTe
|
|||
break;
|
||||
|
||||
case BOUNDARY_WORD_START:
|
||||
needsStart = PR_TRUE;
|
||||
needsStart = true;
|
||||
amount = eSelectWord;
|
||||
break;
|
||||
|
||||
|
@ -949,7 +942,7 @@ nsresult nsHyperTextAccessible::GetTextHelper(EGetTextType aType, nsAccessibleTe
|
|||
// Newlines are considered at the end of a line. Since getting
|
||||
// the BOUNDARY_LINE_START gets the text from the line-start to the next
|
||||
// line-start, the newline is included at the end of the string.
|
||||
needsStart = PR_TRUE;
|
||||
needsStart = true;
|
||||
amount = eSelectLine;
|
||||
break;
|
||||
|
||||
|
@ -962,7 +955,7 @@ nsresult nsHyperTextAccessible::GetTextHelper(EGetTextType aType, nsAccessibleTe
|
|||
|
||||
case BOUNDARY_ATTRIBUTE_RANGE:
|
||||
{
|
||||
nsresult rv = GetTextAttributes(PR_FALSE, aOffset,
|
||||
nsresult rv = GetTextAttributes(false, aOffset,
|
||||
aStartOffset, aEndOffset, nsnull);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
|
@ -1144,7 +1137,7 @@ nsHyperTextAccessible::GetTextAttributes(bool aIncludeDefAttrs,
|
|||
// default attributes if they were requested, otherwise return empty set.
|
||||
if (aOffset == 0) {
|
||||
if (aIncludeDefAttrs) {
|
||||
nsTextAttrsMgr textAttrsMgr(this, PR_TRUE, nsnull, -1);
|
||||
nsTextAttrsMgr textAttrsMgr(this, true, nsnull, -1);
|
||||
return textAttrsMgr.GetAttributes(*aAttributes);
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -1201,7 +1194,7 @@ nsHyperTextAccessible::GetDefaultTextAttributes(nsIPersistentProperties **aAttri
|
|||
|
||||
NS_ADDREF(*aAttributes = attributes);
|
||||
|
||||
nsTextAttrsMgr textAttrsMgr(this, PR_TRUE);
|
||||
nsTextAttrsMgr textAttrsMgr(this, true);
|
||||
return textAttrsMgr.GetAttributes(*aAttributes);
|
||||
}
|
||||
|
||||
|
@ -1360,7 +1353,7 @@ nsHyperTextAccessible::GetOffsetAtPoint(PRInt32 aX, PRInt32 aY,
|
|||
if (pointInFrame.x < frameSize.width && pointInFrame.y < frameSize.height) {
|
||||
// Finished
|
||||
if (frame->GetType() == nsGkAtoms::textFrame) {
|
||||
nsIFrame::ContentOffsets contentOffsets = frame->GetContentOffsetsFromPointExternal(pointInFrame, PR_TRUE);
|
||||
nsIFrame::ContentOffsets contentOffsets = frame->GetContentOffsetsFromPointExternal(pointInFrame, true);
|
||||
if (contentOffsets.IsNull() || contentOffsets.content != content) {
|
||||
return NS_OK; // Not found, will return -1
|
||||
}
|
||||
|
@ -1587,26 +1580,33 @@ nsHyperTextAccessible::SetSelectionRange(PRInt32 aStartPos, PRInt32 aEndPos)
|
|||
|
||||
// If range 0 was successfully set, clear any additional selection
|
||||
// ranges remaining from previous selection
|
||||
nsCOMPtr<nsISelection> domSel;
|
||||
nsCOMPtr<nsISelectionController> selCon;
|
||||
GetSelections(nsISelectionController::SELECTION_NORMAL,
|
||||
getter_AddRefs(selCon), getter_AddRefs(domSel));
|
||||
if (domSel) {
|
||||
PRInt32 numRanges;
|
||||
domSel->GetRangeCount(&numRanges);
|
||||
nsRefPtr<nsFrameSelection> frameSelection = FrameSelection();
|
||||
NS_ENSURE_STATE(frameSelection);
|
||||
|
||||
for (PRInt32 count = 0; count < numRanges - 1; count ++) {
|
||||
nsCOMPtr<nsIDOMRange> range;
|
||||
domSel->GetRangeAt(1, getter_AddRefs(range));
|
||||
domSel->RemoveRange(range);
|
||||
}
|
||||
nsCOMPtr<nsISelection> domSel =
|
||||
frameSelection->GetSelection(nsISelectionController::SELECTION_NORMAL);
|
||||
NS_ENSURE_STATE(domSel);
|
||||
|
||||
PRInt32 numRanges = 0;
|
||||
domSel->GetRangeCount(&numRanges);
|
||||
|
||||
for (PRInt32 count = 0; count < numRanges - 1; count ++) {
|
||||
nsCOMPtr<nsIDOMRange> range;
|
||||
domSel->GetRangeAt(1, getter_AddRefs(range));
|
||||
domSel->RemoveRange(range);
|
||||
}
|
||||
|
||||
if (selCon) {
|
||||
// XXX I'm not sure this can do synchronous scrolling. If the last param is
|
||||
// set to true, this calling might flush the pending reflow. See bug 418470.
|
||||
selCon->ScrollSelectionIntoView(nsISelectionController::SELECTION_NORMAL,
|
||||
nsISelectionController::SELECTION_FOCUS_REGION, 0);
|
||||
|
||||
// Now that selection is done, move the focus to the selection.
|
||||
nsFocusManager* DOMFocusManager = nsFocusManager::GetFocusManager();
|
||||
if (DOMFocusManager) {
|
||||
nsCOMPtr<nsIPresShell> shell = GetPresShell();
|
||||
NS_ENSURE_TRUE(shell, NS_ERROR_FAILURE);
|
||||
nsCOMPtr<nsIDocument> doc = shell->GetDocument();
|
||||
NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
|
||||
nsCOMPtr<nsPIDOMWindow> window = doc->GetWindow();
|
||||
nsCOMPtr<nsIDOMElement> result;
|
||||
DOMFocusManager->MoveFocus(window, nsnull, nsIFocusManager::MOVEFOCUS_CARET,
|
||||
nsIFocusManager::FLAG_BYMOVEFOCUS, getter_AddRefs(result));
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -1635,13 +1635,15 @@ nsHyperTextAccessible::GetCaretOffset(PRInt32 *aCaretOffset)
|
|||
|
||||
// Turn the focus node and offset of the selection into caret hypretext
|
||||
// offset.
|
||||
nsCOMPtr<nsISelection> domSel;
|
||||
nsresult rv = GetSelections(nsISelectionController::SELECTION_NORMAL,
|
||||
nsnull, getter_AddRefs(domSel));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsRefPtr<nsFrameSelection> frameSelection = FrameSelection();
|
||||
NS_ENSURE_STATE(frameSelection);
|
||||
|
||||
nsISelection* domSel =
|
||||
frameSelection->GetSelection(nsISelectionController::SELECTION_NORMAL);
|
||||
NS_ENSURE_STATE(domSel);
|
||||
|
||||
nsCOMPtr<nsIDOMNode> focusDOMNode;
|
||||
rv = domSel->GetFocusNode(getter_AddRefs(focusDOMNode));
|
||||
nsresult rv = domSel->GetFocusNode(getter_AddRefs(focusDOMNode));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
PRInt32 focusOffset;
|
||||
|
@ -1665,18 +1667,19 @@ nsHyperTextAccessible::GetCaretOffset(PRInt32 *aCaretOffset)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
PRInt32 nsHyperTextAccessible::GetCaretLineNumber()
|
||||
PRInt32
|
||||
nsHyperTextAccessible::GetCaretLineNumber()
|
||||
{
|
||||
// Provide the line number for the caret, relative to the
|
||||
// currently focused node. Use a 1-based index
|
||||
nsCOMPtr<nsISelection> domSel;
|
||||
GetSelections(nsISelectionController::SELECTION_NORMAL, nsnull,
|
||||
getter_AddRefs(domSel));
|
||||
nsCOMPtr<nsISelectionPrivate> privateSelection(do_QueryInterface(domSel));
|
||||
NS_ENSURE_TRUE(privateSelection, -1);
|
||||
nsRefPtr<nsFrameSelection> frameSelection;
|
||||
privateSelection->GetFrameSelection(getter_AddRefs(frameSelection));
|
||||
NS_ENSURE_TRUE(frameSelection, -1);
|
||||
nsRefPtr<nsFrameSelection> frameSelection = FrameSelection();
|
||||
if (!frameSelection)
|
||||
return -1;
|
||||
|
||||
nsISelection* domSel =
|
||||
frameSelection->GetSelection(nsISelectionController::SELECTION_NORMAL);
|
||||
if (!domSel)
|
||||
return - 1;
|
||||
|
||||
nsCOMPtr<nsIDOMNode> caretNode;
|
||||
domSel->GetFocusNode(getter_AddRefs(caretNode));
|
||||
|
@ -1731,104 +1734,70 @@ PRInt32 nsHyperTextAccessible::GetCaretLineNumber()
|
|||
return lineNumber;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHyperTextAccessible::GetSelections(PRInt16 aType,
|
||||
nsISelectionController **aSelCon,
|
||||
nsISelection **aDomSel,
|
||||
nsCOMArray<nsIDOMRange>* aRanges)
|
||||
already_AddRefed<nsFrameSelection>
|
||||
nsHyperTextAccessible::FrameSelection()
|
||||
{
|
||||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
nsIFrame* frame = GetFrame();
|
||||
return frame ? frame->GetFrameSelection() : nsnull;
|
||||
}
|
||||
|
||||
if (aSelCon) {
|
||||
*aSelCon = nsnull;
|
||||
}
|
||||
if (aDomSel) {
|
||||
*aDomSel = nsnull;
|
||||
}
|
||||
if (aRanges) {
|
||||
aRanges->Clear();
|
||||
}
|
||||
|
||||
nsCOMPtr<nsISelection> domSel;
|
||||
nsCOMPtr<nsISelectionController> selCon;
|
||||
void
|
||||
nsHyperTextAccessible::GetSelectionDOMRanges(PRInt16 aType,
|
||||
nsCOMArray<nsIDOMRange>* aRanges)
|
||||
{
|
||||
nsRefPtr<nsFrameSelection> frameSelection = FrameSelection();
|
||||
if (!frameSelection)
|
||||
return;
|
||||
|
||||
nsISelection* domSel = frameSelection->GetSelection(aType);
|
||||
if (!domSel)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsINode> startNode = GetNode();
|
||||
|
||||
nsCOMPtr<nsIEditor> editor;
|
||||
GetAssociatedEditor(getter_AddRefs(editor));
|
||||
nsCOMPtr<nsIPlaintextEditor> peditor(do_QueryInterface(editor));
|
||||
if (peditor) {
|
||||
// Case 1: plain text editor
|
||||
// This is for form controls which have their own
|
||||
// selection controller separate from the document, for example
|
||||
// HTML:input, HTML:textarea, XUL:textbox, etc.
|
||||
editor->GetSelectionController(getter_AddRefs(selCon));
|
||||
}
|
||||
else {
|
||||
// Case 2: rich content subtree (can be rich editor)
|
||||
// This uses the selection controller from the entire document
|
||||
nsIFrame *frame = GetFrame();
|
||||
NS_ENSURE_TRUE(frame, NS_ERROR_FAILURE);
|
||||
|
||||
// Get the selection and selection controller
|
||||
frame->GetSelectionController(GetPresContext(),
|
||||
getter_AddRefs(selCon));
|
||||
}
|
||||
NS_ENSURE_TRUE(selCon, NS_ERROR_FAILURE);
|
||||
|
||||
selCon->GetSelection(aType, getter_AddRefs(domSel));
|
||||
NS_ENSURE_TRUE(domSel, NS_ERROR_FAILURE);
|
||||
|
||||
if (aSelCon) {
|
||||
NS_ADDREF(*aSelCon = selCon);
|
||||
}
|
||||
if (aDomSel) {
|
||||
NS_ADDREF(*aDomSel = domSel);
|
||||
if (editor) {
|
||||
nsCOMPtr<nsIDOMElement> editorRoot;
|
||||
editor->GetRootElement(getter_AddRefs(editorRoot));
|
||||
startNode = do_QueryInterface(editorRoot);
|
||||
}
|
||||
|
||||
if (aRanges) {
|
||||
nsCOMPtr<nsISelectionPrivate> privSel(do_QueryInterface(domSel));
|
||||
if (!startNode)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsINode> startNode = GetNode();
|
||||
if (peditor) {
|
||||
nsCOMPtr<nsIDOMElement> editorRoot;
|
||||
editor->GetRootElement(getter_AddRefs(editorRoot));
|
||||
startNode = do_QueryInterface(editorRoot);
|
||||
}
|
||||
NS_ENSURE_STATE(startNode);
|
||||
PRUint32 childCount = startNode->GetChildCount();
|
||||
nsCOMPtr<nsIDOMNode> startDOMNode(do_QueryInterface(startNode));
|
||||
nsCOMPtr<nsISelectionPrivate> privSel(do_QueryInterface(domSel));
|
||||
nsresult rv = privSel->
|
||||
GetRangesForIntervalCOMArray(startDOMNode, 0, startDOMNode, childCount,
|
||||
true, aRanges);
|
||||
NS_ENSURE_SUCCESS(rv,);
|
||||
|
||||
PRUint32 childCount = startNode->GetChildCount();
|
||||
nsCOMPtr<nsIDOMNode> startDOMNode(do_QueryInterface(startNode));
|
||||
nsresult rv = privSel->
|
||||
GetRangesForIntervalCOMArray(startDOMNode, 0, startDOMNode, childCount,
|
||||
PR_TRUE, aRanges);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
// Remove collapsed ranges
|
||||
PRInt32 numRanges = aRanges->Count();
|
||||
for (PRInt32 count = 0; count < numRanges; count ++) {
|
||||
bool isCollapsed;
|
||||
(*aRanges)[count]->GetCollapsed(&isCollapsed);
|
||||
if (isCollapsed) {
|
||||
aRanges->RemoveObjectAt(count);
|
||||
-- numRanges;
|
||||
-- count;
|
||||
}
|
||||
// Remove collapsed ranges
|
||||
PRInt32 numRanges = aRanges->Count();
|
||||
for (PRInt32 count = 0; count < numRanges; count ++) {
|
||||
bool isCollapsed = false;
|
||||
(*aRanges)[count]->GetCollapsed(&isCollapsed);
|
||||
if (isCollapsed) {
|
||||
aRanges->RemoveObjectAt(count);
|
||||
--numRanges;
|
||||
--count;
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Gets the number of selected regions.
|
||||
*/
|
||||
NS_IMETHODIMP nsHyperTextAccessible::GetSelectionCount(PRInt32 *aSelectionCount)
|
||||
NS_IMETHODIMP
|
||||
nsHyperTextAccessible::GetSelectionCount(PRInt32* aSelectionCount)
|
||||
{
|
||||
nsCOMPtr<nsISelection> domSel;
|
||||
nsCOMArray<nsIDOMRange> ranges;
|
||||
nsresult rv = GetSelections(nsISelectionController::SELECTION_NORMAL,
|
||||
nsnull, nsnull, &ranges);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
NS_ENSURE_ARG_POINTER(aSelectionCount);
|
||||
*aSelectionCount = 0;
|
||||
|
||||
nsCOMArray<nsIDOMRange> ranges;
|
||||
GetSelectionDOMRanges(nsISelectionController::SELECTION_NORMAL, &ranges);
|
||||
*aSelectionCount = ranges.Count();
|
||||
|
||||
return NS_OK;
|
||||
|
@ -1837,15 +1806,17 @@ NS_IMETHODIMP nsHyperTextAccessible::GetSelectionCount(PRInt32 *aSelectionCount)
|
|||
/*
|
||||
* Gets the start and end offset of the specified selection.
|
||||
*/
|
||||
NS_IMETHODIMP nsHyperTextAccessible::GetSelectionBounds(PRInt32 aSelectionNum, PRInt32 *aStartOffset, PRInt32 *aEndOffset)
|
||||
NS_IMETHODIMP
|
||||
nsHyperTextAccessible::GetSelectionBounds(PRInt32 aSelectionNum,
|
||||
PRInt32* aStartOffset,
|
||||
PRInt32* aEndOffset)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aStartOffset);
|
||||
NS_ENSURE_ARG_POINTER(aEndOffset);
|
||||
*aStartOffset = *aEndOffset = 0;
|
||||
|
||||
nsCOMPtr<nsISelection> domSel;
|
||||
nsCOMArray<nsIDOMRange> ranges;
|
||||
nsresult rv = GetSelections(nsISelectionController::SELECTION_NORMAL,
|
||||
nsnull, getter_AddRefs(domSel), &ranges);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
GetSelectionDOMRanges(nsISelectionController::SELECTION_NORMAL, &ranges);
|
||||
|
||||
PRInt32 rangeCount = ranges.Count();
|
||||
if (aSelectionNum < 0 || aSelectionNum >= rangeCount)
|
||||
|
@ -1857,18 +1828,19 @@ NS_IMETHODIMP nsHyperTextAccessible::GetSelectionBounds(PRInt32 aSelectionNum, P
|
|||
nsCOMPtr<nsIDOMNode> startDOMNode;
|
||||
range->GetStartContainer(getter_AddRefs(startDOMNode));
|
||||
nsCOMPtr<nsINode> startNode(do_QueryInterface(startDOMNode));
|
||||
PRInt32 startOffset;
|
||||
PRInt32 startOffset = 0;
|
||||
range->GetStartOffset(&startOffset);
|
||||
|
||||
// Get end point
|
||||
nsCOMPtr<nsIDOMNode> endDOMNode;
|
||||
range->GetEndContainer(getter_AddRefs(endDOMNode));
|
||||
nsCOMPtr<nsINode> endNode(do_QueryInterface(endDOMNode));
|
||||
PRInt32 endOffset;
|
||||
PRInt32 endOffset = 0;
|
||||
range->GetEndOffset(&endOffset);
|
||||
|
||||
PRInt16 rangeCompareResult;
|
||||
rv = range->CompareBoundaryPoints(nsIDOMRange::START_TO_END, range, &rangeCompareResult);
|
||||
PRInt16 rangeCompareResult = 0;
|
||||
nsresult rv = range->CompareBoundaryPoints(nsIDOMRange::START_TO_END, range,
|
||||
&rangeCompareResult);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (rangeCompareResult < 0) {
|
||||
|
@ -1886,7 +1858,7 @@ NS_IMETHODIMP nsHyperTextAccessible::GetSelectionBounds(PRInt32 aSelectionNum, P
|
|||
*aStartOffset = 0; // Could not find start point within this hypertext, so starts before
|
||||
}
|
||||
|
||||
DOMPointToHypertextOffset(endNode, endOffset, aEndOffset, PR_TRUE);
|
||||
DOMPointToHypertextOffset(endNode, endOffset, aEndOffset, true);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -1898,15 +1870,17 @@ nsHyperTextAccessible::SetSelectionBounds(PRInt32 aSelectionNum,
|
|||
PRInt32 aStartOffset,
|
||||
PRInt32 aEndOffset)
|
||||
{
|
||||
nsCOMPtr<nsISelection> domSel;
|
||||
nsresult rv = GetSelections(nsISelectionController::SELECTION_NORMAL,
|
||||
nsnull, getter_AddRefs(domSel));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsRefPtr<nsFrameSelection> frameSelection = FrameSelection();
|
||||
NS_ENSURE_STATE(frameSelection);
|
||||
|
||||
nsCOMPtr<nsISelection> domSel =
|
||||
frameSelection->GetSelection(nsISelectionController::SELECTION_NORMAL);
|
||||
NS_ENSURE_STATE(domSel);
|
||||
|
||||
// Caret is a collapsed selection
|
||||
bool isOnlyCaret = (aStartOffset == aEndOffset);
|
||||
|
||||
PRInt32 rangeCount;
|
||||
PRInt32 rangeCount = 0;
|
||||
domSel->GetRangeCount(&rangeCount);
|
||||
nsCOMPtr<nsIDOMRange> range;
|
||||
if (aSelectionNum == rangeCount) { // Add a range
|
||||
|
@ -1921,38 +1895,45 @@ nsHyperTextAccessible::SetSelectionBounds(PRInt32 aSelectionNum,
|
|||
NS_ENSURE_TRUE(range, NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
PRInt32 startOffset, endOffset;
|
||||
PRInt32 startOffset = 0, endOffset = 0;
|
||||
nsCOMPtr<nsIDOMNode> startNode, endNode;
|
||||
|
||||
rv = HypertextOffsetsToDOMRange(aStartOffset, aEndOffset,
|
||||
getter_AddRefs(startNode), &startOffset,
|
||||
getter_AddRefs(endNode), &endOffset);
|
||||
nsresult rv = HypertextOffsetsToDOMRange(aStartOffset, aEndOffset,
|
||||
getter_AddRefs(startNode), &startOffset,
|
||||
getter_AddRefs(endNode), &endOffset);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = range->SetStart(startNode, startOffset);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = isOnlyCaret ? range->Collapse(PR_TRUE) :
|
||||
rv = isOnlyCaret ? range->Collapse(true) :
|
||||
range->SetEnd(endNode, endOffset);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (aSelectionNum == rangeCount) { // Add successfully created new range
|
||||
// If new range was created then add it, otherwise notify selection listeners
|
||||
// that existing selection range was changed.
|
||||
if (aSelectionNum == rangeCount)
|
||||
return domSel->AddRange(range);
|
||||
}
|
||||
|
||||
domSel->RemoveRange(range);
|
||||
domSel->AddRange(range);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds a selection bounded by the specified offsets.
|
||||
*/
|
||||
NS_IMETHODIMP nsHyperTextAccessible::AddSelection(PRInt32 aStartOffset, PRInt32 aEndOffset)
|
||||
NS_IMETHODIMP
|
||||
nsHyperTextAccessible::AddSelection(PRInt32 aStartOffset, PRInt32 aEndOffset)
|
||||
{
|
||||
nsCOMPtr<nsISelection> domSel;
|
||||
nsresult rv = GetSelections(nsISelectionController::SELECTION_NORMAL,
|
||||
nsnull, getter_AddRefs(domSel));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsRefPtr<nsFrameSelection> frameSelection = FrameSelection();
|
||||
NS_ENSURE_STATE(frameSelection);
|
||||
|
||||
PRInt32 rangeCount;
|
||||
nsCOMPtr<nsISelection> domSel =
|
||||
frameSelection->GetSelection(nsISelectionController::SELECTION_NORMAL);
|
||||
NS_ENSURE_STATE(domSel);
|
||||
|
||||
PRInt32 rangeCount = 0;
|
||||
domSel->GetRangeCount(&rangeCount);
|
||||
|
||||
return SetSelectionBounds(rangeCount, aStartOffset, aEndOffset);
|
||||
|
@ -1961,12 +1942,15 @@ NS_IMETHODIMP nsHyperTextAccessible::AddSelection(PRInt32 aStartOffset, PRInt32
|
|||
/*
|
||||
* Removes the specified selection.
|
||||
*/
|
||||
NS_IMETHODIMP nsHyperTextAccessible::RemoveSelection(PRInt32 aSelectionNum)
|
||||
NS_IMETHODIMP
|
||||
nsHyperTextAccessible::RemoveSelection(PRInt32 aSelectionNum)
|
||||
{
|
||||
nsCOMPtr<nsISelection> domSel;
|
||||
nsresult rv = GetSelections(nsISelectionController::SELECTION_NORMAL,
|
||||
nsnull, getter_AddRefs(domSel));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsRefPtr<nsFrameSelection> frameSelection = FrameSelection();
|
||||
NS_ENSURE_STATE(frameSelection);
|
||||
|
||||
nsCOMPtr<nsISelection> domSel =
|
||||
frameSelection->GetSelection(nsISelectionController::SELECTION_NORMAL);
|
||||
NS_ENSURE_STATE(domSel);
|
||||
|
||||
PRInt32 rangeCount;
|
||||
domSel->GetRangeCount(&rangeCount);
|
||||
|
@ -2057,7 +2041,7 @@ nsHyperTextAccessible::ScrollSubstringToPoint(PRInt32 aStartIndex,
|
|||
vPercent, hPercent);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
initialScrolled = PR_TRUE;
|
||||
initialScrolled = true;
|
||||
} else {
|
||||
// Substring was scrolled to the given point already inside its closest
|
||||
// scrollable area. If there are nested scrollable areas then make
|
||||
|
@ -2348,9 +2332,7 @@ nsHyperTextAccessible::GetSpellTextAttribute(nsIDOMNode *aNode,
|
|||
nsIPersistentProperties *aAttributes)
|
||||
{
|
||||
nsCOMArray<nsIDOMRange> ranges;
|
||||
nsresult rv = GetSelections(nsISelectionController::SELECTION_SPELLCHECK,
|
||||
nsnull, nsnull, &ranges);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
GetSelectionDOMRanges(nsISelectionController::SELECTION_SPELLCHECK, &ranges);
|
||||
|
||||
PRInt32 rangeCount = ranges.Count();
|
||||
if (!rangeCount)
|
||||
|
@ -2362,7 +2344,7 @@ nsHyperTextAccessible::GetSpellTextAttribute(nsIDOMNode *aNode,
|
|||
NS_ENSURE_STATE(nsrange);
|
||||
|
||||
PRInt16 result;
|
||||
rv = nsrange->ComparePoint(aNode, aNodeOffset, &result);
|
||||
nsresult rv = nsrange->ComparePoint(aNode, aNodeOffset, &result);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
// ComparePoint checks boundary points, but we need to check that
|
||||
// text at aNodeOffset is inside the range.
|
||||
|
@ -2381,8 +2363,8 @@ nsHyperTextAccessible::GetSpellTextAttribute(nsIDOMNode *aNode,
|
|||
|
||||
if (result == 1) { // range is before point
|
||||
PRInt32 startHTOffset = 0;
|
||||
rv = DOMRangeBoundToHypertextOffset(range, PR_FALSE, PR_TRUE,
|
||||
&startHTOffset);
|
||||
nsresult rv = DOMRangeBoundToHypertextOffset(range, false, true,
|
||||
&startHTOffset);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (startHTOffset > *aHTStartOffset)
|
||||
|
@ -2390,8 +2372,8 @@ nsHyperTextAccessible::GetSpellTextAttribute(nsIDOMNode *aNode,
|
|||
|
||||
} else if (result == -1) { // range is after point
|
||||
PRInt32 endHTOffset = 0;
|
||||
rv = DOMRangeBoundToHypertextOffset(range, PR_TRUE, PR_FALSE,
|
||||
&endHTOffset);
|
||||
nsresult rv = DOMRangeBoundToHypertextOffset(range, true, false,
|
||||
&endHTOffset);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (endHTOffset < *aHTEndOffset)
|
||||
|
@ -2399,12 +2381,12 @@ nsHyperTextAccessible::GetSpellTextAttribute(nsIDOMNode *aNode,
|
|||
|
||||
} else { // point is in range
|
||||
PRInt32 startHTOffset = 0;
|
||||
rv = DOMRangeBoundToHypertextOffset(range, PR_TRUE, PR_TRUE,
|
||||
&startHTOffset);
|
||||
nsresult rv = DOMRangeBoundToHypertextOffset(range, true, true,
|
||||
&startHTOffset);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
PRInt32 endHTOffset = 0;
|
||||
rv = DOMRangeBoundToHypertextOffset(range, PR_FALSE, PR_FALSE,
|
||||
rv = DOMRangeBoundToHypertextOffset(range, false, false,
|
||||
&endHTOffset);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
|
|
|
@ -154,11 +154,11 @@ public:
|
|||
* if >=0 and aNode is not text, this represents a child node offset
|
||||
* @param aResultOffset - the character offset into the current
|
||||
* nsHyperTextAccessible
|
||||
* @param aIsEndOffset - if PR_TRUE, then then this offset is not inclusive. The character
|
||||
* @param aIsEndOffset - if true, then then this offset is not inclusive. The character
|
||||
* indicated by the offset returned is at [offset - 1]. This means
|
||||
* if the passed-in offset is really in a descendant, then the offset returned
|
||||
* will come just after the relevant embedded object characer.
|
||||
* If PR_FALSE, then the offset is inclusive. The character indicated
|
||||
* If false, then the offset is inclusive. The character indicated
|
||||
* by the offset returned is at [offset]. If the passed-in offset in inside a
|
||||
* descendant, then the returned offset will be on the relevant embedded object char.
|
||||
*
|
||||
|
@ -351,22 +351,15 @@ protected:
|
|||
|
||||
// Selection helpers
|
||||
|
||||
/**
|
||||
* Get the relevant selection interfaces and ranges for the current hyper
|
||||
* text.
|
||||
*
|
||||
* @param aType [in] the selection type
|
||||
* @param aSelCon [out, optional] the selection controller for the current
|
||||
* hyper text
|
||||
* @param aDomSel [out, optional] the selection interface for the current
|
||||
* hyper text
|
||||
* @param aRanges [out, optional] the selected ranges within the current
|
||||
* subtree
|
||||
/**
|
||||
* Return frame selection object for the accessible.
|
||||
*/
|
||||
nsresult GetSelections(PRInt16 aType,
|
||||
nsISelectionController **aSelCon,
|
||||
nsISelection **aDomSel = nsnull,
|
||||
nsCOMArray<nsIDOMRange>* aRanges = nsnull);
|
||||
virtual already_AddRefed<nsFrameSelection> FrameSelection();
|
||||
|
||||
/**
|
||||
* Return selection ranges within the accessible subtree.
|
||||
*/
|
||||
void GetSelectionDOMRanges(PRInt16 aType, nsCOMArray<nsIDOMRange>* aRanges);
|
||||
|
||||
nsresult SetSelectionRange(PRInt32 aStartPos, PRInt32 aEndPos);
|
||||
|
||||
|
|
|
@ -86,6 +86,6 @@ struct AccessibleWrapper {
|
|||
|
||||
return (bool)[object accessibilityIsIgnored];
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(PR_FALSE);
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(false);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -64,16 +64,16 @@ bool
|
|||
nsAccessibleWrap::Init ()
|
||||
{
|
||||
if (!nsAccessible::Init())
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
if (!mNativeWrapper && !AncestorIsFlat()) {
|
||||
// Create our native object using the class type specified in GetNativeType().
|
||||
mNativeWrapper = new AccessibleWrapper (this, GetNativeType());
|
||||
if (!mNativeWrapper)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -234,12 +234,12 @@ nsAccessibleWrap::GetUnignoredChildCount(bool aDeepCount)
|
|||
|
||||
if (aDeepCount) {
|
||||
// recursively count the unignored children of our children since it's a deep count.
|
||||
resultChildCount += childAcc->GetUnignoredChildCount(PR_TRUE);
|
||||
resultChildCount += childAcc->GetUnignoredChildCount(true);
|
||||
} else {
|
||||
// no deep counting, but if the child is ignored, we want to substitute it for its
|
||||
// children.
|
||||
if (childAcc->IsIgnored())
|
||||
resultChildCount += childAcc->GetUnignoredChildCount(PR_FALSE);
|
||||
resultChildCount += childAcc->GetUnignoredChildCount(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -316,10 +316,10 @@ nsAccessibleWrap::AncestorIsFlat()
|
|||
nsAccessible* parent = Parent();
|
||||
while (parent) {
|
||||
if (nsAccUtils::MustPrune(parent))
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
|
||||
parent = parent->Parent();
|
||||
}
|
||||
// no parent was flat
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ bool
|
|||
nsDocAccessibleWrap::Init ()
|
||||
{
|
||||
if (!nsDocAccessible::Init())
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
NS_ASSERTION(!mNativeWrapper, "nsDocAccessibleWrap::Init() called more than once!");
|
||||
|
||||
|
@ -62,8 +62,8 @@ nsDocAccessibleWrap::Init ()
|
|||
// Create our native object using the class type specified in GetNativeType().
|
||||
mNativeWrapper = new AccessibleWrapper (this, GetNativeType());
|
||||
if (!mNativeWrapper)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ __try {
|
|||
|
||||
PRInt32 startOffset = 0, endOffset = 0;
|
||||
nsCOMPtr<nsIPersistentProperties> attributes;
|
||||
nsresult rv = textAcc->GetTextAttributes(PR_TRUE, aOffset,
|
||||
nsresult rv = textAcc->GetTextAttributes(true, aOffset,
|
||||
&startOffset, &endOffset,
|
||||
getter_AddRefs(attributes));
|
||||
if (NS_FAILED(rv))
|
||||
|
@ -499,7 +499,7 @@ STDMETHODIMP
|
|||
CAccessibleText::get_newText(IA2TextSegment *aNewText)
|
||||
{
|
||||
__try {
|
||||
return GetModifiedText(PR_TRUE, aNewText);
|
||||
return GetModifiedText(true, aNewText);
|
||||
|
||||
} __except(nsAccessNodeWrap::FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
|
||||
return E_FAIL;
|
||||
|
@ -509,7 +509,7 @@ STDMETHODIMP
|
|||
CAccessibleText::get_oldText(IA2TextSegment *aOldText)
|
||||
{
|
||||
__try {
|
||||
return GetModifiedText(PR_FALSE, aOldText);
|
||||
return GetModifiedText(false, aOldText);
|
||||
|
||||
} __except(nsAccessNodeWrap::FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
|
||||
return E_FAIL;
|
||||
|
|
|
@ -675,7 +675,7 @@ bool nsAccessNodeWrap::IsOnlyMsaaCompatibleJawsPresent()
|
|||
{
|
||||
HMODULE jhookhandle = ::GetModuleHandleW(kJAWSModuleHandle);
|
||||
if (!jhookhandle)
|
||||
return PR_FALSE; // No JAWS, or some other screen reader, use IA2
|
||||
return false; // No JAWS, or some other screen reader, use IA2
|
||||
|
||||
PRUnichar fileName[MAX_PATH];
|
||||
::GetModuleFileNameW(jhookhandle, fileName, MAX_PATH);
|
||||
|
@ -726,14 +726,14 @@ void nsAccessNodeWrap::TurnOffNewTabSwitchingForJawsAndWE()
|
|||
}
|
||||
|
||||
// Value has never been set, set it.
|
||||
Preferences::SetBool(CTRLTAB_DISALLOW_FOR_SCREEN_READERS_PREF, PR_TRUE);
|
||||
Preferences::SetBool(CTRLTAB_DISALLOW_FOR_SCREEN_READERS_PREF, true);
|
||||
}
|
||||
|
||||
void nsAccessNodeWrap::DoATSpecificProcessing()
|
||||
{
|
||||
if (IsOnlyMsaaCompatibleJawsPresent())
|
||||
// All versions below 8.0.2173 are not compatible
|
||||
gIsIA2Disabled = PR_TRUE;
|
||||
gIsIA2Disabled = true;
|
||||
|
||||
TurnOffNewTabSwitchingForJawsAndWE();
|
||||
}
|
||||
|
@ -743,6 +743,10 @@ nsRefPtrHashtable<nsVoidPtrHashKey, nsDocAccessible> nsAccessNodeWrap::sHWNDCach
|
|||
LRESULT CALLBACK
|
||||
nsAccessNodeWrap::WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
// Note, this window's message handling should not invoke any call that
|
||||
// may result in a cross-process ipc call. Doing so may violate RPC
|
||||
// message semantics.
|
||||
|
||||
switch (msg) {
|
||||
case WM_GETOBJECT:
|
||||
{
|
||||
|
|
|
@ -759,10 +759,10 @@ __try {
|
|||
xpAccessible->TakeSelection();
|
||||
|
||||
if (flagsSelect & SELFLAG_ADDSELECTION)
|
||||
xpAccessible->SetSelected(PR_TRUE);
|
||||
xpAccessible->SetSelected(true);
|
||||
|
||||
if (flagsSelect & SELFLAG_REMOVESELECTION)
|
||||
xpAccessible->SetSelected(PR_FALSE);
|
||||
xpAccessible->SetSelected(false);
|
||||
|
||||
if (flagsSelect & SELFLAG_EXTENDSELECTION)
|
||||
xpAccessible->ExtendSelection();
|
||||
|
|
|
@ -224,8 +224,8 @@ nsresult nsTextAccessibleWrap::GetCharacterExtents(PRInt32 aStartOffset, PRInt32
|
|||
NS_ENSURE_TRUE(frame, NS_ERROR_FAILURE);
|
||||
|
||||
nsPoint startPoint, endPoint;
|
||||
nsIFrame *startFrame = GetPointFromOffset(frame, aStartOffset, PR_TRUE, startPoint);
|
||||
nsIFrame *endFrame = GetPointFromOffset(frame, aEndOffset, PR_FALSE, endPoint);
|
||||
nsIFrame *startFrame = GetPointFromOffset(frame, aStartOffset, true, startPoint);
|
||||
nsIFrame *endFrame = GetPointFromOffset(frame, aEndOffset, false, endPoint);
|
||||
if (!startFrame || !endFrame) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
|
|
@ -46,6 +46,10 @@
|
|||
#include "nsArrayUtils.h"
|
||||
#include "nsIDocShellTreeItem.h"
|
||||
|
||||
// Window property used by ipc related code in identifying accessible
|
||||
// tab windows.
|
||||
const PRUnichar* kPropNameTabContent = L"AccessibleTabWindow";
|
||||
|
||||
HRESULT
|
||||
nsWinUtils::ConvertToIA2Array(nsIArray *aGeckoArray, IUnknown ***aIA2Array,
|
||||
long *aIA2ArrayLen)
|
||||
|
@ -149,14 +153,19 @@ nsWinUtils::CreateNativeWindow(LPCWSTR aWindowClass, HWND aParentWnd,
|
|||
int aX, int aY, int aWidth, int aHeight,
|
||||
bool aIsActive)
|
||||
{
|
||||
return ::CreateWindowExW(WS_EX_TRANSPARENT, aWindowClass,
|
||||
L"NetscapeDispatchWnd",
|
||||
WS_CHILD | (aIsActive ? WS_VISIBLE : 0),
|
||||
aX, aY, aWidth, aHeight,
|
||||
aParentWnd,
|
||||
NULL,
|
||||
GetModuleHandle(NULL),
|
||||
NULL);
|
||||
HWND hwnd = ::CreateWindowExW(WS_EX_TRANSPARENT, aWindowClass,
|
||||
L"NetscapeDispatchWnd",
|
||||
WS_CHILD | (aIsActive ? WS_VISIBLE : 0),
|
||||
aX, aY, aWidth, aHeight,
|
||||
aParentWnd,
|
||||
NULL,
|
||||
GetModuleHandle(NULL),
|
||||
NULL);
|
||||
if (hwnd) {
|
||||
// Mark this window so that ipc related code can identify it.
|
||||
::SetPropW(hwnd, kPropNameTabContent, (HANDLE)1);
|
||||
}
|
||||
return hwnd;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -214,7 +214,7 @@ nsXFormsAccessible::Description(nsString& aDescription)
|
|||
bool
|
||||
nsXFormsAccessible::GetAllowsAnonChildAccessibles()
|
||||
{
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -237,7 +237,7 @@ nsXFormsContainerAccessible::NativeRole()
|
|||
bool
|
||||
nsXFormsContainerAccessible::GetAllowsAnonChildAccessibles()
|
||||
{
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
@ -331,7 +331,7 @@ nsXFormsSelectableAccessible::SelectedItems()
|
|||
nsIAccessible* item = GetAccService()->GetAccessibleInWeakShell(itemNode,
|
||||
mWeakShell);
|
||||
if (item)
|
||||
selectedItems->AppendElement(item, PR_FALSE);
|
||||
selectedItems->AppendElement(item, false);
|
||||
|
||||
nsIMutableArray* items = nsnull;
|
||||
selectedItems.forget(&items);
|
||||
|
@ -356,7 +356,7 @@ nsXFormsSelectableAccessible::SelectedItems()
|
|||
nsIAccessible* item = GetAccService()->GetAccessibleInWeakShell(itemNode,
|
||||
mWeakShell);
|
||||
if (item)
|
||||
selectedItems->AppendElement(item, PR_FALSE);
|
||||
selectedItems->AppendElement(item, false);
|
||||
}
|
||||
|
||||
nsIMutableArray* items = nsnull;
|
||||
|
@ -571,7 +571,7 @@ nsXFormsSelectableItemAccessible::IsSelected()
|
|||
while ((parent = parent->GetNodeParent())) {
|
||||
nsCOMPtr<nsIContent> content(do_QueryInterface(parent));
|
||||
if (!content)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
nsCOMPtr<nsINodeInfo> nodeinfo = content->NodeInfo();
|
||||
if (!nodeinfo->NamespaceEquals(NS_LITERAL_STRING(NS_NAMESPACE_XFORMS)))
|
||||
|
@ -596,6 +596,6 @@ nsXFormsSelectableItemAccessible::IsSelected()
|
|||
}
|
||||
}
|
||||
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ public:
|
|||
virtual PRUint64 NativeState();
|
||||
|
||||
// Denies accessible nodes in anonymous content of xforms element by
|
||||
// always returning PR_FALSE value.
|
||||
// always returning false value.
|
||||
virtual bool GetAllowsAnonChildAccessibles();
|
||||
|
||||
protected:
|
||||
|
@ -130,7 +130,7 @@ public:
|
|||
virtual PRUint32 NativeRole();
|
||||
|
||||
// Allows accessible nodes in anonymous content of xforms element by
|
||||
// always returning PR_TRUE value.
|
||||
// always returning true value.
|
||||
virtual bool GetAllowsAnonChildAccessibles();
|
||||
};
|
||||
|
||||
|
|
|
@ -591,7 +591,7 @@ nsXFormsSelectComboboxAccessible::NativeState()
|
|||
bool
|
||||
nsXFormsSelectComboboxAccessible::GetAllowsAnonChildAccessibles()
|
||||
{
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -176,7 +176,7 @@ nsXULColorPickerAccessible::AreItemsOperable() const
|
|||
void
|
||||
nsXULColorPickerAccessible::CacheChildren()
|
||||
{
|
||||
nsAccTreeWalker walker(mWeakShell, mContent, PR_TRUE);
|
||||
nsAccTreeWalker walker(mWeakShell, mContent, true);
|
||||
|
||||
nsAccessible* child = nsnull;
|
||||
while ((child = walker.NextChild())) {
|
||||
|
|
|
@ -149,12 +149,12 @@ nsXULComboboxAccessible::GetAllowsAnonChildAccessibles()
|
|||
// Both the XUL <textbox type="autocomplete"> and <menulist editable="true"> widgets
|
||||
// use nsXULComboboxAccessible. We need to walk the anonymous children for these
|
||||
// so that the entry field is a child
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Argument of PR_FALSE indicates we don't walk anonymous children for
|
||||
// Argument of false indicates we don't walk anonymous children for
|
||||
// menuitems
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
}
|
||||
PRUint8
|
||||
nsXULComboboxAccessible::ActionCount()
|
||||
|
|
|
@ -221,7 +221,7 @@ nsXULButtonAccessible::CacheChildren()
|
|||
eCaseMatters);
|
||||
|
||||
bool isMenuButton = isMenu ?
|
||||
PR_FALSE :
|
||||
false :
|
||||
mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
|
||||
nsGkAtoms::menuButton, eCaseMatters);
|
||||
|
||||
|
@ -231,7 +231,7 @@ nsXULButtonAccessible::CacheChildren()
|
|||
nsAccessible* menupopup = nsnull;
|
||||
nsAccessible* button = nsnull;
|
||||
|
||||
nsAccTreeWalker walker(mWeakShell, mContent, PR_TRUE);
|
||||
nsAccTreeWalker walker(mWeakShell, mContent, true);
|
||||
|
||||
nsAccessible* child = nsnull;
|
||||
while ((child = walker.NextChild())) {
|
||||
|
@ -322,7 +322,7 @@ bool nsXULDropmarkerAccessible::DropmarkerOpen(bool aToggleOpen)
|
|||
NS_IMETHODIMP nsXULDropmarkerAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
|
||||
{
|
||||
if (aIndex == eAction_Click) {
|
||||
if (DropmarkerOpen(PR_FALSE))
|
||||
if (DropmarkerOpen(false))
|
||||
aName.AssignLiteral("close");
|
||||
else
|
||||
aName.AssignLiteral("open");
|
||||
|
@ -338,7 +338,7 @@ NS_IMETHODIMP nsXULDropmarkerAccessible::GetActionName(PRUint8 aIndex, nsAString
|
|||
NS_IMETHODIMP nsXULDropmarkerAccessible::DoAction(PRUint8 index)
|
||||
{
|
||||
if (index == eAction_Click) {
|
||||
DropmarkerOpen(PR_TRUE); // Reverse the open attribute
|
||||
DropmarkerOpen(true); // Reverse the open attribute
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
@ -353,7 +353,7 @@ nsXULDropmarkerAccessible::NativeRole()
|
|||
PRUint64
|
||||
nsXULDropmarkerAccessible::NativeState()
|
||||
{
|
||||
return DropmarkerOpen(PR_FALSE) ? states::PRESSED : 0;
|
||||
return DropmarkerOpen(false) ? states::PRESSED : 0;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -666,7 +666,7 @@ nsXULToolbarButtonAccessible::IsSeparator(nsAccessible *aAccessible)
|
|||
nsCOMPtr<nsIContent> contentDomNode(do_QueryInterface(domNode));
|
||||
|
||||
if (!contentDomNode)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
return (contentDomNode->Tag() == nsGkAtoms::toolbarseparator) ||
|
||||
(contentDomNode->Tag() == nsGkAtoms::toolbarspacer) ||
|
||||
|
@ -851,7 +851,7 @@ NS_IMETHODIMP nsXULTextFieldAccessible::DoAction(PRUint8 index)
|
|||
bool
|
||||
nsXULTextFieldAccessible::GetAllowsAnonChildAccessibles()
|
||||
{
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsXULTextFieldAccessible::GetAssociatedEditor(nsIEditor **aEditor)
|
||||
|
@ -876,12 +876,23 @@ nsXULTextFieldAccessible::CacheChildren()
|
|||
if (!inputContent)
|
||||
return;
|
||||
|
||||
nsAccTreeWalker walker(mWeakShell, inputContent, PR_FALSE);
|
||||
nsAccTreeWalker walker(mWeakShell, inputContent, false);
|
||||
|
||||
nsAccessible* child = nsnull;
|
||||
while ((child = walker.NextChild()) && AppendChild(child));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsXULTextFieldAccessible: nsHyperTextAccessible protected
|
||||
|
||||
already_AddRefed<nsFrameSelection>
|
||||
nsXULTextFieldAccessible::FrameSelection()
|
||||
{
|
||||
nsCOMPtr<nsIContent> inputContent(GetInputField());
|
||||
nsIFrame* frame = inputContent->GetPrimaryFrame();
|
||||
return frame ? frame->GetFrameSelection() : nsnull;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsXULTextFieldAccessible protected
|
||||
|
||||
|
|
|
@ -276,6 +276,9 @@ protected:
|
|||
// nsAccessible
|
||||
virtual void CacheChildren();
|
||||
|
||||
// nsHyperTextAccessible
|
||||
virtual already_AddRefed<nsFrameSelection> FrameSelection();
|
||||
|
||||
// nsXULTextFieldAccessible
|
||||
already_AddRefed<nsIContent> GetInputField() const;
|
||||
};
|
||||
|
|
|
@ -168,7 +168,7 @@ nsXULListboxAccessible::IsMulticolumn()
|
|||
PRInt32 numColumns = 0;
|
||||
nsresult rv = GetColumnCount(&numColumns);
|
||||
if (NS_FAILED(rv))
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
return numColumns > 1;
|
||||
}
|
||||
|
@ -443,7 +443,7 @@ NS_IMETHODIMP
|
|||
nsXULListboxAccessible::IsColumnSelected(PRInt32 aColumn, bool *aIsSelected)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsSelected);
|
||||
*aIsSelected = PR_FALSE;
|
||||
*aIsSelected = false;
|
||||
|
||||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -469,7 +469,7 @@ NS_IMETHODIMP
|
|||
nsXULListboxAccessible::IsRowSelected(PRInt32 aRow, bool *aIsSelected)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsSelected);
|
||||
*aIsSelected = PR_FALSE;
|
||||
*aIsSelected = false;
|
||||
|
||||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -620,7 +620,7 @@ nsXULListboxAccessible::GetSelectedCells(nsIArray **aCells)
|
|||
for (PRInt32 cellIdx = 0; cellIdx < cellCount; cellIdx++) {
|
||||
nsAccessible *cell = mChildren[cellIdx];
|
||||
if (cell->Role() == nsIAccessibleRole::ROLE_CELL)
|
||||
selCells->AppendElement(static_cast<nsIAccessible*>(cell), PR_FALSE);
|
||||
selCells->AppendElement(static_cast<nsIAccessible*>(cell), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -830,7 +830,7 @@ NS_IMETHODIMP
|
|||
nsXULListboxAccessible::IsProbablyForLayout(bool *aIsProbablyForLayout)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsProbablyForLayout);
|
||||
*aIsProbablyForLayout = PR_FALSE;
|
||||
*aIsProbablyForLayout = false;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -1033,7 +1033,7 @@ bool
|
|||
nsXULListitemAccessible::GetAllowsAnonChildAccessibles()
|
||||
{
|
||||
// That indicates we should walk anonymous children for listitems
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1216,7 +1216,7 @@ nsXULListCellAccessible::GetColumnHeaderCells(nsIArray **aHeaderCells)
|
|||
do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
headerCells->AppendElement(headerCell, PR_FALSE);
|
||||
headerCells->AppendElement(headerCell, false);
|
||||
NS_ADDREF(*aHeaderCells = headerCells);
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -1251,7 +1251,7 @@ NS_IMETHODIMP
|
|||
nsXULListCellAccessible::IsSelected(bool *aIsSelected)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsSelected);
|
||||
*aIsSelected = PR_FALSE;
|
||||
*aIsSelected = false;
|
||||
|
||||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
|
|
@ -118,7 +118,7 @@ nsXULSelectableAccessible::SelectedItems()
|
|||
GetAccService()->GetAccessibleInWeakShell(itemNode, mWeakShell);
|
||||
if (item)
|
||||
selectedItems->AppendElement(static_cast<nsIAccessible*>(item),
|
||||
PR_FALSE);
|
||||
false);
|
||||
}
|
||||
}
|
||||
else { // Single select?
|
||||
|
@ -130,7 +130,7 @@ nsXULSelectableAccessible::SelectedItems()
|
|||
GetAccService()->GetAccessibleInWeakShell(itemNode, mWeakShell);
|
||||
if (item)
|
||||
selectedItems->AppendElement(static_cast<nsIAccessible*>(item),
|
||||
PR_FALSE);
|
||||
false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -356,7 +356,7 @@ nsXULMenuitemAccessible::NativeState()
|
|||
bool isCollapsed = false;
|
||||
nsAccessible* parent = Parent();
|
||||
if (parent && parent->State() & states::INVISIBLE)
|
||||
isCollapsed = PR_TRUE;
|
||||
isCollapsed = true;
|
||||
|
||||
if (isSelected) {
|
||||
state |= states::SELECTED;
|
||||
|
@ -463,11 +463,7 @@ nsXULMenuitemAccessible::KeyboardShortcut() const
|
|||
if (keyElmId.IsEmpty())
|
||||
return KeyBinding();
|
||||
|
||||
nsIDocument* document = mContent->GetOwnerDoc();
|
||||
if (!document)
|
||||
return KeyBinding();
|
||||
|
||||
nsIContent* keyElm = document->GetElementById(keyElmId);
|
||||
nsIContent* keyElm = mContent->OwnerDoc()->GetElementById(keyElmId);
|
||||
if (!keyElm)
|
||||
return KeyBinding();
|
||||
|
||||
|
@ -565,7 +561,7 @@ bool
|
|||
nsXULMenuitemAccessible::GetAllowsAnonChildAccessibles()
|
||||
{
|
||||
// That indicates we don't walk anonymous children for menuitems
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsXULMenuitemAccessible::DoAction(PRUint8 index)
|
||||
|
|
|
@ -192,7 +192,7 @@ bool
|
|||
nsXULSliderAccessible::GetAllowsAnonChildAccessibles()
|
||||
{
|
||||
// Do not allow anonymous xul:slider be accessible.
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Utils
|
||||
|
@ -204,11 +204,7 @@ nsXULSliderAccessible::GetSliderNode()
|
|||
return nsnull;
|
||||
|
||||
if (!mSliderNode) {
|
||||
nsIDocument* document = mContent->GetOwnerDoc();
|
||||
if (!document)
|
||||
return nsnull;
|
||||
|
||||
nsCOMPtr<nsIDOMDocumentXBL> xblDoc(do_QueryInterface(document));
|
||||
nsCOMPtr<nsIDOMDocumentXBL> xblDoc(do_QueryInterface(mContent->OwnerDoc()));
|
||||
if (!xblDoc)
|
||||
return nsnull;
|
||||
|
||||
|
@ -251,7 +247,7 @@ nsXULSliderAccessible::SetSliderAttr(nsIAtom *aName, const nsAString& aValue)
|
|||
nsCOMPtr<nsIContent> sliderNode(GetSliderNode());
|
||||
NS_ENSURE_STATE(sliderNode);
|
||||
|
||||
sliderNode->SetAttr(kNameSpaceID_None, aName, aValue, PR_TRUE);
|
||||
sliderNode->SetAttr(kNameSpaceID_None, aName, aValue, true);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -257,11 +257,11 @@ nsXULLinkAccessible::AnchorURIAt(PRUint32 aAnchorIndex)
|
|||
mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::href, href);
|
||||
|
||||
nsCOMPtr<nsIURI> baseURI = mContent->GetBaseURI();
|
||||
nsIDocument* document = mContent->GetOwnerDoc();
|
||||
nsIDocument* document = mContent->OwnerDoc();
|
||||
|
||||
nsIURI* anchorURI = nsnull;
|
||||
NS_NewURI(&anchorURI, href,
|
||||
document ? document->GetDocumentCharacterSet().get() : nsnull,
|
||||
document->GetDocumentCharacterSet().get(),
|
||||
baseURI);
|
||||
|
||||
return anchorURI;
|
||||
|
|
|
@ -300,7 +300,7 @@ nsXULTreeAccessible::SelectedItems()
|
|||
for (PRInt32 rowIdx = firstIdx; rowIdx <= lastIdx; rowIdx++) {
|
||||
nsIAccessible* item = GetTreeItemAccessible(rowIdx);
|
||||
if (item)
|
||||
selectedItems->AppendElement(item, PR_FALSE);
|
||||
selectedItems->AppendElement(item, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -883,12 +883,7 @@ nsXULTreeItemAccessibleBase::DoAction(PRUint8 aIndex)
|
|||
bool
|
||||
nsXULTreeItemAccessibleBase::IsDefunct() const
|
||||
{
|
||||
if (nsAccessibleWrap::IsDefunct() || !mTree || !mTreeView || mRow < 0)
|
||||
return PR_TRUE;
|
||||
|
||||
PRInt32 rowCount = 0;
|
||||
nsresult rv = mTreeView->GetRowCount(&rowCount);
|
||||
return NS_FAILED(rv) || mRow >= rowCount;
|
||||
return nsAccessibleWrap::IsDefunct() || !mTree || !mTreeView || mRow < 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1083,12 +1078,12 @@ nsXULTreeItemAccessibleBase::IsExpandable()
|
|||
columns->GetPrimaryColumn(getter_AddRefs(primaryColumn));
|
||||
if (primaryColumn &&
|
||||
!nsCoreUtils::IsColumnHidden(primaryColumn))
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1169,10 +1164,10 @@ bool
|
|||
nsXULTreeItemAccessible::Init()
|
||||
{
|
||||
if (!nsXULTreeItemAccessibleBase::Init())
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
GetName(mCachedName);
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -210,7 +210,7 @@ nsXULTreeGridAccessible::GetSelectedCells(nsIArray **aCells)
|
|||
for (PRInt32 colIdx = 0; colIdx < columnCount; colIdx++) {
|
||||
nsCOMPtr<nsIAccessible> cell;
|
||||
GetCellAt(rowIdx, colIdx, getter_AddRefs(cell));
|
||||
selCells->AppendElement(cell, PR_FALSE);
|
||||
selCells->AppendElement(cell, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -494,7 +494,7 @@ nsXULTreeGridAccessible::IsColumnSelected(PRInt32 aColumnIndex,
|
|||
bool *aIsSelected)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsSelected);
|
||||
*aIsSelected = PR_FALSE;
|
||||
*aIsSelected = false;
|
||||
|
||||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -518,7 +518,7 @@ NS_IMETHODIMP
|
|||
nsXULTreeGridAccessible::IsRowSelected(PRInt32 aRowIndex, bool *aIsSelected)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsSelected);
|
||||
*aIsSelected = PR_FALSE;
|
||||
*aIsSelected = false;
|
||||
|
||||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -573,7 +573,7 @@ NS_IMETHODIMP
|
|||
nsXULTreeGridAccessible::IsProbablyForLayout(bool *aIsProbablyForLayout)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsProbablyForLayout);
|
||||
*aIsProbablyForLayout = PR_FALSE;
|
||||
*aIsProbablyForLayout = false;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -1083,7 +1083,7 @@ nsXULTreeGridCellAccessible::GetColumnHeaderCells(nsIArray **aHeaderCells)
|
|||
|
||||
if (headerCell)
|
||||
headerCells->AppendElement(static_cast<nsIAccessible*>(headerCell),
|
||||
PR_FALSE);
|
||||
false);
|
||||
|
||||
NS_ADDREF(*aHeaderCells = headerCells);
|
||||
return NS_OK;
|
||||
|
@ -1111,7 +1111,7 @@ NS_IMETHODIMP
|
|||
nsXULTreeGridCellAccessible::IsSelected(bool *aIsSelected)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsSelected);
|
||||
*aIsSelected = PR_FALSE;
|
||||
*aIsSelected = false;
|
||||
|
||||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -1137,7 +1137,7 @@ bool
|
|||
nsXULTreeGridCellAccessible::Init()
|
||||
{
|
||||
if (!nsLeafAccessible::Init())
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
PRInt16 type;
|
||||
mColumn->GetType(&type);
|
||||
|
@ -1146,7 +1146,7 @@ nsXULTreeGridCellAccessible::Init()
|
|||
else
|
||||
mTreeView->GetCellText(mRow, mColumn, mCachedTextEquiv);
|
||||
|
||||
return PR_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -1337,19 +1337,19 @@ nsXULTreeGridCellAccessible::IsEditable() const
|
|||
bool isEditable = false;
|
||||
nsresult rv = mTreeView->IsEditable(mRow, mColumn, &isEditable);
|
||||
if (NS_FAILED(rv) || !isEditable)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
nsCOMPtr<nsIDOMElement> columnElm;
|
||||
mColumn->GetElement(getter_AddRefs(columnElm));
|
||||
if (!columnElm)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
nsCOMPtr<nsIContent> columnContent(do_QueryInterface(columnElm));
|
||||
if (!columnContent->AttrValueIs(kNameSpaceID_None,
|
||||
nsGkAtoms::editable,
|
||||
nsGkAtoms::_true,
|
||||
eCaseMatters))
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
return mContent->AttrValueIs(kNameSpaceID_None,
|
||||
nsGkAtoms::editable,
|
||||
|
|
|
@ -56,6 +56,7 @@ DIRS = \
|
|||
states \
|
||||
table \
|
||||
text \
|
||||
textselection \
|
||||
tree \
|
||||
treeupdate \
|
||||
value \
|
||||
|
|
|
@ -23,6 +23,7 @@ const EVENT_TEXT_ATTRIBUTE_CHANGED = nsIAccessibleEvent.EVENT_TEXT_ATTRIBUTE_CHA
|
|||
const EVENT_TEXT_CARET_MOVED = nsIAccessibleEvent.EVENT_TEXT_CARET_MOVED;
|
||||
const EVENT_TEXT_INSERTED = nsIAccessibleEvent.EVENT_TEXT_INSERTED;
|
||||
const EVENT_TEXT_REMOVED = nsIAccessibleEvent.EVENT_TEXT_REMOVED;
|
||||
const EVENT_TEXT_SELECTION_CHANGED = nsIAccessibleEvent.EVENT_TEXT_SELECTION_CHANGED;
|
||||
const EVENT_VALUE_CHANGE = nsIAccessibleEvent.EVENT_VALUE_CHANGE;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
|
||||
// table with role of grid
|
||||
testAbsentAttrs("table1", attr);
|
||||
// table with role of grid and datatable="0"
|
||||
testAbsentAttrs("table1.1", attr);
|
||||
|
||||
// table with landmark role
|
||||
testAbsentAttrs("table2", attr);
|
||||
|
@ -93,6 +95,9 @@
|
|||
testAttrs("table21.5", attr, true);
|
||||
testAttrs("table21.6", attr, true);
|
||||
|
||||
// layout table having datatable="0" attribute and containing data table structure (tfoot element)
|
||||
testAttrs("table22", attr, true);
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
|
@ -141,6 +146,12 @@
|
|||
<td>June 12</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- table with role of grid and datatable="0"-->
|
||||
<table id="table1.1" role="grid" datatable="0">
|
||||
<tr>
|
||||
<td>Cell1</td><td>cell2</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- table with landmark role -->
|
||||
<table id="table2" role="main">
|
||||
|
@ -411,5 +422,14 @@
|
|||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- layout table with datatable="0" and tfoot element-->
|
||||
<table id="table22" datatable="0">
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td>Cell1</td><td>cell2</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -34,9 +34,11 @@
|
|||
/**
|
||||
* Invokers.
|
||||
*/
|
||||
function setCaretOffsetInvoker(aID, aOffset)
|
||||
function setCaretOffsetInvoker(aID, aOffset, aFocusableContainerID)
|
||||
{
|
||||
this.target = getAccessible(aID, [nsIAccessibleText]);
|
||||
this.focus = aFocusableContainerID ?
|
||||
getAccessible(aFocusableContainerID) : this.target;
|
||||
|
||||
this.invoke = function setCaretOffsetInvoker_invoke()
|
||||
{
|
||||
|
@ -45,29 +47,47 @@
|
|||
|
||||
this.getID = function setCaretOffsetInvoker_getID()
|
||||
{
|
||||
return "nsIAccessibleText::caretOffset test";
|
||||
return "Set caretOffset on " + prettyName(aID) + " at " + aOffset;
|
||||
}
|
||||
|
||||
this.eventSeq = [
|
||||
new invokerChecker(EVENT_FOCUS, this.target),
|
||||
new caretMovedChecker(this.target, aOffset)
|
||||
new caretMovedChecker(this.target, aOffset),
|
||||
new asyncInvokerChecker(EVENT_FOCUS, this.focus)
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn on/off the caret browsing mode.
|
||||
*/
|
||||
function turnCaretBrowsing(aIsOn)
|
||||
{
|
||||
var prefs = Components.classes["@mozilla.org/preferences-service;1"].
|
||||
getService(Components.interfaces.nsIPrefBranch);
|
||||
prefs.setBoolPref("accessibility.browsewithcaret", aIsOn);
|
||||
}
|
||||
|
||||
/**
|
||||
* Do tests.
|
||||
*/
|
||||
var gQueue = null;
|
||||
|
||||
// gA11yEventDumpID = "eventdump"; // debug stuff
|
||||
//gA11yEventDumpID = "eventdump"; // debug stuff
|
||||
//gA11yEventDumpToConsole = true;
|
||||
|
||||
function doTests()
|
||||
{
|
||||
turnCaretBrowsing(true);
|
||||
|
||||
// test caret move events and caret offsets
|
||||
gQueue = new eventQueue();
|
||||
|
||||
gQueue.push(new setCaretOffsetInvoker("textbox", 1));
|
||||
gQueue.push(new setCaretOffsetInvoker("link", 1));
|
||||
gQueue.push(new setCaretOffsetInvoker("heading", 1, document));
|
||||
gQueue.onFinish = function()
|
||||
{
|
||||
turnCaretBrowsing(false);
|
||||
}
|
||||
|
||||
gQueue.invoke(); // Will call SimpleTest.finish();
|
||||
}
|
||||
|
@ -84,6 +104,11 @@
|
|||
title="HyperText accessible should get focus when the caret is positioned inside of it, text is changed or copied into clipboard by ATs">
|
||||
Mozilla Bug 524115
|
||||
</a>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=546068"
|
||||
title="Position is not being updated when atk_text_set_caret_offset is used">
|
||||
Mozilla Bug 546068
|
||||
</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
|
@ -91,6 +116,7 @@
|
|||
|
||||
<input id="textbox" value="hello"/>
|
||||
<a id="link" href="about:">about mozilla</a>
|
||||
<h5 id="heading">heading</h5>
|
||||
|
||||
<div id="eventdump"></div>
|
||||
</body>
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
#
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public License Version
|
||||
# 1.1 (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
# http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
# for the specific language governing rights and limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Mozilla Foundation.
|
||||
# Portions created by the Initial Developer are Copyright (C) 2011
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Alexander Surkov <surkov.alexander@gmail.com> (original author)
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
DEPTH = ../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
relativesrcdir = accessible/textselection
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
_TEST_FILES = \
|
||||
test_general.html \
|
||||
$(NULL)
|
||||
|
||||
libs:: $(_TEST_FILES)
|
||||
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/a11y/$(relativesrcdir)
|
|
@ -0,0 +1,170 @@
|
|||
<html>
|
||||
|
||||
<head>
|
||||
<title>Text selection testing</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../events.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
/**
|
||||
* Invokers
|
||||
*/
|
||||
function addSelection(aID, aStartOffset, aEndOffset)
|
||||
{
|
||||
this.hyperTextNode = getNode(aID);
|
||||
this.hyperText = getAccessible(aID, [ nsIAccessibleText ]);
|
||||
|
||||
this.eventSeq = [
|
||||
new invokerChecker(EVENT_TEXT_SELECTION_CHANGED, aID)
|
||||
];
|
||||
|
||||
this.invoke = function addSelection_invoke()
|
||||
{
|
||||
this.hyperText.addSelection(aStartOffset, aEndOffset);
|
||||
}
|
||||
|
||||
this.finalCheck = function addSelection_finalCheck()
|
||||
{
|
||||
is(this.hyperText.selectionCount, 1,
|
||||
"addSelection: Wrong selection count for " + aID);
|
||||
var startOffset = {}, endOffset = {};
|
||||
this.hyperText.getSelectionBounds(0, startOffset, endOffset);
|
||||
|
||||
is(startOffset.value, aStartOffset,
|
||||
"addSelection: Wrong start offset for " + aID);
|
||||
is(endOffset.value, aEndOffset,
|
||||
"addSelection: Wrong end offset for " + aID);
|
||||
}
|
||||
|
||||
this.getID = function addSelection_getID()
|
||||
{
|
||||
return "nsIAccessibleText::addSelection test for " + aID;
|
||||
}
|
||||
}
|
||||
|
||||
function changeSelection(aID, aStartOffset, aEndOffset)
|
||||
{
|
||||
this.hyperTextNode = getNode(aID);
|
||||
this.hyperText = getAccessible(aID, [ nsIAccessibleText ]);
|
||||
|
||||
this.eventSeq = [
|
||||
new invokerChecker(EVENT_TEXT_SELECTION_CHANGED, aID)
|
||||
];
|
||||
|
||||
this.invoke = function changeSelection_invoke()
|
||||
{
|
||||
this.hyperText.setSelectionBounds(0, aStartOffset, aEndOffset);
|
||||
}
|
||||
|
||||
this.finalCheck = function changeSelection_finalCheck()
|
||||
{
|
||||
is(this.hyperText.selectionCount, 1,
|
||||
"setSelectionBounds: Wrong selection count for " + aID);
|
||||
var startOffset = {}, endOffset = {};
|
||||
this.hyperText.getSelectionBounds(0, startOffset, endOffset);
|
||||
|
||||
is(startOffset.value, aStartOffset,
|
||||
"setSelectionBounds: Wrong start offset for " + aID);
|
||||
is(endOffset.value, aEndOffset,
|
||||
"setSelectionBounds: Wrong end offset for " + aID);
|
||||
}
|
||||
|
||||
this.getID = function changeSelection_getID()
|
||||
{
|
||||
return "nsIAccessibleText::setSelectionBounds test for " + aID;
|
||||
}
|
||||
}
|
||||
|
||||
function removeSelection(aID)
|
||||
{
|
||||
this.hyperText = getAccessible(aID, [ nsIAccessibleText ]);
|
||||
|
||||
this.eventSeq = [
|
||||
new invokerChecker(EVENT_TEXT_SELECTION_CHANGED, aID)
|
||||
];
|
||||
|
||||
this.invoke = function removeSelection_invoke()
|
||||
{
|
||||
this.hyperText.removeSelection(0);
|
||||
}
|
||||
|
||||
this.finalCheck = function removeSelection_finalCheck()
|
||||
{
|
||||
is(this.hyperText.selectionCount, 0,
|
||||
"removeSelection: Wrong selection count for " + aID);
|
||||
}
|
||||
|
||||
this.getID = function removeSelection_getID()
|
||||
{
|
||||
return "nsIAccessibleText::removeSelection test for " + aID;
|
||||
}
|
||||
}
|
||||
|
||||
function onfocusEventSeq(aID)
|
||||
{
|
||||
var caretMovedChecker =
|
||||
new invokerChecker(EVENT_TEXT_CARET_MOVED, aID);
|
||||
var selChangedChecker =
|
||||
new invokerChecker(EVENT_TEXT_SELECTION_CHANGED, aID);
|
||||
selChangedChecker.unexpected = true;
|
||||
|
||||
return [ caretMovedChecker, selChangedChecker ];
|
||||
}
|
||||
|
||||
/**
|
||||
* Do tests
|
||||
*/
|
||||
|
||||
//gA11yEventDumpToConsole = true; // debug stuff
|
||||
|
||||
var gQueue = null;
|
||||
function doTests()
|
||||
{
|
||||
gQueue = new eventQueue();
|
||||
|
||||
gQueue.push(new addSelection("paragraph", 1, 3));
|
||||
gQueue.push(new changeSelection("paragraph", 2, 4));
|
||||
//gQueue.push(new removeSelection("paragraph"));
|
||||
todo(false, "removeSelection doesn't fire text selection changed events, see bug bug 688124.");
|
||||
|
||||
gQueue.push(new synthFocus("textbox", onfocusEventSeq("textbox")));
|
||||
gQueue.push(new changeSelection("textbox", 1, 3));
|
||||
|
||||
gQueue.push(new synthFocus("textarea", onfocusEventSeq("textarea")));
|
||||
gQueue.push(new changeSelection("textarea", 1, 3));
|
||||
|
||||
gQueue.invoke(); // Will call SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addA11yLoadEvent(doTests);
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=688126"
|
||||
title="nsIAccessibleText::setSelectionBounds doesn't fire text selection changed events in some cases">
|
||||
Mozilla Bug 688126
|
||||
</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
|
||||
<p id="paragraph">hello</p>
|
||||
<input id="textbox" value="hello"/>
|
||||
<textarea id="textarea">hello</textarea>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -40,8 +40,8 @@ nsTreeView.prototype =
|
|||
getCellText: function getCellText(aRow, aCol)
|
||||
{
|
||||
var data = this.getDataForIndex(aRow);
|
||||
if (aCol in data.colsText)
|
||||
return data.colsText[aCol];
|
||||
if (aCol.id in data.colsText)
|
||||
return data.colsText[aCol.id];
|
||||
|
||||
return data.text + aCol.id;
|
||||
},
|
||||
|
@ -120,7 +120,7 @@ nsTreeView.prototype =
|
|||
setCellText: function setCellText(aRow, aCol, aValue)
|
||||
{
|
||||
var data = this.getDataForIndex(aRow);
|
||||
data.colsText[aCol] = aValue;
|
||||
data.colsText[aCol.id] = aValue;
|
||||
},
|
||||
setCellValue: function setCellValue(aRow, aCol, aValue)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0"?>
|
||||
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1317659919000">
|
||||
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1318359094000">
|
||||
<emItems>
|
||||
<emItem blockID="i41" id="{99079a25-328f-4bd4-be04-00955acaa0a7}">
|
||||
<versionRange minVersion="0.1" maxVersion="4.3.1.00" severity="1">
|
||||
|
@ -9,6 +9,8 @@
|
|||
<versionRange minVersion=" " severity="1">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i43" id="supportaccessplugin@gmail.com">
|
||||
</emItem>
|
||||
<emItem blockID="i38" id="{B7082FAA-CB62-4872-9106-E42DD88EDE45}">
|
||||
<versionRange minVersion="0.1" maxVersion="3.3.0.*">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
|
@ -86,6 +88,8 @@
|
|||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i44" id="sigma@labs.mozilla">
|
||||
</emItem>
|
||||
<emItem blockID="i5" id="support@daemon-tools.cc">
|
||||
<versionRange minVersion=" " maxVersion="1.0.0.5">
|
||||
</versionRange>
|
||||
|
|
|
@ -103,7 +103,7 @@ static bool IsArg(const char* arg, const char* s)
|
|||
return !strcasecmp(++arg, s);
|
||||
#endif
|
||||
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -143,10 +143,10 @@ static int do_main(const char *exePath, int argc, char* argv[])
|
|||
#ifdef XP_WIN
|
||||
// exePath comes from mozilla::BinaryPath::Get, which returns a UTF-8
|
||||
// encoded path, so it is safe to convert it
|
||||
nsresult rv = NS_NewLocalFile(NS_ConvertUTF8toUTF16(exePath), PR_FALSE,
|
||||
nsresult rv = NS_NewLocalFile(NS_ConvertUTF8toUTF16(exePath), false,
|
||||
getter_AddRefs(appini));
|
||||
#else
|
||||
nsresult rv = NS_NewNativeLocalFile(nsDependentCString(exePath), PR_FALSE,
|
||||
nsresult rv = NS_NewNativeLocalFile(nsDependentCString(exePath), false,
|
||||
getter_AddRefs(appini));
|
||||
#endif
|
||||
if (NS_FAILED(rv)) {
|
||||
|
|
|
@ -77,7 +77,7 @@ pref("extensions.update.autoUpdateDefault", true);
|
|||
// Disable add-ons installed into the shared user and shared system areas by
|
||||
// default. This does not include the application directory. See the SCOPE
|
||||
// constants in AddonManager.jsm for values to use here
|
||||
pref("extensions.autoDisableScopes", 10);
|
||||
pref("extensions.autoDisableScopes", 15);
|
||||
|
||||
// Dictionary download preference
|
||||
pref("browser.dictionaries.download.url", "https://addons.mozilla.org/%LOCALE%/firefox/dictionaries/");
|
||||
|
@ -170,9 +170,8 @@ pref("app.update.url", "https://aus3.mozilla.org/update/3/%PRODUCT%/%VERSION%/%B
|
|||
//pref("app.update.url.override", "");
|
||||
|
||||
// app.update.interval is in branding section
|
||||
// app.update.promptWaitTime is in branding section
|
||||
|
||||
// Give the user x seconds to react before showing the big UI. default=12 hours
|
||||
pref("app.update.promptWaitTime", 43200);
|
||||
// Show the Update Checking/Ready UI when the user was idle for x seconds
|
||||
pref("app.update.idletime", 60);
|
||||
|
||||
|
@ -1011,6 +1010,9 @@ pref("devtools.scratchpad.enabled", true);
|
|||
// Enable tools for Chrome development.
|
||||
pref("devtools.chrome.enabled", false);
|
||||
|
||||
// Disable the GCLI enhanced command line.
|
||||
pref("devtools.gcli.enable", false);
|
||||
|
||||
// The last Web Console height. This is initially 0 which means that the Web
|
||||
// Console will use the default height next time it shows.
|
||||
// Change to -1 if you do not want the Web Console to remember its last height.
|
||||
|
|
|
@ -83,6 +83,3 @@ endif
|
|||
ifneq (,$(filter windows gtk2, $(MOZ_WIDGET_TOOLKIT)))
|
||||
DEFINES += -DMENUBAR_CAN_AUTOHIDE=1
|
||||
endif
|
||||
|
||||
libs::
|
||||
$(NSINSTALL) $(srcdir)/content/tabview/modules/* $(FINAL_TARGET)/modules/tabview
|
||||
|
|
|
@ -67,7 +67,8 @@
|
|||
#else
|
||||
title="&aboutDialog.title;"
|
||||
#endif
|
||||
aria-describedby="version distribution distributionId"
|
||||
role="dialog"
|
||||
aria-describedby="version distribution distributionId communityDesc contributeDesc trademark"
|
||||
>
|
||||
|
||||
<script type="application/javascript" src="chrome://browser/content/aboutDialog.js"/>
|
||||
|
@ -80,7 +81,7 @@
|
|||
<label id="distribution" class="text-blurb"/>
|
||||
<label id="distributionId" class="text-blurb"/>
|
||||
|
||||
<vbox id="detailsBox" aria-describedby="communityDesc contributeDesc">
|
||||
<vbox id="detailsBox">
|
||||
<vbox id="updateBox">
|
||||
#ifdef MOZ_UPDATER
|
||||
<deck id="updateDeck" orient="vertical">
|
||||
|
|
|
@ -52,7 +52,6 @@ let TabView = {
|
|||
PREF_RESTORE_ENABLED_ONCE: "browser.panorama.session_restore_enabled_once",
|
||||
GROUPS_IDENTIFIER: "tabview-groups",
|
||||
VISIBILITY_IDENTIFIER: "tabview-visibility",
|
||||
LAST_SESSION_GROUP_NAME_IDENTIFIER: "tabview-last-session-group-name",
|
||||
|
||||
// ----------
|
||||
get windowTitle() {
|
||||
|
@ -94,10 +93,9 @@ let TabView = {
|
|||
// ----------
|
||||
init: function TabView_init() {
|
||||
// disable the ToggleTabView command for popup windows
|
||||
if (!window.toolbar.visible) {
|
||||
goSetCommandEnabled("Browser:ToggleTabView", false);
|
||||
goSetCommandEnabled("Browser:ToggleTabView", window.toolbar.visible);
|
||||
if (!window.toolbar.visible)
|
||||
return;
|
||||
}
|
||||
|
||||
if (this._initialized)
|
||||
return;
|
||||
|
@ -143,10 +141,6 @@ let TabView = {
|
|||
"TabShow", this._tabShowEventListener, false);
|
||||
gBrowser.tabContainer.addEventListener(
|
||||
"TabClose", this._tabCloseEventListener, false);
|
||||
|
||||
// grab the last used group title
|
||||
this._lastSessionGroupName = sessionstore.getWindowValue(window,
|
||||
this.LAST_SESSION_GROUP_NAME_IDENTIFIER);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -279,30 +273,6 @@ let TabView = {
|
|||
else
|
||||
this.show();
|
||||
},
|
||||
|
||||
getActiveGroupName: function TabView_getActiveGroupName() {
|
||||
if (!this._window)
|
||||
return this._lastSessionGroupName;
|
||||
|
||||
// We get the active group this way, instead of querying
|
||||
// GroupItems.getActiveGroupItem() because the tabSelect event
|
||||
// will not have happened by the time the browser tries to
|
||||
// update the title.
|
||||
let groupItem = null;
|
||||
let activeTab = window.gBrowser.selectedTab;
|
||||
let activeTabItem = activeTab._tabViewTabItem;
|
||||
|
||||
if (activeTab.pinned) {
|
||||
// It's an app tab, so it won't have a .tabItem. However, its .parent
|
||||
// will already be set as the active group.
|
||||
groupItem = this._window.GroupItems.getActiveGroupItem();
|
||||
} else if (activeTabItem) {
|
||||
groupItem = activeTabItem.parent;
|
||||
}
|
||||
|
||||
// groupItem may still be null, if the active tab is an orphan.
|
||||
return groupItem ? groupItem.getTitle() : "";
|
||||
},
|
||||
|
||||
// ----------
|
||||
updateContextMenu: function TabView_updateContextMenu(tab, popup) {
|
||||
|
|
|
@ -2281,18 +2281,17 @@ function BrowserTryToCloseWindow()
|
|||
window.close(); // WindowIsClosing does all the necessary checks
|
||||
}
|
||||
|
||||
function loadURI(uri, referrer, postData, allowThirdPartyFixup)
|
||||
{
|
||||
function loadURI(uri, referrer, postData, allowThirdPartyFixup) {
|
||||
if (postData === undefined)
|
||||
postData = null;
|
||||
|
||||
var flags = nsIWebNavigation.LOAD_FLAGS_NONE;
|
||||
if (allowThirdPartyFixup)
|
||||
flags |= nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP;
|
||||
|
||||
try {
|
||||
if (postData === undefined)
|
||||
postData = null;
|
||||
var flags = nsIWebNavigation.LOAD_FLAGS_NONE;
|
||||
if (allowThirdPartyFixup) {
|
||||
flags = nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP;
|
||||
}
|
||||
gBrowser.loadURIWithFlags(uri, flags, referrer, null, postData);
|
||||
} catch (e) {
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
function getShortcutOrURI(aURL, aPostDataRef, aMayInheritPrincipal) {
|
||||
|
@ -3430,6 +3429,7 @@ const BrowserSearch = {
|
|||
openLinkIn(submission.uri.spec,
|
||||
useNewTab ? "tab" : "current",
|
||||
{ postData: submission.postData,
|
||||
inBackground: false,
|
||||
relatedToCurrent: true });
|
||||
},
|
||||
|
||||
|
@ -4159,7 +4159,7 @@ var XULBrowserWindow = {
|
|||
startTime: 0,
|
||||
statusText: "",
|
||||
isBusy: false,
|
||||
inContentWhitelist: ["about:addons", "about:permissions"],
|
||||
inContentWhitelist: ["about:addons", "about:permissions", "about:sync-progress"],
|
||||
|
||||
QueryInterface: function (aIID) {
|
||||
if (aIID.equals(Ci.nsIWebProgressListener) ||
|
||||
|
@ -5647,7 +5647,8 @@ function middleMousePaste(event) {
|
|||
// bar's behavior (stripsurroundingwhitespace)
|
||||
clipboard = clipboard.replace(/\s*\n\s*/g, "");
|
||||
|
||||
let url = getShortcutOrURI(clipboard);
|
||||
let mayInheritPrincipal = { value: false };
|
||||
let url = getShortcutOrURI(clipboard, mayInheritPrincipal);
|
||||
try {
|
||||
makeURI(url);
|
||||
} catch (ex) {
|
||||
|
@ -5663,9 +5664,10 @@ function middleMousePaste(event) {
|
|||
Cu.reportError(ex);
|
||||
}
|
||||
|
||||
openUILink(url,
|
||||
event,
|
||||
true /* ignore the fact this is a middle click */);
|
||||
// FIXME: Bug 631500, use openUILink directly
|
||||
let where = whereToOpenLink(event, true);
|
||||
openUILinkIn(url, where,
|
||||
{ disallowInheritPrincipal: !mayInheritPrincipal.value });
|
||||
|
||||
event.stopPropagation();
|
||||
}
|
||||
|
@ -5838,11 +5840,10 @@ function stylesheetFillPopup(menuPopup) {
|
|||
if (!currentStyleSheet.title)
|
||||
continue;
|
||||
|
||||
// Skip any stylesheets that don't match the screen media type.
|
||||
// Skip any stylesheets whose media attribute doesn't match.
|
||||
if (currentStyleSheet.media.length > 0) {
|
||||
let media = currentStyleSheet.media.mediaText.split(", ");
|
||||
if (media.indexOf("screen") == -1 &&
|
||||
media.indexOf("all") == -1)
|
||||
let mediaQueryList = currentStyleSheet.media.mediaText;
|
||||
if (!window.content.matchMedia(mediaQueryList).matches)
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -976,7 +976,6 @@
|
|||
<toolbarbutton id="inspector-inspect-toolbutton"
|
||||
label="&inspectButton.label;"
|
||||
accesskey="&inspectButton.accesskey;"
|
||||
class="toolbarbutton-text"
|
||||
command="Inspector:Inspect"/>
|
||||
<toolbarseparator />
|
||||
<hbox id="inspector-tools">
|
||||
|
@ -1012,7 +1011,7 @@
|
|||
</svg:mask>
|
||||
<svg:mask id="winstripe-urlbar-back-button-mask" maskContentUnits="userSpaceOnUse">
|
||||
<svg:rect x="0" y="0" width="10000" height="50" fill="white"/>
|
||||
<svg:circle cx="-11" cy="12" r="15"/>
|
||||
<svg:circle cx="-11" cy="13" r="15"/>
|
||||
</svg:mask>
|
||||
</svg:svg>
|
||||
#endif
|
||||
|
|
|
@ -42,6 +42,9 @@
|
|||
|
||||
#highlighter-nodeinfobar-container {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
#highlighter-nodeinfobar-container:not([locked]) {
|
||||
-moz-transition-property: top, left;
|
||||
-moz-transition-duration: 0.1s;
|
||||
-moz-transition-timing-function: linear;
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Firefox Sync.
|
||||
*
|
||||
* The Initial Developer of the Original Code is the Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2011
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Allison Naaktgeboren <ally@mozilla.com> (original author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://services-sync/main.js");
|
||||
|
||||
let gProgressBar;
|
||||
let gCounter = 0;
|
||||
|
||||
function onLoad(event) {
|
||||
Services.obs.addObserver(increaseProgressBar, "weave:engine:sync:finish", false);
|
||||
Services.obs.addObserver(increaseProgressBar, "weave:engine:sync:error", false);
|
||||
gProgressBar = document.getElementById('uploadProgressBar');
|
||||
|
||||
if (Services.prefs.getPrefType("services.sync.firstSync") != Ci.nsIPrefBranch.PREF_INVALID) {
|
||||
gProgressBar.max = Weave.Engines.getEnabled().length;
|
||||
gProgressBar.style.display = "inline";
|
||||
}
|
||||
else {
|
||||
gProgressBar.style.display = "none";
|
||||
}
|
||||
}
|
||||
|
||||
function onUnload(event) {
|
||||
Services.obs.removeObserver(increaseProgressBar, "weave:engine:sync:finish");
|
||||
Services.obs.removeObserver(increaseProgressBar, "weave:engine:sync:error");
|
||||
}
|
||||
|
||||
function increaseProgressBar(){
|
||||
gCounter += 1;
|
||||
gProgressBar.setAttribute("value", gCounter);
|
||||
}
|
||||
|
||||
function closeTab() {
|
||||
window.close();
|
||||
}
|
|
@ -0,0 +1,86 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public License
|
||||
# Version
|
||||
# 1.1 (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
# http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS IS"
|
||||
# basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
# for the specific language governing rights and limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is Firefox Sync.
|
||||
#
|
||||
# The Initial Developer of the Original Code is the Mozilla Foundation.
|
||||
# Portions created by the Initial Developer are Copyright (C) 2011
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Allison Naaktgeboren <ally@mozilla.com> (original author)
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
<!DOCTYPE html [
|
||||
<!ENTITY % htmlDTD
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"DTD/xhtml1-strict.dtd">
|
||||
%htmlDTD;
|
||||
<!ENTITY % syncProgressDTD
|
||||
SYSTEM "chrome://browser/locale/syncProgress.dtd">
|
||||
%syncProgressDTD;
|
||||
<!ENTITY % syncSetupDTD
|
||||
SYSTEM "chrome://browser/locale/syncSetup.dtd">
|
||||
%syncSetupDTD;
|
||||
]>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>&syncProgress.pageTitle;</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" media="all"
|
||||
href="chrome://browser/skin/syncProgress.css"/>
|
||||
|
||||
<link rel="icon" type="image/png" id="favicon"
|
||||
href="chrome://browser/skin/sync-16.png"/>
|
||||
|
||||
<script type="text/javascript;version=1.8"
|
||||
src="chrome://browser/content/syncProgress.js"/>
|
||||
</head>
|
||||
<body onload="onLoad(event)" onunload="onUnload(event)">
|
||||
<title>&setup.successPage.title;</title>
|
||||
<div id="floatingBox" class="main-content">
|
||||
<div id="title">
|
||||
<h1>&setup.successPage.title;</h1>
|
||||
</div>
|
||||
<div id="successLogo">
|
||||
<img id="brandSyncLogo" src="chrome://browser/skin/sync-128.png" alt="&syncProgress.logoAltText;" />
|
||||
</div>
|
||||
<div id="loadingText">
|
||||
<p id="blurb">&syncProgress.textBlurb; </p>
|
||||
</div>
|
||||
<div id="progressBar">
|
||||
<progress id="uploadProgressBar" value="0"/>
|
||||
</div>
|
||||
<div id="bottomRow">
|
||||
<button id="closeButton" onclick="closeTab()">&syncProgress.closeButton; </button>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -24,6 +24,7 @@
|
|||
* Philipp von Weitershausen <philipp@weitershausen.de>
|
||||
* Paul O’Shannessy <paul@oshannessy.com>
|
||||
* Richard Newman <rnewman@mozilla.com>
|
||||
* Allison Naaktgeboren <ally@mozilla.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
|
@ -53,7 +54,6 @@ const EXISTING_ACCOUNT_CONNECT_PAGE = 3;
|
|||
const EXISTING_ACCOUNT_LOGIN_PAGE = 4;
|
||||
const OPTIONS_PAGE = 5;
|
||||
const OPTIONS_CONFIRM_PAGE = 6;
|
||||
const SETUP_SUCCESS_PAGE = 7;
|
||||
|
||||
// Broader than we'd like, but after this changed from api-secure.recaptcha.net
|
||||
// we had no choice. At least we only do this for the duration of setup.
|
||||
|
@ -411,6 +411,7 @@ var gSyncSetup = {
|
|||
this.checkFields();
|
||||
break;
|
||||
case EXISTING_ACCOUNT_CONNECT_PAGE:
|
||||
Weave.Svc.Prefs.set("firstSync", "existingAccount");
|
||||
this.wizard.getButton("next").hidden = false;
|
||||
this.wizard.getButton("back").hidden = false;
|
||||
this.wizard.getButton("extra1").hidden = false;
|
||||
|
@ -425,18 +426,6 @@ var gSyncSetup = {
|
|||
this.wizard.canRewind = true;
|
||||
this.checkFields();
|
||||
break;
|
||||
case SETUP_SUCCESS_PAGE:
|
||||
this.wizard.canRewind = false;
|
||||
this.wizard.canAdvance = true;
|
||||
this.wizard.getButton("back").hidden = true;
|
||||
this.wizard.getButton("next").hidden = true;
|
||||
this.wizard.getButton("cancel").hidden = true;
|
||||
this.wizard.getButton("finish").hidden = false;
|
||||
this._handleSuccess();
|
||||
if (this.wizardType == "pair") {
|
||||
this.completePairing();
|
||||
}
|
||||
break;
|
||||
case OPTIONS_PAGE:
|
||||
this.wizard.canRewind = false;
|
||||
this.wizard.canAdvance = true;
|
||||
|
@ -473,7 +462,7 @@ var gSyncSetup = {
|
|||
!Weave.Utils.ensureMPUnlocked()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
switch (this.wizard.pageIndex) {
|
||||
case PAIR_PAGE:
|
||||
this.startPairing();
|
||||
|
@ -519,7 +508,8 @@ var gSyncSetup = {
|
|||
Weave.Service.password = password;
|
||||
Weave.Service.passphrase = Weave.Utils.generatePassphrase();
|
||||
this._handleNoScript(false);
|
||||
this.wizard.pageIndex = SETUP_SUCCESS_PAGE;
|
||||
Weave.Svc.Prefs.set("firstSync", "newAccount");
|
||||
this.wizardFinish();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -532,8 +522,9 @@ var gSyncSetup = {
|
|||
Weave.Service.password = document.getElementById("existingPassword").value;
|
||||
let pp = document.getElementById("existingPassphrase").value;
|
||||
Weave.Service.passphrase = Weave.Utils.normalizePassphrase(pp);
|
||||
if (Weave.Service.login())
|
||||
this.wizard.pageIndex = SETUP_SUCCESS_PAGE;
|
||||
if (Weave.Service.login()) {
|
||||
this.wizardFinish();
|
||||
}
|
||||
return false;
|
||||
case OPTIONS_PAGE:
|
||||
let desc = document.getElementById("mergeChoiceRadio").selectedIndex;
|
||||
|
@ -544,8 +535,7 @@ var gSyncSetup = {
|
|||
return this._handleChoice();
|
||||
case OPTIONS_CONFIRM_PAGE:
|
||||
if (this._resettingSync) {
|
||||
this.onWizardFinish();
|
||||
window.close();
|
||||
this.wizardFinish();
|
||||
return false;
|
||||
}
|
||||
return this.returnFromOptions();
|
||||
|
@ -580,9 +570,13 @@ var gSyncSetup = {
|
|||
return true;
|
||||
},
|
||||
|
||||
onWizardFinish: function () {
|
||||
wizardFinish: function () {
|
||||
this.setupInitialSync();
|
||||
|
||||
if (this.wizardType == "pair") {
|
||||
this.completePairing();
|
||||
}
|
||||
|
||||
if (!this._resettingSync) {
|
||||
function isChecked(element) {
|
||||
return document.getElementById(element).hasAttribute("checked");
|
||||
|
@ -598,22 +592,17 @@ var gSyncSetup = {
|
|||
|
||||
Weave.Service.persistLogin();
|
||||
Weave.Svc.Obs.notify("weave:service:setup-complete");
|
||||
if (this._settingUpNew)
|
||||
gSyncUtils.openFirstClientFirstrun();
|
||||
else
|
||||
gSyncUtils.openAddedClientFirstrun();
|
||||
|
||||
gSyncUtils.openFirstSyncProgressPage();
|
||||
}
|
||||
Weave.Utils.nextTick(Weave.Service.sync, Weave.Service);
|
||||
window.close();
|
||||
},
|
||||
|
||||
onWizardCancel: function () {
|
||||
if (this._resettingSync)
|
||||
return;
|
||||
|
||||
if (this.wizard.pageIndex == SETUP_SUCCESS_PAGE) {
|
||||
this.onWizardFinish();
|
||||
return;
|
||||
}
|
||||
this.abortEasySetup();
|
||||
this._handleNoScript(false);
|
||||
Weave.Service.startOver();
|
||||
|
@ -714,7 +703,7 @@ var gSyncSetup = {
|
|||
Weave.Service.password = credentials.password;
|
||||
Weave.Service.passphrase = credentials.synckey;
|
||||
Weave.Service.serverURL = credentials.serverURL;
|
||||
self.wizard.pageIndex = SETUP_SUCCESS_PAGE;
|
||||
gSyncSetup.wizardFinish();
|
||||
},
|
||||
|
||||
onAbort: function onAbort(error) {
|
||||
|
@ -906,25 +895,6 @@ var gSyncSetup = {
|
|||
return valid;
|
||||
},
|
||||
|
||||
_handleSuccess: function() {
|
||||
let self = this;
|
||||
function fill(id, string)
|
||||
document.getElementById(id).firstChild.nodeValue =
|
||||
string ? self._stringBundle.GetStringFromName(string) : "";
|
||||
|
||||
fill("firstSyncAction", "");
|
||||
fill("firstSyncActionWarning", "");
|
||||
if (this._settingUpNew) {
|
||||
fill("firstSyncAction", "newAccount.action.label");
|
||||
fill("firstSyncActionChange", "newAccount.change.label");
|
||||
return;
|
||||
}
|
||||
fill("firstSyncActionChange", "existingAccount.change.label");
|
||||
let action = document.getElementById("mergeChoiceRadio").selectedItem.id;
|
||||
let id = action == "resetClient" ? "firstSyncAction" : "firstSyncActionWarning";
|
||||
fill(id, action + ".change.label");
|
||||
},
|
||||
|
||||
_handleChoice: function () {
|
||||
let desc = document.getElementById("mergeChoiceRadio").selectedIndex;
|
||||
document.getElementById("chosenActionDeck").selectedIndex = desc;
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
# Mike Connor <mconnor@mozilla.com>
|
||||
# Paul O’Shannessy <paul@oshannessy.com>
|
||||
# Philipp von Weitershausen <philipp@weitershausen.de>
|
||||
# Allison Naaktgeboren <ally@mozilla.com>
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
|
@ -60,7 +61,6 @@
|
|||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
onwizardnext="return gSyncSetup.onWizardAdvance()"
|
||||
onwizardback="return gSyncSetup.onWizardBack()"
|
||||
onwizardfinish="gSyncSetup.onWizardFinish()"
|
||||
onwizardcancel="gSyncSetup.onWizardCancel()"
|
||||
onload="gSyncSetup.init()">
|
||||
|
||||
|
@ -511,24 +511,11 @@
|
|||
</vbox>
|
||||
</deck>
|
||||
</wizardpage>
|
||||
|
||||
<wizardpage label="&setup.successPage.title;"
|
||||
id="successfulSetup"
|
||||
onextra1="gSyncSetup.onSyncOptions()"
|
||||
onpageshow="gSyncSetup.onPageShow()">
|
||||
<vbox align="center">
|
||||
<image id="successPageIcon"/>
|
||||
</vbox>
|
||||
<separator/>
|
||||
<description class="normal">
|
||||
<html:span id="firstSyncAction">replace me</html:span>
|
||||
<html:strong id="firstSyncActionWarning">replace me</html:strong>
|
||||
<html:span id="firstSyncActionChange">replace me</html:span>
|
||||
</description>
|
||||
<description>
|
||||
&continueUsing.label;
|
||||
</description>
|
||||
<separator flex="1"/>
|
||||
# In terms of the wizard flow shown to the user, the 'syncOptionsConfirm'
|
||||
# page above is not the last wizard page. To prevent the wizard binding from
|
||||
# assuming that it is, we're inserting this dummy page here. This also means
|
||||
# that the wizard needs to always be closed manually via wizardFinish().
|
||||
<wizardpage>
|
||||
</wizardpage>
|
||||
</wizard>
|
||||
|
||||
|
|
|
@ -109,17 +109,8 @@ let gSyncUtils = {
|
|||
this._openLink(Weave.Svc.Prefs.get("privacyURL"));
|
||||
},
|
||||
|
||||
// xxxmpc - fix domain before 1.3 final (bug 583652)
|
||||
_baseURL: "http://www.mozilla.com/firefox/sync/",
|
||||
|
||||
openFirstClientFirstrun: function () {
|
||||
let url = this._baseURL + "firstrun.html";
|
||||
this._openLink(url);
|
||||
},
|
||||
|
||||
openAddedClientFirstrun: function () {
|
||||
let url = this._baseURL + "secondrun.html";
|
||||
this._openLink(url);
|
||||
openFirstSyncProgressPage: function () {
|
||||
this._openLink("about:sync-progress");
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -813,12 +813,6 @@
|
|||
}
|
||||
} catch (e) {}
|
||||
|
||||
if ("TabView" in window) {
|
||||
let groupName = TabView.getActiveGroupName();
|
||||
if (groupName)
|
||||
newTitle = groupName + sep + newTitle;
|
||||
}
|
||||
|
||||
return newTitle;
|
||||
]]>
|
||||
</body>
|
||||
|
|
|
@ -40,10 +40,6 @@ srcdir = @srcdir@
|
|||
VPATH = @srcdir@
|
||||
relativesrcdir = browser/base/content/test
|
||||
|
||||
DIRS += \
|
||||
tabview \
|
||||
$(NULL)
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
|
@ -249,6 +245,8 @@ _BROWSER_FILES = \
|
|||
test_wyciwyg_copying.html \
|
||||
authenticate.sjs \
|
||||
browser_minimize.js \
|
||||
browser_aboutSyncProgress.js \
|
||||
browser_middleMouse_inherit.js \
|
||||
$(NULL)
|
||||
|
||||
ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))
|
||||
|
|
|
@ -0,0 +1,101 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||
*/
|
||||
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://services-sync/main.js");
|
||||
|
||||
let gTests = [ {
|
||||
desc: "Makes sure the progress bar appears if firstSync pref is set",
|
||||
setup: function () {
|
||||
Services.prefs.setCharPref("services.sync.firstSync", "newAccount");
|
||||
},
|
||||
run: function () {
|
||||
let doc = gBrowser.selectedTab.linkedBrowser.contentDocument;
|
||||
let progressBar = doc.getElementById("uploadProgressBar");
|
||||
|
||||
isnot(progressBar.style.display, "none", "progress bar should be visible");
|
||||
executeSoon(runNextTest);
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
desc: "Makes sure the progress bar is hidden if firstSync pref is not set",
|
||||
setup: function () {
|
||||
Services.prefs.clearUserPref("services.sync.firstSync");
|
||||
is(Services.prefs.getPrefType("services.sync.firstSync"),
|
||||
Ci.nsIPrefBranch.PREF_INVALID, "pref DNE" );
|
||||
},
|
||||
run: function () {
|
||||
let doc = gBrowser.selectedTab.linkedBrowser.contentDocument;
|
||||
let progressBar = doc.getElementById("uploadProgressBar");
|
||||
|
||||
is(progressBar.style.display, "none",
|
||||
"progress bar should not be visible");
|
||||
executeSoon(runNextTest);
|
||||
}
|
||||
},
|
||||
{
|
||||
desc: "Makes sure the observer updates are reflected in the progress bar",
|
||||
setup: function () {
|
||||
},
|
||||
run: function () {
|
||||
let doc = gBrowser.selectedTab.linkedBrowser.contentDocument;
|
||||
let progressBar = doc.getElementById("uploadProgressBar");
|
||||
|
||||
Services.obs.notifyObservers(null, "weave:engine:sync:finish", null);
|
||||
Services.obs.notifyObservers(null, "weave:engine:sync:error", null);
|
||||
|
||||
let received = progressBar.getAttribute("value");
|
||||
|
||||
is(received, 2, "progress bar received correct notifications");
|
||||
executeSoon(runNextTest);
|
||||
}
|
||||
},
|
||||
{
|
||||
desc: "Close button should close tab",
|
||||
setup: function (){
|
||||
},
|
||||
run: function () {
|
||||
function onTabClosed() {
|
||||
ok(true, "received TabClose notification");
|
||||
gBrowser.tabContainer.removeEventListener("TabClose", onTabClosed, false);
|
||||
executeSoon(runNextTest);
|
||||
}
|
||||
let doc = gBrowser.selectedTab.linkedBrowser.contentDocument;
|
||||
let button = doc.getElementById('closeButton');
|
||||
let window = doc.defaultView;
|
||||
gBrowser.tabContainer.addEventListener("TabClose", onTabClosed, false);
|
||||
EventUtils.sendMouseEvent({type: "click"}, button, window);
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
function test () {
|
||||
waitForExplicitFinish();
|
||||
executeSoon(runNextTest);
|
||||
}
|
||||
|
||||
function runNextTest()
|
||||
{
|
||||
while (gBrowser.tabs.length > 1) {
|
||||
gBrowser.removeCurrentTab();
|
||||
}
|
||||
|
||||
if (gTests.length) {
|
||||
let test = gTests.shift();
|
||||
info(test.desc);
|
||||
test.setup();
|
||||
let tab = gBrowser.selectedTab = gBrowser.addTab("about:sync-progress");
|
||||
tab.linkedBrowser.addEventListener("load", function (event) {
|
||||
tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
// Some part of the page is populated on load, so enqueue on it.
|
||||
executeSoon(test.run);
|
||||
}, true);
|
||||
}
|
||||
else {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
const middleMousePastePref = "middlemouse.contentLoadURL";
|
||||
const autoScrollPref = "general.autoScroll";
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
Services.prefs.setBoolPref(middleMousePastePref, true);
|
||||
Services.prefs.setBoolPref(autoScrollPref, false);
|
||||
let tab = gBrowser.selectedTab = gBrowser.addTab();
|
||||
|
||||
registerCleanupFunction(function () {
|
||||
Services.prefs.clearUserPref(middleMousePastePref);
|
||||
Services.prefs.clearUserPref(autoScrollPref);
|
||||
gBrowser.removeTab(tab);
|
||||
});
|
||||
|
||||
addPageShowListener(function () {
|
||||
let pagePrincipal = gBrowser.contentPrincipal;
|
||||
|
||||
// copy javascript URI to the clipboard
|
||||
let url = "javascript:1+1";
|
||||
waitForClipboard(url,
|
||||
function() {
|
||||
Components.classes["@mozilla.org/widget/clipboardhelper;1"]
|
||||
.getService(Components.interfaces.nsIClipboardHelper)
|
||||
.copyString(url);
|
||||
},
|
||||
function () {
|
||||
// Middle click on the content area
|
||||
info("Middle clicking");
|
||||
EventUtils.sendMouseEvent({type: "click", button: 1}, gBrowser);
|
||||
},
|
||||
function() {
|
||||
ok(false, "Failed to copy URL to the clipboard");
|
||||
finish();
|
||||
}
|
||||
);
|
||||
|
||||
addPageShowListener(function () {
|
||||
is(gBrowser.currentURI.spec, url, "url loaded by middle click");
|
||||
ok(!gBrowser.contentPrincipal.equals(pagePrincipal),
|
||||
"middle click load of " + url + " should produce a page with a different principal");
|
||||
finish();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function addPageShowListener(func) {
|
||||
gBrowser.selectedBrowser.addEventListener("pageshow", function loadListener() {
|
||||
gBrowser.selectedBrowser.removeEventListener("pageshow", loadListener, false);
|
||||
func();
|
||||
});
|
||||
}
|
|
@ -90,6 +90,20 @@ var tests = [
|
|||
copyExpected: "http://example.com/\xe9"
|
||||
},
|
||||
|
||||
{
|
||||
loadURL: "http://example.com/?%C3%B7%C3%B7",
|
||||
expectedURL: "example.com/?\xf7\xf7",
|
||||
copyExpected: "http://example.com/?%C3%B7%C3%B7"
|
||||
},
|
||||
{
|
||||
copyVal: "e<xample.com/?\xf7>\xf7",
|
||||
copyExpected: "xample.com/?\xf7"
|
||||
},
|
||||
{
|
||||
copyVal: "<example.com/?\xf7>\xf7",
|
||||
copyExpected: "http://example.com/?\xf7"
|
||||
},
|
||||
|
||||
// data: and javsacript: URIs shouldn't be encoded
|
||||
{
|
||||
loadURL: "javascript:('%C3%A9')",
|
||||
|
|
|
@ -22,15 +22,19 @@
|
|||
<link data-state="1" href="404.css" title="12" rel="alternate stylesheet" media="ALL ">
|
||||
<link data-state="1" href="404.css" title="13" rel="alternate stylesheet" media="screen">
|
||||
<link data-state="1" href="404.css" title="14" rel="alternate stylesheet" media=" Screen">
|
||||
<link data-state="1" href="404.css" title="15" rel="alternate stylesheet" media="screen foo">
|
||||
<link data-state="1" href="404.css" title="16" rel="alternate stylesheet" media="all screen">
|
||||
<link data-state="1" href="404.css" title="17" rel="alternate stylesheet" media="foo bar">
|
||||
<link data-state="0" href="404.css" title="15" rel="alternate stylesheet" media="screen foo">
|
||||
<link data-state="0" href="404.css" title="16" rel="alternate stylesheet" media="all screen">
|
||||
<link data-state="0" href="404.css" title="17" rel="alternate stylesheet" media="foo bar">
|
||||
<link data-state="1" href="404.css" title="18" rel="alternate stylesheet" media="all,screen">
|
||||
<link data-state="1" href="404.css" title="19" rel="alternate stylesheet" media="all, screen">
|
||||
<link data-state="1" href="404.css" title="20" rel="alternate stylesheet" media="all screen">
|
||||
<link data-state="0" href="404.css" title="20" rel="alternate stylesheet" media="all screen">
|
||||
<link data-state="0" href="404.css" title="21" rel="alternate stylesheet" media="foo">
|
||||
<link data-state="0" href="404.css" title="22" rel="alternate stylesheet" media="allscreen">
|
||||
<link data-state="0" href="404.css" title="23" rel="alternate stylesheet" media="_all">
|
||||
<link data-state="0" href="404.css" title="24" rel="alternate stylesheet" media="not screen">
|
||||
<link data-state="1" href="404.css" title="25" rel="alternate stylesheet" media="only screen">
|
||||
<link data-state="1" href="404.css" title="26" rel="alternate stylesheet" media="screen and (min-device-width: 1px)">
|
||||
<link data-state="0" href="404.css" title="27" rel="alternate stylesheet" media="screen and (max-device-width: 1px)">
|
||||
</head>
|
||||
<body></body>
|
||||
</html>
|
||||
|
|
|
@ -23,16 +23,33 @@ netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
|||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
|
||||
function openContextMenuFor(element, shiftkey) {
|
||||
function openContextMenuFor(element, shiftkey, shouldWaitForFocus) {
|
||||
// Context menu should be closed before we open it again.
|
||||
is(contextMenu.state, "closed", "checking if popup is closed");
|
||||
|
||||
if (lastElement)
|
||||
lastElement.blur();
|
||||
element.focus();
|
||||
lastElement = element;
|
||||
var eventDetails = { type : "contextmenu", button : 2, shiftKey : shiftkey };
|
||||
synthesizeMouse(element, 2, 2, eventDetails, element.ownerDocument.defaultView);
|
||||
//Some elements need time to focus and spellcheck before any tests are
|
||||
//run on them.
|
||||
if(shouldWaitForFocus)
|
||||
{
|
||||
if (lastElement)
|
||||
lastElement.blur();
|
||||
element.focus();
|
||||
|
||||
SimpleTest.executeSoon(function() {
|
||||
lastElement = element;
|
||||
var eventDetails = { type : "contextmenu", button : 2, shiftKey : shiftkey };
|
||||
synthesizeMouse(element, 2, 2, eventDetails, element.ownerDocument.defaultView);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
if (lastElement)
|
||||
lastElement.blur();
|
||||
element.focus();
|
||||
lastElement = element;
|
||||
var eventDetails = { type : "contextmenu", button : 2, shiftKey : shiftkey };
|
||||
synthesizeMouse(element, 2, 2, eventDetails, element.ownerDocument.defaultView);
|
||||
}
|
||||
}
|
||||
|
||||
function closeContextMenu() {
|
||||
|
@ -421,7 +438,7 @@ function runTest(testNum) {
|
|||
"---", null,
|
||||
"context-inspect", true]);
|
||||
closeContextMenu();
|
||||
openContextMenuFor(textarea); // Invoke context menu for next test.
|
||||
openContextMenuFor(textarea, false, true); // Invoke context menu for next test, but wait for the spellcheck.
|
||||
break;
|
||||
|
||||
case 12:
|
||||
|
|
|
@ -515,7 +515,7 @@
|
|||
|
||||
let uri;
|
||||
try {
|
||||
uri = uriFixup.createFixupURI(inputVal, Ci.nsIURIFixup.FIXUP_FLAG_NONE);
|
||||
uri = uriFixup.createFixupURI(inputVal, Ci.nsIURIFixup.FIXUP_FLAG_USE_UTF8);
|
||||
} catch (e) {}
|
||||
if (!uri)
|
||||
return selectedVal;
|
||||
|
|
|
@ -196,6 +196,7 @@ function openLinkIn(url, where, params) {
|
|||
var aReferrerURI = params.referrerURI;
|
||||
var aRelatedToCurrent = params.relatedToCurrent;
|
||||
var aInBackground = params.inBackground;
|
||||
var aDisallowInheritPrincipal = params.disallowInheritPrincipal;
|
||||
|
||||
if (where == "save") {
|
||||
saveURL(url, null, null, true, null, aReferrerURI);
|
||||
|
@ -264,7 +265,12 @@ function openLinkIn(url, where, params) {
|
|||
|
||||
switch (where) {
|
||||
case "current":
|
||||
w.loadURI(url, aReferrerURI, aPostData, aAllowThirdPartyFixup);
|
||||
let flags = Ci.nsIWebNavigation.LOAD_FLAGS_NONE;
|
||||
if (aAllowThirdPartyFixup)
|
||||
flags |= Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP;
|
||||
if (aDisallowInheritPrincipal)
|
||||
flags |= Ci.nsIWebNavigation.LOAD_FLAGS_DISALLOW_INHERIT_OWNER;
|
||||
w.gBrowser.loadURIWithFlags(url, flags, aReferrerURI, null, aPostData);
|
||||
break;
|
||||
case "tabshifted":
|
||||
loadInBackground = !loadInBackground;
|
||||
|
|
|
@ -49,10 +49,6 @@ browser.jar:
|
|||
content/browser/sanitizeDialog.css (content/sanitizeDialog.css)
|
||||
* content/browser/tabbrowser.css (content/tabbrowser.css)
|
||||
* content/browser/tabbrowser.xml (content/tabbrowser.xml)
|
||||
content/browser/tabview.css (content/tabview/tabview.css)
|
||||
* content/browser/tabview.js (content/tabview/tabview.js)
|
||||
content/browser/tabview.html (content/tabview/tabview.html)
|
||||
content/browser/tabview-content.js (content/tabview/content.js)
|
||||
* content/browser/urlbarBindings.xml (content/urlbarBindings.xml)
|
||||
* content/browser/utilityOverlay.js (content/utilityOverlay.js)
|
||||
* content/browser/web-panels.js (content/web-panels.js)
|
||||
|
@ -75,6 +71,8 @@ browser.jar:
|
|||
* content/browser/syncQuota.xul (content/syncQuota.xul)
|
||||
content/browser/syncQuota.js (content/syncQuota.js)
|
||||
content/browser/syncUtils.js (content/syncUtils.js)
|
||||
content/browser/syncProgress.js (content/syncProgress.js)
|
||||
* content/browser/syncProgress.xhtml (content/syncProgress.xhtml)
|
||||
#endif
|
||||
# XXX: We should exclude this one as well (bug 71895)
|
||||
* content/browser/hiddenWindow.xul (content/hiddenWindow.xul)
|
||||
|
|
|
@ -7,6 +7,8 @@ pref("app.update.interval", 28800);
|
|||
// The time interval between the downloading of mar file chunks in the
|
||||
// background (in seconds)
|
||||
pref("app.update.download.backgroundInterval", 60);
|
||||
// Give the user x seconds to react before showing the big UI. default=24 hours
|
||||
pref("app.update.promptWaitTime", 86400);
|
||||
// URL user can browse to manually if for some reason all update installation
|
||||
// attempts fail.
|
||||
pref("app.update.url.manual", "http://www.mozilla.com/firefox/channel/");
|
||||
|
|
|
@ -5,6 +5,8 @@ pref("app.update.interval", 7200); // 2 hours
|
|||
// The time interval between the downloading of mar file chunks in the
|
||||
// background (in seconds)
|
||||
pref("app.update.download.backgroundInterval", 60);
|
||||
// Give the user x seconds to react before showing the big UI. default=12 hours
|
||||
pref("app.update.promptWaitTime", 43200);
|
||||
// URL user can browse to manually if for some reason all update installation
|
||||
// attempts fail.
|
||||
pref("app.update.url.manual", "http://nightly.mozilla.org/");
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
// Fight update fatigue by suppressing whatsnew tab opening after update (bug 685727)
|
||||
pref("startup.homepage_override_url","");
|
||||
pref("startup.homepage_override_url","http://www.mozilla.com/%LOCALE%/%APP%/%VERSION%/whatsnew/");
|
||||
pref("startup.homepage_welcome_url","http://www.mozilla.com/%LOCALE%/%APP%/%VERSION%/firstrun/");
|
||||
// Interval: Time between checks for a new version (in seconds)
|
||||
// nightly=6 hours, official=24 hours
|
||||
|
@ -7,6 +6,8 @@ pref("app.update.interval", 86400);
|
|||
// The time interval between the downloading of mar file chunks in the
|
||||
// background (in seconds)
|
||||
pref("app.update.download.backgroundInterval", 600);
|
||||
// Give the user x seconds to react before showing the big UI. default=24 hours
|
||||
pref("app.update.promptWaitTime", 86400);
|
||||
// URL user can browse to manually if for some reason all update installation
|
||||
// attempts fail.
|
||||
pref("app.update.url.manual", "http://www.firefox.com");
|
||||
|
|
|
@ -5,6 +5,8 @@ pref("app.update.interval", 86400); // 24 hours
|
|||
// The time interval between the downloading of mar file chunks in the
|
||||
// background (in seconds)
|
||||
pref("app.update.download.backgroundInterval", 60);
|
||||
// Give the user x seconds to react before showing the big UI. default=24 hours
|
||||
pref("app.update.promptWaitTime", 86400);
|
||||
// URL user can browse to manually if for some reason all update installation
|
||||
// attempts fail.
|
||||
pref("app.update.url.manual", "http://www.mozilla.org/products/%APP%/");
|
||||
|
|
|
@ -70,6 +70,7 @@ PARALLEL_DIRS = \
|
|||
sessionstore \
|
||||
shell \
|
||||
sidebar/src \
|
||||
tabview \
|
||||
migration \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -97,6 +97,8 @@ static RedirEntry kRedirMap[] = {
|
|||
{ "sessionrestore", "chrome://browser/content/aboutSessionRestore.xhtml",
|
||||
nsIAboutModule::ALLOW_SCRIPT },
|
||||
#ifdef MOZ_SERVICES_SYNC
|
||||
{ "sync-progress", "chrome://browser/content/syncProgress.xhtml",
|
||||
nsIAboutModule::ALLOW_SCRIPT },
|
||||
{ "sync-tabs", "chrome://browser/content/aboutSyncTabs.xul",
|
||||
nsIAboutModule::ALLOW_SCRIPT },
|
||||
#endif
|
||||
|
|
|
@ -156,6 +156,7 @@ static const mozilla::Module::ContractIDEntry kBrowserContracts[] = {
|
|||
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "sessionrestore", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
|
||||
#ifdef MOZ_SERVICES_SYNC
|
||||
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "sync-tabs", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
|
||||
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "sync-progress", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
|
||||
#endif
|
||||
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "home", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
|
||||
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "permissions", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче