зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1410482 - enable AOM for privileged content, r=smaug
This commit is contained in:
Родитель
4d05f461aa
Коммит
ee836366fc
|
@ -18,7 +18,21 @@ using namespace mozilla;
|
|||
using namespace mozilla::a11y;
|
||||
using namespace mozilla::dom;
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(AccessibleNode)
|
||||
bool
|
||||
AccessibleNode::IsAOMEnabled(JSContext* aCx, JSObject* /*unused*/)
|
||||
{
|
||||
static bool sPrefCached = false;
|
||||
static bool sPrefCacheValue = false;
|
||||
|
||||
if (!sPrefCached) {
|
||||
sPrefCached = true;
|
||||
Preferences::AddBoolVarCache(&sPrefCacheValue, "accessibility.AOM.enabled");
|
||||
}
|
||||
|
||||
return nsContentUtils::IsSystemCaller(aCx) || sPrefCacheValue;
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(AccessibleNode, mIntl, mDOMNode, mStates)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(AccessibleNode)
|
||||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
||||
|
|
|
@ -47,7 +47,7 @@ public:
|
|||
JS::MutableHandle<JS::Value> aValue,
|
||||
ErrorResult& aRv);
|
||||
|
||||
a11y::Accessible* Internal() const { return mIntl; }
|
||||
static bool IsAOMEnabled(JSContext*, JSObject*);
|
||||
|
||||
protected:
|
||||
AccessibleNode(const AccessibleNode& aCopy) = delete;
|
||||
|
|
|
@ -405,8 +405,9 @@ NS_IMETHODIMP
|
|||
nsAccessibilityService::Observe(nsISupports *aSubject, const char *aTopic,
|
||||
const char16_t *aData)
|
||||
{
|
||||
if (!nsCRT::strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID))
|
||||
if (!nsCRT::strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
|
||||
Shutdown();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
[Pref="accessibility.AOM.enabled"]
|
||||
[Func="mozilla::dom::AccessibleNode::IsAOMEnabled"]
|
||||
interface AccessibleNode {
|
||||
readonly attribute DOMString role;
|
||||
[Frozen, Cached, Pure]
|
||||
|
|
|
@ -208,7 +208,7 @@ interface Node : EventTarget {
|
|||
Promise<void> localize(L10nCallback l10nCallback);
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
[Pref="accessibility.AOM.enabled"]
|
||||
[Func="mozilla::dom::AccessibleNode::IsAOMEnabled"]
|
||||
readonly attribute AccessibleNode? accessibleNode;
|
||||
#endif
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче