Commit 265e6721 authored by Sylvestre Ledru's avatar Sylvestre Ledru
Browse files

Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format

# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
parent fe3fa7f5
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:uriloader/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:media/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:docshell/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:netwerk/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:ipc/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:intl/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:taskcluster/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:servo/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:devtools/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:python/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:gfx/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:image/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:js/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:editor/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:parser/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:widget/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:mfbt/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:services/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:caps/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:chrome/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:extensions/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:view/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:xpfe/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:accessible/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:browser/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:toolkit/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:addon-sdk/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:config/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:embedding/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:security/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:dom/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:tools/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:gradle/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:storage/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:nsprpub/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:db/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:layout/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:xpcom/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:testing/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:other-licenses/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:modules/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:build/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:memory/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:mobile/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:startupcache/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:hal/**", "tool": "clang-format"}
{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:mozglue/**", "tool": "clang-format"}
......@@ -16,7 +16,7 @@ namespace a11y {
typedef class ARIAGridAccessible ARIAGridAccessibleWrap;
typedef class ARIAGridCellAccessible ARIAGridCellAccessibleWrap;
} // namespace a11y
} // namespace mozilla
} // namespace a11y
} // namespace mozilla
#endif
This diff is collapsed.
......@@ -14,9 +14,8 @@
namespace mozilla {
namespace a11y {
class AccessibleWrap : public Accessible
{
public:
class AccessibleWrap : public Accessible {
public:
AccessibleWrap(nsIContent* aContent, DocAccessible* aDoc);
virtual ~AccessibleWrap();
......@@ -33,36 +32,30 @@ public:
mozilla::java::GeckoBundle::LocalRef ToBundle();
mozilla::java::GeckoBundle::LocalRef ToBundle(const uint64_t aState,
const nsIntRect& aBounds,
const nsString& aName,
const nsString& aTextValue,
const nsString& aDOMNodeID,
const double& aCurVal,
const double& aMinVal,
const double& aMaxVal,
const double& aStep,
nsIPersistentProperties* aAttributes);
mozilla::java::GeckoBundle::LocalRef ToBundle(
const uint64_t aState, const nsIntRect& aBounds, const nsString& aName,
const nsString& aTextValue, const nsString& aDOMNodeID,
const double& aCurVal, const double& aMinVal, const double& aMaxVal,
const double& aStep, nsIPersistentProperties* aAttributes);
mozilla::java::GeckoBundle::LocalRef ToSmallBundle(const uint64_t aState, const nsIntRect& aBounds);
mozilla::java::GeckoBundle::LocalRef ToSmallBundle(const uint64_t aState,
const nsIntRect& aBounds);
mozilla::java::GeckoBundle::LocalRef ToSmallBundle();
virtual void WrapperDOMNodeID(nsString& aDOMNodeID);
int32_t AndroidClass()
{
int32_t AndroidClass() {
return mID == kNoID ? java::SessionAccessibility::CLASSNAME_WEBVIEW
: GetAndroidClass(WrapperRole());
}
static already_AddRefed<nsIPersistentProperties> AttributeArrayToProperties(
const nsTArray<Attribute>& aAttributes);
const nsTArray<Attribute>& aAttributes);
static const int32_t kNoID = -1;
protected:
protected:
// IDs should be a positive 32bit integer.
static int32_t AcquireID();
static void ReleaseID(int32_t aID);
......@@ -73,26 +66,26 @@ protected:
int32_t mID;
private:
virtual AccessibleWrap* WrapperParent() { return static_cast<AccessibleWrap*>(Parent()); }
private:
virtual AccessibleWrap* WrapperParent() {
return static_cast<AccessibleWrap*>(Parent());
}
virtual bool WrapperRangeInfo(double* aCurVal, double* aMinVal, double* aMaxVal, double* aStep);
virtual bool WrapperRangeInfo(double* aCurVal, double* aMinVal,
double* aMaxVal, double* aStep);
virtual role WrapperRole() { return Role(); }
static void GetRoleDescription(role aRole,
nsAString& aGeckoRole,
static void GetRoleDescription(role aRole, nsAString& aGeckoRole,
nsAString& aRoleDescription);
static uint32_t GetFlags(role aRole, uint64_t aState);
};
static inline AccessibleWrap*
WrapperFor(const ProxyAccessible* aProxy)
{
static inline AccessibleWrap* WrapperFor(const ProxyAccessible* aProxy) {
return reinterpret_cast<AccessibleWrap*>(aProxy->GetWrapper());
}
} // namespace a11y
} // namespace mozilla
} // namespace a11y
} // namespace mozilla
#endif
......@@ -14,7 +14,7 @@ namespace mozilla {
namespace a11y {
typedef ApplicationAccessible ApplicationAccessibleWrap;
} // namespace a11y
} // namespace mozilla
} // namespace a11y
} // namespace mozilla
#endif
......@@ -23,8 +23,7 @@ const uint32_t kCacheRefreshInterval = 500;
DocAccessibleWrap::DocAccessibleWrap(nsIDocument* aDocument,
nsIPresShell* aPresShell)
: DocAccessible(aDocument, aPresShell)
{
: DocAccessible(aDocument, aPresShell) {
nsCOMPtr<nsIDocShellTreeItem> treeItem(aDocument->GetDocShell());
nsCOMPtr<nsIDocShellTreeItem> parentTreeItem;
......@@ -42,9 +41,7 @@ DocAccessibleWrap::DocAccessibleWrap(nsIDocument* aDocument,
DocAccessibleWrap::~DocAccessibleWrap() {}
AccessibleWrap*
DocAccessibleWrap::GetAccessibleByID(int32_t aID) const
{
AccessibleWrap* DocAccessibleWrap::GetAccessibleByID(int32_t aID) const {
if (AccessibleWrap* acc = mIDToAccessibleMap.Get(aID)) {
return acc;
}
......@@ -60,17 +57,13 @@ DocAccessibleWrap::GetAccessibleByID(int32_t aID) const
return nullptr;
}
void
DocAccessibleWrap::DoInitialUpdate()
{
void DocAccessibleWrap::DoInitialUpdate() {
DocAccessible::DoInitialUpdate();
CacheViewport();
}
nsresult
DocAccessibleWrap::HandleAccEvent(AccEvent* aEvent)
{
switch(aEvent->GetEventType()) {
nsresult DocAccessibleWrap::HandleAccEvent(AccEvent* aEvent) {
switch (aEvent->GetEventType()) {
case nsIAccessibleEvent::EVENT_SHOW:
case nsIAccessibleEvent::EVENT_HIDE:
case nsIAccessibleEvent::EVENT_SCROLLING_END:
......@@ -86,16 +79,15 @@ DocAccessibleWrap::HandleAccEvent(AccEvent* aEvent)
return DocAccessible::HandleAccEvent(aEvent);
}
void
DocAccessibleWrap::CacheViewportCallback(nsITimer* aTimer, void* aDocAccParam)
{
RefPtr<DocAccessibleWrap> docAcc(dont_AddRef(
reinterpret_cast<DocAccessibleWrap*>(aDocAccParam)));
void DocAccessibleWrap::CacheViewportCallback(nsITimer* aTimer,
void* aDocAccParam) {
RefPtr<DocAccessibleWrap> docAcc(
dont_AddRef(reinterpret_cast<DocAccessibleWrap*>(aDocAccParam)));
if (!docAcc) {
return;
}
nsIPresShell *presShell = docAcc->PresShell();
nsIPresShell* presShell = docAcc->PresShell();
if (!presShell) {
return;
}
......@@ -109,10 +101,8 @@ DocAccessibleWrap::CacheViewportCallback(nsITimer* aTimer, void* aDocAccParam)
nsRect scrollPort = sf ? sf->GetScrollPortRect() : rootFrame->GetRect();
nsLayoutUtils::GetFramesForArea(
presShell->GetRootFrame(),
scrollPort,
frames,
nsLayoutUtils::FrameForPointFlags::ONLY_VISIBLE);
presShell->GetRootFrame(), scrollPort, frames,
nsLayoutUtils::FrameForPointFlags::ONLY_VISIBLE);
AccessibleHashtable inViewAccs;
for (size_t i = 0; i < frames.Length(); i++) {
nsIContent* content = frames.ElementAt(i)->GetContent();
......@@ -125,7 +115,8 @@ DocAccessibleWrap::CacheViewportCallback(nsITimer* aTimer, void* aDocAccParam)
continue;
}
for (Accessible* acc = visibleAcc; acc && acc != docAcc->Parent(); acc = acc->Parent()) {
for (Accessible* acc = visibleAcc; acc && acc != docAcc->Parent();
acc = acc->Parent()) {
if (inViewAccs.Contains(acc->UniqueID())) {
break;
}
......@@ -138,27 +129,24 @@ DocAccessibleWrap::CacheViewportCallback(nsITimer* aTimer, void* aDocAccParam)
nsTArray<BatchData> cacheData(inViewAccs.Count());
for (auto iter = inViewAccs.Iter(); !iter.Done(); iter.Next()) {
Accessible* accessible = iter.Data();
auto uid = accessible->IsDoc() && accessible->AsDoc()->IPCDoc() ? 0
: reinterpret_cast<uint64_t>(accessible->UniqueID());
cacheData.AppendElement(BatchData(accessible->Document()->IPCDoc(),
uid,
accessible->State(),
accessible->Bounds(),
nsString(),
nsString(),
nsString(),
UnspecifiedNaN<double>(),
UnspecifiedNaN<double>(),
UnspecifiedNaN<double>(),
UnspecifiedNaN<double>(),
nsTArray<Attribute>()));
auto uid = accessible->IsDoc() && accessible->AsDoc()->IPCDoc()
? 0
: reinterpret_cast<uint64_t>(accessible->UniqueID());
cacheData.AppendElement(
BatchData(accessible->Document()->IPCDoc(), uid, accessible->State(),
accessible->Bounds(), nsString(), nsString(), nsString(),
UnspecifiedNaN<double>(), UnspecifiedNaN<double>(),
UnspecifiedNaN<double>(), UnspecifiedNaN<double>(),
nsTArray<Attribute>()));
}
ipcDoc->SendBatch(eBatch_Viewport, cacheData);
} else if (SessionAccessibility* sessionAcc = SessionAccessibility::GetInstanceFor(docAcc)) {
} else if (SessionAccessibility* sessionAcc =
SessionAccessibility::GetInstanceFor(docAcc)) {
nsTArray<AccessibleWrap*> accessibles(inViewAccs.Count());
for (auto iter = inViewAccs.Iter(); !iter.Done(); iter.Next()) {
accessibles.AppendElement(static_cast<AccessibleWrap*>(iter.Data().get()));
accessibles.AppendElement(
static_cast<AccessibleWrap*>(iter.Data().get()));
}
sessionAcc->ReplaceViewportCache(accessibles);
......@@ -169,25 +157,22 @@ DocAccessibleWrap::CacheViewportCallback(nsITimer* aTimer, void* aDocAccParam)
}
}
void
DocAccessibleWrap::CacheViewport()
{
void DocAccessibleWrap::CacheViewport() {
if (VirtualViewID() == kNoID && !mCacheRefreshTimer) {
NS_NewTimerWithFuncCallback(getter_AddRefs(mCacheRefreshTimer),
CacheViewportCallback,
this,
kCacheRefreshInterval,
nsITimer::TYPE_ONE_SHOT,
CacheViewportCallback, this,
kCacheRefreshInterval, nsITimer::TYPE_ONE_SHOT,
"a11y::DocAccessibleWrap::CacheViewport");
if (mCacheRefreshTimer) {
NS_ADDREF_THIS(); // Kung fu death grip
NS_ADDREF_THIS(); // Kung fu death grip
}
}
}
DocAccessibleWrap*
DocAccessibleWrap::GetTopLevelContentDoc(AccessibleWrap* aAccessible) {
DocAccessibleWrap* doc = static_cast<DocAccessibleWrap*>(aAccessible->Document());
DocAccessibleWrap* DocAccessibleWrap::GetTopLevelContentDoc(
AccessibleWrap* aAccessible) {
DocAccessibleWrap* doc =
static_cast<DocAccessibleWrap*>(aAccessible->Document());
while (doc && doc->VirtualViewID() != kNoID) {
doc = static_cast<DocAccessibleWrap*>(doc->ParentDocument());
}
......@@ -195,17 +180,16 @@ DocAccessibleWrap::GetTopLevelContentDoc(AccessibleWrap* aAccessible) {
return doc;
}
void
DocAccessibleWrap::CacheFocusPath(AccessibleWrap* aAccessible)
{
void DocAccessibleWrap::CacheFocusPath(AccessibleWrap* aAccessible) {
mFocusPath.Clear();
if (IPCAccessibilityActive()) {
DocAccessibleChild* ipcDoc = IPCDoc();
nsTArray<BatchData> cacheData;
for (AccessibleWrap* acc = aAccessible; acc && acc != this->Parent();
acc = static_cast<AccessibleWrap*>(acc->Parent())) {
auto uid = acc->IsDoc() && acc->AsDoc()->IPCDoc() ? 0
: reinterpret_cast<uint64_t>(acc->UniqueID());
auto uid = acc->IsDoc() && acc->AsDoc()->IPCDoc()
? 0
: reinterpret_cast<uint64_t>(acc->UniqueID());
nsAutoString name;
acc->Name(name);
nsAutoString textValue;
......@@ -215,23 +199,16 @@ DocAccessibleWrap::CacheFocusPath(AccessibleWrap* aAccessible)
nsCOMPtr<nsIPersistentProperties> props = acc->Attributes();
nsTArray<Attribute> attributes;
nsAccUtils::PersistentPropertiesToArray(props, &attributes);
cacheData.AppendElement(BatchData(acc->Document()->IPCDoc(),
uid,
acc->State(),
acc->Bounds(),
name,
textValue,
nodeID,
acc->CurValue(),
acc->MinValue(),
acc->MaxValue(),
acc->Step(),
attributes));
cacheData.AppendElement(
BatchData(acc->Document()->IPCDoc(), uid, acc->State(), acc->Bounds(),
name, textValue, nodeID, acc->CurValue(), acc->MinValue(),
acc->MaxValue(), acc->Step(), attributes));
mFocusPath.Put(acc->UniqueID(), acc);
}
ipcDoc->SendBatch(eBatch_FocusPath, cacheData);
} else if (SessionAccessibility* sessionAcc = SessionAccessibility::GetInstanceFor(this)) {
} else if (SessionAccessibility* sessionAcc =
SessionAccessibility::GetInstanceFor(this)) {
nsTArray<AccessibleWrap*> accessibles;
for (AccessibleWrap* acc = aAccessible; acc && acc != this->Parent();
acc = static_cast<AccessibleWrap*>(acc->Parent())) {
......@@ -242,9 +219,7 @@ DocAccessibleWrap::CacheFocusPath(AccessibleWrap* aAccessible)
}
}
void
DocAccessibleWrap::UpdateFocusPathBounds()
{
void DocAccessibleWrap::UpdateFocusPathBounds() {
if (!mFocusPath.Count()) {
return;
}
......@@ -254,27 +229,23 @@ DocAccessibleWrap::UpdateFocusPathBounds()
nsTArray<BatchData> boundsData(mFocusPath.Count());
for (auto iter = mFocusPath.Iter(); !iter.Done(); iter.Next()) {
Accessible* accessible = iter.Data();
auto uid = accessible->IsDoc() && accessible->AsDoc()->IPCDoc() ? 0
: reinterpret_cast<uint64_t>(accessible->UniqueID());
boundsData.AppendElement(BatchData(accessible->Document()->IPCDoc(),
uid,
0,
accessible->Bounds(),
nsString(),
nsString(),
nsString(),
UnspecifiedNaN<double>(),
UnspecifiedNaN<double>(),
UnspecifiedNaN<double>(),
UnspecifiedNaN<double>(),
nsTArray<Attribute>()));
auto uid = accessible->IsDoc() && accessible->AsDoc()->IPCDoc()
? 0
: reinterpret_cast<uint64_t>(accessible->UniqueID());
boundsData.AppendElement(BatchData(
accessible->Document()->IPCDoc(), uid, 0, accessible->Bounds(),
nsString(), nsString(), nsString(), UnspecifiedNaN<double>(),
UnspecifiedNaN<double>(), UnspecifiedNaN<double>(),
UnspecifiedNaN<double>(), nsTArray<Attribute>()));
}
ipcDoc->SendBatch(eBatch_BoundsUpdate, boundsData);
} else if (SessionAccessibility* sessionAcc = SessionAccessibility::GetInstanceFor(this)) {
} else if (SessionAccessibility* sessionAcc =
SessionAccessibility::GetInstanceFor(this)) {
nsTArray<AccessibleWrap*> accessibles(mFocusPath.Count());
for (auto iter = mFocusPath.Iter(); !iter.Done(); iter.Next()) {
accessibles.AppendElement(static_cast<AccessibleWrap*>(iter.Data().get()));
accessibles.AppendElement(
static_cast<AccessibleWrap*>(iter.Data().get()));
}
sessionAcc->UpdateCachedBounds(accessibles);
......
......@@ -12,9 +12,8 @@
namespace mozilla {
namespace a11y {
class DocAccessibleWrap : public DocAccessible
{
public:
class DocAccessibleWrap : public DocAccessible {
public:
DocAccessibleWrap(nsIDocument* aDocument, nsIPresShell* aPresShell);
virtual ~DocAccessibleWrap();
......@@ -23,8 +22,7 @@ public:
/**
* Manage the mapping from id to Accessible.
*/
void AddID(uint32_t aID, AccessibleWrap* aAcc)
{
void AddID(uint32_t aID, AccessibleWrap* aAcc) {
mIDToAccessibleMap.Put(aID, aAcc);
}
void RemoveID(uint32_t aID) { mIDToAccessibleMap.Remove(aID); }
......@@ -40,7 +38,7 @@ public:
eBatch_BoundsUpdate = 2,
};
protected:
protected:
/*
* This provides a mapping from 32 bit id to accessible objects.
*/
......@@ -48,7 +46,7 @@ protected:
virtual void DoInitialUpdate() override;
private:
private:
void CacheViewport();
void UpdateFocusPathBounds();
......@@ -60,7 +58,7 @@ private:
AccessibleHashtable mFocusPath;
};
} // namespace a11y
} // namespace mozilla
} // namespace a11y
} // namespace mozilla
#endif
......@@ -17,7 +17,7 @@ typedef class HTMLTableAccessible HTMLTableAccessibleWrap;
typedef class HTMLTableCellAccessible HTMLTableCellAccessibleWrap;
typedef class HTMLTableHeaderCellAccessible HTMLTableHeaderCellAccessibleWrap;
} // namespace a11y
} // namespace mozilla
} // namespace a11y
} // namespace mozilla
#endif
......@@ -13,7 +13,7 @@ namespace a11y {
typedef class HyperTextAccessible HyperTextAccessibleWrap;
} // namespace a11y
} // namespace mozilla
} // namespace a11y
} // namespace mozilla
#endif
......@@ -15,7 +15,7 @@ namespace a11y {
typedef class ImageAccessible ImageAccessibleWrap;
} // namespace a11y
} // namespace mozilla
} // namespace a11y
} // namespace mozilla
#endif
......@@ -15,19 +15,11 @@
using namespace mozilla;
using namespace mozilla::a11y;
void
a11y::PlatformInit()
{
}
void a11y::PlatformInit() {}
void
a11y::PlatformShutdown()
{
}
void a11y::PlatformShutdown() {}
void
a11y::ProxyCreated(ProxyAccessible* aProxy, uint32_t aInterfaces)
{
void a11y::ProxyCreated(ProxyAccessible* aProxy, uint32_t aInterfaces) {
AccessibleWrap* wrapper = nullptr;
if (aProxy->IsDoc()) {
wrapper = new DocProxyAccessibleWrap(aProxy->AsDoc());
......@@ -39,11 +31,9 @@ a11y::ProxyCreated(ProxyAccessible* aProxy, uint32_t aInterfaces)
aProxy->SetWrapper(reinterpret_cast<uintptr_t>(wrapper));
}
void
a11y::ProxyDestroyed(ProxyAccessible* aProxy)
{
void a11y::ProxyDestroyed(ProxyAccessible* aProxy) {
AccessibleWrap* wrapper =
reinterpret_cast<AccessibleWrap*>(aProxy->GetWrapper());
reinterpret_cast<AccessibleWrap*>(aProxy->GetWrapper());
// If aProxy is a document that was created, but
// RecvPDocAccessibleConstructor failed then aProxy->GetWrapper() will be
......@@ -57,11 +47,9 @@ a11y::ProxyDestroyed(ProxyAccessible* aProxy)
wrapper->Release();
}
void
a11y::ProxyEvent(ProxyAccessible* aTarget, uint32_t aEventType)
{
void a11y::ProxyEvent(ProxyAccessible* aTarget, uint32_t aEventType) {
SessionAccessibility* sessionAcc =
SessionAccessibility::GetInstanceFor(aTarget);
SessionAccessibility::GetInstanceFor(aTarget);
if (!sessionAcc) {
return;
}
......@@ -73,13 +61,10 @@ a11y::ProxyEvent(ProxyAccessible* aTarget, uint32_t aEventType)
}
}
void
a11y::ProxyStateChangeEvent(ProxyAccessible* aTarget,
uint64_t aState,
bool aEnabled)
{
void a11y::ProxyStateChangeEvent(ProxyAccessible* aTarget, uint64_t aState,
bool aEnabled) {
SessionAccessibility* sessionAcc =
SessionAccessibility::GetInstanceFor(aTarget);
SessionAccessibility::GetInstanceFor(aTarget);
if (!sessionAcc) {
return;
......@@ -98,70 +83,51 @@ a11y::ProxyStateChangeEvent(ProxyAccessible* aTarget,
}
}
void
a11y::ProxyCaretMoveEvent(ProxyAccessible* aTarget, int32_t aOffset)
{
void a11y::ProxyCaretMoveEvent(ProxyAccessible* aTarget, int32_t aOffset) {
SessionAccessibility* sessionAcc =
SessionAccessibility::GetInstanceFor(aTarget);
SessionAccessibility::GetInstanceFor(aTarget);
if (sessionAcc) {
sessionAcc->SendTextSelectionChangedEvent(WrapperFor(aTarget), aOffset);
}
}
void
a11y::ProxyTextChangeEvent(ProxyAccessible* aTarget,
const nsString& aStr,
int32_t aStart,
uint32_t aLen,
bool aIsInsert,
bool aFromUser)
{
void a11y::ProxyTextChangeEvent(ProxyAccessible* aTarget, const nsString& aStr,
int32_t aStart, uint32_t aLen, bool aIsInsert,
bool aFromUser) {
SessionAccessibility* sessionAcc =
SessionAccessibility::GetInstanceFor(aTarget);
SessionAccessibility::GetInstanceFor(aTarget);