#include "config.h"
#include "core/accessibility/AXScrollView.h"
-#include "core/accessibility/AXObjectCache.h"
+#include "core/accessibility/AXObjectCacheImpl.h"
#include "core/accessibility/AXScrollbar.h"
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
namespace blink {
-AXScrollView::AXScrollView(ScrollView* view)
+AXScrollView::AXScrollView(FrameView* view)
: m_scrollView(view)
, m_childrenDirty(false)
{
m_scrollView = 0;
}
-PassRefPtr<AXScrollView> AXScrollView::create(ScrollView* view)
+PassRefPtr<AXScrollView> AXScrollView::create(FrameView* view)
{
return adoptRef(new AXScrollView(view));
}
}
// If this is WebKit1 then the native scroll view needs to return the
-// AX information (because there are no scroll bar children in the ScrollView object in WK1).
-// In WebKit2, the ScrollView object will return the AX information (because there are no platform widgets).
+// AX information (because there are no scroll bar children in the FrameView object in WK1).
+// In WebKit2, the FrameView object will return the AX information (because there are no platform widgets).
bool AXScrollView::isAttachment() const
{
return false;
bool AXScrollView::computeAccessibilityIsIgnored() const
{
+ // We just want to match whatever's returned by our web area, which is a child of this
+ // object. Normally cached attribute values may only search up the tree. We can't just
+ // call accessibilityIsIgnored on the web area, because the web area may search up its
+ // ancestors and call this function recursively, and we'd loop until a stack overflow.
+
+ // Instead, we first update the cached accessibilityIsIgnored value for this node to
+ // false, call accessibilityIsIgnored on the web area, then return the mathcing value.
+ m_cachedIsIgnored = false;
+ m_lastModificationCount = axObjectCache()->modificationCount();
+
AXObject* webArea = webAreaObject();
- if (!webArea)
- return true;
+ if (webArea)
+ return webArea->accessibilityIsIgnored();
- return webArea->accessibilityIsIgnored();
+ return true;
}
void AXScrollView::addChildren()
if (!m_scrollView || !m_scrollView->isFrameView())
return 0;
- Document* doc = toFrameView(m_scrollView)->frame().document();
+ Document* doc = m_scrollView->frame().document();
if (!doc || !doc->renderView())
return 0;
if (!m_scrollView || !m_scrollView->isFrameView())
return 0;
- return toFrameView(m_scrollView);
+ return m_scrollView;
}
-AXObject* AXScrollView::parentObject() const
+AXObject* AXScrollView::computeParent() const
{
if (!m_scrollView || !m_scrollView->isFrameView())
return 0;
// FIXME: Broken for OOPI.
- HTMLFrameOwnerElement* owner = toFrameView(m_scrollView)->frame().deprecatedLocalOwner();
+ HTMLFrameOwnerElement* owner = m_scrollView->frame().deprecatedLocalOwner();
if (owner && owner->renderer())
return axObjectCache()->getOrCreate(owner);
- return axObjectCache()->getOrCreate(toFrameView(m_scrollView)->frame().pagePopupOwner());
+ return axObjectCache()->getOrCreate(m_scrollView->frame().pagePopupOwner());
}
-AXObject* AXScrollView::parentObjectIfExists() const
+AXObject* AXScrollView::computeParentIfExists() const
{
if (!m_scrollView || !m_scrollView->isFrameView())
return 0;
- HTMLFrameOwnerElement* owner = toFrameView(m_scrollView)->frame().deprecatedLocalOwner();
+ HTMLFrameOwnerElement* owner = m_scrollView->frame().deprecatedLocalOwner();
if (owner && owner->renderer())
return axObjectCache()->get(owner);
- return axObjectCache()->get(toFrameView(m_scrollView)->frame().pagePopupOwner());
+ return axObjectCache()->get(m_scrollView->frame().pagePopupOwner());
}
ScrollableArea* AXScrollView::getScrollableAreaIfScrollable() const