Commit c35bf3d4 authored by dmazzoni@google.com's avatar dmazzoni@google.com

AX: Need AccessibilityObjects for nodes without renderers in canvas subtree

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

Reviewed by Chris Fleizach.

Source/WebCore:

Refactors AccessibilityRenderObject so that it inherits from a new class,
AccessibilityNodeObject, that can be constructed from a Node without a
renderer. Modifies AXObjectCache so that it automatically creates an
AccessibilityNodeObject for elements in a canvas subtree but not otherwise.
A new layout test verifies that this correctly exposes an accessibility
tree with appropriate roles for elements in a canvas subtree.

This patch does not try to complete the implementation of
AccessibilityNodeObject. Most AX methods are still unimplemented and need
to be migrated from AccessibilityRenderObject to AccessibilityNodeObject
in a future patch.

This patch also doesn't change anything outside of WebCore/accessibility, so
the rest of WebCore only calls AXObjectCache when there are changes to a
RenderObject, not to a Node. Accessible notifications on nodes without
renderers need to be implemented in a future patch.

Test: accessibility/canvas-accessibilitynodeobject.html

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::get):
(WebCore):
(WebCore::createFromNode):
(WebCore::AXObjectCache::getOrCreate):
(WebCore::AXObjectCache::remove):
* accessibility/AXObjectCache.h:
(AXObjectCache):
(WebCore::AXObjectCache::get):
(WebCore::AXObjectCache::getOrCreate):
(WebCore::AXObjectCache::remove):
* accessibility/AccessibilityARIAGrid.cpp:
(WebCore::AccessibilityARIAGrid::AccessibilityARIAGrid):
(WebCore):
(WebCore::AccessibilityARIAGrid::~AccessibilityARIAGrid):
(WebCore::AccessibilityARIAGrid::init):
(WebCore::AccessibilityARIAGrid::create):
* accessibility/AccessibilityARIAGrid.h:
(AccessibilityARIAGrid):
* accessibility/AccessibilityARIAGridCell.cpp:
(WebCore::AccessibilityARIAGridCell::create):
* accessibility/AccessibilityARIAGridRow.cpp:
(WebCore::AccessibilityARIAGridRow::create):
* accessibility/AccessibilityAllInOne.cpp:
* accessibility/AccessibilityList.cpp:
(WebCore::AccessibilityList::create):
* accessibility/AccessibilityListBox.cpp:
(WebCore::AccessibilityListBox::create):
* accessibility/AccessibilityMediaControls.cpp:
(WebCore::AccessibilityMediaControl::create):
(WebCore::AccessibilityMediaControlsContainer::create):
(WebCore::AccessibilityMediaTimeline::create):
(WebCore::AccessibilityMediaTimeDisplay::create):
* accessibility/AccessibilityMenuList.cpp:
(WebCore::AccessibilityMenuList::create):
(WebCore):
* accessibility/AccessibilityMenuList.h:
(AccessibilityMenuList):
* accessibility/AccessibilityNodeObject.cpp: Added.
(WebCore):
(WebCore::AccessibilityNodeObject::AccessibilityNodeObject):
(WebCore::AccessibilityNodeObject::~AccessibilityNodeObject):
(WebCore::AccessibilityNodeObject::init):
(WebCore::AccessibilityNodeObject::create):
(WebCore::AccessibilityNodeObject::detach):
(WebCore::AccessibilityNodeObject::childrenChanged):
(WebCore::AccessibilityNodeObject::updateAccessibilityRole):
(WebCore::AccessibilityNodeObject::firstChild):
(WebCore::AccessibilityNodeObject::lastChild):
(WebCore::AccessibilityNodeObject::previousSibling):
(WebCore::AccessibilityNodeObject::nextSibling):
(WebCore::AccessibilityNodeObject::parentObjectIfExists):
(WebCore::AccessibilityNodeObject::parentObject):
(WebCore::AccessibilityNodeObject::elementRect):
(WebCore::AccessibilityNodeObject::setNode):
(WebCore::AccessibilityNodeObject::document):
(WebCore::AccessibilityNodeObject::determineAccessibilityRole):
(WebCore::AccessibilityNodeObject::addChildren):
(WebCore::AccessibilityNodeObject::accessibilityIsIgnored):
(WebCore::AccessibilityNodeObject::canSetFocusAttribute):
(WebCore::AccessibilityNodeObject::determineAriaRoleAttribute):
(WebCore::AccessibilityNodeObject::ariaRoleAttribute):
(WebCore::AccessibilityNodeObject::remapAriaRoleDueToParent):
* accessibility/AccessibilityNodeObject.h: Added.
(WebCore):
(AccessibilityNodeObject):
(WebCore::AccessibilityNodeObject::isAccessibilityNodeObject):
(WebCore::AccessibilityNodeObject::node):
(WebCore::AccessibilityNodeObject::isDetached):
(WebCore::toAccessibilityNodeObject):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isAccessibilityNodeObject):
* accessibility/AccessibilityProgressIndicator.cpp:
(WebCore::AccessibilityProgressIndicator::create):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::AccessibilityRenderObject):
(WebCore::AccessibilityRenderObject::init):
(WebCore):
(WebCore::AccessibilityRenderObject::create):
(WebCore::AccessibilityRenderObject::detach):
(WebCore::AccessibilityRenderObject::setRenderer):
(WebCore::AccessibilityRenderObject::canHaveChildren):
(WebCore::AccessibilityRenderObject::addCanvasChildren):
(WebCore::AccessibilityRenderObject::addChildren):
* accessibility/AccessibilityRenderObject.h:
(AccessibilityRenderObject):
* accessibility/AccessibilitySlider.cpp:
(WebCore::AccessibilitySlider::create):
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::AccessibilityTable):
(WebCore):
(WebCore::AccessibilityTable::~AccessibilityTable):
(WebCore::AccessibilityTable::init):
(WebCore::AccessibilityTable::create):
* accessibility/AccessibilityTable.h:
(AccessibilityTable):
* accessibility/AccessibilityTableCell.cpp:
(WebCore::AccessibilityTableCell::create):
* accessibility/AccessibilityTableRow.cpp:
(WebCore::AccessibilityTableRow::create):

LayoutTests:

This new test adds a bunch of elements to a normal container and the same elements to
a canvas subtree, then it iterates over all of the accessible objects within each
container and makes sure they have identical roles. Because we know the nodes in the
canvas subtree don't have renderers, this successfully tests that AccessibilityNodeObjects
are getting created for these nodes.

* accessibility/canvas-accessibilitynodeobject-expected.txt: Added.
* accessibility/canvas-accessibilitynodeobject.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123428 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ba69b448
2012-07-23 Dominic Mazzoni <dmazzoni@google.com>
AX: Need AccessibilityObjects for nodes without renderers in canvas subtree
https://bugs.webkit.org/show_bug.cgi?id=87899
Reviewed by Chris Fleizach.
This new test adds a bunch of elements to a normal container and the same elements to
a canvas subtree, then it iterates over all of the accessible objects within each
container and makes sure they have identical roles. Because we know the nodes in the
canvas subtree don't have renderers, this successfully tests that AccessibilityNodeObjects
are getting created for these nodes.
* accessibility/canvas-accessibilitynodeobject-expected.txt: Added.
* accessibility/canvas-accessibilitynodeobject.html: Added.
2012-07-23 Douglas Stockwell <dstockwell@chromium.org>
Null-pointer crash when a derived color like -webkit-activelink is set in a gradient stop
Link Button ARIA button ARIA link
This test makes sure that AccessibilityNodeObjects are created for elements in a canvas subtree.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS axRenderObjects.length is axNodeObjects.length
PASS i == 0; axRenderObject.role == axNodeObject.role is true
PASS i == 1; axRenderObject.role == axNodeObject.role is true
PASS i == 2; axRenderObject.role == axNodeObject.role is true
PASS i == 3; axRenderObject.role == axNodeObject.role is true
PASS i == 4; axRenderObject.role == axNodeObject.role is true
PASS i == 5; axRenderObject.role == axNodeObject.role is true
PASS i == 6; axRenderObject.role == axNodeObject.role is true
PASS i == 7; axRenderObject.role == axNodeObject.role is true
PASS i == 8; axRenderObject.role == axNodeObject.role is true
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE HTML>
<html>
<body>
<script src="../fast/js/resources/js-test-pre.js"></script>
<div id="myContainer" tabindex="-1">
<a href="#">Link</a>
<button>Button</button>
<input type="text">
<input type="checkbox">
<input type="radio">
<input type="submit">
<select><option>1<option>2</select>
<span tabindex="0" role="button">ARIA button</span>
<span tabindex="0" role="link">ARIA link</span>
</div>
<canvas id="myCanvas" width="300" height="300" tabindex="-1">
<a href="#">Link</a>
<button>Button</button>
<input type="text">
<input type="checkbox">
<input type="radio">
<input type="submit">
<select><option>1<option>2</select>
<span tabindex="0" role="button">ARIA button</span>
<span tabindex="0" role="link">ARIA link</span>
</canvas>
<div id="console"></div>
<script>
description("This test makes sure that AccessibilityNodeObjects are created for elements in a canvas subtree.");
if (window.layoutTestController && window.accessibilityController) {
window.layoutTestController.dumpAsText();
function appendFocusableDescendants(axObject, axFocusableList) {
for (var i = 0; i < axObject.childrenCount; i++) {
var axChild = axObject.childAtIndex(i);
if (axChild.isFocusable)
axFocusableList.push(axChild);
appendFocusableDescendants(axChild, axFocusableList);
}
}
var container = document.getElementById("myContainer");
container.focus();
var axContainer = accessibilityController.focusedElement;
var canvas = document.getElementById("myCanvas");
canvas.focus();
var axCanvas = accessibilityController.focusedElement;
var axRenderObjects = [];
var axNodeObjects = [];
appendFocusableDescendants(axContainer, axRenderObjects);
appendFocusableDescendants(axCanvas, axNodeObjects);
shouldBe("axRenderObjects.length", "axNodeObjects.length");
for (var i = 0; i < axRenderObjects.length; i++) {
var axRenderObject = axRenderObjects[i];
var axNodeObject = axNodeObjects[i];
shouldBe("i == " + i + "; axRenderObject.role == axNodeObject.role", "true");
}
}
</script>
<script src="../fast/js/resources/js-test-post.js"></script>
</body>
</html>
......@@ -935,6 +935,7 @@ SET(WebCore_SOURCES
accessibility/AccessibilityMenuListOption.cpp
accessibility/AccessibilityMenuListPopup.cpp
accessibility/AccessibilityMockObject.cpp
accessibility/AccessibilityNodeObject.cpp
accessibility/AccessibilityObject.cpp
accessibility/AccessibilityProgressIndicator.cpp
accessibility/AccessibilityRenderObject.cpp
......
2012-07-23 Dominic Mazzoni <dmazzoni@google.com>
AX: Need AccessibilityObjects for nodes without renderers in canvas subtree
https://bugs.webkit.org/show_bug.cgi?id=87899
Reviewed by Chris Fleizach.
Refactors AccessibilityRenderObject so that it inherits from a new class,
AccessibilityNodeObject, that can be constructed from a Node without a
renderer. Modifies AXObjectCache so that it automatically creates an
AccessibilityNodeObject for elements in a canvas subtree but not otherwise.
A new layout test verifies that this correctly exposes an accessibility
tree with appropriate roles for elements in a canvas subtree.
This patch does not try to complete the implementation of
AccessibilityNodeObject. Most AX methods are still unimplemented and need
to be migrated from AccessibilityRenderObject to AccessibilityNodeObject
in a future patch.
This patch also doesn't change anything outside of WebCore/accessibility, so
the rest of WebCore only calls AXObjectCache when there are changes to a
RenderObject, not to a Node. Accessible notifications on nodes without
renderers need to be implemented in a future patch.
Test: accessibility/canvas-accessibilitynodeobject.html
* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::get):
(WebCore):
(WebCore::createFromNode):
(WebCore::AXObjectCache::getOrCreate):
(WebCore::AXObjectCache::remove):
* accessibility/AXObjectCache.h:
(AXObjectCache):
(WebCore::AXObjectCache::get):
(WebCore::AXObjectCache::getOrCreate):
(WebCore::AXObjectCache::remove):
* accessibility/AccessibilityARIAGrid.cpp:
(WebCore::AccessibilityARIAGrid::AccessibilityARIAGrid):
(WebCore):
(WebCore::AccessibilityARIAGrid::~AccessibilityARIAGrid):
(WebCore::AccessibilityARIAGrid::init):
(WebCore::AccessibilityARIAGrid::create):
* accessibility/AccessibilityARIAGrid.h:
(AccessibilityARIAGrid):
* accessibility/AccessibilityARIAGridCell.cpp:
(WebCore::AccessibilityARIAGridCell::create):
* accessibility/AccessibilityARIAGridRow.cpp:
(WebCore::AccessibilityARIAGridRow::create):
* accessibility/AccessibilityAllInOne.cpp:
* accessibility/AccessibilityList.cpp:
(WebCore::AccessibilityList::create):
* accessibility/AccessibilityListBox.cpp:
(WebCore::AccessibilityListBox::create):
* accessibility/AccessibilityMediaControls.cpp:
(WebCore::AccessibilityMediaControl::create):
(WebCore::AccessibilityMediaControlsContainer::create):
(WebCore::AccessibilityMediaTimeline::create):
(WebCore::AccessibilityMediaTimeDisplay::create):
* accessibility/AccessibilityMenuList.cpp:
(WebCore::AccessibilityMenuList::create):
(WebCore):
* accessibility/AccessibilityMenuList.h:
(AccessibilityMenuList):
* accessibility/AccessibilityNodeObject.cpp: Added.
(WebCore):
(WebCore::AccessibilityNodeObject::AccessibilityNodeObject):
(WebCore::AccessibilityNodeObject::~AccessibilityNodeObject):
(WebCore::AccessibilityNodeObject::init):
(WebCore::AccessibilityNodeObject::create):
(WebCore::AccessibilityNodeObject::detach):
(WebCore::AccessibilityNodeObject::childrenChanged):
(WebCore::AccessibilityNodeObject::updateAccessibilityRole):
(WebCore::AccessibilityNodeObject::firstChild):
(WebCore::AccessibilityNodeObject::lastChild):
(WebCore::AccessibilityNodeObject::previousSibling):
(WebCore::AccessibilityNodeObject::nextSibling):
(WebCore::AccessibilityNodeObject::parentObjectIfExists):
(WebCore::AccessibilityNodeObject::parentObject):
(WebCore::AccessibilityNodeObject::elementRect):
(WebCore::AccessibilityNodeObject::setNode):
(WebCore::AccessibilityNodeObject::document):
(WebCore::AccessibilityNodeObject::determineAccessibilityRole):
(WebCore::AccessibilityNodeObject::addChildren):
(WebCore::AccessibilityNodeObject::accessibilityIsIgnored):
(WebCore::AccessibilityNodeObject::canSetFocusAttribute):
(WebCore::AccessibilityNodeObject::determineAriaRoleAttribute):
(WebCore::AccessibilityNodeObject::ariaRoleAttribute):
(WebCore::AccessibilityNodeObject::remapAriaRoleDueToParent):
* accessibility/AccessibilityNodeObject.h: Added.
(WebCore):
(AccessibilityNodeObject):
(WebCore::AccessibilityNodeObject::isAccessibilityNodeObject):
(WebCore::AccessibilityNodeObject::node):
(WebCore::AccessibilityNodeObject::isDetached):
(WebCore::toAccessibilityNodeObject):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isAccessibilityNodeObject):
* accessibility/AccessibilityProgressIndicator.cpp:
(WebCore::AccessibilityProgressIndicator::create):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::AccessibilityRenderObject):
(WebCore::AccessibilityRenderObject::init):
(WebCore):
(WebCore::AccessibilityRenderObject::create):
(WebCore::AccessibilityRenderObject::detach):
(WebCore::AccessibilityRenderObject::setRenderer):
(WebCore::AccessibilityRenderObject::canHaveChildren):
(WebCore::AccessibilityRenderObject::addCanvasChildren):
(WebCore::AccessibilityRenderObject::addChildren):
* accessibility/AccessibilityRenderObject.h:
(AccessibilityRenderObject):
* accessibility/AccessibilitySlider.cpp:
(WebCore::AccessibilitySlider::create):
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::AccessibilityTable):
(WebCore):
(WebCore::AccessibilityTable::~AccessibilityTable):
(WebCore::AccessibilityTable::init):
(WebCore::AccessibilityTable::create):
* accessibility/AccessibilityTable.h:
(AccessibilityTable):
* accessibility/AccessibilityTableCell.cpp:
(WebCore::AccessibilityTableCell::create):
* accessibility/AccessibilityTableRow.cpp:
(WebCore::AccessibilityTableRow::create):
2012-07-23 David Barr <davidbarr@chromium.org>
Fix ENABLE_CSS_IMAGE_ORIENTATION compile flag
......@@ -1317,6 +1317,8 @@ webcore_sources += \
Source/WebCore/accessibility/AccessibilityMenuListPopup.h \
Source/WebCore/accessibility/AccessibilityMockObject.cpp \
Source/WebCore/accessibility/AccessibilityMockObject.h \
Source/WebCore/accessibility/AccessibilityNodeObject.cpp \
Source/WebCore/accessibility/AccessibilityNodeObject.h \
Source/WebCore/accessibility/AccessibilityObject.cpp \
Source/WebCore/accessibility/AccessibilityObject.h \
Source/WebCore/accessibility/AccessibilityProgressIndicator.cpp \
......
......@@ -52,6 +52,7 @@ SOURCES += \
accessibility/AccessibilityList.cpp \
accessibility/AccessibilityListBox.cpp \
accessibility/AccessibilityListBoxOption.cpp \
accessibility/AccessibilityNodeObject.cpp \
accessibility/AccessibilityProgressIndicator.cpp \
accessibility/AccessibilityRenderObject.cpp \
accessibility/AccessibilityScrollbar.cpp \
......
......@@ -1794,6 +1794,8 @@
'accessibility/AccessibilityMenuListPopup.h',
'accessibility/AccessibilityMockObject.cpp',
'accessibility/AccessibilityMockObject.h',
'accessibility/AccessibilityNodeObject.cpp',
'accessibility/AccessibilityNodeObject.h',
'accessibility/AccessibilityObject.cpp',
'accessibility/AccessibilityProgressIndicator.cpp',
'accessibility/AccessibilityProgressIndicator.h',
......
......@@ -188,6 +188,23 @@ AccessibilityObject* AXObjectCache::get(RenderObject* renderer)
return m_objects.get(axID).get();
}
AccessibilityObject* AXObjectCache::get(Node* node)
{
if (!node)
return 0;
// Always prefer building the AccessibilityObject from the renderer if there is one.
if (node->renderer())
return get(node->renderer());
AXID axID = m_nodeObjectMapping.get(node);
ASSERT(!HashTraits<AXID>::isDeletedValue(axID));
if (!axID)
return 0;
return m_objects.get(axID).get();
}
// FIXME: This probably belongs on Node.
// FIXME: This should take a const char*, but one caller passes nullAtom.
bool nodeHasRole(Node* node, const String& role)
......@@ -252,6 +269,11 @@ static PassRefPtr<AccessibilityObject> createFromRenderer(RenderObject* renderer
return AccessibilityRenderObject::create(renderer);
}
static PassRefPtr<AccessibilityObject> createFromNode(Node* node)
{
return AccessibilityNodeObject::create(node);
}
AccessibilityObject* AXObjectCache::getOrCreate(Widget* widget)
{
if (!widget)
......@@ -273,7 +295,32 @@ AccessibilityObject* AXObjectCache::getOrCreate(Widget* widget)
attachWrapper(newObj.get());
return newObj.get();
}
AccessibilityObject* AXObjectCache::getOrCreate(Node* node)
{
if (!node)
return 0;
if (AccessibilityObject* obj = get(node))
return obj;
if (node->renderer())
return getOrCreate(node->renderer());
// It's only allowed to create an AccessibilityObject from a Node if it's in a canvas subtree.
if (!node->parentElement() || !node->parentElement()->isInCanvasSubtree())
return 0;
RefPtr<AccessibilityObject> newObj = createFromNode(node);
getAXID(newObj.get());
m_nodeObjectMapping.set(node, newObj->axObjectID());
m_objects.set(newObj->axObjectID(), newObj);
attachWrapper(newObj.get());
return newObj.get();
}
AccessibilityObject* AXObjectCache::getOrCreate(RenderObject* renderer)
{
if (!renderer)
......@@ -388,6 +435,24 @@ void AXObjectCache::remove(RenderObject* renderer)
m_renderObjectMapping.remove(renderer);
}
void AXObjectCache::remove(Node* node)
{
if (!node)
return;
removeNodeForUse(node);
// This is all safe even if we didn't have a mapping.
AXID axID = m_nodeObjectMapping.get(node);
remove(axID);
m_nodeObjectMapping.remove(node);
if (node->renderer()) {
remove(node->renderer());
return;
}
}
void AXObjectCache::remove(Widget* view)
{
if (!view)
......
......@@ -70,6 +70,7 @@ public:
// For AX objects with elements that back them.
AccessibilityObject* getOrCreate(RenderObject*);
AccessibilityObject* getOrCreate(Widget*);
AccessibilityObject* getOrCreate(Node*);
// used for objects without backing elements
AccessibilityObject* getOrCreate(AccessibilityRole);
......@@ -77,8 +78,10 @@ public:
// will only return the AccessibilityObject if it already exists
AccessibilityObject* get(RenderObject*);
AccessibilityObject* get(Widget*);
AccessibilityObject* get(Node*);
void remove(RenderObject*);
void remove(Node*);
void remove(Widget*);
void remove(AXID);
......@@ -182,6 +185,7 @@ private:
HashMap<AXID, RefPtr<AccessibilityObject> > m_objects;
HashMap<RenderObject*, AXID> m_renderObjectMapping;
HashMap<Widget*, AXID> m_widgetObjectMapping;
HashMap<Node*, AXID> m_nodeObjectMapping;
HashSet<Node*> m_textMarkerNodes;
static bool gAccessibilityEnabled;
static bool gAccessibilityEnhancedUserInterfaceEnabled;
......@@ -204,9 +208,11 @@ inline AXObjectCache::AXObjectCache(const Document* doc) : m_document(const_cast
inline AXObjectCache::~AXObjectCache() { }
inline AccessibilityObject* AXObjectCache::focusedUIElementForPage(const Page*) { return 0; }
inline AccessibilityObject* AXObjectCache::get(RenderObject*) { return 0; }
inline AccessibilityObject* AXObjectCache::get(Node*) { return 0; }
inline AccessibilityObject* AXObjectCache::get(Widget*) { return 0; }
inline AccessibilityObject* AXObjectCache::getOrCreate(AccessibilityRole) { return 0; }
inline AccessibilityObject* AXObjectCache::getOrCreate(RenderObject*) { return 0; }
inline AccessibilityObject* AXObjectCache::getOrCreate(Node*) { return 0; }
inline AccessibilityObject* AXObjectCache::getOrCreate(Widget*) { return 0; }
inline AccessibilityObject* AXObjectCache::rootObject() { return 0; }
inline AccessibilityObject* AXObjectCache::rootObjectForFrame(Frame*) { return 0; }
......@@ -233,6 +239,7 @@ inline void AXObjectCache::postNotification(RenderObject*, AXNotification, bool
inline void AXObjectCache::postPlatformNotification(AccessibilityObject*, AXNotification) { }
inline void AXObjectCache::remove(AXID) { }
inline void AXObjectCache::remove(RenderObject*) { }
inline void AXObjectCache::remove(Node*) { }
inline void AXObjectCache::remove(Widget*) { }
inline void AXObjectCache::selectedChildrenChanged(RenderObject*) { }
#endif
......
......@@ -43,6 +43,15 @@ namespace WebCore {
AccessibilityARIAGrid::AccessibilityARIAGrid(RenderObject* renderer)
: AccessibilityTable(renderer)
{
}
AccessibilityARIAGrid::~AccessibilityARIAGrid()
{
}
void AccessibilityARIAGrid::init()
{
AccessibilityTable::init();
#if ACCESSIBILITY_TABLES
m_isAccessibilityTable = true;
#else
......@@ -50,13 +59,11 @@ AccessibilityARIAGrid::AccessibilityARIAGrid(RenderObject* renderer)
#endif
}
AccessibilityARIAGrid::~AccessibilityARIAGrid()
{
}
PassRefPtr<AccessibilityARIAGrid> AccessibilityARIAGrid::create(RenderObject* renderer)
{
return adoptRef(new AccessibilityARIAGrid(renderer));
AccessibilityARIAGrid* obj = new AccessibilityARIAGrid(renderer);
obj->init();
return adoptRef(obj);
}
bool AccessibilityARIAGrid::addChild(AccessibilityObject* child, HashSet<AccessibilityObject*>& appendedRows, unsigned& columnCount)
......
......@@ -44,6 +44,8 @@ private:
public:
static PassRefPtr<AccessibilityARIAGrid> create(RenderObject*);
virtual ~AccessibilityARIAGrid();
virtual void init();
virtual bool isAriaTable() const { return true; }
......
......@@ -48,7 +48,9 @@ AccessibilityARIAGridCell::~AccessibilityARIAGridCell()
PassRefPtr<AccessibilityARIAGridCell> AccessibilityARIAGridCell::create(RenderObject* renderer)
{
return adoptRef(new AccessibilityARIAGridCell(renderer));
AccessibilityARIAGridCell* obj = new AccessibilityARIAGridCell(renderer);
obj->init();
return adoptRef(obj);
}
AccessibilityObject* AccessibilityARIAGridCell::parentTable() const
......
......@@ -48,7 +48,9 @@ AccessibilityARIAGridRow::~AccessibilityARIAGridRow()
PassRefPtr<AccessibilityARIAGridRow> AccessibilityARIAGridRow::create(RenderObject* renderer)
{
return adoptRef(new AccessibilityARIAGridRow(renderer));
AccessibilityARIAGridRow* obj = new AccessibilityARIAGridRow(renderer);
obj->init();
return adoptRef(obj);
}
bool AccessibilityARIAGridRow::isARIATreeGridRow() const
......
......@@ -34,6 +34,7 @@
#include "AccessibilityListBox.cpp"
#include "AccessibilityListBoxOption.cpp"
#include "AccessibilityMediaControls.cpp"
#include "AccessibilityNodeObject.cpp"
#include "AccessibilityObject.cpp"
#include "AccessibilityRenderObject.cpp"
#include "AccessibilityScrollView.cpp"
......
......@@ -50,7 +50,9 @@ AccessibilityList::~AccessibilityList()
PassRefPtr<AccessibilityList> AccessibilityList::create(RenderObject* renderer)
{
return adoptRef(new AccessibilityList(renderer));
AccessibilityList* obj = new AccessibilityList(renderer);
obj->init();
return adoptRef(obj);
}
bool AccessibilityList::accessibilityIsIgnored() const
......
......@@ -54,7 +54,9 @@ AccessibilityListBox::~AccessibilityListBox()
PassRefPtr<AccessibilityListBox> AccessibilityListBox::create(RenderObject* renderer)
{
return adoptRef(new AccessibilityListBox(renderer));
AccessibilityListBox* obj = new AccessibilityListBox(renderer);
obj->init();
return adoptRef(obj);
}
bool AccessibilityListBox::canSetSelectedChildrenAttribute() const
......
......@@ -67,8 +67,11 @@ PassRefPtr<AccessibilityObject> AccessibilityMediaControl::create(RenderObject*
case MediaControlsPanel:
return AccessibilityMediaControlsContainer::create(renderer);
default:
return adoptRef(new AccessibilityMediaControl(renderer));
default: {
AccessibilityMediaControl* obj = new AccessibilityMediaControl(renderer);
obj->init();
return adoptRef(obj);
}
}
}
......@@ -207,7 +210,9 @@ AccessibilityMediaControlsContainer::AccessibilityMediaControlsContainer(RenderO
PassRefPtr<AccessibilityObject> AccessibilityMediaControlsContainer::create(RenderObject* renderer)
{
return adoptRef(new AccessibilityMediaControlsContainer(renderer));
AccessibilityMediaControlsContainer* obj = new AccessibilityMediaControlsContainer(renderer);
obj->init();
return adoptRef(obj);
}
String AccessibilityMediaControlsContainer::accessibilityDescription() const
......@@ -251,7 +256,9 @@ AccessibilityMediaTimeline::AccessibilityMediaTimeline(RenderObject* renderer)
PassRefPtr<AccessibilityObject> AccessibilityMediaTimeline::create(RenderObject* renderer)
{
return adoptRef(new AccessibilityMediaTimeline(renderer));
AccessibilityMediaTimeline* obj = new AccessibilityMediaTimeline(renderer);
obj->init();
return adoptRef(obj);
}
String AccessibilityMediaTimeline::valueDescription() const
......@@ -281,7 +288,9 @@ AccessibilityMediaTimeDisplay::AccessibilityMediaTimeDisplay(RenderObject* rende
PassRefPtr<AccessibilityObject> AccessibilityMediaTimeDisplay::create(RenderObject* renderer)
{
return adoptRef(new AccessibilityMediaTimeDisplay(renderer));
AccessibilityMediaTimeDisplay* obj = new AccessibilityMediaTimeDisplay(renderer);
obj->init();
return adoptRef(obj);
}
bool AccessibilityMediaTimeDisplay::accessibilityIsIgnored() const
......
......@@ -37,6 +37,13 @@ AccessibilityMenuList::AccessibilityMenuList(RenderMenuList* renderer)
{
}
PassRefPtr<AccessibilityMenuList> AccessibilityMenuList::create(RenderMenuList* renderer)
{
AccessibilityMenuList* obj = new AccessibilityMenuList(renderer);
obj->init();
return adoptRef(obj);
}
bool AccessibilityMenuList::press() const
{
RenderMenuList* menuList = static_cast<RenderMenuList*>(m_renderer);
......
......@@ -37,7 +37,7 @@ class RenderMenuList;
class AccessibilityMenuList : public AccessibilityRenderObject {
public:
static PassRefPtr<AccessibilityMenuList> create(RenderMenuList* renderer) { return adoptRef(new AccessibilityMenuList(renderer)); }
static PassRefPtr<AccessibilityMenuList> create(RenderMenuList* renderer);
virtual bool isCollapsed() const;
virtual bool press() const;
......
/*
* Copyright (C) 2012, Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT