AX: children() method should be consolidated in AccessibilityObject
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Oct 2011 17:01:41 +0000 (17:01 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Oct 2011 17:01:41 +0000 (17:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=70243

Code cleanup, no new tests.

Reviewed by Darin Adler.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::children):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::updateChildrenIfNecessary):
* accessibility/AccessibilityRenderObject.h:
* accessibility/AccessibilityScrollView.cpp:
(WebCore::AccessibilityScrollView::updateChildrenIfNecessary):
(WebCore::AccessibilityScrollView::updateScrollbars):
(WebCore::AccessibilityScrollView::addChildren):
* accessibility/AccessibilityScrollView.h:
* accessibility/AccessibilitySlider.cpp:
* accessibility/AccessibilitySlider.h:
* accessibility/AccessibilityTableColumn.cpp:
* accessibility/AccessibilityTableColumn.h:
* accessibility/AccessibilityTableHeaderContainer.cpp:
* accessibility/AccessibilityTableHeaderContainer.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97629 268f45cc-cd09-0410-ab3c-d52691b4dbfc

13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/accessibility/AccessibilityRenderObject.h
Source/WebCore/accessibility/AccessibilityScrollView.cpp
Source/WebCore/accessibility/AccessibilityScrollView.h
Source/WebCore/accessibility/AccessibilitySlider.cpp
Source/WebCore/accessibility/AccessibilitySlider.h
Source/WebCore/accessibility/AccessibilityTableColumn.cpp
Source/WebCore/accessibility/AccessibilityTableColumn.h
Source/WebCore/accessibility/AccessibilityTableHeaderContainer.cpp
Source/WebCore/accessibility/AccessibilityTableHeaderContainer.h

index fbd35e1..6156511 100644 (file)
@@ -1,3 +1,30 @@
+2011-10-17  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: children() method should be consolidated in AccessibilityObject
+        https://bugs.webkit.org/show_bug.cgi?id=70243
+
+        Code cleanup, no new tests.
+
+        Reviewed by Darin Adler.
+
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::children):
+        * accessibility/AccessibilityObject.h:
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::updateChildrenIfNecessary):
+        * accessibility/AccessibilityRenderObject.h:
+        * accessibility/AccessibilityScrollView.cpp:
+        (WebCore::AccessibilityScrollView::updateChildrenIfNecessary):
+        (WebCore::AccessibilityScrollView::updateScrollbars):
+        (WebCore::AccessibilityScrollView::addChildren):
+        * accessibility/AccessibilityScrollView.h:
+        * accessibility/AccessibilitySlider.cpp:
+        * accessibility/AccessibilitySlider.h:
+        * accessibility/AccessibilityTableColumn.cpp:
+        * accessibility/AccessibilityTableColumn.h:
+        * accessibility/AccessibilityTableHeaderContainer.cpp:
+        * accessibility/AccessibilityTableHeaderContainer.h:
+
 2011-10-17  Vsevolod Vlasov  <vsevik@chromium.org>
 
         Web Inspector: Search matches highlighting in text does not work correctly.
index 7d71f6a..8e26fcb 100644 (file)
@@ -1011,6 +1011,13 @@ FrameView* AccessibilityObject::documentFrameView() const
 
     return object->documentFrameView();
 }
+
+const AccessibilityObject::AccessibilityChildrenVector& AccessibilityObject::children()
+{
+    updateChildrenIfNecessary();
+    
+    return m_children;
+}
     
 void AccessibilityObject::updateChildrenIfNecessary()
 {
index f337b9e..ecccffb 100644 (file)
@@ -552,7 +552,7 @@ public:
 
     virtual void childrenChanged() { }
     virtual void contentChanged() { }
-    virtual const AccessibilityChildrenVector& children() { return m_children; }
+    const AccessibilityChildrenVector& children();
     virtual void addChildren() { }
     virtual bool canHaveChildren() const { return true; }
     virtual bool hasChildren() const { return m_haveChildren; }
index 1a99f44..5600a22 100644 (file)
@@ -3473,13 +3473,6 @@ void AccessibilityRenderObject::updateChildrenIfNecessary()
     
     AccessibilityObject::updateChildrenIfNecessary();
 }
-    
-const AccessibilityObject::AccessibilityChildrenVector& AccessibilityRenderObject::children()
-{
-    updateChildrenIfNecessary();
-    
-    return m_children;
-}
 
 void AccessibilityRenderObject::addChildren()
 {
index 45e02f6..0d147f1 100644 (file)
@@ -201,7 +201,6 @@ public:
     virtual FrameView* documentFrameView() const;
     virtual unsigned hierarchicalLevel() const;
 
-    virtual const AccessibilityChildrenVector& children();
     virtual void clearChildren();
     virtual void updateChildrenIfNecessary();
     
index e12031d..8698c60 100644 (file)
@@ -59,13 +59,6 @@ AccessibilityObject* AccessibilityScrollView::scrollBar(AccessibilityOrientation
     return 0;
 }
 
-const AccessibilityObject::AccessibilityChildrenVector& AccessibilityScrollView::children()
-{
-    if (!m_haveChildren)
-        addChildren();
-    return m_children;
-}
-
 // 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).
@@ -81,6 +74,14 @@ Widget* AccessibilityScrollView::widgetForAttachmentView() const
     
 void AccessibilityScrollView::updateChildrenIfNecessary()
 {
+    if (!m_haveChildren)
+        addChildren();
+    
+    updateScrollbars();
+}
+
+void AccessibilityScrollView::updateScrollbars()
+{
     if (m_scrollView->horizontalScrollbar() && !m_horizontalScrollbar)
         m_horizontalScrollbar = addChildScrollbar(m_scrollView->horizontalScrollbar());
     else if (!m_scrollView->horizontalScrollbar() && m_horizontalScrollbar) {
@@ -125,7 +126,7 @@ void AccessibilityScrollView::addChildren()
     if (webArea)
         m_children.append(webArea);
     
-    updateChildrenIfNecessary();
+    updateScrollbars();
 }
 
 AccessibilityObject* AccessibilityScrollView::webAreaObject() const
index a5b067f..9083687 100644 (file)
@@ -53,8 +53,8 @@ private:
     virtual AccessibilityObject* scrollBar(AccessibilityOrientation) const;
     virtual void addChildren();
     virtual AccessibilityObject* accessibilityHitTest(const LayoutPoint&) const;
-    virtual const AccessibilityChildrenVector& children();
     virtual void updateChildrenIfNecessary();
+    void updateScrollbars();
     
     virtual FrameView* documentFrameView() const;
     virtual LayoutRect elementRect() const;
index 1bddecc..8bdb35c 100644 (file)
@@ -50,13 +50,6 @@ PassRefPtr<AccessibilitySlider> AccessibilitySlider::create(RenderObject* render
     return adoptRef(new AccessibilitySlider(renderer));
 }
 
-const AccessibilityObject::AccessibilityChildrenVector& AccessibilitySlider::children()
-{
-    if (!m_haveChildren)
-        addChildren();
-    return m_children;
-}
-
 AccessibilityOrientation AccessibilitySlider::orientation() const
 {
     // Default to horizontal in the unknown case.
index fbd27ca..69ff3bf 100644 (file)
@@ -54,7 +54,6 @@ private:
     virtual bool isSlider() const { return true; }
     virtual bool isInputSlider() const { return true; }
     
-    virtual const AccessibilityChildrenVector& children();
     virtual void addChildren();
     
     virtual bool canSetValueAttribute() const { return true; }
index 4a1e83a..581cda5 100644 (file)
@@ -72,14 +72,7 @@ LayoutSize AccessibilityTableColumn::size() const
 {
     return elementRect().size();
 }
-  
-const AccessibilityObject::AccessibilityChildrenVector& AccessibilityTableColumn::children()
-{
-    if (!m_haveChildren)
-        addChildren();
-    return m_children;
-}
-    
 AccessibilityObject* AccessibilityTableColumn::headerObject()
 {
     if (!m_parent)
index 5c60396..a914657 100644 (file)
@@ -54,7 +54,6 @@ public:
     void setColumnIndex(int columnIndex) { m_columnIndex = columnIndex; }
     int columnIndex() const { return m_columnIndex; }    
     
-    virtual const AccessibilityChildrenVector& children();
     virtual void addChildren();
     virtual void setParent(AccessibilityObject*);
     
index 7c3c5e2..ff959cd 100644 (file)
@@ -49,13 +49,6 @@ PassRefPtr<AccessibilityTableHeaderContainer> AccessibilityTableHeaderContainer:
     return adoptRef(new AccessibilityTableHeaderContainer());
 }
     
-const AccessibilityObject::AccessibilityChildrenVector& AccessibilityTableHeaderContainer::children()
-{
-    if (!m_haveChildren)
-        addChildren();
-    return m_children;
-}
-
 LayoutRect AccessibilityTableHeaderContainer::elementRect() const
 {
     // this will be filled in when addChildren is called
index 7babe68..3cffd28 100644 (file)
@@ -45,7 +45,6 @@ public:
     
     virtual AccessibilityRole roleValue() const { return TableHeaderContainerRole; }
     
-    virtual const AccessibilityChildrenVector& children();
     virtual void addChildren();
     
     virtual LayoutSize size() const;