Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Unified Diff: third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp

Issue 1564863002: Get rid of AXScrollView and AXScrollbar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dump_oopif_3
Patch Set: Fix Android expectation Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp b/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp
index a6133eeed256e60ebb9c7355d8d448deebcd576e..314bcaa6d1c0290441f3137f5c37d3356bc3b655 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp
@@ -66,8 +66,6 @@
#include "modules/accessibility/AXMenuListPopup.h"
#include "modules/accessibility/AXProgressIndicator.h"
#include "modules/accessibility/AXSVGRoot.h"
-#include "modules/accessibility/AXScrollView.h"
-#include "modules/accessibility/AXScrollbar.h"
#include "modules/accessibility/AXSlider.h"
#include "modules/accessibility/AXSpinButton.h"
#include "modules/accessibility/AXTable.h"
@@ -185,19 +183,6 @@ AXObject* AXObjectCacheImpl::focusedUIElementForPage(const Page* page)
return obj;
}
-AXObject* AXObjectCacheImpl::get(Widget* widget)
-{
- if (!widget)
- return 0;
-
- AXID axID = m_widgetObjectMapping.get(widget);
- ASSERT(!HashTraits<AXID>::isDeletedValue(axID));
- if (!axID)
- return 0;
-
- return m_objects.get(axID);
-}
-
AXObject* AXObjectCacheImpl::get(LayoutObject* layoutObject)
{
if (!layoutObject)
@@ -352,44 +337,6 @@ AXObject* AXObjectCacheImpl::createFromInlineTextBox(AbstractInlineTextBox* inli
return AXInlineTextBox::create(inlineTextBox, *this);
}
-AXObject* AXObjectCacheImpl::getOrCreate(Widget* widget)
-{
- if (!widget)
- return 0;
-
- if (AXObject* obj = get(widget))
- return obj;
-
- AXObject* newObj = nullptr;
- if (widget->isFrameView()) {
- FrameView* frameView = toFrameView(widget);
-
- // Don't create an AXScrollView for a FrameView that isn't attached to a frame,
- // for example if it's in the process of being disposed.
- if (frameView->frame().view() != frameView || !frameView->layoutView())
- return 0;
-
- newObj = AXScrollView::create(toFrameView(widget), *this);
- } else if (widget->isScrollbar()) {
- newObj = AXScrollbar::create(toScrollbar(widget), *this);
- }
-
- // Will crash later if we have two objects for the same widget.
- ASSERT(!get(widget));
-
- // Catch the case if an (unsupported) widget type is used. Only FrameView and ScrollBar are supported now.
- ASSERT(newObj);
- if (!newObj)
- return 0;
-
- getAXID(newObj);
-
- m_widgetObjectMapping.set(widget, newObj->axObjectID());
- m_objects.set(newObj->axObjectID(), newObj);
- newObj->init();
- return newObj;
-}
-
AXObject* AXObjectCacheImpl::getOrCreate(Node* node)
{
if (!node)
@@ -478,7 +425,7 @@ AXObject* AXObjectCacheImpl::rootObject()
if (!accessibilityEnabled())
return 0;
- return getOrCreate(m_document->view());
+ return getOrCreate(m_document);
}
AXObject* AXObjectCacheImpl::getOrCreate(AccessibilityRole role)
@@ -565,16 +512,6 @@ void AXObjectCacheImpl::remove(Node* node)
}
}
-void AXObjectCacheImpl::remove(Widget* view)
-{
- if (!view)
- return;
-
- AXID axID = m_widgetObjectMapping.get(view);
- remove(axID);
- m_widgetObjectMapping.remove(view);
-}
-
void AXObjectCacheImpl::remove(AbstractInlineTextBox* inlineTextBox)
{
if (!inlineTextBox)
@@ -971,18 +908,6 @@ void AXObjectCacheImpl::listboxActiveIndexChanged(HTMLSelectElement* select)
toAXListBox(obj)->activeIndexChanged();
}
-void AXObjectCacheImpl::handleScrollbarUpdate(FrameView* view)
-{
- if (!view)
- return;
-
- // We don't want to create a scroll view from this method, only update an existing one.
- if (AXObject* scrollViewObject = get(view)) {
- m_modificationCount++;
- scrollViewObject->updateChildrenIfNecessary();
- }
-}
-
void AXObjectCacheImpl::handleLayoutComplete(LayoutObject* layoutObject)
{
if (!layoutObject)
@@ -1164,17 +1089,6 @@ bool isNodeAriaVisible(Node* node)
void AXObjectCacheImpl::postPlatformNotification(AXObject* obj, AXNotification notification)
{
- if (obj && obj->isAXScrollbar() && notification == AXValueChanged) {
- // Send document value changed on scrollbar value changed notification.
- Scrollbar* scrollBar = toAXScrollbar(obj)->scrollbar();
- if (!scrollBar || !scrollBar->parent() || !scrollBar->parent()->isFrameView())
- return;
- Document* document = toFrameView(scrollBar->parent())->frame().document();
- if (document != document->topDocument())
- return;
- obj = get(document->layoutView());
- }
-
if (!obj || !obj->document() || !obj->documentFrameView() || !obj->documentFrameView()->frame().page())
return;
@@ -1279,10 +1193,7 @@ void AXObjectCacheImpl::handleScrolledToAnchor(const Node* anchorNode)
void AXObjectCacheImpl::handleScrollPositionChanged(FrameView* frameView)
{
- // Prefer to fire the scroll position changed event on the frame view's child web area, if possible.
- AXObject* targetAXObject = getOrCreate(frameView);
- if (targetAXObject && !targetAXObject->children().isEmpty())
- targetAXObject = targetAXObject->children()[0].get();
+ AXObject* targetAXObject = getOrCreate(frameView->frame().document());
postPlatformNotification(targetAXObject, AXScrollPositionChanged);
}
@@ -1328,7 +1239,6 @@ DEFINE_TRACE(AXObjectCacheImpl)
{
#if ENABLE(OILPAN)
visitor->trace(m_document);
- visitor->trace(m_widgetObjectMapping);
visitor->trace(m_nodeObjectMapping);
#endif

Powered by Google App Engine
This is Rietveld 408576698