Commit 14f57ce1 authored by cfleizach@apple.com's avatar cfleizach@apple.com

accessibilityIsIgnoredBase() needs to respect when platform says include

https://bugs.webkit.org/show_bug.cgi?id=36025

Reviewed by Beth Dakin.

Changed accessibilityIsIgnoredBase() to return a policy instead of a yes/no
answer. This allows the platform to make a yes decision on an element.

* accessibility/AccessibilityList.cpp:
(WebCore::AccessibilityList::accessibilityIsIgnored):
* accessibility/AccessibilityListBox.cpp:
(WebCore::AccessibilityListBox::accessibilityIsIgnored):
* accessibility/AccessibilityObject.h:
(WebCore::):
(WebCore::AccessibilityObject::accessibilityIgnoreAttachment):
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::accessibilityIsIgnoredBase):
(WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
* accessibility/AccessibilityRenderObject.h:
* accessibility/AccessibilitySlider.cpp:
(WebCore::AccessibilitySlider::accessibilityIsIgnored):
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::accessibilityIsIgnored):
* accessibility/AccessibilityTableCell.cpp:
(WebCore::AccessibilityTableCell::accessibilityIsIgnored):
* accessibility/AccessibilityTableRow.cpp:
(WebCore::AccessibilityTableRow::accessibilityIsIgnored):
* accessibility/chromium/AccessibilityObjectChromium.cpp:
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
* accessibility/gtk/AccessibilityObjectAtk.cpp:
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
* accessibility/mac/AccessibilityObjectMac.mm:
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
* accessibility/qt/AccessibilityObjectQt.cpp:
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
* accessibility/win/AccessibilityObjectWin.cpp:
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
* accessibility/wx/AccessibilityObjectWx.cpp:
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55855 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 99eec601
2010-03-11 Chris Fleizach <cfleizach@apple.com>
Reviewed by Beth Dakin.
accessibilityIsIgnoredBase() needs to respect when platform says include
https://bugs.webkit.org/show_bug.cgi?id=36025
Changed accessibilityIsIgnoredBase() to return a policy instead of a yes/no
answer. This allows the platform to make a yes decision on an element.
* accessibility/AccessibilityList.cpp:
(WebCore::AccessibilityList::accessibilityIsIgnored):
* accessibility/AccessibilityListBox.cpp:
(WebCore::AccessibilityListBox::accessibilityIsIgnored):
* accessibility/AccessibilityObject.h:
(WebCore::):
(WebCore::AccessibilityObject::accessibilityIgnoreAttachment):
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::accessibilityIsIgnoredBase):
(WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
* accessibility/AccessibilityRenderObject.h:
* accessibility/AccessibilitySlider.cpp:
(WebCore::AccessibilitySlider::accessibilityIsIgnored):
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::accessibilityIsIgnored):
* accessibility/AccessibilityTableCell.cpp:
(WebCore::AccessibilityTableCell::accessibilityIsIgnored):
* accessibility/AccessibilityTableRow.cpp:
(WebCore::AccessibilityTableRow::accessibilityIsIgnored):
* accessibility/chromium/AccessibilityObjectChromium.cpp:
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
* accessibility/gtk/AccessibilityObjectAtk.cpp:
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
* accessibility/mac/AccessibilityObjectMac.mm:
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
* accessibility/qt/AccessibilityObjectQt.cpp:
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
* accessibility/win/AccessibilityObjectWin.cpp:
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
* accessibility/wx/AccessibilityObjectWx.cpp:
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
2010-03-11 Kenneth Russell <kbr@google.com>
Reviewed by Dimitri Glazkov.
......
......@@ -55,7 +55,10 @@ PassRefPtr<AccessibilityList> AccessibilityList::create(RenderObject* renderer)
bool AccessibilityList::accessibilityIsIgnored() const
{
if (accessibilityIsIgnoredBase())
AccessibilityObjectInclusion decision = accessibilityIsIgnoredBase();
if (decision == IncludeObject)
return false;
if (decision == IgnoreObject)
return true;
// lists don't appear on tiger/leopard on the mac
......
......@@ -154,7 +154,10 @@ AccessibilityObject* AccessibilityListBox::listBoxOptionAccessibilityObject(HTML
bool AccessibilityListBox::accessibilityIsIgnored() const
{
if (accessibilityIsIgnoredBase())
AccessibilityObjectInclusion decision = accessibilityIsIgnoredBase();
if (decision == IncludeObject)
return false;
if (decision == IgnoreObject)
return true;
return false;
......
......@@ -203,7 +203,7 @@ enum AccessibilityOrientation {
AccessibilityOrientationHorizontal,
};
enum AccessibilityObjectPlatformInclusion {
enum AccessibilityObjectInclusion {
IncludeObject,
IgnoreObject,
DefaultBehavior,
......@@ -534,18 +534,14 @@ public:
#endif
#endif
// a platform-specific method for determining if an attachment is ignored
#if HAVE(ACCESSIBILITY)
// a platform-specific method for determining if an attachment is ignored
bool accessibilityIgnoreAttachment() const;
#else
bool accessibilityIgnoreAttachment() const { return true; }
#endif
// gives platforms the opportunity to indicate if and how an object should be included
#if HAVE(ACCESSIBILITY)
AccessibilityObjectPlatformInclusion accessibilityPlatformIncludesObject() const;
AccessibilityObjectInclusion accessibilityPlatformIncludesObject() const;
#else
AccessibilityObjectPlatformInclusion accessibilityPlatformIncludesObject() const { return DefaultBehavior; }
bool accessibilityIgnoreAttachment() const { return true; }
AccessibilityObjectInclusion accessibilityPlatformIncludesObject() const { return DefaultBehavior; }
#endif
// allows for an AccessibilityObject to update its render tree or perform
......
......@@ -1447,29 +1447,30 @@ bool AccessibilityRenderObject::isAllowedChildOfTree() const
return true;
}
bool AccessibilityRenderObject::accessibilityIsIgnoredBase() const
AccessibilityObjectInclusion AccessibilityRenderObject::accessibilityIsIgnoredBase() const
{
// The following cases can apply to any element that's a subclass of AccessibilityRenderObject.
// Is the platform interested in this object?
AccessibilityObjectPlatformInclusion decision = accessibilityPlatformIncludesObject();
if (decision == IncludeObject)
return false;
if (decision == IgnoreObject)
return true;
// the decision must, therefore, be DefaultBehavior.
// ignore invisible element
// Ignore invisible elements.
if (!m_renderer || m_renderer->style()->visibility() != VISIBLE)
return true;
return IgnoreObject;
// Anything marked as aria-hidden or a child of something aria-hidden must be hidden.
if (ariaIsHidden())
return true;
return IgnoreObject;
// Anything that is a presentational role must be hidden.
if (isPresentationalChildOfAriaRole())
return true;
return false;
return IgnoreObject;
// Allow the platform to make a decision.
AccessibilityObjectInclusion decision = accessibilityPlatformIncludesObject();
if (decision == IncludeObject)
return IncludeObject;
if (decision == IgnoreObject)
return IgnoreObject;
return DefaultBehavior;
}
bool AccessibilityRenderObject::accessibilityIsIgnored() const
......@@ -1477,7 +1478,10 @@ bool AccessibilityRenderObject::accessibilityIsIgnored() 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.
if (accessibilityIsIgnoredBase())
AccessibilityObjectInclusion decision = accessibilityIsIgnoredBase();
if (decision == IncludeObject)
return false;
if (decision == IgnoreObject)
return true;
// If this element is within a parent that cannot have children, it should not be exposed.
......
......@@ -115,7 +115,7 @@ public:
virtual bool hasIntValue() const;
// Provides common logic used by all elements when determining isIgnored.
bool accessibilityIsIgnoredBase() const;
AccessibilityObjectInclusion accessibilityIsIgnoredBase() const;
virtual bool accessibilityIsIgnored() const;
virtual int headingLevel() const;
......
......@@ -101,9 +101,12 @@ const AtomicString& AccessibilitySlider::getAttribute(const QualifiedName& attri
bool AccessibilitySlider::accessibilityIsIgnored() const
{
if (accessibilityIsIgnoredBase())
AccessibilityObjectInclusion decision = accessibilityIsIgnoredBase();
if (decision == IncludeObject)
return false;
if (decision == IgnoreObject)
return true;
return false;
}
......
......@@ -445,9 +445,12 @@ AccessibilityRole AccessibilityTable::roleValue() const
bool AccessibilityTable::accessibilityIsIgnored() const
{
if (accessibilityIsIgnoredBase())
AccessibilityObjectInclusion decision = accessibilityIsIgnoredBase();
if (decision == IncludeObject)
return false;
if (decision == IgnoreObject)
return true;
if (!isDataTable())
return AccessibilityRenderObject::accessibilityIsIgnored();
......
......@@ -56,9 +56,12 @@ PassRefPtr<AccessibilityTableCell> AccessibilityTableCell::create(RenderObject*
bool AccessibilityTableCell::accessibilityIsIgnored() const
{
if (accessibilityIsIgnoredBase())
AccessibilityObjectInclusion decision = accessibilityIsIgnoredBase();
if (decision == IncludeObject)
return false;
if (decision == IgnoreObject)
return true;
if (!isTableCell())
return AccessibilityRenderObject::accessibilityIsIgnored();
......
......@@ -76,11 +76,10 @@ bool AccessibilityTableRow::isTableRow() const
bool AccessibilityTableRow::accessibilityIsIgnored() const
{
#if PLATFORM(GTK)
return true;
#endif
if (accessibilityIsIgnoredBase())
AccessibilityObjectInclusion decision = accessibilityIsIgnoredBase();
if (decision == IncludeObject)
return false;
if (decision == IgnoreObject)
return true;
if (!isTableRow())
......
......@@ -34,7 +34,7 @@ bool AccessibilityObject::accessibilityIgnoreAttachment() const
return false;
}
AccessibilityObjectPlatformInclusion AccessibilityObject::accessibilityPlatformIncludesObject() const
AccessibilityObjectInclusion AccessibilityObject::accessibilityPlatformIncludesObject() const
{
if (isMenuListPopup() || isMenuListOption())
return IgnoreObject;
......
......@@ -32,7 +32,7 @@ bool AccessibilityObject::accessibilityIgnoreAttachment() const
return false;
}
AccessibilityObjectPlatformInclusion AccessibilityObject::accessibilityPlatformIncludesObject() const
AccessibilityObjectInclusion AccessibilityObject::accessibilityPlatformIncludesObject() const
{
AccessibilityObject* parent = parentObject();
if (!parent)
......
......@@ -41,7 +41,7 @@ bool AccessibilityObject::accessibilityIgnoreAttachment() const
return [attachment accessibilityIsIgnored];
}
AccessibilityObjectPlatformInclusion AccessibilityObject::accessibilityPlatformIncludesObject() const
AccessibilityObjectInclusion AccessibilityObject::accessibilityPlatformIncludesObject() const
{
if (isMenuListPopup() || isMenuListOption())
return IgnoreObject;
......
......@@ -29,7 +29,7 @@ bool AccessibilityObject::accessibilityIgnoreAttachment() const
return false;
}
AccessibilityObjectPlatformInclusion AccessibilityObject::accessibilityPlatformIncludesObject() const
AccessibilityObjectInclusion AccessibilityObject::accessibilityPlatformIncludesObject() const
{
if (isMenuListPopup() || isMenuListOption())
return IgnoreObject;
......
......@@ -35,7 +35,7 @@ bool AccessibilityObject::accessibilityIgnoreAttachment() const
return false;
}
AccessibilityObjectPlatformInclusion AccessibilityObject::accessibilityPlatformIncludesObject() const
AccessibilityObjectInclusion AccessibilityObject::accessibilityPlatformIncludesObject() const
{
if (isMenuListPopup() || isMenuListOption())
return IncludeObject;
......
......@@ -29,7 +29,7 @@ bool AccessibilityObject::accessibilityIgnoreAttachment() const
return false;
}
AccessibilityObjectPlatformInclusion AccessibilityObject::accessibilityPlatformIncludesObject() const
AccessibilityObjectInclusion AccessibilityObject::accessibilityPlatformIncludesObject() const
{
if (isMenuListPopup() || isMenuListOption())
return IgnoreObject;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment