mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-05 05:30:29 +00:00
6896a2d0f4
We need to implement things like https://developer.gnome.org/atk/unstable/AtkObject.html#atk-object-ref-state-set and the same basic thing on windows. That API is fundamentally sync, but the information necessary to implement it is only available in the child process. That seems to leave us with two options, either we can use sync ipc or we can use async ipc but spin a nested event loop. If we were to spin nested event loops we'd have to be careful to make sure a11y didn't do anything until the nested event loop was done, and then a11y would have to deal with whatever changed. I'm not sure that will work, and since the system is probably waiting for the accessibility information anyway I don't think we get much out of spinning the event loop. So I think its somewhat less bad to use sync ipc here.
52 lines
1.1 KiB
C++
52 lines
1.1 KiB
C++
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* vim: set ts=2 et sw=2 tw=80: */
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#include "ProxyAccessible.h"
|
|
#include "DocAccessibleParent.h"
|
|
#include "mozilla/unused.h"
|
|
#include "mozilla/a11y/Platform.h"
|
|
|
|
namespace mozilla {
|
|
namespace a11y {
|
|
|
|
void
|
|
ProxyAccessible::Shutdown()
|
|
{
|
|
MOZ_ASSERT(!mOuterDoc);
|
|
|
|
uint32_t childCount = mChildren.Length();
|
|
for (uint32_t idx = 0; idx < childCount; idx++)
|
|
mChildren[idx]->Shutdown();
|
|
|
|
mChildren.Clear();
|
|
ProxyDestroyed(this);
|
|
mDoc->RemoveAccessible(this);
|
|
}
|
|
|
|
void
|
|
ProxyAccessible::SetChildDoc(DocAccessibleParent* aParent)
|
|
{
|
|
if (aParent) {
|
|
MOZ_ASSERT(mChildren.IsEmpty());
|
|
mChildren.AppendElement(aParent);
|
|
mOuterDoc = true;
|
|
} else {
|
|
MOZ_ASSERT(mChildren.Length() == 1);
|
|
mChildren.Clear();
|
|
mOuterDoc = false;
|
|
}
|
|
}
|
|
|
|
uint64_t
|
|
ProxyAccessible::State() const
|
|
{
|
|
uint64_t state = 0;
|
|
unused << mDoc->SendState(mID, &state);
|
|
return state;
|
|
}
|
|
}
|
|
}
|