#include "core/accessibility/AXTableRow.h"
#include "core/dom/Document.h"
#include "core/frame/LocalFrame.h"
+#include "core/frame/Settings.h"
#include "core/html/HTMLAreaElement.h"
#include "core/html/HTMLImageElement.h"
#include "core/html/HTMLInputElement.h"
m_idMapping.clear();
}
-bool AXObjectCache::gAccessibilityEnabled = false;
-bool AXObjectCache::gInlineTextBoxAccessibility = false;
-
AXObjectCache::AXObjectCache(Document& document)
: m_document(document)
, m_notificationPostTimer(this, &AXObjectCache::notificationPostTimerFired)
AXObject* AXObjectCache::focusedUIElementForPage(const Page* page)
{
- if (!gAccessibilityEnabled)
+ if (!page->settings().accessibilityEnabled())
return 0;
// Cross-process accessibility is not yet implemented.
AXObject* AXObjectCache::rootObject()
{
- if (!gAccessibilityEnabled)
+ if (!accessibilityEnabled())
return 0;
return getOrCreate(m_document.view());
else if (attrName == forAttr && isHTMLLabelElement(*element))
labelChanged(element);
- if (!attrName.localName().string().startsWith("aria-"))
+ if (!attrName.localName().startsWith("aria-"))
return;
if (attrName == aria_activedescendantAttr)
void AXObjectCache::inlineTextBoxesUpdated(RenderObject* renderer)
{
- if (!gInlineTextBoxAccessibility)
+ if (!inlineTextBoxAccessibilityEnabled())
return;
// Only update if the accessibility object already exists and it's
}
}
+Settings* AXObjectCache::settings()
+{
+ return m_document.settings();
+}
+
+bool AXObjectCache::accessibilityEnabled()
+{
+ Settings* settings = this->settings();
+ if (!settings)
+ return false;
+ return settings->accessibilityEnabled();
+}
+
+bool AXObjectCache::inlineTextBoxAccessibilityEnabled()
+{
+ Settings* settings = this->settings();
+ if (!settings)
+ return false;
+ return settings->inlineTextBoxAccessibilityEnabled();
+}
+
const Element* AXObjectCache::rootAXEditableElement(const Node* node)
{
const Element* result = node->rootEditableElement();