import changes from `dev' branch of rmottola/Arctic-Fox:

- Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj (0662c2ac56)
- Bug 1235261 - Part 2: Switch some uses of AutoFallibleTArray to AutoTArray. r=froydnj (ab52085f2a)
- Bug 1235261 - Part 3: Switch remaining uses of AutoFallibleTArray to AutoTArray. r=froydnj (3763b16ddd)
- Bug 1235261 - Part 4: Remove AutoFallibleTArray. r=froydnj (5480b0d786)
- Bug 1235261 - Part 5: Merge nsAutoArrayBase into AutoTArray. r=froydnj (6c64e73e3b)
- Bug 1235261 - Part 7: Remove AutoInfallibleTArray. r=froydnj (acf266464e)
- Bug 1222624: Make xpath document() function use nsIPrincipals and nsIURIs rather than strings. r=peterv (5ee694d132)
- Bug 1235261 - Part 6: Rename AutoInfallibleTArray to AutoTArray. r=froydnj (d282f7df6c)
- Bug 1241394 - Hit testing with 3d transforms should use fuzzy when comparing depths. r=thinker (6c3f50670f)
- Bug 1241394 - Follow up to fix windows build bustage. (02ab2600af)
- Bug 1241394 - Check clip for the children of the establisher. r=mattwoodrow (46f151ea55)
- bug 1241453 - allow caching proxies in xpcAccessibleDocuments r=davidb (f5d41ad2ee)
- Bug 1247364 - use AllChildrenIterator::Seek by a11y tree walker, r=davidb (0ec230908e)
- Bug 1248840 - rename TreeWalker::NextChild, r=yzen (c89ecc5a29)
- Bug 1249927 - devirtualize CanHavaAnonymousChildren, r=davdib (89e8088e63)
- Bug 1206598 - Use universal reference to reduce the redundant copy. r=nfroyd (bae4ad6dd1)
- Bug 1247364 - add AllChildrenIterator::Seek, r=bz (215abebf12)
- bug 1241453 - allow storing proxies in xpcAccessibleGeneric::mIntl r=davidb (dd5e6c896b)
- bug 1241453 - allow constructing xpcAccessibles with proxies r=davidb (d0258122be)
- bug 1241453 - fixup xpcAccessible Intl() methods to not assume mIntl is always an Accessible r=davidb (168f71fdf5)
- bug 1241453 - allow xpcAccessibleDocument::mCache to use proxies as keys r=davidb (85b7eec81c)
- bug 1241453 - assert accessibles are only added to non remote xpcAccessibleDocuments r=davidb (7731b21d17)
- bug 1243077 - add ToXPC{,Document} overloads for proxied accessibles r=davidb (7bc085f1b5)
- bug 1243077 - add AccessibleOrProxy xpcAccessible::IntlGeneric() r=davidb (006a635992)
- Bug 1245464 - initialize with 0 mSupportedIfaces in xpcAccessibleGeneric in order to avoid corrupted result after bit-wise operation. r=surkov (ae41bafcef)
- bug 1241453 - allow caching xpc documents for remote documents r=davidb (a357630690)
- bug 1241453 - factor dispatching nsIAccessibleEvents out of HandleAccEvent() r=davidb (091073d981)
- Bug 1249183 - Suppress GC harder, r=terrence (2185ccb4dd)
- Bug 1248420 - Handle JSObject::getGroup OOM in js::ArraySetLength. r=jandem (04b67c8d31)
- Bug 1242270 - Add SPS pseudo frames for the Array.prototype methods; r=shu (f5e5871439)
- Bug 1247701 - Bail from ArrayShiftDenseKernel if the array is used by for-in iteration. r=jandem (41eff38954)
- Bug 1247701 followup - Change ArrayShiftDenseKernel to receive handle. r=bz (b29ce0c555)
This commit is contained in:
2023-11-09 17:37:18 +08:00
parent b5b14065e8
commit 04083ef9b4
408 changed files with 1633 additions and 1274 deletions
+4 -4
View File
@@ -759,7 +759,7 @@ getAttributesCB(AtkObject *aAtkObj)
if (!proxy)
return nullptr;
nsAutoTArray<Attribute, 10> attrs;
AutoTArray<Attribute, 10> attrs;
proxy->Attributes(&attrs);
if (attrs.IsEmpty())
return nullptr;
@@ -1019,7 +1019,7 @@ refRelationSetCB(AtkObject *aAtkObj)
continue;
size_t targetCount = targetSets[i].Length();
nsAutoTArray<AtkObject*, 5> wrappers;
AutoTArray<AtkObject*, 5> wrappers;
for (size_t j = 0; j < targetCount; j++)
wrappers.AppendElement(GetWrapperFor(targetSets[i][j]));
@@ -1664,7 +1664,7 @@ AccessibleWrap::GetColumnHeader(TableAccessible* aAccessible, int32_t aColIdx)
return nullptr;
}
nsAutoTArray<Accessible*, 10> headerCells;
AutoTArray<Accessible*, 10> headerCells;
tableCell->ColHeaderCells(&headerCells);
if (headerCells.IsEmpty()) {
return nullptr;
@@ -1698,7 +1698,7 @@ AccessibleWrap::GetRowHeader(TableAccessible* aAccessible, int32_t aRowIdx)
return nullptr;
}
nsAutoTArray<Accessible*, 10> headerCells;
AutoTArray<Accessible*, 10> headerCells;
tableCell->RowHeaderCells(&headerCells);
if (headerCells.IsEmpty()) {
return nullptr;
+2 -2
View File
@@ -273,7 +273,7 @@ getSelectedColumnsCB(AtkTable *aTable, gint** aSelected)
{
*aSelected = nullptr;
nsAutoTArray<uint32_t, 10> cols;
AutoTArray<uint32_t, 10> cols;
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (accWrap) {
accWrap->AsTable()->SelectedColIndices(&cols);
@@ -300,7 +300,7 @@ getSelectedColumnsCB(AtkTable *aTable, gint** aSelected)
static gint
getSelectedRowsCB(AtkTable *aTable, gint **aSelected)
{
nsAutoTArray<uint32_t, 10> rows;
AutoTArray<uint32_t, 10> rows;
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (accWrap) {
accWrap->AsTable()->SelectedRowIndices(&rows);
+2 -2
View File
@@ -311,7 +311,7 @@ getRunAttributesCB(AtkText *aText, gint aOffset,
return nullptr;
}
nsAutoTArray<Attribute, 10> attrs;
AutoTArray<Attribute, 10> attrs;
proxy->TextAttributes(false, aOffset, &attrs, &startOffset, &endOffset);
*aStartOffset = startOffset;
*aEndOffset = endOffset;
@@ -337,7 +337,7 @@ getDefaultAttributesCB(AtkText *aText)
return nullptr;
}
nsAutoTArray<Attribute, 10> attrs;
AutoTArray<Attribute, 10> attrs;
proxy->DefaultTextAttributes(&attrs);
return ConvertToAtkTextAttributeSet(attrs);
}
+32
View File
@@ -40,6 +40,8 @@ using namespace mozilla::a11y;
using namespace mozilla::dom;
StaticAutoPtr<nsTArray<DocAccessibleParent*>> DocManager::sRemoteDocuments;
nsRefPtrHashtable<nsPtrHashKey<const DocAccessibleParent>, xpcAccessibleDocument>*
DocManager::sRemoteXPCDocumentCache = nullptr;
////////////////////////////////////////////////////////////////////////////////
// DocManager
@@ -101,6 +103,16 @@ DocManager::NotifyOfDocumentShutdown(DocAccessible* aDocument,
RemoveListeners(aDOMDocument);
}
void
DocManager::NotifyOfRemoteDocShutdown(DocAccessibleParent* aDoc)
{
xpcAccessibleDocument* doc = GetCachedXPCDocument(aDoc);
if (doc) {
doc->Shutdown();
sRemoteXPCDocumentCache->Remove(aDoc);
}
}
xpcAccessibleDocument*
DocManager::GetXPCDocument(DocAccessible* aDocument)
{
@@ -115,6 +127,26 @@ DocManager::GetXPCDocument(DocAccessible* aDocument)
return xpcDoc;
}
xpcAccessibleDocument*
DocManager::GetXPCDocument(DocAccessibleParent* aDoc)
{
xpcAccessibleDocument* doc = GetCachedXPCDocument(aDoc);
if (doc) {
return doc;
}
if (!sRemoteXPCDocumentCache) {
sRemoteXPCDocumentCache =
new nsRefPtrHashtable<nsPtrHashKey<const DocAccessibleParent>, xpcAccessibleDocument>;
}
doc =
new xpcAccessibleDocument(aDoc, Interfaces::DOCUMENT | Interfaces::HYPERTEXT);
sRemoteXPCDocumentCache->Put(aDoc, doc);
return doc;
}
#ifdef DEBUG
bool
DocManager::IsProcessingRefreshDriverNotification() const
+17
View File
@@ -90,6 +90,21 @@ public:
static const nsTArray<DocAccessibleParent*>* TopLevelRemoteDocs()
{ return sRemoteDocuments; }
/**
* Remove the xpc document for a remote document if there is one.
*/
static void NotifyOfRemoteDocShutdown(DocAccessibleParent* adoc);
/**
* Get a XPC document for a remote document.
*/
static xpcAccessibleDocument* GetXPCDocument(DocAccessibleParent* aDoc);
static xpcAccessibleDocument* GetCachedXPCDocument(const DocAccessibleParent* aDoc)
{
return sRemoteXPCDocumentCache ? sRemoteXPCDocumentCache->GetWeak(aDoc)
: nullptr;
}
#ifdef DEBUG
bool IsProcessingRefreshDriverNotification() const;
#endif
@@ -147,6 +162,8 @@ private:
typedef nsRefPtrHashtable<nsPtrHashKey<const DocAccessible>, xpcAccessibleDocument>
XPCDocumentHashtable;
XPCDocumentHashtable mXPCDocumentCache;
static nsRefPtrHashtable<nsPtrHashKey<const DocAccessibleParent>, xpcAccessibleDocument>*
sRemoteXPCDocumentCache;
/*
* The list of remote top level documents.
+1 -1
View File
@@ -76,7 +76,7 @@ protected:
DocAccessible* mDocument;
/**
* Pending events array. Don't make this an nsAutoTArray; we use
* Pending events array. Don't make this an AutoTArray; we use
* SwapElements() on it.
*/
nsTArray<RefPtr<AccEvent> > mEvents;
+2 -2
View File
@@ -275,7 +275,7 @@ private:
/**
* A pending accessible tree update notifications for content insertions.
* Don't make this an nsAutoTArray; we use SwapElements() on it.
* Don't make this an AutoTArray; we use SwapElements() on it.
*/
nsTArray<RefPtr<ContentInsertion> > mContentInsertions;
@@ -309,7 +309,7 @@ private:
nsTHashtable<nsCOMPtrHashKey<nsIContent> > mTextHash;
/**
* Other notifications like DOM events. Don't make this an nsAutoTArray; we
* Other notifications like DOM events. Don't make this an AutoTArray; we
* use SwapElements() on it.
*/
nsTArray<RefPtr<Notification> > mNotifications;
+1 -1
View File
@@ -17,7 +17,7 @@ inline Accessible*
TextRange::Container() const
{
uint32_t pos1 = 0, pos2 = 0;
nsAutoTArray<Accessible*, 30> parents1, parents2;
AutoTArray<Accessible*, 30> parents1, parents2;
return CommonParent(mStartContainer, mEndContainer,
&parents1, &pos1, &parents2, &pos2);
}
+3 -3
View File
@@ -24,7 +24,7 @@ TextPoint::operator <(const TextPoint& aPoint) const
// Build the chain of parents
Accessible* p1 = mContainer;
Accessible* p2 = aPoint.mContainer;
nsAutoTArray<Accessible*, 30> parents1, parents2;
AutoTArray<Accessible*, 30> parents1, parents2;
do {
parents1.AppendElement(p1);
p1 = p1->Parent();
@@ -76,7 +76,7 @@ TextRange::EmbeddedChildren(nsTArray<Accessible*>* aChildren) const
Accessible* p2 = mEndContainer->GetChildAtOffset(mEndOffset);
uint32_t pos1 = 0, pos2 = 0;
nsAutoTArray<Accessible*, 30> parents1, parents2;
AutoTArray<Accessible*, 30> parents1, parents2;
Accessible* container =
CommonParent(p1, p2, &parents1, &pos1, &parents2, &pos2);
@@ -146,7 +146,7 @@ bool
TextRange::Crop(Accessible* aContainer)
{
uint32_t boundaryPos = 0, containerPos = 0;
nsAutoTArray<Accessible*, 30> boundaryParents, containerParents;
AutoTArray<Accessible*, 30> boundaryParents, containerParents;
// Crop the start boundary.
Accessible* container = nullptr;
+6 -8
View File
@@ -27,8 +27,8 @@ TreeWalker::
{
NS_ASSERTION(aContent, "No node for the accessible tree walker!");
mChildFilter = mContext->CanHaveAnonChildren() ?
nsIContent::eAllChildren : nsIContent::eAllButXBL;
mChildFilter = mContext->NoXBLKids() ?
nsIContent::eAllButXBL : nsIContent::eAllChildren;
mChildFilter |= nsIContent::eSkipPlaceholderContent;
if (aContent)
@@ -46,7 +46,7 @@ TreeWalker::~TreeWalker()
// TreeWalker: private
Accessible*
TreeWalker::NextChild()
TreeWalker::Next()
{
if (mStateStack.IsEmpty())
return nullptr;
@@ -80,11 +80,9 @@ TreeWalker::NextChild()
nsIContent* parent = parentNode->AsElement();
top = PushState(parent);
while (nsIContent* childNode = Next(top)) {
if (childNode == mAnchorNode) {
mAnchorNode = parent;
return NextChild();
}
if (top->mDOMIter.Seek(mAnchorNode)) {
mAnchorNode = parent;
return Next();
}
// XXX We really should never get here, it means we're trying to find an
+3 -3
View File
@@ -44,13 +44,13 @@ public:
~TreeWalker();
/**
* Return the next child accessible.
* Return the next accessible.
*
* @note Returned accessible is bound to the document, if the accessible is
* rejected during tree creation then the caller should be unbind it
* from the document.
*/
Accessible* NextChild();
Accessible* Next();
private:
TreeWalker();
@@ -87,7 +87,7 @@ private:
DocAccessible* mDoc;
Accessible* mContext;
nsIContent* mAnchorNode;
nsAutoTArray<ChildrenIterator, 20> mStateStack;
AutoTArray<ChildrenIterator, 20> mStateStack;
int32_t mChildFilter;
uint32_t mFlags;
};
+1 -1
View File
@@ -596,7 +596,7 @@ nsAccessibilityService::ContentRemoved(nsIPresShell* aPresShell,
Accessible* container = document->GetContainerAccessible(aChildNode);
a11y::TreeWalker walker(container ? container : document, aChildNode,
a11y::TreeWalker::eWalkCache);
child = walker.NextChild();
child = walker.Next();
}
if (child) {
+28
View File
@@ -16,11 +16,13 @@
#include "nsIBoxObject.h"
#include "nsIDOMXULElement.h"
#include "nsIDocShell.h"
#include "nsIObserverService.h"
#include "nsIPresShell.h"
#include "nsPresContext.h"
#include "nsIScrollableFrame.h"
#include "nsISelectionPrivate.h"
#include "nsISelectionController.h"
#include "nsISimpleEnumerator.h"
#include "mozilla/dom/TouchEvent.h"
#include "mozilla/EventListenerManager.h"
#include "mozilla/EventStateManager.h"
@@ -647,3 +649,29 @@ nsCoreUtils::IsWhitespaceString(const nsSubstring& aString)
return iterBegin == iterEnd;
}
bool
nsCoreUtils::AccEventObserversExist()
{
nsCOMPtr<nsIObserverService> obsService = services::GetObserverService();
NS_ENSURE_TRUE(obsService, false);
nsCOMPtr<nsISimpleEnumerator> observers;
obsService->EnumerateObservers(NS_ACCESSIBLE_EVENT_TOPIC,
getter_AddRefs(observers));
NS_ENSURE_TRUE(observers, false);
bool hasObservers = false;
observers->HasMoreElements(&hasObservers);
return hasObservers;
}
void
nsCoreUtils::DispatchAccEvent(RefPtr<nsIAccessibleEvent> event)
{
nsCOMPtr<nsIObserverService> obsService = services::GetObserverService();
NS_ENSURE_TRUE_VOID(obsService);
obsService->NotifyObservers(event, NS_ACCESSIBLE_EVENT_TOPIC, nullptr);
}
+11
View File
@@ -7,6 +7,7 @@
#define nsCoreUtils_h_
#include "mozilla/EventForwards.h"
#include "nsIAccessibleEvent.h"
#include "nsIContent.h"
#include "nsIDocument.h" // for GetShell()
#include "nsIPresShell.h"
@@ -314,6 +315,16 @@ public:
return aChar == ' ' || aChar == '\n' ||
aChar == '\r' || aChar == '\t' || aChar == 0xa0;
}
/*
* Return true if there are any observers of accessible events.
*/
static bool AccEventObserversExist();
/**
* Notify accessible event observers of an event.
*/
static void DispatchAccEvent(RefPtr<nsIAccessibleEvent> aEvent);
};
#endif
+3 -21
View File
@@ -302,12 +302,6 @@ Accessible::KeyboardShortcut() const
return KeyBinding();
}
bool
Accessible::CanHaveAnonChildren()
{
return true;
}
void
Accessible::TranslateString(const nsString& aKey, nsAString& aStringOut)
{
@@ -885,20 +879,8 @@ Accessible::HandleAccEvent(AccEvent* aEvent)
}
}
nsCOMPtr<nsIObserverService> obsService = services::GetObserverService();
NS_ENSURE_TRUE(obsService, NS_ERROR_FAILURE);
nsCOMPtr<nsISimpleEnumerator> observers;
obsService->EnumerateObservers(NS_ACCESSIBLE_EVENT_TOPIC,
getter_AddRefs(observers));
NS_ENSURE_STATE(observers);
bool hasObservers = false;
observers->HasMoreElements(&hasObservers);
if (hasObservers) {
nsCOMPtr<nsIAccessibleEvent> event = MakeXPCEvent(aEvent);
return obsService->NotifyObservers(event, NS_ACCESSIBLE_EVENT_TOPIC, nullptr);
if (nsCoreUtils::AccEventObserversExist()) {
nsCoreUtils::DispatchAccEvent(MakeXPCEvent(aEvent));
}
return NS_OK;
@@ -2512,7 +2494,7 @@ Accessible::CacheChildren()
TreeWalker walker(this, mContent);
Accessible* child = nullptr;
while ((child = walker.NextChild()) && AppendChild(child));
while ((child = walker.Next()) && AppendChild(child));
}
void
+9 -7
View File
@@ -489,11 +489,6 @@ public:
*/
virtual nsresult HandleAccEvent(AccEvent* aAccEvent);
/**
* Return true if this accessible allows accessible children from anonymous subtree.
*/
virtual bool CanHaveAnonChildren();
/**
* Return true if the accessible is an acceptable child.
*/
@@ -925,6 +920,12 @@ public:
mStateFlags &= ~eRelocated;
}
/**
* Return true if the accessible doesn't allow accessible children from XBL
* anonymous subtree.
*/
bool NoXBLKids() { return mStateFlags & eNoXBLKids; }
/**
* Return true if this accessible has a parent whose name depends on this
* accessible.
@@ -1016,8 +1017,9 @@ protected:
eIgnoreDOMUIEvent = 1 << 7, // don't process DOM UI events for a11y events
eSurvivingInUpdate = 1 << 8, // parent drops children to recollect them
eRelocated = 1 << 9, // accessible was moved in tree
eNoXBLKids = 1 << 10, // accessible don't allows XBL children
eLastStateFlag = eRelocated
eLastStateFlag = eNoXBLKids
};
/**
@@ -1132,7 +1134,7 @@ protected:
int32_t mIndexInParent;
static const uint8_t kChildrenFlagsBits = 2;
static const uint8_t kStateFlagsBits = 10;
static const uint8_t kStateFlagsBits = 11;
static const uint8_t kContextFlagsBits = 2;
static const uint8_t kTypeBits = 6;
static const uint8_t kGenericTypesBits = 14;
+1 -1
View File
@@ -1437,7 +1437,7 @@ DocAccessible::CacheChildren()
// Ignore last HTML:br, copied from HyperTextAccessible.
TreeWalker walker(this, rootElm);
Accessible* lastChild = nullptr;
while (Accessible* child = walker.NextChild()) {
while (Accessible* child = walker.Next()) {
if (lastChild)
AppendChild(lastChild);
+2 -2
View File
@@ -284,7 +284,7 @@ HyperTextAccessible::DOMPointToOffset(nsINode* aNode, int32_t aNodeOffset,
if (container) {
TreeWalker walker(container, findNode->AsContent(),
TreeWalker::eWalkContextTree);
descendant = walker.NextChild();
descendant = walker.Next();
if (!descendant)
descendant = container;
}
@@ -1945,7 +1945,7 @@ HyperTextAccessible::CacheChildren()
TreeWalker walker(this, mContent);
Accessible* child = nullptr;
Accessible* lastChild = nullptr;
while ((child = walker.NextChild())) {
while ((child = walker.Next())) {
if (lastChild)
AppendChild(lastChild);
+2 -2
View File
@@ -403,10 +403,10 @@ HTMLTableAccessible::CacheChildren()
TreeWalker walker(this, mContent);
Accessible* child = nullptr;
while ((child = walker.NextChild())) {
while ((child = walker.Next())) {
if (child->Role() == roles::CAPTION) {
InsertChildAt(0, child);
while ((child = walker.NextChild()) && AppendChild(child));
while ((child = walker.Next()) && AppendChild(child));
break;
}
AppendChild(child);
+4 -4
View File
@@ -1048,7 +1048,7 @@ DocAccessibleChild::RecvColHeaderCells(const uint64_t& aID,
{
TableCellAccessible* acc = IdToTableCellAccessible(aID);
if (acc) {
nsAutoTArray<Accessible*, 10> headerCells;
AutoTArray<Accessible*, 10> headerCells;
acc->ColHeaderCells(&headerCells);
aCells->SetCapacity(headerCells.Length());
for (uint32_t i = 0; i < headerCells.Length(); ++i) {
@@ -1066,7 +1066,7 @@ DocAccessibleChild::RecvRowHeaderCells(const uint64_t& aID,
{
TableCellAccessible* acc = IdToTableCellAccessible(aID);
if (acc) {
nsAutoTArray<Accessible*, 10> headerCells;
AutoTArray<Accessible*, 10> headerCells;
acc->RowHeaderCells(&headerCells);
aCells->SetCapacity(headerCells.Length());
for (uint32_t i = 0; i < headerCells.Length(); ++i) {
@@ -1368,7 +1368,7 @@ DocAccessibleChild::RecvTableSelectedCells(const uint64_t& aID,
{
TableAccessible* acc = IdToTableAccessible(aID);
if (acc) {
nsAutoTArray<Accessible*, 30> cells;
AutoTArray<Accessible*, 30> cells;
acc->SelectedCells(&cells);
aCellIDs->SetCapacity(cells.Length());
for (uint32_t i = 0; i < cells.Length(); ++i) {
@@ -1529,7 +1529,7 @@ DocAccessibleChild::RecvSelectedItems(const uint64_t& aID,
{
Accessible* acc = IdToAccessibleSelect(aID);
if (acc) {
nsAutoTArray<Accessible*, 10> selectedItems;
AutoTArray<Accessible*, 10> selectedItems;
acc->SelectedItems(&selectedItems);
aSelectedItemIDs->SetCapacity(selectedItems.Length());
for (size_t i = 0; i < selectedItems.Length(); ++i) {
+2
View File
@@ -267,6 +267,8 @@ DocAccessibleParent::Destroy()
ProxyDestroyed(iter.Get()->mProxy);
iter.Remove();
}
DocManager::NotifyOfRemoteDocShutdown(this);
ProxyDestroyed(this);
if (mParentDoc)
mParentDoc->RemoveChildDoc(this);
+8 -2
View File
@@ -14,6 +14,7 @@
#include "mozilla/a11y/Platform.h"
#include "RelationType.h"
#include "mozilla/a11y/Role.h"
#include "xpcAccessibleDocument.h"
namespace mozilla {
namespace a11y {
@@ -23,6 +24,11 @@ ProxyAccessible::Shutdown()
{
MOZ_DIAGNOSTIC_ASSERT(!IsDoc());
NS_ASSERTION(!mOuterDoc, "Why do we still have a child doc?");
xpcAccessibleDocument* xpcDoc =
GetAccService()->GetCachedXPCDocument(Document());
if (xpcDoc) {
xpcDoc->NotifyOfShutdown(this);
}
// XXX Ideally this wouldn't be necessary, but it seems OuterDoc accessibles
// can be destroyed before the doc they own.
@@ -772,7 +778,7 @@ ProxyAccessible::TableSelectedRowCount()
void
ProxyAccessible::TableSelectedCells(nsTArray<ProxyAccessible*>* aCellIDs)
{
nsAutoTArray<uint64_t, 30> cellIDs;
AutoTArray<uint64_t, 30> cellIDs;
Unused << mDoc->SendTableSelectedCells(mID, &cellIDs);
aCellIDs->SetCapacity(cellIDs.Length());
for (uint32_t i = 0; i < cellIDs.Length(); ++i) {
@@ -851,7 +857,7 @@ ProxyAccessible::AtkTableRowHeader(int32_t aRow)
void
ProxyAccessible::SelectedItems(nsTArray<ProxyAccessible*>* aSelectedItems)
{
nsAutoTArray<uint64_t, 10> itemIDs;
AutoTArray<uint64_t, 10> itemIDs;
Unused << mDoc->SendSelectedItems(mID, &itemIDs);
aSelectedItems->SetCapacity(itemIDs.Length());
for (size_t i = 0; i < itemIDs.Length(); ++i) {
+1
View File
@@ -24,6 +24,7 @@ if CONFIG['ACCESSIBILITY']:
LOCAL_INCLUDES += [
'../base',
'../generic',
'../xpcom',
]
if CONFIG['MOZ_ENABLE_GTK']:
+3 -3
View File
@@ -420,7 +420,7 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
nsCOMPtr<nsIPersistentProperties> attributes = accWrap->Attributes();
nsAccUtils::GetAccAttr(attributes, nsGkAtoms::linethickness_, thickness);
} else {
nsAutoTArray<Attribute, 10> attrs;
AutoTArray<Attribute, 10> attrs;
proxy->Attributes(&attrs);
for (size_t i = 0 ; i < attrs.Length() ; i++) {
if (attrs.ElementAt(i).Name() == "thickness") {
@@ -684,11 +684,11 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
// get the array of children.
if (accWrap) {
nsAutoTArray<Accessible*, 10> childrenArray;
AutoTArray<Accessible*, 10> childrenArray;
accWrap->GetUnignoredChildren(&childrenArray);
mChildren = ConvertToNSArray(childrenArray);
} else if (ProxyAccessible* proxy = [self getProxyAccessible]) {
nsAutoTArray<ProxyAccessible*, 10> childrenArray;
AutoTArray<ProxyAccessible*, 10> childrenArray;
GetProxyUnignoredChildren(proxy, &childrenArray);
mChildren = ConvertToNSArray(childrenArray);
}
+2 -2
View File
@@ -207,12 +207,12 @@
return [NSValue valueWithRange:NSMakeRange(cell->ColIdx(),
cell->ColExtent())];
if ([attribute isEqualToString:NSAccessibilityRowHeaderUIElementsAttribute]) {
nsAutoTArray<Accessible*, 10> headerCells;
AutoTArray<Accessible*, 10> headerCells;
cell->RowHeaderCells(&headerCells);
return ConvertToNSArray(headerCells);
}
if ([attribute isEqualToString:NSAccessibilityColumnHeaderUIElementsAttribute]) {
nsAutoTArray<Accessible*, 10> headerCells;
AutoTArray<Accessible*, 10> headerCells;
cell->ColHeaderCells(&headerCells);
return ConvertToNSArray(headerCells);
}
+1 -1
View File
@@ -768,7 +768,7 @@ ia2Accessible::get_selectionRanges(IA2Range** aRanges,
if (acc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsAutoTArray<TextRange, 1> ranges;
AutoTArray<TextRange, 1> ranges;
acc->Document()->SelectionRanges(&ranges);
uint32_t len = ranges.Length();
for (uint32_t idx = 0; idx < len; idx++) {
@@ -371,7 +371,7 @@ ia2AccessibleTable::get_selectedChildren(long aMaxChildren, long** aChildren,
if (!mTable)
return CO_E_OBJNOTCONNECTED;
nsAutoTArray<uint32_t, 30> cellIndices;
AutoTArray<uint32_t, 30> cellIndices;
mTable->SelectedCellIndices(&cellIndices);
uint32_t maxCells = cellIndices.Length();
@@ -663,7 +663,7 @@ ia2AccessibleTable::get_selectedCells(IUnknown*** aCells, long* aNSelectedCells)
if (!mTable)
return CO_E_OBJNOTCONNECTED;
nsAutoTArray<Accessible*, 30> cells;
AutoTArray<Accessible*, 30> cells;
mTable->SelectedCells(&cells);
if (cells.IsEmpty())
return S_FALSE;
@@ -699,7 +699,7 @@ ia2AccessibleTable::get_selectedColumns(long** aColumns, long* aNColumns)
if (!mTable)
return CO_E_OBJNOTCONNECTED;
nsAutoTArray<uint32_t, 30> colIndices;
AutoTArray<uint32_t, 30> colIndices;
mTable->SelectedColIndices(&colIndices);
uint32_t maxCols = colIndices.Length();
@@ -729,7 +729,7 @@ ia2AccessibleTable::get_selectedRows(long** aRows, long* aNRows)
if (!mTable)
return CO_E_OBJNOTCONNECTED;
nsAutoTArray<uint32_t, 30> rowIndices;
AutoTArray<uint32_t, 30> rowIndices;
mTable->SelectedRowIndices(&rowIndices);
uint32_t maxRows = rowIndices.Length();
@@ -100,7 +100,7 @@ ia2AccessibleTableCell::get_columnHeaderCells(IUnknown*** aCellAccessibles,
if (!mTableCell)
return CO_E_OBJNOTCONNECTED;
nsAutoTArray<Accessible*, 10> cells;
AutoTArray<Accessible*, 10> cells;
mTableCell->ColHeaderCells(&cells);
*aNColumnHeaderCells = cells.Length();
@@ -172,7 +172,7 @@ ia2AccessibleTableCell::get_rowHeaderCells(IUnknown*** aCellAccessibles,
if (!mTableCell)
return CO_E_OBJNOTCONNECTED;
nsAutoTArray<Accessible*, 10> cells;
AutoTArray<Accessible*, 10> cells;
mTableCell->RowHeaderCells(&cells);
*aNRowHeaderCells = cells.Length();
+1 -1
View File
@@ -61,7 +61,7 @@ ia2AccessibleText::get_attributes(long aOffset, long *aStartOffset,
int32_t startOffset = 0, endOffset = 0;
HRESULT hr;
if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
nsAutoTArray<Attribute, 10> attrs;
AutoTArray<Attribute, 10> attrs;
proxy->TextAttributes(true, aOffset, &attrs, &startOffset, &endOffset);
hr = AccessibleWrap::ConvertToIA2Attributes(&attrs, aTextAttributes);
} else {
+1 -1
View File
@@ -837,7 +837,7 @@ AccessibleWrap::get_accSelection(VARIANT __RPC_FAR *pvarChildren)
return E_NOTIMPL;
if (IsSelect()) {
nsAutoTArray<Accessible*, 10> selectedItems;
AutoTArray<Accessible*, 10> selectedItems;
if (IsProxy()) {
nsTArray<ProxyAccessible*> proxies;
Proxy()->SelectedItems(&proxies);
+2
View File
@@ -60,3 +60,5 @@ xpc_acc_events_cpp.script = 'AccEventGen.py:gen_cpp_file'
xpc_acc_events_cpp.inputs += ['AccEvents.conf']
FINAL_LIBRARY = 'xul'
include('/ipc/chromium/chromium-config.mozbuild')
+2
View File
@@ -15,6 +15,7 @@ namespace mozilla {
namespace a11y {
class Accessible;
class AccessibleOrProxy;
/**
* XPCOM nsIAccessible interface implementation, used by xpcAccessibleGeneric
@@ -92,6 +93,7 @@ protected:
private:
Accessible* Intl();
AccessibleOrProxy IntlGeneric();
xpcAccessible(const xpcAccessible&) = delete;
xpcAccessible& operator =(const xpcAccessible&) = delete;
+1 -1
View File
@@ -36,7 +36,7 @@ protected:
virtual ~xpcAccessibleApplication() {}
private:
ApplicationAccessible* Intl() { return mIntl->AsApplication(); }
ApplicationAccessible* Intl() { return mIntl.AsAccessible()->AsApplication(); }
xpcAccessibleApplication(const xpcAccessibleApplication&) = delete;
xpcAccessibleApplication& operator =(const xpcAccessibleApplication&) = delete;
@@ -9,9 +9,11 @@
#include "xpcAccessibleTable.h"
#include "xpcAccessibleTableCell.h"
#include "mozilla/a11y/DocAccessibleParent.h"
#include "DocAccessible-inl.h"
#include "nsIDOMDocument.h"
using namespace mozilla;
using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
@@ -168,6 +170,7 @@ xpcAccessibleDocument::GetVirtualCursor(nsIAccessiblePivot** aVirtualCursor)
xpcAccessibleGeneric*
xpcAccessibleDocument::GetAccessible(Accessible* aAccessible)
{
MOZ_ASSERT(!mRemote);
if (ToXPCDocument(aAccessible->Document()) != this) {
NS_ERROR("This XPCOM document is not related with given internal accessible!");
return nullptr;
@@ -195,6 +198,27 @@ xpcAccessibleDocument::GetAccessible(Accessible* aAccessible)
return xpcAcc;
}
xpcAccessibleGeneric*
xpcAccessibleDocument::GetXPCAccessible(ProxyAccessible* aProxy)
{
MOZ_ASSERT(mRemote);
MOZ_ASSERT(aProxy->Document() == mIntl.AsProxy());
if (aProxy->IsDoc()) {
return this;
}
xpcAccessibleGeneric* acc = mCache.GetWeak(aProxy);
if (acc) {
return acc;
}
// XXX support exposing optional interfaces.
acc = new xpcAccessibleGeneric(aProxy, 0);
mCache.Put(aProxy, acc);
return acc;
}
void
xpcAccessibleDocument::Shutdown()
{
@@ -204,3 +228,18 @@ xpcAccessibleDocument::Shutdown()
}
xpcAccessibleGeneric::Shutdown();
}
xpcAccessibleGeneric*
a11y::ToXPC(AccessibleOrProxy aAcc)
{
if (aAcc.IsNull()) {
return nullptr;
}
if (aAcc.IsAccessible()) {
return ToXPC(aAcc.AsAccessible());
}
xpcAccessibleDocument* doc = ToXPCDocument(aAcc.AsProxy()->Document());
return doc->GetXPCAccessible(aAcc.AsProxy());
}
+37 -3
View File
@@ -25,7 +25,11 @@ class xpcAccessibleDocument : public xpcAccessibleHyperText,
{
public:
explicit xpcAccessibleDocument(DocAccessible* aIntl) :
xpcAccessibleHyperText(aIntl), mCache(kDefaultCacheLength) { }
xpcAccessibleHyperText(aIntl), mCache(kDefaultCacheLength), mRemote(false) { }
xpcAccessibleDocument(ProxyAccessible* aProxy, uint32_t aInterfaces) :
xpcAccessibleHyperText(aProxy, aInterfaces), mCache(kDefaultCacheLength),
mRemote(true) {}
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(xpcAccessibleDocument,
@@ -51,6 +55,7 @@ public:
* Return XPCOM wrapper for the internal accessible.
*/
xpcAccessibleGeneric* GetAccessible(Accessible* aAccessible);
xpcAccessibleGeneric* GetXPCAccessible(ProxyAccessible* aProxy);
virtual void Shutdown() override;
@@ -58,10 +63,18 @@ protected:
virtual ~xpcAccessibleDocument() {}
private:
DocAccessible* Intl() { return mIntl->AsDoc(); }
DocAccessible* Intl()
{
if (Accessible* acc = mIntl.AsAccessible()) {
return acc->AsDoc();
}
return nullptr;
}
void NotifyOfShutdown(Accessible* aAccessible)
{
MOZ_ASSERT(!mRemote);
xpcAccessibleGeneric* xpcAcc = mCache.GetWeak(aAccessible);
if (xpcAcc)
xpcAcc->Shutdown();
@@ -69,13 +82,26 @@ private:
mCache.Remove(aAccessible);
}
void NotifyOfShutdown(ProxyAccessible* aProxy)
{
MOZ_ASSERT(mRemote);
xpcAccessibleGeneric* acc = mCache.GetWeak(aProxy);
if (acc) {
acc->Shutdown();
}
mCache.Remove(aProxy);
}
friend class DocManager;
friend class DocAccessible;
friend class ProxyAccessible;
xpcAccessibleDocument(const xpcAccessibleDocument&) = delete;
xpcAccessibleDocument& operator =(const xpcAccessibleDocument&) = delete;
nsRefPtrHashtable<nsPtrHashKey<const Accessible>, xpcAccessibleGeneric> mCache;
nsRefPtrHashtable<nsPtrHashKey<const void>, xpcAccessibleGeneric> mCache;
bool mRemote;
};
inline xpcAccessibleGeneric*
@@ -92,6 +118,8 @@ ToXPC(Accessible* aAccessible)
return xpcDoc ? xpcDoc->GetAccessible(aAccessible) : nullptr;
}
xpcAccessibleGeneric* ToXPC(AccessibleOrProxy aAcc);
inline xpcAccessibleHyperText*
ToXPCText(HyperTextAccessible* aAccessible)
{
@@ -109,6 +137,12 @@ ToXPCDocument(DocAccessible* aAccessible)
return GetAccService()->GetXPCDocument(aAccessible);
}
inline xpcAccessibleDocument*
ToXPCDocument(DocAccessibleParent* aAccessible)
{
return GetAccService()->GetXPCDocument(aAccessible);
}
} // namespace a11y
} // namespace mozilla
+1 -1
View File
@@ -33,7 +33,7 @@ NS_IMPL_CYCLE_COLLECTING_RELEASE(xpcAccessibleGeneric)
Accessible*
xpcAccessibleGeneric::ToInternalAccessible() const
{
return mIntl;
return mIntl.AsAccessible();
}
////////////////////////////////////////////////////////////////////////////////
+28 -7
View File
@@ -13,6 +13,7 @@
#include "xpcAccessibleValue.h"
#include "Accessible.h"
#include "AccessibleOrProxy.h"
namespace mozilla {
namespace a11y {
@@ -29,14 +30,28 @@ public:
explicit xpcAccessibleGeneric(Accessible* aInternal) :
mIntl(aInternal), mSupportedIfaces(0)
{
if (mIntl->IsSelect())
if (aInternal->IsSelect())
mSupportedIfaces |= eSelectable;
if (mIntl->HasNumericValue())
if (aInternal->HasNumericValue())
mSupportedIfaces |= eValue;
if (mIntl->IsLink())
if (aInternal->IsLink())
mSupportedIfaces |= eHyperLink;
}
xpcAccessibleGeneric(ProxyAccessible* aProxy, uint32_t aInterfaces) :
mIntl(aProxy), mSupportedIfaces(0)
{
if (aInterfaces & Interfaces::SELECTION) {
mSupportedIfaces |= eSelectable;
}
if (aInterfaces & Interfaces::VALUE) {
mSupportedIfaces |= eValue;
}
if (aInterfaces & Interfaces::HYPERLINK) {
mSupportedIfaces |= eHyperLink;
}
}
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(xpcAccessibleGeneric, nsIAccessible)
@@ -49,7 +64,7 @@ public:
protected:
virtual ~xpcAccessibleGeneric() {}
Accessible* mIntl;
AccessibleOrProxy mIntl;
enum {
eSelectable = 1 << 0,
@@ -72,6 +87,12 @@ private:
inline Accessible*
xpcAccessible::Intl()
{
return static_cast<xpcAccessibleGeneric*>(this)->mIntl.AsAccessible();
}
inline AccessibleOrProxy
xpcAccessible::IntlGeneric()
{
return static_cast<xpcAccessibleGeneric*>(this)->mIntl;
}
@@ -79,19 +100,19 @@ xpcAccessible::Intl()
inline Accessible*
xpcAccessibleHyperLink::Intl()
{
return static_cast<xpcAccessibleGeneric*>(this)->mIntl;
return static_cast<xpcAccessibleGeneric*>(this)->mIntl.AsAccessible();
}
inline Accessible*
xpcAccessibleSelectable::Intl()
{
return static_cast<xpcAccessibleGeneric*>(this)->mIntl;
return static_cast<xpcAccessibleGeneric*>(this)->mIntl.AsAccessible();
}
inline Accessible*
xpcAccessibleValue::Intl()
{
return static_cast<xpcAccessibleGeneric*>(this)->mIntl;
return static_cast<xpcAccessibleGeneric*>(this)->mIntl.AsAccessible();
}
} // namespace a11y
+1 -1
View File
@@ -371,7 +371,7 @@ xpcAccessibleHyperText::GetSelectionRanges(nsIArray** aRanges)
do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsAutoTArray<TextRange, 1> ranges;
AutoTArray<TextRange, 1> ranges;
Intl()->SelectionRanges(&ranges);
uint32_t len = ranges.Length();
for (uint32_t idx = 0; idx < len; idx++)
+12 -2
View File
@@ -26,10 +26,13 @@ public:
explicit xpcAccessibleHyperText(Accessible* aIntl) :
xpcAccessibleGeneric(aIntl)
{
if (mIntl->IsHyperText() && mIntl->AsHyperText()->IsTextRole())
if (aIntl->IsHyperText() && aIntl->AsHyperText()->IsTextRole())
mSupportedIfaces |= eText;
}
xpcAccessibleHyperText(ProxyAccessible* aProxy, uint32_t aInterfaces) :
xpcAccessibleGeneric(aProxy, aInterfaces) { mSupportedIfaces |= eText; }
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIACCESSIBLETEXT
@@ -40,7 +43,14 @@ protected:
virtual ~xpcAccessibleHyperText() {}
private:
HyperTextAccessible* Intl() { return mIntl->AsHyperText(); }
HyperTextAccessible* Intl()
{
if (Accessible* acc = mIntl.AsAccessible()) {
return acc->AsHyperText();
}
return nullptr;
}
xpcAccessibleHyperText(const xpcAccessibleHyperText&) = delete;
xpcAccessibleHyperText& operator =(const xpcAccessibleHyperText&) = delete;
+5 -1
View File
@@ -21,6 +21,9 @@ public:
explicit xpcAccessibleImage(Accessible* aIntl) :
xpcAccessibleGeneric(aIntl) { }
xpcAccessibleImage(ProxyAccessible* aProxy, uint32_t aInterfaces) :
xpcAccessibleGeneric(aProxy, aInterfaces) {}
NS_DECL_ISUPPORTS_INHERITED
NS_IMETHOD GetImagePosition(uint32_t aCoordType,
@@ -31,7 +34,8 @@ protected:
virtual ~xpcAccessibleImage() {}
private:
ImageAccessible* Intl() { return mIntl->AsImage(); }
ImageAccessible* Intl()
{ return mIntl.IsAccessible() ? mIntl.AsAccessible()->AsImage() : nullptr; }
xpcAccessibleImage(const xpcAccessibleImage&) = delete;
xpcAccessibleImage& operator =(const xpcAccessibleImage&) = delete;
+1 -1
View File
@@ -21,7 +21,7 @@ xpcAccessibleSelectable::GetSelectedItems(nsIArray** aSelectedItems)
return NS_ERROR_FAILURE;
NS_PRECONDITION(Intl()->IsSelect(), "Called on non selectable widget!");
nsAutoTArray<Accessible*, 10> items;
AutoTArray<Accessible*, 10> items;
Intl()->SelectedItems(&items);
uint32_t itemCount = items.Length();
+4 -4
View File
@@ -273,7 +273,7 @@ xpcAccessibleTable::GetSelectedCells(nsIArray** aSelectedCells)
do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsAutoTArray<Accessible*, XPC_TABLE_DEFAULT_SIZE> cellsArray;
AutoTArray<Accessible*, XPC_TABLE_DEFAULT_SIZE> cellsArray;
Intl()->SelectedCells(&cellsArray);
uint32_t totalCount = cellsArray.Length();
@@ -299,7 +299,7 @@ xpcAccessibleTable::GetSelectedCellIndices(uint32_t* aCellsArraySize,
if (!Intl())
return NS_ERROR_FAILURE;
nsAutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> cellsArray;
AutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> cellsArray;
Intl()->SelectedCellIndices(&cellsArray);
*aCellsArraySize = cellsArray.Length();
@@ -324,7 +324,7 @@ xpcAccessibleTable::GetSelectedColumnIndices(uint32_t* aColsArraySize,
if (!Intl())
return NS_ERROR_FAILURE;
nsAutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> colsArray;
AutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> colsArray;
Intl()->SelectedColIndices(&colsArray);
*aColsArraySize = colsArray.Length();
@@ -349,7 +349,7 @@ xpcAccessibleTable::GetSelectedRowIndices(uint32_t* aRowsArraySize,
if (!Intl())
return NS_ERROR_FAILURE;
nsAutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> rowsArray;
AutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> rowsArray;
Intl()->SelectedRowIndices(&rowsArray);
*aRowsArraySize = rowsArray.Length();
+5 -1
View File
@@ -23,6 +23,9 @@ public:
explicit xpcAccessibleTable(Accessible* aIntl) :
xpcAccessibleGeneric(aIntl) { }
xpcAccessibleTable(ProxyAccessible* aProxy, uint32_t aInterfaces) :
xpcAccessibleGeneric(aProxy, aInterfaces) {}
NS_DECL_ISUPPORTS_INHERITED
// nsIAccessibleTable
@@ -80,7 +83,8 @@ protected:
virtual ~xpcAccessibleTable() {}
private:
TableAccessible* Intl() { return mIntl->AsTable(); }
TableAccessible* Intl()
{ return mIntl.IsAccessible() ? mIntl.AsAccessible()->AsTable() : nullptr; }
xpcAccessibleTable(const xpcAccessibleTable&) = delete;
xpcAccessibleTable& operator =(const xpcAccessibleTable&) = delete;
+2 -2
View File
@@ -108,7 +108,7 @@ xpcAccessibleTableCell::GetColumnHeaderCells(nsIArray** aHeaderCells)
if (!Intl())
return NS_ERROR_FAILURE;
nsAutoTArray<Accessible*, 10> headerCells;
AutoTArray<Accessible*, 10> headerCells;
Intl()->ColHeaderCells(&headerCells);
nsCOMPtr<nsIMutableArray> cells = do_CreateInstance(NS_ARRAY_CONTRACTID);
@@ -132,7 +132,7 @@ xpcAccessibleTableCell::GetRowHeaderCells(nsIArray** aHeaderCells)
if (!Intl())
return NS_ERROR_FAILURE;
nsAutoTArray<Accessible*, 10> headerCells;
AutoTArray<Accessible*, 10> headerCells;
Intl()->RowHeaderCells(&headerCells);
nsCOMPtr<nsIMutableArray> cells = do_CreateInstance(NS_ARRAY_CONTRACTID);
+11 -1
View File
@@ -24,6 +24,9 @@ public:
explicit xpcAccessibleTableCell(Accessible* aIntl) :
xpcAccessibleHyperText(aIntl) { }
xpcAccessibleTableCell(ProxyAccessible* aProxy, uint32_t aInterfaces) :
xpcAccessibleHyperText(aProxy, aInterfaces) {}
NS_DECL_ISUPPORTS_INHERITED
// nsIAccessibleTableCell
@@ -40,7 +43,14 @@ protected:
virtual ~xpcAccessibleTableCell() {}
private:
TableCellAccessible* Intl() { return mIntl->AsTableCell(); }
TableCellAccessible* Intl()
{
if (Accessible* acc = mIntl.AsAccessible()) {
return acc->AsTableCell();
}
return nullptr;
}
xpcAccessibleTableCell(const xpcAccessibleTableCell&) = delete;
xpcAccessibleTableCell& operator =(const xpcAccessibleTableCell&) = delete;
+9 -17
View File
@@ -31,6 +31,15 @@ XULComboboxAccessible::
mGenericTypes |= eAutoComplete;
else
mGenericTypes |= eCombobox;
// Both the XUL <textbox type="autocomplete"> and <menulist editable="true">
// widgets use XULComboboxAccessible. We need to walk the anonymous children
// for these so that the entry field is a child. Otherwise no XBL children.
if (!mContent->NodeInfo()->Equals(nsGkAtoms::textbox, kNameSpaceID_XUL) &&
!mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::editable,
nsGkAtoms::_true, eIgnoreCase)) {
mStateFlags |= eNoXBLKids;
}
}
role
@@ -96,23 +105,6 @@ XULComboboxAccessible::Value(nsString& aValue)
menuList->GetLabel(aValue);
}
bool
XULComboboxAccessible::CanHaveAnonChildren()
{
if (mContent->NodeInfo()->Equals(nsGkAtoms::textbox, kNameSpaceID_XUL) ||
mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::editable,
nsGkAtoms::_true, eIgnoreCase)) {
// Both the XUL <textbox type="autocomplete"> and <menulist editable="true"> widgets
// use XULComboboxAccessible. We need to walk the anonymous children for these
// so that the entry field is a child
return true;
}
// Argument of false indicates we don't walk anonymous children for
// menuitems
return false;
}
uint8_t
XULComboboxAccessible::ActionCount()
{
-1
View File
@@ -26,7 +26,6 @@ public:
virtual void Value(nsString& aValue) override;
virtual a11y::role NativeRole() override;
virtual uint64_t NativeState() override;
virtual bool CanHaveAnonChildren() override;
// ActionAccessible
virtual uint8_t ActionCount() override;
+4 -7
View File
@@ -544,6 +544,10 @@ XULListitemAccessible::
nsGkAtoms::checkbox,
eCaseMatters);
mType = eXULListItemType;
// Walk XBL anonymous children for list items. Overrides the flag value from
// base XULMenuitemAccessible class.
mStateFlags &= ~eNoXBLKids;
}
XULListitemAccessible::~XULListitemAccessible()
@@ -668,13 +672,6 @@ XULListitemAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
}
}
bool
XULListitemAccessible::CanHaveAnonChildren()
{
// That indicates we should walk anonymous children for listitems
return true;
}
////////////////////////////////////////////////////////////////////////////////
// XULListitemAccessible: Widgets
-1
View File
@@ -115,7 +115,6 @@ public:
virtual a11y::role NativeRole() override;
virtual uint64_t NativeState() override;
virtual uint64_t NativeInteractiveState() const override;
virtual bool CanHaveAnonChildren() override;
// Actions
virtual void ActionNameAt(uint8_t index, nsAString& aName) override;
+1 -7
View File
@@ -41,6 +41,7 @@ XULMenuitemAccessible::
XULMenuitemAccessible(nsIContent* aContent, DocAccessible* aDoc) :
AccessibleWrap(aContent, aDoc)
{
mStateFlags |= eNoXBLKids;
}
uint64_t
@@ -267,13 +268,6 @@ XULMenuitemAccessible::GetLevelInternal()
return nsAccUtils::GetLevelForXULContainerItem(mContent);
}
bool
XULMenuitemAccessible::CanHaveAnonChildren()
{
// That indicates we don't walk anonymous children for menuitems
return false;
}
bool
XULMenuitemAccessible::DoAction(uint8_t index)
{
-2
View File
@@ -30,8 +30,6 @@ public:
virtual uint64_t NativeInteractiveState() const override;
virtual int32_t GetLevelInternal() override;
virtual bool CanHaveAnonChildren() override;
// ActionAccessible
virtual uint8_t ActionCount() override;
virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
+1 -8
View File
@@ -23,7 +23,7 @@ XULSliderAccessible::
XULSliderAccessible(nsIContent* aContent, DocAccessible* aDoc) :
AccessibleWrap(aContent, aDoc)
{
mStateFlags |= eHasNumericValue;
mStateFlags |= eHasNumericValue | eNoXBLKids;
}
// Accessible
@@ -127,13 +127,6 @@ XULSliderAccessible::SetCurValue(double aValue)
return SetSliderAttr(nsGkAtoms::curpos, aValue);
}
bool
XULSliderAccessible::CanHaveAnonChildren()
{
// Do not allow anonymous xul:slider be accessible.
return false;
}
// Utils
nsIContent*
-1
View File
@@ -26,7 +26,6 @@ public:
virtual a11y::role NativeRole() override;
virtual uint64_t NativeInteractiveState() const override;
virtual bool NativelyUnavailable() const override;
virtual bool CanHaveAnonChildren() override;
// Value
virtual double MaxValue() const override;
+3 -3
View File
@@ -1699,7 +1699,7 @@ nsDocShell::FirePageHideNotification(bool aIsUnload)
mTiming->NotifyUnloadEventEnd();
}
nsAutoTArray<nsCOMPtr<nsIDocShell>, 8> kids;
AutoTArray<nsCOMPtr<nsIDocShell>, 8> kids;
uint32_t n = mChildList.Length();
kids.SetCapacity(n);
for (uint32_t i = 0; i < n; i++) {
@@ -4377,7 +4377,7 @@ nsDocShell::RemoveFromSessionHistory()
int32_t index = 0;
sessionHistory->GetIndex(&index);
nsAutoTArray<uint64_t, 16> ids;
AutoTArray<uint64_t, 16> ids;
ids.AppendElement(mHistoryID);
internalHistory->RemoveEntries(ids, index);
return NS_OK;
@@ -4468,7 +4468,7 @@ nsDocShell::ClearFrameHistory(nsISHEntry* aEntry)
int32_t count = 0;
shcontainer->GetChildCount(&count);
nsAutoTArray<uint64_t, 16> ids;
AutoTArray<uint64_t, 16> ids;
for (int32_t i = 0; i < count; ++i) {
nsCOMPtr<nsISHEntry> child;
shcontainer->GetChildAt(i, getter_AddRefs(child));
+1 -1
View File
@@ -1404,7 +1404,7 @@ nsSHistory::RemoveDynEntries(int32_t aOldIndex, int32_t aNewIndex)
nsCOMPtr<nsISHEntry> originalSH;
GetEntryAtIndex(aOldIndex, false, getter_AddRefs(originalSH));
nsCOMPtr<nsISHContainer> originalContainer = do_QueryInterface(originalSH);
nsAutoTArray<uint64_t, 16> toBeRemovedEntries;
AutoTArray<uint64_t, 16> toBeRemovedEntries;
if (originalContainer) {
nsTArray<uint64_t> originalDynDocShellIDs;
GetDynamicChildren(originalContainer, originalDynDocShellIDs, true);
+1 -1
View File
@@ -551,7 +551,7 @@ EffectCompositor::GetOverriddenProperties(nsStyleContext* aStyleContext,
nsCSSPropertySet&
aPropertiesOverridden)
{
nsAutoTArray<nsCSSProperty, LayerAnimationInfo::kRecords> propertiesToTrack;
AutoTArray<nsCSSProperty, LayerAnimationInfo::kRecords> propertiesToTrack;
{
nsCSSPropertySet propertiesToTrackAsSet;
for (KeyframeEffectReadOnly* effect : aEffectSet) {
+1 -1
View File
@@ -1394,7 +1394,7 @@ BuildAnimationPropertyListFromKeyframeSequence(
{
// Convert the object in aIterator to sequence<Keyframe>, producing
// an array of OffsetIndexedKeyframe objects.
nsAutoTArray<OffsetIndexedKeyframe,4> keyframes;
AutoTArray<OffsetIndexedKeyframe,4> keyframes;
if (!ConvertKeyframeSequence(aCx, aIterator, keyframes)) {
aRv.Throw(NS_ERROR_FAILURE);
return;
+34 -3
View File
@@ -190,7 +190,7 @@ FlattenedChildIterator::Init(bool aIgnoreXBL)
}
}
void
bool
ExplicitChildIterator::Seek(nsIContent* aChildToFind)
{
if (aChildToFind->GetParent() == mParent &&
@@ -204,14 +204,14 @@ ExplicitChildIterator::Seek(nsIContent* aChildToFind)
mShadowIterator = nullptr;
mDefaultChild = nullptr;
mIsFirst = false;
return;
return true;
}
// Can we add more fast paths here based on whether the parent of aChildToFind
// is a shadow insertion point or content insertion point?
// Slow path: just walk all our kids.
Seek(aChildToFind, nullptr);
return Seek(aChildToFind, nullptr);
}
nsIContent*
@@ -311,6 +311,37 @@ ExplicitChildIterator::GetPreviousChild()
return mChild;
}
bool
AllChildrenIterator::Seek(nsIContent* aChildToFind)
{
if (mPhase == eNeedBeforeKid) {
mPhase = eNeedExplicitKids;
nsIFrame* frame = mOriginalContent->GetPrimaryFrame();
if (frame) {
nsIFrame* beforeFrame = nsLayoutUtils::GetBeforeFrame(frame);
if (beforeFrame) {
if (beforeFrame->GetContent() == aChildToFind) {
return true;
}
}
}
}
if (mPhase == eNeedExplicitKids) {
if (ExplicitChildIterator::Seek(aChildToFind)) {
return true;
}
mPhase = eNeedAnonKids;
}
nsIContent* child = nullptr;
do {
child = GetNextChild();
} while (child && child != aChildToFind);
return child == aChildToFind;
}
nsIContent*
AllChildrenIterator::GetNextChild()
{
+3 -1
View File
@@ -64,7 +64,7 @@ public:
// found. This version can take shortcuts that the two-argument version
// can't, so can be faster (and in fact can be O(1) instead of O(N) in many
// cases).
void Seek(nsIContent* aChildToFind);
bool Seek(nsIContent* aChildToFind);
// Looks for aChildToFind respecting insertion points until aChildToFind is found.
// or aBound is found. If aBound is nullptr then the seek is unbounded. Returns
@@ -199,6 +199,8 @@ public:
~AllChildrenIterator() { MOZ_ASSERT(!mMutationGuard.Mutated(0)); }
#endif
bool Seek(nsIContent* aChildToFind);
nsIContent* GetNextChild();
nsIContent* Parent() const { return mOriginalContent; }
+2 -2
View File
@@ -267,7 +267,7 @@ template <typename T> void GetDataFromMatrix(const DOMMatrixReadOnly* aMatrix, T
void
DOMMatrixReadOnly::ToFloat32Array(JSContext* aCx, JS::MutableHandle<JSObject*> aResult, ErrorResult& aRv) const
{
nsAutoTArray<float, 16> arr;
AutoTArray<float, 16> arr;
arr.SetLength(16);
GetDataFromMatrix(this, arr.Elements());
JS::Rooted<JS::Value> value(aCx);
@@ -281,7 +281,7 @@ DOMMatrixReadOnly::ToFloat32Array(JSContext* aCx, JS::MutableHandle<JSObject*> a
void
DOMMatrixReadOnly::ToFloat64Array(JSContext* aCx, JS::MutableHandle<JSObject*> aResult, ErrorResult& aRv) const
{
nsAutoTArray<double, 16> arr;
AutoTArray<double, 16> arr;
arr.SetLength(16);
GetDataFromMatrix(this, arr.Elements());
JS::Rooted<JS::Value> value(aCx);
+1 -1
View File
@@ -259,7 +259,7 @@ Blob::ToFile()
already_AddRefed<File>
Blob::ToFile(const nsAString& aName, ErrorResult& aRv) const
{
nsAutoTArray<RefPtr<BlobImpl>, 1> blobImpls;
AutoTArray<RefPtr<BlobImpl>, 1> blobImpls;
blobImpls.AppendElement(mImpl);
nsAutoString contentType;
+9 -9
View File
@@ -303,7 +303,7 @@ nsIContent::GetBaseURI(bool aTryUseXHRDocBaseURI) const
// faster for the far more common case of there not being any such
// attributes.
// Also check for SVG elements which require special handling
nsAutoTArray<nsString, 5> baseAttrs;
AutoTArray<nsString, 5> baseAttrs;
nsString attr;
const nsIContent *elem = this;
do {
@@ -1323,7 +1323,7 @@ public:
}
private:
nsAutoTArray<nsCOMPtr<nsIContent>,
AutoTArray<nsCOMPtr<nsIContent>,
SUBTREE_UNBINDINGS_PER_RUNNABLE> mSubtreeRoots;
RefPtr<ContentUnbinder> mNext;
ContentUnbinder* mLast;
@@ -1522,11 +1522,11 @@ FragmentOrElement::CanSkipInCC(nsINode* aNode)
// nodesToUnpurple contains nodes which will be removed
// from the purple buffer if the DOM tree is black.
nsAutoTArray<nsIContent*, 1020> nodesToUnpurple;
AutoTArray<nsIContent*, 1020> nodesToUnpurple;
// grayNodes need script traverse, so they aren't removed from
// the purple buffer, but are marked to be in black subtree so that
// traverse is faster.
nsAutoTArray<nsINode*, 1020> grayNodes;
AutoTArray<nsINode*, 1020> grayNodes;
bool foundBlack = root->IsBlack();
if (root != currentDoc) {
@@ -1592,8 +1592,8 @@ FragmentOrElement::CanSkipInCC(nsINode* aNode)
return !NeedsScriptTraverse(aNode);
}
nsAutoTArray<nsINode*, 1020>* gPurpleRoots = nullptr;
nsAutoTArray<nsIContent*, 1020>* gNodesToUnbind = nullptr;
AutoTArray<nsINode*, 1020>* gPurpleRoots = nullptr;
AutoTArray<nsIContent*, 1020>* gNodesToUnbind = nullptr;
void ClearCycleCollectorCleanupData()
{
@@ -1696,7 +1696,7 @@ FragmentOrElement::CanSkip(nsINode* aNode, bool aRemovingAllowed)
// nodesToClear contains nodes which are either purple or
// gray.
nsAutoTArray<nsIContent*, 1020> nodesToClear;
AutoTArray<nsIContent*, 1020> nodesToClear;
bool foundBlack = root->IsBlack();
bool domOnlyCycle = false;
@@ -1745,7 +1745,7 @@ FragmentOrElement::CanSkip(nsINode* aNode, bool aRemovingAllowed)
root->SetIsPurpleRoot(true);
if (domOnlyCycle) {
if (!gNodesToUnbind) {
gNodesToUnbind = new nsAutoTArray<nsIContent*, 1020>();
gNodesToUnbind = new AutoTArray<nsIContent*, 1020>();
}
gNodesToUnbind->AppendElement(static_cast<nsIContent*>(root));
for (uint32_t i = 0; i < nodesToClear.Length(); ++i) {
@@ -1757,7 +1757,7 @@ FragmentOrElement::CanSkip(nsINode* aNode, bool aRemovingAllowed)
return true;
} else {
if (!gPurpleRoots) {
gPurpleRoots = new nsAutoTArray<nsINode*, 1020>();
gPurpleRoots = new AutoTArray<nsINode*, 1020>();
}
gPurpleRoots->AppendElement(root);
}
+1 -1
View File
@@ -850,7 +850,7 @@ Navigator::RemoveIdleObserver(MozIdleObserver& aIdleObserver, ErrorResult& aRv)
bool
Navigator::Vibrate(uint32_t aDuration)
{
nsAutoTArray<uint32_t, 1> pattern;
AutoTArray<uint32_t, 1> pattern;
pattern.AppendElement(aDuration);
return Vibrate(pattern);
}
+5 -5
View File
@@ -155,7 +155,7 @@ protected:
nsCOMPtr<nsINode> mCommonParent;
// used by nsContentIterator to cache indices
nsAutoTArray<int32_t, 8> mIndexes;
AutoTArray<int32_t, 8> mIndexes;
// used by nsSubtreeIterator to cache indices. Why put them in the base
// class? Because otherwise I have to duplicate the routines GetNextSibling
@@ -1058,8 +1058,8 @@ nsContentIterator::PositionAt(nsINode* aCurNode)
// We can be at ANY node in the sequence. Need to regenerate the array of
// indexes back to the root or common parent!
nsAutoTArray<nsINode*, 8> oldParentStack;
nsAutoTArray<int32_t, 8> newIndexes;
AutoTArray<nsINode*, 8> oldParentStack;
AutoTArray<int32_t, 8> newIndexes;
// Get a list of the parents up to the root, then compare the new node with
// entries in that array until we find a match (lowest common ancestor). If
@@ -1213,8 +1213,8 @@ protected:
RefPtr<nsRange> mRange;
// these arrays all typically are used and have elements
nsAutoTArray<nsIContent*, 8> mEndNodes;
nsAutoTArray<int32_t, 8> mEndOffsets;
AutoTArray<nsIContent*, 8> mEndNodes;
AutoTArray<int32_t, 8> mEndOffsets;
};
NS_IMPL_ADDREF_INHERITED(nsContentSubtreeIterator, nsContentIterator)
+1 -1
View File
@@ -549,7 +549,7 @@ nsContentList::GetSupportedNames(unsigned aFlags, nsTArray<nsString>& aNames)
BringSelfUpToDate(true);
nsAutoTArray<nsIAtom*, 8> atoms;
AutoTArray<nsIAtom*, 8> atoms;
for (uint32_t i = 0; i < mElements.Length(); ++i) {
nsIContent *content = mElements.ElementAt(i);
if (content->HasID()) {
+7 -7
View File
@@ -2304,7 +2304,7 @@ nsContentUtils::GetCommonAncestor(nsINode* aNode1,
}
// Build the chain of parents
nsAutoTArray<nsINode*, 30> parents1, parents2;
AutoTArray<nsINode*, 30> parents1, parents2;
do {
parents1.AppendElement(aNode1);
aNode1 = aNode1->GetParentNode();
@@ -2353,7 +2353,7 @@ nsContentUtils::ComparePoints(nsINode* aParent1, int32_t aOffset1,
0;
}
nsAutoTArray<nsINode*, 32> parents1, parents2;
AutoTArray<nsINode*, 32> parents1, parents2;
nsINode* node1 = aParent1;
nsINode* node2 = aParent2;
do {
@@ -4288,7 +4288,7 @@ nsContentUtils::CreateContextualFragment(nsINode* aContextNode,
return frag.forget();
}
nsAutoTArray<nsString, 32> tagStack;
AutoTArray<nsString, 32> tagStack;
nsAutoString uriStr, nameStr;
nsCOMPtr<nsIContent> content = do_QueryInterface(aContextNode);
// just in case we have a text node
@@ -6863,7 +6863,7 @@ nsContentUtils::FireMutationEventsForDirectParsing(nsIDocument* aDoc,
int32_t newChildCount = aDest->GetChildCount();
if (newChildCount && nsContentUtils::
HasMutationListeners(aDoc, NS_EVENT_BITS_MUTATION_NODEINSERTED)) {
nsAutoTArray<nsCOMPtr<nsIContent>, 50> childNodes;
AutoTArray<nsCOMPtr<nsIContent>, 50> childNodes;
NS_ASSERTION(newChildCount - aOldChildCount >= 0,
"What, some unexpected dom mutation has happened?");
childNodes.SetCapacity(newChildCount - aOldChildCount);
@@ -7935,7 +7935,7 @@ nsContentUtils::FirePageHideEvent(nsIDocShellTreeItem* aItem,
int32_t childCount = 0;
aItem->GetChildCount(&childCount);
nsAutoTArray<nsCOMPtr<nsIDocShellTreeItem>, 8> kids;
AutoTArray<nsCOMPtr<nsIDocShellTreeItem>, 8> kids;
kids.AppendElements(childCount);
for (int32_t i = 0; i < childCount; ++i) {
aItem->GetChildAt(i, getter_AddRefs(kids[i]));
@@ -7960,7 +7960,7 @@ nsContentUtils::FirePageShowEvent(nsIDocShellTreeItem* aItem,
{
int32_t childCount = 0;
aItem->GetChildCount(&childCount);
nsAutoTArray<nsCOMPtr<nsIDocShellTreeItem>, 8> kids;
AutoTArray<nsCOMPtr<nsIDocShellTreeItem>, 8> kids;
kids.AppendElements(childCount);
for (int32_t i = 0; i < childCount; ++i) {
aItem->GetChildAt(i, getter_AddRefs(kids[i]));
@@ -8570,7 +8570,7 @@ private:
}
}
nsAutoTArray<Unit, STRING_BUFFER_UNITS> mUnits;
AutoTArray<Unit, STRING_BUFFER_UNITS> mUnits;
nsAutoPtr<StringBuilder> mNext;
StringBuilder* mLast;
// mLength is used only in the first StringBuilder object in the linked list.
+5 -5
View File
@@ -22,7 +22,7 @@
using mozilla::dom::TreeOrderComparator;
using mozilla::dom::Animation;
nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>*
AutoTArray<RefPtr<nsDOMMutationObserver>, 4>*
nsDOMMutationObserver::sScheduledMutationObservers = nullptr;
nsDOMMutationObserver* nsDOMMutationObserver::sCurrentObserver = nullptr;
@@ -30,7 +30,7 @@ nsDOMMutationObserver* nsDOMMutationObserver::sCurrentObserver = nullptr;
uint32_t nsDOMMutationObserver::sMutationLevel = 0;
uint64_t nsDOMMutationObserver::sCount = 0;
nsAutoTArray<nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>*
AutoTArray<AutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>*
nsDOMMutationObserver::sCurrentlyHandlingObservers = nullptr;
nsINodeList*
@@ -585,7 +585,7 @@ void
nsDOMMutationObserver::RescheduleForRun()
{
if (!sScheduledMutationObservers) {
sScheduledMutationObservers = new nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>;
sScheduledMutationObservers = new AutoTArray<RefPtr<nsDOMMutationObserver>, 4>;
}
bool didInsert = false;
@@ -882,7 +882,7 @@ nsDOMMutationObserver::HandleMutationsInternal()
nsTArray<RefPtr<nsDOMMutationObserver> >* suppressedObservers = nullptr;
while (sScheduledMutationObservers) {
nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>* observers =
AutoTArray<RefPtr<nsDOMMutationObserver>, 4>* observers =
sScheduledMutationObservers;
sScheduledMutationObservers = nullptr;
for (uint32_t i = 0; i < observers->Length(); ++i) {
@@ -995,7 +995,7 @@ nsDOMMutationObserver::AddCurrentlyHandlingObserver(nsDOMMutationObserver* aObse
if (!sCurrentlyHandlingObservers) {
sCurrentlyHandlingObservers =
new nsAutoTArray<nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>;
new AutoTArray<AutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>;
}
while (sCurrentlyHandlingObservers->Length() < aMutationLevel) {
+5 -5
View File
@@ -604,7 +604,7 @@ protected:
nsClassHashtable<nsISupportsHashKey,
nsCOMArray<nsMutationReceiver> > mTransientReceivers;
// MutationRecords which are being constructed.
nsAutoTArray<nsDOMMutationRecord*, 4> mCurrentMutations;
AutoTArray<nsDOMMutationRecord*, 4> mCurrentMutations;
// MutationRecords which will be handed to the callback at the end of
// the microtask.
RefPtr<nsDOMMutationRecord> mFirstPendingMutation;
@@ -620,11 +620,11 @@ protected:
uint64_t mId;
static uint64_t sCount;
static nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>* sScheduledMutationObservers;
static AutoTArray<RefPtr<nsDOMMutationObserver>, 4>* sScheduledMutationObservers;
static nsDOMMutationObserver* sCurrentObserver;
static uint32_t sMutationLevel;
static nsAutoTArray<nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>*
static AutoTArray<AutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>*
sCurrentlyHandlingObservers;
};
@@ -739,7 +739,7 @@ private:
static nsAutoMutationBatch* sCurrentBatch;
nsAutoMutationBatch* mPreviousBatch;
nsAutoTArray<BatchObserver, 2> mObservers;
AutoTArray<BatchObserver, 2> mObservers;
nsTArray<nsCOMPtr<nsIContent> > mRemovedNodes;
nsTArray<nsCOMPtr<nsIContent> > mAddedNodes;
nsINode* mBatchTarget;
@@ -906,7 +906,7 @@ private:
};
static nsAutoAnimationMutationBatch* sCurrentBatch;
nsAutoTArray<nsDOMMutationObserver*, 2> mObservers;
AutoTArray<nsDOMMutationObserver*, 2> mObservers;
typedef nsTArray<Entry> EntryArray;
nsClassHashtable<nsPtrHashKey<nsINode>, EntryArray> mEntryTable;
// List of nodes referred to by mEntryTable so we can sort them
+4 -4
View File
@@ -134,7 +134,7 @@ nsDOMTokenList::AddInternal(const nsAttrValue* aAttr,
}
bool oneWasAdded = false;
nsAutoTArray<nsString, 10> addedClasses;
AutoTArray<nsString, 10> addedClasses;
for (uint32_t i = 0, l = aTokens.Length(); i < l; ++i) {
const nsString& aToken = aTokens[i];
@@ -175,7 +175,7 @@ nsDOMTokenList::Add(const nsTArray<nsString>& aTokens, ErrorResult& aError)
void
nsDOMTokenList::Add(const nsAString& aToken, mozilla::ErrorResult& aError)
{
nsAutoTArray<nsString, 1> tokens;
AutoTArray<nsString, 1> tokens;
tokens.AppendElement(aToken);
Add(tokens, aError);
}
@@ -261,7 +261,7 @@ nsDOMTokenList::Remove(const nsTArray<nsString>& aTokens, ErrorResult& aError)
void
nsDOMTokenList::Remove(const nsAString& aToken, mozilla::ErrorResult& aError)
{
nsAutoTArray<nsString, 1> tokens;
AutoTArray<nsString, 1> tokens;
tokens.AppendElement(aToken);
Remove(tokens, aError);
}
@@ -281,7 +281,7 @@ nsDOMTokenList::Toggle(const nsAString& aToken,
const bool forceOff = aForce.WasPassed() && !aForce.Value();
bool isPresent = attr && attr->Contains(aToken);
nsAutoTArray<nsString, 1> tokens;
AutoTArray<nsString, 1> tokens;
(*tokens.AppendElement()).Rebind(aToken.Data(), aToken.Length());
if (isPresent) {
+4 -4
View File
@@ -3338,7 +3338,7 @@ nsDocument::ElementFromPointHelper(float aX, float aY,
bool aIgnoreRootScrollFrame,
bool aFlushLayout)
{
nsAutoTArray<RefPtr<Element>, 1> elementArray;
AutoTArray<RefPtr<Element>, 1> elementArray;
ElementsFromPointHelper(aX, aY,
((aIgnoreRootScrollFrame ? nsIDocument::IGNORE_ROOT_SCROLL_FRAME : 0) |
(aFlushLayout ? nsIDocument::FLUSH_LAYOUT : 0) |
@@ -3460,7 +3460,7 @@ nsDocument::NodesFromRectHelper(float aX, float aY,
if (!rootFrame)
return NS_OK; // return nothing to premature XUL callers as a reminder to wait
nsAutoTArray<nsIFrame*,8> outFrames;
AutoTArray<nsIFrame*,8> outFrames;
nsLayoutUtils::GetFramesForArea(rootFrame, rect, outFrames,
nsLayoutUtils::IGNORE_PAINT_SUPPRESSION | nsLayoutUtils::IGNORE_CROSS_DOC |
(aIgnoreRootScrollFrame ? nsLayoutUtils::IGNORE_ROOT_SCROLL_FRAME : 0));
@@ -11217,7 +11217,7 @@ ExitFullscreenInDocTree(nsIDocument* aMaybeNotARootDoc)
// order when exiting fullscreen, but we traverse the doctree in a
// root-to-leaf order, so we save references to the documents we must
// dispatch to so that we dispatch in the specified order.
nsAutoTArray<nsIDocument*, 8> changed;
AutoTArray<nsIDocument*, 8> changed;
// Walk the tree of fullscreen documents, and reset their fullscreen state.
ResetFullScreen(root, static_cast<void*>(&changed));
@@ -11788,7 +11788,7 @@ nsDocument::RequestFullScreen(Element* aElement,
// order, but we traverse the doctree in a leaf-to-root order, so we save
// references to the documents we must dispatch to so that we get the order
// as specified.
nsAutoTArray<nsIDocument*, 8> changed;
AutoTArray<nsIDocument*, 8> changed;
// Remember the root document, so that if a full-screen document is hidden
// we can reset full-screen state in the remaining visible full-screen documents.
+5 -5
View File
@@ -162,11 +162,11 @@ protected:
uint32_t mEndDepth;
int32_t mStartRootIndex;
int32_t mEndRootIndex;
nsAutoTArray<nsINode*, 8> mCommonAncestors;
nsAutoTArray<nsIContent*, 8> mStartNodes;
nsAutoTArray<int32_t, 8> mStartOffsets;
nsAutoTArray<nsIContent*, 8> mEndNodes;
nsAutoTArray<int32_t, 8> mEndOffsets;
AutoTArray<nsINode*, 8> mCommonAncestors;
AutoTArray<nsIContent*, 8> mStartNodes;
AutoTArray<int32_t, 8> mStartOffsets;
AutoTArray<nsIContent*, 8> mEndNodes;
AutoTArray<int32_t, 8> mEndOffsets;
bool mHaltRangeHint;
// Used when context has already been serialized for
// table cell selections (where parent is <tr>)
+1 -1
View File
@@ -1385,7 +1385,7 @@ nsFocusManager::GetCommonAncestor(nsPIDOMWindow* aWindow1,
nsCOMPtr<nsIDocShellTreeItem> dsti2 = aWindow2->GetDocShell();
NS_ENSURE_TRUE(dsti2, nullptr);
nsAutoTArray<nsIDocShellTreeItem*, 30> parents1, parents2;
AutoTArray<nsIDocShellTreeItem*, 30> parents1, parents2;
do {
parents1.AppendElement(dsti1);
nsCOMPtr<nsIDocShellTreeItem> parentDsti1;
+1 -1
View File
@@ -399,7 +399,7 @@ protected:
bool InitChildGlobalInternal(nsISupports* aScope, const nsACString& aID);
nsCOMPtr<nsIXPConnectJSObjectHolder> mGlobal;
nsCOMPtr<nsIPrincipal> mPrincipal;
nsAutoTArray<JS::Heap<JSObject*>, 2> mAnonymousGlobalScopes;
AutoTArray<JS::Heap<JSObject*>, 2> mAnonymousGlobalScopes;
static nsDataHashtable<nsStringHashKey, nsMessageManagerScriptHolder*>* sCachedScripts;
static nsScriptCacheCleaner* sScriptCacheCleaner;
+1 -1
View File
@@ -1855,7 +1855,7 @@ public:
return mObservers;
}
protected:
nsAutoTArray< nsCOMPtr<nsIObserver>, 8 > mObservers;
AutoTArray< nsCOMPtr<nsIObserver>, 8 > mObservers;
};
/**
+4 -4
View File
@@ -595,7 +595,7 @@ void
nsINode::Normalize()
{
// First collect list of nodes to be removed
nsAutoTArray<nsCOMPtr<nsIContent>, 50> nodes;
AutoTArray<nsCOMPtr<nsIContent>, 50> nodes;
bool canMerge = false;
for (nsIContent* node = this->GetFirstChild();
@@ -864,7 +864,7 @@ nsINode::CompareDocumentPosition(nsINode& aOtherNode) const
return static_cast<uint16_t>(nsIDOMNode::DOCUMENT_POSITION_FOLLOWING);
}
nsAutoTArray<const nsINode*, 32> parents1, parents2;
AutoTArray<const nsINode*, 32> parents1, parents2;
const nsINode *node1 = &aOtherNode, *node2 = this;
@@ -2156,7 +2156,7 @@ nsINode::ReplaceOrInsertBefore(bool aReplace, nsINode* aNewChild,
nodeToInsertBefore = nodeToInsertBefore->GetNextSibling();
}
Maybe<nsAutoTArray<nsCOMPtr<nsIContent>, 50> > fragChildren;
Maybe<AutoTArray<nsCOMPtr<nsIContent>, 50> > fragChildren;
// Remove the new child from the old parent if one exists
nsCOMPtr<nsINode> oldParent = newContent->GetParentNode();
@@ -2864,7 +2864,7 @@ nsINode::QuerySelectorAll(const nsAString& aSelector, ErrorResult& aResult)
nsCSSSelectorList* selectorList = ParseSelectorList(aSelector, aResult);
if (selectorList) {
FindMatchingElements<false, nsAutoTArray<Element*, 128>>(this,
FindMatchingElements<false, AutoTArray<Element*, 128>>(this,
selectorList,
*contentList,
aResult);
+1 -1
View File
@@ -150,7 +150,7 @@ nsImageLoadingContent::Notify(imgIRequest* aRequest,
{
// Calling Notify on observers can modify the list of observers so make
// a local copy.
nsAutoTArray<nsCOMPtr<imgINotificationObserver>, 2> observers;
AutoTArray<nsCOMPtr<imgINotificationObserver>, 2> observers;
for (ImageObserver* observer = &mObserverList, *next; observer;
observer = next) {
+4 -4
View File
@@ -59,7 +59,7 @@ nsresult
nsLineBreaker::FlushCurrentWord()
{
uint32_t length = mCurrentWord.Length();
nsAutoTArray<uint8_t,4000> breakState;
AutoTArray<uint8_t,4000> breakState;
if (!breakState.AppendElements(length))
return NS_ERROR_OUT_OF_MEMORY;
@@ -187,7 +187,7 @@ nsLineBreaker::AppendText(nsIAtom* aHyphenationLanguage, const char16_t* aText,
return rv;
}
nsAutoTArray<uint8_t,4000> breakState;
AutoTArray<uint8_t,4000> breakState;
if (aSink) {
if (!breakState.AppendElements(aLength))
return NS_ERROR_OUT_OF_MEMORY;
@@ -313,7 +313,7 @@ nsLineBreaker::FindHyphenationPoints(nsHyphenator *aHyphenator,
uint8_t *aBreakState)
{
nsDependentSubstring string(aTextStart, aTextLimit);
AutoFallibleTArray<bool,200> hyphens;
AutoTArray<bool,200> hyphens;
if (NS_SUCCEEDED(aHyphenator->Hyphenate(string, hyphens))) {
for (uint32_t i = 0; i + 1 < string.Length(); ++i) {
if (hyphens[i]) {
@@ -368,7 +368,7 @@ nsLineBreaker::AppendText(nsIAtom* aHyphenationLanguage, const uint8_t* aText, u
return rv;
}
nsAutoTArray<uint8_t,4000> breakState;
AutoTArray<uint8_t,4000> breakState;
if (aSink) {
if (!breakState.AppendElements(aLength))
return NS_ERROR_OUT_OF_MEMORY;
+2 -2
View File
@@ -206,9 +206,9 @@ private:
const char16_t *aTextLimit,
uint8_t *aBreakState);
nsAutoTArray<char16_t,100> mCurrentWord;
AutoTArray<char16_t,100> mCurrentWord;
// All the items that contribute to mCurrentWord
nsAutoTArray<TextItem,2> mTextItems;
AutoTArray<TextItem,2> mTextItems;
nsIAtom* mCurrentWordLanguage;
bool mCurrentWordContainsMixedLang;
bool mCurrentWordContainsComplexChar;
+1 -1
View File
@@ -997,7 +997,7 @@ DOMHighResTimeStamp
PerformanceBase::ResolveTimestampFromName(const nsAString& aName,
ErrorResult& aRv)
{
nsAutoTArray<RefPtr<PerformanceEntry>, 1> arr;
AutoTArray<RefPtr<PerformanceEntry>, 1> arr;
DOMHighResTimeStamp ts;
Optional<nsAString> typeParam;
nsAutoString str;
+2 -2
View File
@@ -195,10 +195,10 @@ private:
RefPtr<mozilla::dom::Element> mElement;
// For handling table rows
nsAutoTArray<bool, 8> mHasWrittenCellsForRow;
AutoTArray<bool, 8> mHasWrittenCellsForRow;
// Values gotten in OpenContainer that is (also) needed in CloseContainer
nsAutoTArray<bool, 8> mIsInCiteBlockquote;
AutoTArray<bool, 8> mIsInCiteBlockquote;
// The output data
nsAString* mOutputString;
+1 -1
View File
@@ -158,7 +158,7 @@ protected:
};
// Stack to store one olState struct per <OL>.
nsAutoTArray<olState, 8> mOLStateStack;
AutoTArray<olState, 8> mOLStateStack;
bool HasNoChildren(nsIContent* aContent);
};
+2 -2
View File
@@ -2075,10 +2075,10 @@ void DoTraceSequence(JSTracer* trc, InfallibleTArray<T>& seq);
namespace binding_detail {
template<typename T>
class AutoSequence : public AutoFallibleTArray<T, 16>
class AutoSequence : public AutoTArray<T, 16>
{
public:
AutoSequence() : AutoFallibleTArray<T, 16>()
AutoSequence() : AutoTArray<T, 16>()
{}
// Allow converting to const sequences as needed
+4 -4
View File
@@ -4467,8 +4467,8 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
# reallocation behavior for arrays. In particular, if we use auto
# arrays for sequences and have a sequence of elements which are
# themselves sequences or have sequences as members, we have a problem.
# In that case, resizing the outermost nsAutoTarray to the right size
# will memmove its elements, but nsAutoTArrays are not memmovable and
# In that case, resizing the outermost AutoTArray to the right size
# will memmove its elements, but AutoTArrays are not memmovable and
# hence will end up with pointers to bogus memory, which is bad. To
# deal with this, we typically map WebIDL sequences to our Sequence
# type, which is in fact memmovable. The one exception is when we're
@@ -8404,7 +8404,7 @@ class CGEnumerateHook(CGAbstractBindingMethod):
def generate_code(self):
return CGGeneric(dedent("""
nsAutoTArray<nsString, 8> names;
AutoTArray<nsString, 8> names;
ErrorResult rv;
self->GetOwnPropertyNames(cx, names, rv);
if (rv.MaybeSetPendingException(cx)) {
@@ -10471,7 +10471,7 @@ class CGEnumerateOwnPropertiesViaGetOwnPropertyNames(CGAbstractBindingMethod):
def generate_code(self):
return CGGeneric(dedent("""
nsAutoTArray<nsString, 8> names;
AutoTArray<nsString, 8> names;
ErrorResult rv;
self->GetOwnPropertyNames(cx, names, rv);
if (rv.MaybeSetPendingException(cx)) {
+4 -4
View File
@@ -94,7 +94,7 @@ GetAllBluetoothActors(InfallibleTArray<BluetoothParent*>& aActors)
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(aActors.IsEmpty());
nsAutoTArray<ContentParent*, 20> contentActors;
AutoTArray<ContentParent*, 20> contentActors;
ContentParent::GetAll(contentActors);
for (uint32_t contentIndex = 0;
@@ -102,7 +102,7 @@ GetAllBluetoothActors(InfallibleTArray<BluetoothParent*>& aActors)
contentIndex++) {
MOZ_ASSERT(contentActors[contentIndex]);
AutoInfallibleTArray<PBluetoothParent*, 5> bluetoothActors;
AutoTArray<PBluetoothParent*, 5> bluetoothActors;
contentActors[contentIndex]->ManagedPBluetoothParent(bluetoothActors);
for (uint32_t bluetoothIndex = 0;
@@ -487,7 +487,7 @@ BluetoothService::SetEnabled(bool aEnabled)
{
MOZ_ASSERT(NS_IsMainThread());
AutoInfallibleTArray<BluetoothParent*, 10> childActors;
AutoTArray<BluetoothParent*, 10> childActors;
GetAllBluetoothActors(childActors);
for (uint32_t index = 0; index < childActors.Length(); index++) {
@@ -571,7 +571,7 @@ BluetoothService::HandleShutdown()
Cleanup();
AutoInfallibleTArray<BluetoothParent*, 10> childActors;
AutoTArray<BluetoothParent*, 10> childActors;
GetAllBluetoothActors(childActors);
if (!childActors.IsEmpty()) {
+3 -3
View File
@@ -47,7 +47,7 @@ CleanupChildFds(CacheReadStream& aReadStream, CleanupAction aAction)
return;
}
nsAutoTArray<FileDescriptor, 4> fds;
AutoTArray<FileDescriptor, 4> fds;
FileDescriptorSetChild* fdSetActor =
static_cast<FileDescriptorSetChild*>(aReadStream.fds().get_PFileDescriptorSetChild());
@@ -107,7 +107,7 @@ CleanupParentFds(CacheReadStream& aReadStream, CleanupAction aAction)
return;
}
nsAutoTArray<FileDescriptor, 4> fds;
AutoTArray<FileDescriptor, 4> fds;
FileDescriptorSetParent* fdSetActor =
static_cast<FileDescriptorSetParent*>(aReadStream.fds().get_PFileDescriptorSetParent());
@@ -306,7 +306,7 @@ MatchInPutList(InternalRequest* aRequest,
RefPtr<InternalHeaders> cachedResponseHeaders =
TypeUtils::ToInternalHeaders(cachedResponse.headers());
nsAutoTArray<nsCString, 16> varyHeaders;
AutoTArray<nsCString, 16> varyHeaders;
ErrorResult rv;
cachedResponseHeaders->GetAll(NS_LITERAL_CSTRING("vary"), varyHeaders, rv);
MOZ_ALWAYS_TRUE(!rv.Failed());
+2 -2
View File
@@ -114,7 +114,7 @@ public:
// an Array of Response objects. The following code unwraps these
// JS values back to an nsTArray<RefPtr<Response>>.
nsAutoTArray<RefPtr<Response>, 256> responseList;
AutoTArray<RefPtr<Response>, 256> responseList;
responseList.SetCapacity(mRequestList.Length());
bool isArray;
@@ -555,7 +555,7 @@ Cache::AddAll(const GlobalObject& aGlobal,
return promise.forget();
}
nsAutoTArray<RefPtr<Promise>, 256> fetchList;
AutoTArray<RefPtr<Promise>, 256> fetchList;
fetchList.SetCapacity(aRequestList.Length());
// Begin fetching each request in parallel. For now, if an error occurs just
+2 -2
View File
@@ -219,7 +219,7 @@ CacheOpChild::HandleResponse(const CacheResponseOrVoid& aResponseOrVoid)
void
CacheOpChild::HandleResponseList(const nsTArray<CacheResponse>& aResponseList)
{
nsAutoTArray<RefPtr<Response>, 256> responses;
AutoTArray<RefPtr<Response>, 256> responses;
responses.SetCapacity(aResponseList.Length());
for (uint32_t i = 0; i < aResponseList.Length(); ++i) {
@@ -233,7 +233,7 @@ CacheOpChild::HandleResponseList(const nsTArray<CacheResponse>& aResponseList)
void
CacheOpChild::HandleRequestList(const nsTArray<CacheRequest>& aRequestList)
{
nsAutoTArray<RefPtr<Request>, 256> requests;
AutoTArray<RefPtr<Request>, 256> requests;
requests.SetCapacity(aRequestList.Length());
for (uint32_t i = 0; i < aRequestList.Length(); ++i) {
+3 -3
View File
@@ -79,8 +79,8 @@ CacheOpParent::Execute(Manager* aManager)
const CachePutAllArgs& args = mOpArgs.get_CachePutAllArgs();
const nsTArray<CacheRequestResponse>& list = args.requestResponseList();
nsAutoTArray<nsCOMPtr<nsIInputStream>, 256> requestStreamList;
nsAutoTArray<nsCOMPtr<nsIInputStream>, 256> responseStreamList;
AutoTArray<nsCOMPtr<nsIInputStream>, 256> requestStreamList;
AutoTArray<nsCOMPtr<nsIInputStream>, 256> responseStreamList;
for (uint32_t i = 0; i < list.Length(); ++i) {
requestStreamList.AppendElement(
@@ -221,7 +221,7 @@ CacheOpParent::DeserializeCacheStream(const CacheReadStreamOrVoid& aStreamOrVoid
}
// Option 3: A stream was serialized using normal methods.
nsAutoTArray<FileDescriptor, 4> fds;
AutoTArray<FileDescriptor, 4> fds;
if (readStream.fds().type() ==
OptionalFileDescriptorSet::TPFileDescriptorSetChild) {
+11 -11
View File
@@ -588,11 +588,11 @@ DeleteCacheId(mozIStorageConnection* aConn, CacheId aCacheId,
// Delete the bodies explicitly as we need to read out the body IDs
// anyway. These body IDs must be deleted one-by-one as content may
// still be referencing them invidivually.
nsAutoTArray<EntryId, 256> matches;
AutoTArray<EntryId, 256> matches;
nsresult rv = QueryAll(aConn, aCacheId, matches);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
nsAutoTArray<IdCount, 16> deletedSecurityIdList;
AutoTArray<IdCount, 16> deletedSecurityIdList;
rv = DeleteEntries(aConn, matches, aDeletedBodyIdListOut,
deletedSecurityIdList);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
@@ -720,7 +720,7 @@ CacheMatch(mozIStorageConnection* aConn, CacheId aCacheId,
*aFoundResponseOut = false;
nsAutoTArray<EntryId, 1> matches;
AutoTArray<EntryId, 1> matches;
nsresult rv = QueryCache(aConn, aCacheId, aRequest, aParams, matches, 1);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
@@ -747,7 +747,7 @@ CacheMatchAll(mozIStorageConnection* aConn, CacheId aCacheId,
MOZ_ASSERT(aConn);
nsresult rv;
nsAutoTArray<EntryId, 256> matches;
AutoTArray<EntryId, 256> matches;
if (aRequestOrVoid.type() == CacheRequestOrVoid::Tvoid_t) {
rv = QueryAll(aConn, aCacheId, matches);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
@@ -781,11 +781,11 @@ CachePut(mozIStorageConnection* aConn, CacheId aCacheId,
CacheQueryParams params(false, false, false, false,
NS_LITERAL_STRING(""));
nsAutoTArray<EntryId, 256> matches;
AutoTArray<EntryId, 256> matches;
nsresult rv = QueryCache(aConn, aCacheId, aRequest, params, matches);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
nsAutoTArray<IdCount, 16> deletedSecurityIdList;
AutoTArray<IdCount, 16> deletedSecurityIdList;
rv = DeleteEntries(aConn, matches, aDeletedBodyIdListOut,
deletedSecurityIdList);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
@@ -814,7 +814,7 @@ CacheDelete(mozIStorageConnection* aConn, CacheId aCacheId,
*aSuccessOut = false;
nsAutoTArray<EntryId, 256> matches;
AutoTArray<EntryId, 256> matches;
nsresult rv = QueryCache(aConn, aCacheId, aRequest, aParams, matches);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
@@ -822,7 +822,7 @@ CacheDelete(mozIStorageConnection* aConn, CacheId aCacheId,
return rv;
}
nsAutoTArray<IdCount, 16> deletedSecurityIdList;
AutoTArray<IdCount, 16> deletedSecurityIdList;
rv = DeleteEntries(aConn, matches, aDeletedBodyIdListOut,
deletedSecurityIdList);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
@@ -845,7 +845,7 @@ CacheKeys(mozIStorageConnection* aConn, CacheId aCacheId,
MOZ_ASSERT(aConn);
nsresult rv;
nsAutoTArray<EntryId, 256> matches;
AutoTArray<EntryId, 256> matches;
if (aRequestOrVoid.type() == CacheRequestOrVoid::Tvoid_t) {
rv = QueryAll(aConn, aCacheId, matches);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
@@ -912,7 +912,7 @@ StorageMatch(mozIStorageConnection* aConn,
rv = state->BindInt32ByName(NS_LITERAL_CSTRING("namespace"), aNamespace);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
nsAutoTArray<CacheId, 32> cacheIdList;
AutoTArray<CacheId, 32> cacheIdList;
bool hasMoreData = false;
while (NS_SUCCEEDED(state->ExecuteStep(&hasMoreData)) && hasMoreData) {
@@ -1218,7 +1218,7 @@ MatchByVaryHeader(mozIStorageConnection* aConn,
rv = state->BindInt32ByName(NS_LITERAL_CSTRING("entry_id"), entryId);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
nsAutoTArray<nsCString, 8> varyValues;
AutoTArray<nsCString, 8> varyValues;
bool hasMoreData = false;
while (NS_SUCCEEDED(state->ExecuteStep(&hasMoreData)) && hasMoreData) {
+5 -5
View File
@@ -74,12 +74,12 @@ public:
mozIStorageConnection::TRANSACTION_IMMEDIATE);
// Clean up orphaned Cache objects
nsAutoTArray<CacheId, 8> orphanedCacheIdList;
AutoTArray<CacheId, 8> orphanedCacheIdList;
nsresult rv = db::FindOrphanedCacheIds(aConn, orphanedCacheIdList);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
for (uint32_t i = 0; i < orphanedCacheIdList.Length(); ++i) {
nsAutoTArray<nsID, 16> deletedBodyIdList;
AutoTArray<nsID, 16> deletedBodyIdList;
rv = db::DeleteCacheId(aConn, orphanedCacheIdList[i], deletedBodyIdList);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
@@ -88,7 +88,7 @@ public:
}
// Clean up orphaned body objects
nsAutoTArray<nsID, 64> knownBodyIdList;
AutoTArray<nsID, 64> knownBodyIdList;
rv = db::GetKnownBodyIds(aConn, knownBodyIdList);
rv = BodyDeleteOrphanedFiles(aDBDir, knownBodyIdList);
@@ -1489,7 +1489,7 @@ Manager::Listener::OnOpComplete(ErrorResult&& aRv, const CacheOpResult& aResult,
const SavedResponse& aSavedResponse,
StreamList* aStreamList)
{
nsAutoTArray<SavedResponse, 1> responseList;
AutoTArray<SavedResponse, 1> responseList;
responseList.AppendElement(aSavedResponse);
OnOpComplete(Move(aRv), aResult, INVALID_CACHE_ID, responseList,
nsTArray<SavedRequest>(), aStreamList);
@@ -2018,7 +2018,7 @@ Manager::NoteOrphanedBodyIdList(const nsTArray<nsID>& aDeletedBodyIdList)
{
NS_ASSERT_OWNINGTHREAD(Manager);
nsAutoTArray<nsID, 64> deleteNowList;
AutoTArray<nsID, 64> deleteNowList;
deleteNowList.SetCapacity(aDeletedBodyIdList.Length());
for (uint32_t i = 0; i < aDeletedBodyIdList.Length(); ++i) {
+2 -2
View File
@@ -222,7 +222,7 @@ ReadStream::Inner::Serialize(CacheReadStream* aReadStreamOut)
aReadStreamOut->id() = mId;
mControl->SerializeControl(aReadStreamOut);
nsAutoTArray<FileDescriptor, 4> fds;
AutoTArray<FileDescriptor, 4> fds;
SerializeInputStream(mStream, aReadStreamOut->params(), fds);
mControl->SerializeFds(aReadStreamOut, fds);
@@ -451,7 +451,7 @@ ReadStream::Create(const CacheReadStream& aReadStream)
}
MOZ_ASSERT(control);
nsAutoTArray<FileDescriptor, 4> fds;
AutoTArray<FileDescriptor, 4> fds;
control->DeserializeFds(aReadStream, fds);
nsCOMPtr<nsIInputStream> stream =
+3 -3
View File
@@ -44,7 +44,7 @@ namespace {
static bool
HasVaryStar(mozilla::dom::InternalHeaders* aHeaders)
{
nsAutoTArray<nsCString, 16> varyHeaders;
AutoTArray<nsCString, 16> varyHeaders;
ErrorResult rv;
aHeaders->GetAll(NS_LITERAL_CSTRING("vary"), varyHeaders, rv);
MOZ_ALWAYS_TRUE(!rv.Failed());
@@ -67,7 +67,7 @@ HasVaryStar(mozilla::dom::InternalHeaders* aHeaders)
void
SerializeNormalStream(nsIInputStream* aStream, CacheReadStream& aReadStreamOut)
{
nsAutoTArray<FileDescriptor, 4> fds;
AutoTArray<FileDescriptor, 4> fds;
SerializeInputStream(aStream, aReadStreamOut.params(), fds);
PFileDescriptorSetChild* fdSet = nullptr;
@@ -94,7 +94,7 @@ ToHeadersEntryList(nsTArray<HeadersEntry>& aOut, InternalHeaders* aHeaders)
{
MOZ_ASSERT(aHeaders);
nsAutoTArray<InternalHeaders::Entry, 16> entryList;
AutoTArray<InternalHeaders::Entry, 16> entryList;
aHeaders->GetEntries(entryList);
for (uint32_t i = 0; i < entryList.Length(); ++i) {
+6 -6
View File
@@ -247,7 +247,7 @@ nsGonkCameraControl::Initialize()
DOM_CAMERA_LOGI(" - flash: NOT supported\n");
}
nsAutoTArray<Size, 16> sizes;
AutoTArray<Size, 16> sizes;
mParams.Get(CAMERA_PARAM_SUPPORTED_VIDEOSIZES, sizes);
if (sizes.Length() > 0) {
mSeparateVideoAndPreviewSizesSupported = true;
@@ -264,7 +264,7 @@ nsGonkCameraControl::Initialize()
mLastRecorderSize = mCurrentConfiguration.mPreviewSize;
}
nsAutoTArray<nsString, 8> modes;
AutoTArray<nsString, 8> modes;
mParams.Get(CAMERA_PARAM_SUPPORTED_METERINGMODES, modes);
if (!modes.IsEmpty()) {
nsString mode;
@@ -302,7 +302,7 @@ nsGonkCameraControl::~nsGonkCameraControl()
nsresult
nsGonkCameraControl::ValidateConfiguration(const Configuration& aConfig, Configuration& aValidatedConfig)
{
nsAutoTArray<Size, 16> supportedSizes;
AutoTArray<Size, 16> supportedSizes;
Get(CAMERA_PARAM_SUPPORTED_PICTURESIZES, supportedSizes);
nsresult rv = GetSupportedSize(aConfig.mPictureSize, supportedSizes,
@@ -923,7 +923,7 @@ nsGonkCameraControl::SetThumbnailSizeImpl(const Size& aSize)
uint32_t smallestDeltaIndex = UINT32_MAX;
int targetArea = aSize.width * aSize.height;
nsAutoTArray<Size, 8> supportedSizes;
AutoTArray<Size, 8> supportedSizes;
Get(CAMERA_PARAM_SUPPORTED_JPEG_THUMBNAIL_SIZES, supportedSizes);
for (uint32_t i = 0; i < supportedSizes.Length(); ++i) {
@@ -1028,7 +1028,7 @@ nsGonkCameraControl::SetPictureSizeImpl(const Size& aSize)
return NS_OK;
}
nsAutoTArray<Size, 8> supportedSizes;
AutoTArray<Size, 8> supportedSizes;
Get(CAMERA_PARAM_SUPPORTED_PICTURESIZES, supportedSizes);
Size best;
@@ -1727,7 +1727,7 @@ nsGonkCameraControl::SelectCaptureAndPreviewSize(const Size& aPreviewSize,
aPreviewSize.width, aPreviewSize.height,
aMaxSize.width, aMaxSize.height);
nsAutoTArray<Size, 16> sizes;
AutoTArray<Size, 16> sizes;
nsresult rv = Get(CAMERA_PARAM_SUPPORTED_PREVIEWSIZES, sizes);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
+1 -1
View File
@@ -1038,7 +1038,7 @@ protected:
bool fontExplicitLanguage;
};
nsAutoTArray<ContextState, 3> mStyleStack;
AutoTArray<ContextState, 3> mStyleStack;
inline ContextState& CurrentState() {
return mStyleStack[mStyleStack.Length() - 1];
+1 -1
View File
@@ -239,7 +239,7 @@ ImageBitmapRenderingContext::GetCanvasLayer(nsDisplayListBuilder* aBuilder,
imageLayer->SetContainer(imageContainer);
}
nsAutoTArray<ImageContainer::NonOwningImage, 1> imageList;
AutoTArray<ImageContainer::NonOwningImage, 1> imageList;
RefPtr<layers::Image> image = ClipToIntrinsicSize();
imageList.AppendElement(ImageContainer::NonOwningImage(image));
imageContainer->SetCurrentImages(imageList);
+2 -2
View File
@@ -716,7 +716,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
if (modifierMask &&
(modifierMask == Prefs::ChromeAccessModifierMask() ||
modifierMask == Prefs::ContentAccessModifierMask())) {
nsAutoTArray<uint32_t, 10> accessCharCodes;
AutoTArray<uint32_t, 10> accessCharCodes;
nsContentUtils::GetAccessKeyCandidates(keyEvent, accessCharCodes);
if (HandleAccessKey(aPresContext, accessCharCodes,
@@ -1275,7 +1275,7 @@ EventStateManager::HandleCrossProcessEvent(WidgetEvent* aEvent,
// event to.
//
// NB: the elements of |targets| must be unique, for correctness.
nsAutoTArray<nsCOMPtr<nsIContent>, 1> targets;
AutoTArray<nsCOMPtr<nsIContent>, 1> targets;
if (aEvent->mClass != eTouchEventClass || aEvent->mMessage == eTouchStart) {
// If this event only has one target, and it's remote, add it to
// the array.
+1 -1
View File
@@ -429,7 +429,7 @@ private:
*/
class TextCompositionArray final :
public nsAutoTArray<RefPtr<TextComposition>, 2>
public AutoTArray<RefPtr<TextComposition>, 2>
{
public:
// Looking for per native IME context.
+2 -2
View File
@@ -241,7 +241,7 @@ FetchDriver::HttpFetch()
NS_ENSURE_SUCCESS(rv, rv);
// Set the same headers.
nsAutoTArray<InternalHeaders::Entry, 5> headers;
AutoTArray<InternalHeaders::Entry, 5> headers;
mRequest->Headers()->GetEntries(headers);
bool hasAccept = false;
for (uint32_t i = 0; i < headers.Length(); ++i) {
@@ -347,7 +347,7 @@ FetchDriver::HttpFetch()
// nsCORSListenerProxy. We just inform it which unsafe headers are included
// in the request.
if (mRequest->Mode() == RequestMode::Cors) {
nsAutoTArray<nsCString, 5> unsafeHeaders;
AutoTArray<nsCString, 5> unsafeHeaders;
mRequest->Headers()->GetUnsafeHeaders(unsafeHeaders);
nsCOMPtr<nsILoadInfo> loadInfo = chan->GetLoadInfo();
loadInfo->SetCorsPreflightInfo(unsafeHeaders, false);
+1 -1
View File
@@ -309,7 +309,7 @@ InternalHeaders::CORSHeaders(InternalHeaders* aHeaders)
aHeaders->Get(NS_LITERAL_CSTRING("Access-Control-Expose-Headers"), acExposedNames, result);
MOZ_ASSERT(!result.Failed());
nsAutoTArray<nsCString, 5> exposeNamesArray;
AutoTArray<nsCString, 5> exposeNamesArray;
nsCCharSeparatedTokenizer exposeTokens(acExposedNames, ',');
while (exposeTokens.hasMoreTokens()) {
const nsDependentCSubstring& token = exposeTokens.nextToken();
+1 -1
View File
@@ -77,7 +77,7 @@ private:
struct udev_monitor* mMonitor;
guint mMonitorSourceID;
// Information about currently connected gamepads.
nsAutoTArray<Gamepad,4> mGamepads;
AutoTArray<Gamepad,4> mGamepads;
};
// singleton instance

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