Commit 39e56eff authored by jhoneycutt@apple.com's avatar jhoneycutt@apple.com

Remove the workaround added in r47316.

Reviewed by Sam Weinig.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::AXObjectCache):

* accessibility/AXObjectCache.h:
Remove the Document argument to the AXObjectCache constructor and the
m_document member variable, and replace the no-parameter
handleFocusedUIElementChanged() with the two-parameter GTK function.
(WebCore::AXObjectCache::handleFocusedUIElementChanged):

* accessibility/chromium/AXObjectCacheChromium.cpp:
(WebCore::AXObjectCache::handleFocusedUIElementChanged):

* accessibility/gtk/AXObjectCacheAtk.cpp:
(WebCore::AXObjectCache::handleFocusedUIElementChanged):

* accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
(fallbackObject):
Don't pass a null Document when constructing the AXObjectCache.

* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::handleFocusedUIElementChanged):

* accessibility/win/AXObjectCacheWin.cpp:
(WebCore::AXObjectCache::handleFocusedUIElementChanged):
Get the document from the RenderObject; m_document was removed.

* dom/Document.cpp:
(WebCore::Document::axObjectCache):
Don't pass the Document when constructing the AXObjectCache.
(WebCore::Document::setFocusedNode):
Pass the old and new focused RenderObjects when calling
handleFocusedUIElementChanged().

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@47946 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent cbbe3564
2009-08-31 Jon Honeycutt <jhoneycutt@apple.com>
Remove the workaround added in r47316.
Reviewed by Sam Weinig.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::AXObjectCache):
* accessibility/AXObjectCache.h:
Remove the Document argument to the AXObjectCache constructor and the
m_document member variable, and replace the no-parameter
handleFocusedUIElementChanged() with the two-parameter GTK function.
(WebCore::AXObjectCache::handleFocusedUIElementChanged):
* accessibility/chromium/AXObjectCacheChromium.cpp:
(WebCore::AXObjectCache::handleFocusedUIElementChanged):
* accessibility/gtk/AXObjectCacheAtk.cpp:
(WebCore::AXObjectCache::handleFocusedUIElementChanged):
* accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
(fallbackObject):
Don't pass a null Document when constructing the AXObjectCache.
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::handleFocusedUIElementChanged):
* accessibility/win/AXObjectCacheWin.cpp:
(WebCore::AXObjectCache::handleFocusedUIElementChanged):
Get the document from the RenderObject; m_document was removed.
* dom/Document.cpp:
(WebCore::Document::axObjectCache):
Don't pass the Document when constructing the AXObjectCache.
(WebCore::Document::setFocusedNode):
Pass the old and new focused RenderObjects when calling
handleFocusedUIElementChanged().
2009-09-01 Yury Semikhatsky <yurys@chromium.org>
Reviewed by Timothy Hatcher.
......@@ -64,9 +64,8 @@ using namespace HTMLNames;
bool AXObjectCache::gAccessibilityEnabled = false;
bool AXObjectCache::gAccessibilityEnhancedUserInterfaceEnabled = false;
AXObjectCache::AXObjectCache(const Document* document)
AXObjectCache::AXObjectCache()
: m_notificationPostTimer(this, &AXObjectCache::notificationPostTimerFired)
, m_document(document)
{
}
......
......@@ -42,7 +42,6 @@ class WebCoreTextMarker;
namespace WebCore {
class Document;
class Node;
class Page;
class RenderObject;
......@@ -58,7 +57,7 @@ namespace WebCore {
class AXObjectCache {
public:
AXObjectCache(const Document*);
AXObjectCache();
~AXObjectCache();
static AccessibilityObject* focusedUIElementForPage(const Page*);
......@@ -83,10 +82,7 @@ namespace WebCore {
void selectedChildrenChanged(RenderObject*);
void handleActiveDescendantChanged(RenderObject*);
void handleAriaRoleChanged(RenderObject*);
void handleFocusedUIElementChanged();
#if PLATFORM(GTK)
void handleFocusedUIElementChangedWithRenderers(RenderObject*, RenderObject*);
#endif
void handleFocusedUIElementChanged(RenderObject* oldFocusedRenderer, RenderObject* newFocusedRenderer);
static void enableAccessibility() { gAccessibilityEnabled = true; }
static void enableEnhancedUserInterfaceAccessibility() { gAccessibilityEnhancedUserInterfaceEnabled = true; }
......@@ -116,22 +112,17 @@ namespace WebCore {
AXID getAXID(AccessibilityObject*);
bool nodeIsAriaType(Node* node, String role);
const Document* m_document;
};
#if !HAVE(ACCESSIBILITY)
inline void AXObjectCache::handleActiveDescendantChanged(RenderObject*) { }
inline void AXObjectCache::handleAriaRoleChanged(RenderObject*) { }
inline void AXObjectCache::handleFocusedUIElementChanged() { }
inline void AXObjectCache::detachWrapper(AccessibilityObject*) { }
inline void AXObjectCache::attachWrapper(AccessibilityObject*) { }
inline void AXObjectCache::selectedChildrenChanged(RenderObject*) { }
inline void AXObjectCache::postNotification(RenderObject*, const String&, bool postToElement) { }
inline void AXObjectCache::postPlatformNotification(AccessibilityObject*, const String&) { }
#if PLATFORM(GTK)
inline void AXObjectCache::handleFocusedUIElementChangedWithRenderers(RenderObject*, RenderObject*) { }
#endif
inline void AXObjectCache::handleFocusedUIElementChanged(RenderObject*, RenderObject*) { }
#endif
}
......
......@@ -47,7 +47,7 @@ void AXObjectCache::postPlatformNotification(AccessibilityObject*, const String&
{
}
void AXObjectCache::handleFocusedUIElementChanged()
void AXObjectCache::handleFocusedUIElementChanged(RenderObject*, RenderObject*)
{
}
......
......@@ -45,12 +45,8 @@ void AXObjectCache::postPlatformNotification(AccessibilityObject* coreObject, co
g_signal_emit_by_name(coreObject->wrapper(), "state-change", "checked", coreObject->isChecked());
}
}
void AXObjectCache::handleFocusedUIElementChanged()
{
}
void AXObjectCache::handleFocusedUIElementChangedWithRenderers(RenderObject* oldFocusedRender, RenderObject* newFocusedRender)
void AXObjectCache::handleFocusedUIElementChanged(RenderObject* oldFocusedRender, RenderObject* newFocusedRender)
{
RefPtr<AccessibilityObject> oldObject = getOrCreate(oldFocusedRender);
if (oldObject) {
......
......@@ -60,7 +60,7 @@ using namespace WebCore;
static AccessibilityObject* fallbackObject()
{
static AXObjectCache* fallbackCache = new AXObjectCache(0);
static AXObjectCache* fallbackCache = new AXObjectCache;
static AccessibilityObject* object = 0;
if (!object) {
// FIXME: using fallbackCache->getOrCreate(ListBoxOptionRole) is a hack
......
......@@ -59,7 +59,7 @@ void AXObjectCache::postPlatformNotification(AccessibilityObject* obj, const Str
NSAccessibilityPostNotification(obj->wrapper(), message);
}
void AXObjectCache::handleFocusedUIElementChanged()
void AXObjectCache::handleFocusedUIElementChanged(RenderObject*, RenderObject*)
{
[[WebCoreViewFactory sharedFactory] accessibilityHandleFocusChanged];
}
......
......@@ -30,6 +30,7 @@
#include "AccessibilityObject.h"
#include "Document.h"
#include "Page.h"
#include "RenderObject.h"
using namespace std;
......@@ -73,9 +74,12 @@ AXID AXObjectCache::platformGenerateAXID() const
return objID;
}
void AXObjectCache::handleFocusedUIElementChanged()
void AXObjectCache::handleFocusedUIElementChanged(RenderObject*, RenderObject* newFocusedRenderer)
{
Page* page = m_document->page();
if (!newFocusedRenderer)
return;
Page* page = newFocusedRenderer->document()->page();
if (!page || !page->chrome()->platformWindow())
return;
......
......@@ -1469,7 +1469,7 @@ AXObjectCache* Document::axObjectCache() const
return doc->axObjectCache();
// this is the top-level document, so install a new cache
m_axObjectCache = new AXObjectCache(this);
m_axObjectCache = new AXObjectCache;
return m_axObjectCache;
}
......@@ -2625,10 +2625,7 @@ bool Document::setFocusedNode(PassRefPtr<Node> newFocusedNode)
}
}
#if (PLATFORM(MAC) || PLATFORM(WIN)) && !PLATFORM(CHROMIUM)
if (!focusChangeBlocked && m_focusedNode && AXObjectCache::accessibilityEnabled())
axObjectCache()->handleFocusedUIElementChanged();
#elif PLATFORM(GTK)
#if ((PLATFORM(MAC) || PLATFORM(WIN)) && !PLATFORM(CHROMIUM)) || PLATFORM(GTK)
if (!focusChangeBlocked && m_focusedNode && AXObjectCache::accessibilityEnabled()) {
RenderObject* oldFocusedRenderer = 0;
RenderObject* newFocusedRenderer = 0;
......@@ -2638,7 +2635,7 @@ bool Document::setFocusedNode(PassRefPtr<Node> newFocusedNode)
if (newFocusedNode)
newFocusedRenderer = newFocusedNode->renderer();
axObjectCache()->handleFocusedUIElementChangedWithRenderers(oldFocusedRenderer, newFocusedRenderer);
axObjectCache()->handleFocusedUIElementChanged(oldFocusedRenderer, newFocusedRenderer);
}
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment