AX: aria-hidden on container does not hide descendant popup buttons
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 16 Mar 2013 08:51:52 +0000 (08:51 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 16 Mar 2013 08:51:52 +0000 (08:51 +0000)
https://bugs.webkit.org/show_bug.cgi?id=112373

Reviewed by Ryosuke Niwa.

Source/WebCore:

There are a number of subclass AX objects that implement accessibilityIsIgnored()
to always return false. This means that even if their parent is aria-hidden=true
they still show up in the tree.

This re-organizes this base case of aria-hidden into AccessibilityObject so that
it can be re-used by these special subclasses where appropriate.

Test: accessibility/aria-hidden-hides-all-elements.html

* accessibility/AccessibilityImageMapLink.h:
(WebCore::AccessibilityImageMapLink::isImageMapLink):
* accessibility/AccessibilityList.cpp:
(WebCore::AccessibilityList::computeAccessibilityIsIgnored):
* accessibility/AccessibilityListBox.cpp:
(WebCore):
* accessibility/AccessibilityListBox.h:
(AccessibilityListBox):
* accessibility/AccessibilityListBoxOption.cpp:
(WebCore::AccessibilityListBoxOption::computeAccessibilityIsIgnored):
* accessibility/AccessibilityMediaControls.cpp:
(WebCore::AccessibilityMediaControl::computeAccessibilityIsIgnored):
(WebCore::AccessibilityMediaControlsContainer::computeAccessibilityIsIgnored):
(WebCore::AccessibilityMediaTimeDisplay::computeAccessibilityIsIgnored):
* accessibility/AccessibilityMediaControls.h:
(AccessibilityMediaControlsContainer):
* accessibility/AccessibilityMenuList.h:
(WebCore::AccessibilityMenuList::roleValue):
* accessibility/AccessibilityMenuListOption.cpp:
(WebCore::AccessibilityMenuListOption::computeAccessibilityIsIgnored):
* accessibility/AccessibilityMenuListPopup.cpp:
(WebCore::AccessibilityMenuListPopup::computeAccessibilityIsIgnored):
* accessibility/AccessibilityMockObject.cpp:
(WebCore::AccessibilityMockObject::computeAccessibilityIsIgnored):
(WebCore):
* accessibility/AccessibilityMockObject.h:
(AccessibilityMockObject):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::accessibilityIsIgnoredDefaultForObject):
(WebCore):
(WebCore::AccessibilityObject::ariaIsHidden):
(WebCore::AccessibilityObject::accessibilityIsIgnoredBase):
* accessibility/AccessibilityObject.h:
(AccessibilityObject):
* accessibility/AccessibilityProgressIndicator.cpp:
(WebCore::AccessibilityProgressIndicator::computeAccessibilityIsIgnored):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore):
(WebCore::AccessibilityRenderObject::accessibilityIsIgnoredBase):
(WebCore::AccessibilityRenderObject::addImageMapChildren):
* accessibility/AccessibilityRenderObject.h:
(AccessibilityRenderObject):
* accessibility/AccessibilityScrollbar.h:
(AccessibilityScrollbar):
* accessibility/AccessibilitySlider.cpp:
(WebCore):
(WebCore::AccessibilitySliderThumb::computeAccessibilityIsIgnored):
* accessibility/AccessibilitySlider.h:
(AccessibilitySlider):
* accessibility/AccessibilitySpinButton.h:
(WebCore::AccessibilitySpinButton::roleValue):
(AccessibilitySpinButtonPart):

LayoutTests:

* accessibility/aria-hidden-hides-all-elements-expected.txt: Added.
* accessibility/aria-hidden-hides-all-elements.html: Added.

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

29 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/aria-hidden-hides-all-elements-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/aria-hidden-hides-all-elements.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityImageMapLink.h
Source/WebCore/accessibility/AccessibilityList.cpp
Source/WebCore/accessibility/AccessibilityListBox.cpp
Source/WebCore/accessibility/AccessibilityListBox.h
Source/WebCore/accessibility/AccessibilityListBoxOption.cpp
Source/WebCore/accessibility/AccessibilityMediaControls.cpp
Source/WebCore/accessibility/AccessibilityMediaControls.h
Source/WebCore/accessibility/AccessibilityMenuList.cpp
Source/WebCore/accessibility/AccessibilityMenuList.h
Source/WebCore/accessibility/AccessibilityMenuListOption.cpp
Source/WebCore/accessibility/AccessibilityMenuListPopup.cpp
Source/WebCore/accessibility/AccessibilityMockObject.cpp
Source/WebCore/accessibility/AccessibilityMockObject.h
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/AccessibilityProgressIndicator.cpp
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/accessibility/AccessibilityRenderObject.h
Source/WebCore/accessibility/AccessibilityScrollbar.h
Source/WebCore/accessibility/AccessibilitySlider.cpp
Source/WebCore/accessibility/AccessibilitySlider.h
Source/WebCore/accessibility/AccessibilitySpinButton.h
Source/WebCore/accessibility/AccessibilityTable.cpp
Source/WebCore/accessibility/AccessibilityTableCell.cpp
Source/WebCore/accessibility/AccessibilityTableRow.cpp

index 18ac1c1..b4307fc 100644 (file)
@@ -1,3 +1,13 @@
+2013-03-16  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: aria-hidden on container does not hide descendant popup buttons
+        https://bugs.webkit.org/show_bug.cgi?id=112373
+
+        Reviewed by Ryosuke Niwa.
+
+        * accessibility/aria-hidden-hides-all-elements-expected.txt: Added.
+        * accessibility/aria-hidden-hides-all-elements.html: Added.
+
 2013-03-16  Ryosuke Niwa  <rniwa@webkit.org>
 
         Mac rebaseline after r145977.
diff --git a/LayoutTests/accessibility/aria-hidden-hides-all-elements-expected.txt b/LayoutTests/accessibility/aria-hidden-hides-all-elements-expected.txt
new file mode 100644 (file)
index 0000000..b4549a2
--- /dev/null
@@ -0,0 +1,10 @@
+This tests aria-hidden on a parent node will hide all these special subclass objects.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS content.childrenCount is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/accessibility/aria-hidden-hides-all-elements.html b/LayoutTests/accessibility/aria-hidden-hides-all-elements.html
new file mode 100644 (file)
index 0000000..7952a3a
--- /dev/null
@@ -0,0 +1,45 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body id="body">
+
+<div id="content" role="group">
+
+<main id="main" aria-hidden="true">
+    <video controls="controls"></video>
+    <select id="select"><option>a</select>
+    <input type="range">
+    <input type="data">
+    <progress></progress>
+    <ul><li>item</li></ul>
+    <select size="10"><option>a</select>
+    <img src="resources/cake.png" width="145" height="126" usemap="#map">
+    <map name="map">
+        <area shape="rect" coords="0,0,100,100" href="#" alt="cake">
+    </map>
+</main>
+
+</div>
+
+<script>
+
+    description("This tests aria-hidden on a parent node will hide all these special subclass objects.");
+
+    if (window.accessibilityController) {
+      
+        var content = accessibilityController.accessibleElementById("content");
+        shouldBe("content.childrenCount", "0");
+
+        // Clear the HTML for better results.
+        document.getElementById("content").innerHTML = "";  
+    }
+
+
+</script>
+
+<script src="../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
+
index 98fdefd..ff42fba 100644 (file)
@@ -1,3 +1,72 @@
+2013-03-16  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: aria-hidden on container does not hide descendant popup buttons
+        https://bugs.webkit.org/show_bug.cgi?id=112373
+
+        Reviewed by Ryosuke Niwa.
+
+        There are a number of subclass AX objects that implement accessibilityIsIgnored()
+        to always return false. This means that even if their parent is aria-hidden=true
+        they still show up in the tree.
+
+        This re-organizes this base case of aria-hidden into AccessibilityObject so that
+        it can be re-used by these special subclasses where appropriate.
+
+        Test: accessibility/aria-hidden-hides-all-elements.html
+
+        * accessibility/AccessibilityImageMapLink.h:
+        (WebCore::AccessibilityImageMapLink::isImageMapLink):
+        * accessibility/AccessibilityList.cpp:
+        (WebCore::AccessibilityList::computeAccessibilityIsIgnored):
+        * accessibility/AccessibilityListBox.cpp:
+        (WebCore):
+        * accessibility/AccessibilityListBox.h:
+        (AccessibilityListBox):
+        * accessibility/AccessibilityListBoxOption.cpp:
+        (WebCore::AccessibilityListBoxOption::computeAccessibilityIsIgnored):
+        * accessibility/AccessibilityMediaControls.cpp:
+        (WebCore::AccessibilityMediaControl::computeAccessibilityIsIgnored):
+        (WebCore::AccessibilityMediaControlsContainer::computeAccessibilityIsIgnored):
+        (WebCore::AccessibilityMediaTimeDisplay::computeAccessibilityIsIgnored):
+        * accessibility/AccessibilityMediaControls.h:
+        (AccessibilityMediaControlsContainer):
+        * accessibility/AccessibilityMenuList.h:
+        (WebCore::AccessibilityMenuList::roleValue):
+        * accessibility/AccessibilityMenuListOption.cpp:
+        (WebCore::AccessibilityMenuListOption::computeAccessibilityIsIgnored):
+        * accessibility/AccessibilityMenuListPopup.cpp:
+        (WebCore::AccessibilityMenuListPopup::computeAccessibilityIsIgnored):
+        * accessibility/AccessibilityMockObject.cpp:
+        (WebCore::AccessibilityMockObject::computeAccessibilityIsIgnored):
+        (WebCore):
+        * accessibility/AccessibilityMockObject.h:
+        (AccessibilityMockObject):
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::accessibilityIsIgnoredDefaultForObject):
+        (WebCore):
+        (WebCore::AccessibilityObject::ariaIsHidden):
+        (WebCore::AccessibilityObject::accessibilityIsIgnoredBase):
+        * accessibility/AccessibilityObject.h:
+        (AccessibilityObject):
+        * accessibility/AccessibilityProgressIndicator.cpp:
+        (WebCore::AccessibilityProgressIndicator::computeAccessibilityIsIgnored):
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore):
+        (WebCore::AccessibilityRenderObject::accessibilityIsIgnoredBase):
+        (WebCore::AccessibilityRenderObject::addImageMapChildren):
+        * accessibility/AccessibilityRenderObject.h:
+        (AccessibilityRenderObject):
+        * accessibility/AccessibilityScrollbar.h:
+        (AccessibilityScrollbar):
+        * accessibility/AccessibilitySlider.cpp:
+        (WebCore):
+        (WebCore::AccessibilitySliderThumb::computeAccessibilityIsIgnored):
+        * accessibility/AccessibilitySlider.h:
+        (AccessibilitySlider):
+        * accessibility/AccessibilitySpinButton.h:
+        (WebCore::AccessibilitySpinButton::roleValue):
+        (AccessibilitySpinButtonPart):
+
 2013-03-15  Simon Fraser  <simon.fraser@apple.com>
 
         Reflected video elements hit assertion on Lion
index fee287f..3e20049 100644 (file)
@@ -74,7 +74,6 @@ private:
     
     virtual void accessibilityText(Vector<AccessibilityText>&);
     virtual bool isImageMapLink() const { return true; }
-    virtual bool computeAccessibilityIsIgnored() const { return false; }
 };
     
 } // namespace WebCore
index 7518a35..8039cf0 100644 (file)
@@ -55,13 +55,7 @@ PassRefPtr<AccessibilityList> AccessibilityList::create(RenderObject* renderer)
 
 bool AccessibilityList::computeAccessibilityIsIgnored() const
 {
-    AccessibilityObjectInclusion decision = accessibilityIsIgnoredBase();
-    if (decision == IncludeObject)
-        return false;
-    if (decision == IgnoreObject)
-        return true;
-    
-    return false;
+    return accessibilityIsIgnoredByDefault();
 }
     
 bool AccessibilityList::isUnorderedList() const
index 1e5c53c..4795849 100644 (file)
@@ -152,17 +152,6 @@ AccessibilityObject* AccessibilityListBox::listBoxOptionAccessibilityObject(HTML
     return listBoxObject;
 }
     
-bool AccessibilityListBox::computeAccessibilityIsIgnored() const
-{
-    AccessibilityObjectInclusion decision = accessibilityIsIgnoredBase();
-    if (decision == IncludeObject)
-        return false;
-    if (decision == IgnoreObject)
-        return true;
-    
-    return false;
-}
-
 AccessibilityObject* AccessibilityListBox::elementAccessibilityHitTest(const IntPoint& point) const
 {
     // the internal HTMLSelectElement methods for returning a listbox option at a point
index 25b0a06..dda37e8 100644 (file)
@@ -54,7 +54,6 @@ public:
 
 private:    
     AccessibilityObject* listBoxOptionAccessibilityObject(HTMLElement*) const;
-    virtual bool computeAccessibilityIsIgnored() const;
     virtual AccessibilityObject* elementAccessibilityHitTest(const IntPoint&) const;
 };
     
index 509699f..3074f1f 100644 (file)
@@ -124,8 +124,8 @@ bool AccessibilityListBoxOption::computeAccessibilityIsIgnored() const
 {
     if (!m_optionElement)
         return true;
-    
-    if (equalIgnoringCase(getAttribute(aria_hiddenAttr), "true"))
+
+    if (accessibilityIsIgnoredByDefault())
         return true;
     
     return parentObject()->accessibilityIsIgnored();
index 4107157..5a09d5b 100644 (file)
@@ -178,7 +178,7 @@ bool AccessibilityMediaControl::computeAccessibilityIsIgnored() const
     if (!m_renderer || !m_renderer->style() || m_renderer->style()->visibility() != VISIBLE || controlType() == MediaTimelineContainer)
         return true;
 
-    return false;
+    return accessibilityIsIgnoredByDefault();
 }
 
 AccessibilityRole AccessibilityMediaControl::roleValue() const
@@ -256,6 +256,10 @@ const String AccessibilityMediaControlsContainer::elementTypeName() const
     return audioElement;
 }
 
+bool AccessibilityMediaControlsContainer::computeAccessibilityIsIgnored() const
+{
+    return accessibilityIsIgnoredByDefault();
+}
 
 //
 // AccessibilityMediaTimeline
@@ -305,7 +309,10 @@ bool AccessibilityMediaTimeDisplay::computeAccessibilityIsIgnored() const
     if (!m_renderer || !m_renderer->style() || m_renderer->style()->visibility() != VISIBLE)
         return true;
 
-    return !m_renderer->style()->width().value();
+    if (!m_renderer->style()->width().value())
+        return true;
+    
+    return accessibilityIsIgnoredByDefault();
 }
 
 String AccessibilityMediaTimeDisplay::accessibilityDescription() const
index 6c81a97..628d70e 100644 (file)
@@ -90,7 +90,7 @@ private:
     explicit AccessibilityMediaControlsContainer(RenderObject*);
     bool controllingVideoElement() const;
     const String elementTypeName() const;
-    virtual bool computeAccessibilityIsIgnored() const { return false; }
+    virtual bool computeAccessibilityIsIgnored() const;
 };
 
 
index 6a49e7d..05a5632 100644 (file)
@@ -62,12 +62,12 @@ void AccessibilityMenuList::addChildren()
     if (!list)
         return;
 
-    if (list->accessibilityPlatformIncludesObject() == IgnoreObject) {
+    static_cast<AccessibilityMockObject*>(list)->setParent(this);
+    if (list->accessibilityIsIgnored()) {
         cache->remove(list->axObjectID());
         return;
     }
 
-    static_cast<AccessibilityMockObject*>(list)->setParent(this);
     m_children.append(list);
 
     list->addChildren();
index d437604..95f7972 100644 (file)
@@ -49,7 +49,6 @@ private:
 
     virtual bool isMenuList() const { return true; }
     virtual AccessibilityRole roleValue() const { return PopUpButtonRole; }
-    virtual bool computeAccessibilityIsIgnored() const { return false; }
     virtual bool canSetFocusAttribute() const;
 
     virtual void addChildren();
index b3df0c9..480e357 100644 (file)
@@ -98,7 +98,7 @@ bool AccessibilityMenuListOption::canSetSelectedAttribute() const
 
 bool AccessibilityMenuListOption::computeAccessibilityIsIgnored() const
 {
-    return accessibilityPlatformIncludesObject() != IncludeObject;
+    return accessibilityIsIgnoredByDefault();
 }
 
 LayoutRect AccessibilityMenuListOption::elementRect() const
index ec1d53e..033ca46 100644 (file)
@@ -64,7 +64,7 @@ bool AccessibilityMenuListPopup::isEnabled() const
 
 bool AccessibilityMenuListPopup::computeAccessibilityIsIgnored() const
 {
-    return accessibilityPlatformIncludesObject() != IncludeObject;
+    return accessibilityIsIgnoredByDefault();
 }
 
 AccessibilityMenuListOption* AccessibilityMenuListPopup::menuListOptionAccessibilityObject(HTMLElement* element) const
index f500404..f481561 100644 (file)
@@ -37,4 +37,9 @@ AccessibilityMockObject::~AccessibilityMockObject()
 {
 }
     
+bool AccessibilityMockObject::computeAccessibilityIsIgnored() const
+{
+    return accessibilityIsIgnoredByDefault();
+}
+    
 }
index e02da6b..8a9a36e 100644 (file)
@@ -47,6 +47,7 @@ protected:
 private:
     virtual bool isMockObject() const { return true; }
 
+    virtual bool computeAccessibilityIsIgnored() const;
     // Must be called when the parent object clears its children.
     virtual void detachFromParent() { m_parent = 0; }
 }; 
index 03cd3d3..2568677 100644 (file)
@@ -1867,6 +1867,35 @@ bool AccessibilityObject::isButton() const
     return role == ButtonRole || role == PopUpButtonRole || role == ToggleButtonRole;
 }
 
+bool AccessibilityObject::accessibilityIsIgnoredByDefault() const
+{
+    return defaultObjectInclusion() == IgnoreObject;
+}
+
+bool AccessibilityObject::ariaIsHidden() const
+{
+    if (equalIgnoringCase(getAttribute(aria_hiddenAttr), "true"))
+        return true;
+    
+    for (AccessibilityObject* object = parentObject(); object; object = object->parentObject()) {
+        if (equalIgnoringCase(object->getAttribute(aria_hiddenAttr), "true"))
+            return true;
+    }
+    
+    return false;
+}
+
+AccessibilityObjectInclusion AccessibilityObject::defaultObjectInclusion() const
+{
+    if (ariaIsHidden())
+        return IgnoreObject;
+    
+    if (isPresentationalChildOfAriaRole())
+        return IgnoreObject;
+    
+    return accessibilityPlatformIncludesObject();
+}
+    
 bool AccessibilityObject::accessibilityIsIgnored() const
 {
     AXComputedObjectAttributeCache* attributeCache = axObjectCache()->computedObjectAttributeCache();
index 0e0bcfa..26a35a6 100644 (file)
@@ -486,7 +486,9 @@ public:
     virtual Node* node() const { return 0; }
     virtual RenderObject* renderer() const { return 0; }
     virtual bool accessibilityIsIgnored() const;
-
+    virtual AccessibilityObjectInclusion defaultObjectInclusion() const;
+    bool accessibilityIsIgnoredByDefault() const;
+    
     int blockquoteLevel() const;
     virtual int headingLevel() const { return 0; }
     virtual int tableLevel() const { return 0; }
@@ -849,6 +851,7 @@ protected:
     static bool isAccessibilityTextSearchMatch(AccessibilityObject*, AccessibilitySearchCriteria*);
     static bool objectMatchesSearchCriteriaWithResultLimit(AccessibilityObject*, AccessibilitySearchCriteria*, AccessibilityChildrenVector&);
     virtual AccessibilityRole buttonRoleType() const;
+    bool ariaIsHidden() const;
 
 #if PLATFORM(GTK) || (PLATFORM(EFL) && HAVE(ACCESSIBILITY))
     bool allowsTextRanges() const;
index 41e5574..08c8656 100644 (file)
@@ -44,7 +44,7 @@ PassRefPtr<AccessibilityProgressIndicator> AccessibilityProgressIndicator::creat
 
 bool AccessibilityProgressIndicator::computeAccessibilityIsIgnored() const
 {
-    return accessibilityIsIgnoredBase() == IgnoreObject;
+    return accessibilityIsIgnoredByDefault();
 }
     
 float AccessibilityProgressIndicator::valueForRange() const
index a6373d6..32230b0 100644 (file)
@@ -1051,22 +1051,6 @@ AccessibilityObject* AccessibilityRenderObject::titleUIElement() const
     return 0;   
 }
     
-bool AccessibilityRenderObject::ariaIsHidden() const
-{
-    if (equalIgnoringCase(getAttribute(aria_hiddenAttr), "true"))
-        return true;
-    
-    // aria-hidden hides this object and any children
-    AccessibilityObject* object = parentObject();
-    while (object) {
-        if (equalIgnoringCase(object->getAttribute(aria_hiddenAttr), "true"))
-            return true;
-        object = object->parentObject();
-    }
-
-    return false;
-}
-
 bool AccessibilityRenderObject::isAllowedChildOfTree() const
 {
     // Determine if this is in a tree. If so, we apply special behavior to make it work like an AXOutline.
@@ -1089,7 +1073,7 @@ bool AccessibilityRenderObject::isAllowedChildOfTree() const
     return true;
 }
     
-AccessibilityObjectInclusion AccessibilityRenderObject::accessibilityIsIgnoredBase() const
+AccessibilityObjectInclusion AccessibilityRenderObject::defaultObjectInclusion() const
 {
     // The following cases can apply to any element that's a subclass of AccessibilityRenderObject.
     
@@ -1103,24 +1087,9 @@ AccessibilityObjectInclusion AccessibilityRenderObject::accessibilityIsIgnoredBa
         
         return IgnoreObject;
     }
-    
-    // Anything marked as aria-hidden or a child of something aria-hidden must be hidden.
-    if (ariaIsHidden())
-        return IgnoreObject;
-    
-    // Anything that is a presentational role must be hidden.
-    if (isPresentationalChildOfAriaRole())
-        return IgnoreObject;
 
-    // Allow the platform to make a decision.
-    AccessibilityObjectInclusion decision = accessibilityPlatformIncludesObject();
-    if (decision == IncludeObject)
-        return IncludeObject;
-    if (decision == IgnoreObject)
-        return IgnoreObject;
-        
-    return DefaultBehavior;
-}  
+    return AccessibilityObject::defaultObjectInclusion();
+}
 
 bool AccessibilityRenderObject::computeAccessibilityIsIgnored() const
 {
@@ -1131,7 +1100,7 @@ bool AccessibilityRenderObject::computeAccessibilityIsIgnored() const
     // Check first if any of the common reasons cause this element to be ignored.
     // Then process other use cases that need to be applied to all the various roles
     // that AccessibilityRenderObjects take on.
-    AccessibilityObjectInclusion decision = accessibilityIsIgnoredBase();
+    AccessibilityObjectInclusion decision = defaultObjectInclusion();
     if (decision == IncludeObject)
         return false;
     if (decision == IgnoreObject)
@@ -2733,8 +2702,10 @@ void AccessibilityRenderObject::addImageMapChildren()
             areaObject->setHTMLAreaElement(static_cast<HTMLAreaElement*>(current));
             areaObject->setHTMLMapElement(map);
             areaObject->setParent(this);
-            
-            m_children.append(areaObject);
+            if (!areaObject->accessibilityIsIgnored())
+                m_children.append(areaObject);
+            else
+                axObjectCache()->remove(areaObject->axObjectID());
         }
     }
 }
index ebb44bb..c01590d 100644 (file)
@@ -93,7 +93,7 @@ public:
     virtual void setAccessibleName(const AtomicString&);
     
     // Provides common logic used by all elements when determining isIgnored.
-    AccessibilityObjectInclusion accessibilityIsIgnoredBase() const;
+    virtual AccessibilityObjectInclusion defaultObjectInclusion() const;
     
     virtual int layoutCount() const;
     virtual double estimatedLoadingProgress() const;
@@ -228,7 +228,6 @@ protected:
 private:
     void ariaListboxSelectedChildren(AccessibilityChildrenVector&);
     void ariaListboxVisibleChildren(AccessibilityChildrenVector&);
-    bool ariaIsHidden() const;
     bool isAllowedChildOfTree() const;
     bool hasTextAlternative() const;
     String positionalDescriptionForMSAA() const;
index 61837f4..6caeaea 100644 (file)
@@ -44,7 +44,6 @@ public:
 private:
     explicit AccessibilityScrollbar(Scrollbar*);
 
-    virtual bool computeAccessibilityIsIgnored() const { return false; }
     virtual bool canSetValueAttribute() const { return true; }
     virtual bool canSetNumericValue() const { return true; }
 
index 89f05f8..14020e0 100644 (file)
@@ -113,17 +113,6 @@ AccessibilityObject* AccessibilitySlider::elementAccessibilityHitTest(const IntP
     return axObjectCache()->getOrCreate(m_renderer);
 }
 
-bool AccessibilitySlider::computeAccessibilityIsIgnored() const
-{
-    AccessibilityObjectInclusion decision = accessibilityIsIgnoredBase();
-    if (decision == IncludeObject)
-        return false;
-    if (decision == IgnoreObject)
-        return true;
-    
-    return false;
-}
-    
 float AccessibilitySlider::valueForRange() const
 {
     return element()->value().toFloat();
@@ -180,13 +169,7 @@ LayoutRect AccessibilitySliderThumb::elementRect() const
 
 bool AccessibilitySliderThumb::computeAccessibilityIsIgnored() const
 {
-    AccessibilityObjectInclusion decision = accessibilityPlatformIncludesObject();
-    if (decision == IncludeObject)
-        return false;
-    if (decision == IgnoreObject)
-        return true;
-
-    return false;
+    return accessibilityIsIgnoredByDefault();
 }
 
 } // namespace WebCore
index 33e23ef..2c4dbbf 100644 (file)
@@ -47,7 +47,6 @@ protected:
 
 private:
     HTMLInputElement* element() const;
-    virtual bool computeAccessibilityIsIgnored() const;
     virtual AccessibilityObject* elementAccessibilityHitTest(const IntPoint&) const;
 
     virtual AccessibilityRole roleValue() const { return SliderRole; }    
index cdc32e0..db5eab5 100644 (file)
@@ -48,7 +48,6 @@ private:
     AccessibilitySpinButton();
 
     virtual AccessibilityRole roleValue() const { return SpinButtonRole; }
-    virtual bool computeAccessibilityIsIgnored() const { return false; }
     virtual bool isSpinButton() const { return true; }
     virtual void addChildren();
     virtual LayoutRect elementRect() const;
@@ -72,7 +71,6 @@ private:
     virtual AccessibilityRole roleValue() const { return ButtonRole; }
     virtual bool isSpinButtonPart() const { return true; }
     virtual LayoutRect elementRect() const;
-    virtual bool computeAccessibilityIsIgnored() const { return false; }
 };
     
 inline AccessibilitySpinButton* toAccessibilitySpinButton(AccessibilityObject* object)
index 4c33236..467ea1e 100644 (file)
@@ -541,7 +541,7 @@ AccessibilityRole AccessibilityTable::roleValue() const
     
 bool AccessibilityTable::computeAccessibilityIsIgnored() const
 {
-    AccessibilityObjectInclusion decision = accessibilityIsIgnoredBase();
+    AccessibilityObjectInclusion decision = defaultObjectInclusion();
     if (decision == IncludeObject)
         return false;
     if (decision == IgnoreObject)
index 0e78b36..8b8b15b 100644 (file)
@@ -56,7 +56,7 @@ PassRefPtr<AccessibilityTableCell> AccessibilityTableCell::create(RenderObject*
 
 bool AccessibilityTableCell::computeAccessibilityIsIgnored() const
 {
-    AccessibilityObjectInclusion decision = accessibilityIsIgnoredBase();
+    AccessibilityObjectInclusion decision = defaultObjectInclusion();
     if (decision == IncludeObject)
         return false;
     if (decision == IgnoreObject)
index 1270cf8..b0d8d9c 100644 (file)
@@ -88,7 +88,7 @@ AccessibilityObject* AccessibilityTableRow::observableObject() const
     
 bool AccessibilityTableRow::computeAccessibilityIsIgnored() const
 {    
-    AccessibilityObjectInclusion decision = accessibilityIsIgnoredBase();
+    AccessibilityObjectInclusion decision = defaultObjectInclusion();
     if (decision == IncludeObject)
         return false;
     if (decision == IgnoreObject)