X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2FWebKit%2FSource%2Fcore%2Faccessibility%2FAXScrollView.cpp;h=9c4c4165e1bdedd4af05aff051f558ad243d5bd0;hb=1afa4dd80ef85af7c90efaea6959db1d92330844;hp=392ac4b1953caccd4159950726671fb12ae10861;hpb=90762837333c13ccf56f2ad88e4481fc71e8d281;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/WebKit/Source/core/accessibility/AXScrollView.cpp b/src/third_party/WebKit/Source/core/accessibility/AXScrollView.cpp index 392ac4b..9c4c416 100644 --- a/src/third_party/WebKit/Source/core/accessibility/AXScrollView.cpp +++ b/src/third_party/WebKit/Source/core/accessibility/AXScrollView.cpp @@ -26,7 +26,7 @@ #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" @@ -34,7 +34,7 @@ namespace blink { -AXScrollView::AXScrollView(ScrollView* view) +AXScrollView::AXScrollView(FrameView* view) : m_scrollView(view) , m_childrenDirty(false) { @@ -51,7 +51,7 @@ void AXScrollView::detach() m_scrollView = 0; } -PassRefPtr AXScrollView::create(ScrollView* view) +PassRefPtr AXScrollView::create(FrameView* view) { return adoptRef(new AXScrollView(view)); } @@ -71,8 +71,8 @@ AXObject* AXScrollView::scrollBar(AccessibilityOrientation orientation) } // 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; @@ -143,11 +143,21 @@ void AXScrollView::clearChildren() 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() @@ -167,7 +177,7 @@ AXObject* AXScrollView::webAreaObject() const 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; @@ -201,32 +211,32 @@ FrameView* AXScrollView::documentFrameView() const 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