haikuwebkit/LayoutTests/accessibility/accessibility-node-reparent...

66 lines
2.6 KiB
HTML
Raw Permalink Normal View History

AX: Calls to AXObjectCache should prefer Node over Renderer https://bugs.webkit.org/show_bug.cgi?id=91794 Reviewed by Chris Fleizach. Source/WebCore: Now that it's possible for nodes inside a canvas subtree to be focused and represent accessible content, accessibility notifications should be triggered with a Node* rather than with a RenderObject* whenever possible. Every public API in AXObjectCache that took a RenderObject* before now either takes a Node* instead, or has a parallel method that takes a Node*. Tests: accessibility/accessibility-node-memory-management.html accessibility/accessibility-node-reparent.html accessibility/canvas-fallback-content.html * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::focusedImageMapUIElement): (WebCore::AXObjectCache::focusedUIElementForPage): (WebCore::AXObjectCache::get): (WebCore::AXObjectCache::getOrCreate): (WebCore::AXObjectCache::contentChanged): (WebCore): (WebCore::AXObjectCache::updateCacheAfterNodeIsAttached): (WebCore::AXObjectCache::childrenChanged): (WebCore::AXObjectCache::postNotification): (WebCore::AXObjectCache::checkedStateChanged): (WebCore::AXObjectCache::selectedChildrenChanged): (WebCore::AXObjectCache::nodeTextChangeNotification): (WebCore::AXObjectCache::handleAriaExpandedChange): (WebCore::AXObjectCache::handleActiveDescendantChanged): (WebCore::AXObjectCache::handleAriaRoleChanged): (WebCore::AXObjectCache::textMarkerDataForVisiblePosition): (WebCore::AXObjectCache::rootAXEditableElement): (WebCore::AXObjectCache::nodeIsTextControl): * accessibility/AXObjectCache.h: (AXObjectCache): (WebCore::AXObjectCache::setNodeInUse): (WebCore::AXObjectCache::removeNodeForUse): (WebCore::AXObjectCache::isNodeInUse): (WebCore::AXObjectCache::checkedStateChanged): (WebCore::AXObjectCache::childrenChanged): (WebCore::AXObjectCache::contentChanged): (WebCore::AXObjectCache::updateCacheAfterNodeIsAttached): (WebCore::AXObjectCache::handleActiveDescendantChanged): (WebCore::AXObjectCache::handleAriaExpandedChange): (WebCore::AXObjectCache::handleAriaRoleChanged): (WebCore::AXObjectCache::handleFocusedUIElementChanged): (WebCore::AXObjectCache::nodeTextChangeNotification): (WebCore::AXObjectCache::postNotification): (WebCore::AXObjectCache::selectedChildrenChanged): * accessibility/AccessibilityListBoxOption.cpp: (WebCore::AccessibilityListBoxOption::parentObject): * accessibility/AccessibilityObject.cpp: (WebCore::appendAccessibilityObject): (WebCore::replacedNodeNeedsCharacter): * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::menuForMenuButton): (WebCore::AccessibilityRenderObject::menuButtonForMenu): (WebCore::AccessibilityRenderObject::checkboxOrRadioRect): (WebCore::AccessibilityRenderObject::addRadioButtonGroupMembers): (WebCore::AccessibilityRenderObject::titleUIElement): (WebCore::AccessibilityRenderObject::isTabItemSelected): (WebCore::AccessibilityRenderObject::accessibilityParentForImageMap): (WebCore::AccessibilityRenderObject::nodeIsTextControl): (WebCore::AccessibilityRenderObject::activeDescendant): (WebCore::AccessibilityRenderObject::correspondingControlForLabelElement): (WebCore::AccessibilityRenderObject::correspondingLabelForControlElement): * accessibility/AccessibilityRenderObject.h: (AccessibilityRenderObject): * accessibility/AccessibilityScrollView.cpp: (WebCore::AccessibilityScrollView::webAreaObject): (WebCore::AccessibilityScrollView::parentObject): (WebCore::AccessibilityScrollView::parentObjectIfExists): * accessibility/chromium/AXObjectCacheChromium.cpp: (WebCore::AXObjectCache::postPlatformNotification): (WebCore::AXObjectCache::handleFocusedUIElementChanged): * accessibility/gtk/AXObjectCacheAtk.cpp: (WebCore::AXObjectCache::handleFocusedUIElementChanged): * accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXObjectCache::handleFocusedUIElementChanged): * accessibility/win/AXObjectCacheWin.cpp: (WebCore::AXObjectCache::handleFocusedUIElementChanged): * bindings/cpp/WebDOMCustomVoidCallback.cpp: (toWebCore): * dom/Document.cpp: (WebCore::Document::setFocusedNode): * dom/Element.cpp: (WebCore::Element::attributeChanged): * dom/Node.cpp: (WebCore::Node::~Node): (WebCore::Node::attach): * editing/AppendNodeCommand.cpp: (WebCore::sendAXTextChangedIgnoringLineBreaks): * editing/DeleteFromTextNodeCommand.cpp: (WebCore::DeleteFromTextNodeCommand::doApply): (WebCore::DeleteFromTextNodeCommand::doUnapply): * editing/Editor.cpp: (WebCore::Editor::respondToChangedContents): (WebCore::Editor::markAndReplaceFor): * editing/InsertIntoTextNodeCommand.cpp: (WebCore::InsertIntoTextNodeCommand::doApply): (WebCore::InsertIntoTextNodeCommand::doUnapply): * editing/InsertNodeBeforeCommand.cpp: (WebCore::InsertNodeBeforeCommand::doApply): (WebCore::InsertNodeBeforeCommand::doUnapply): * editing/chromium/FrameSelectionChromium.cpp: (WebCore::FrameSelection::notifyAccessibilityForSelectionChange): * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::setChecked): * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::childrenChanged): (WebCore::HTMLSelectElement::optionElementChildrenChanged): * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::setInnerTextValue): * html/InputType.cpp: (WebCore::InputType::applyStep): * html/RangeInputType.cpp: (WebCore::RangeInputType::handleKeydownEvent): * page/FocusController.cpp: (WebCore::FocusController::setInitialFocus): LayoutTests: New tests: - canvas-fallback-content tests that objects in a canvas subtree can be focused and then you can retrieve the role of the accessible object. - accessibility-node-memory-management ensures that an AccessibilityNodeObject is detached when its node is destroyed. - accessibility-node-reparent ensures that if an AccessibilityNodeObject is created for a node without a renderer, but the node later gets a renderer, the AccessibilityNodeObject is detached and an AccessibilityRenderObject is created instead. * accessibility/accessibility-node-memory-management-expected.txt: Added. * accessibility/accessibility-node-memory-management.html: Added. * accessibility/accessibility-node-reparent-expected.txt: Added. * accessibility/accessibility-node-reparent.html: Added. * accessibility/canvas-fallback-content-expected.txt: Added. * accessibility/canvas-fallback-content.html: Added. * platform/gtk/TestExpectations: Canonical link: https://commits.webkit.org/111968@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@125710 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-08-15 21:31:35 +00:00
<!DOCTYPE HTML>
<html>
<body>
Change LayoutTests' a* and b* files to use pre and post js files in LayoutTests/resources. https://bugs.webkit.org/show_bug.cgi?id=120985. Rubber stamped by Filip Pizlo. * accessibility/accessibility-node-memory-management.html: * accessibility/accessibility-node-reparent.html: * accessibility/accessibility-object-detached.html: * accessibility/adjacent-continuations-cause-assertion-failure.html: * accessibility/anonymous-render-block-in-continuation-causes-crash.html: * accessibility/aria-checkbox-checked.html: * accessibility/aria-checkbox-sends-notification.html: * accessibility/aria-checkbox-text.html: * accessibility/aria-combobox.html: * accessibility/aria-controls-with-tabs.html: * accessibility/aria-disabled.html: * accessibility/aria-fallback-roles.html: * accessibility/aria-help.html: * accessibility/aria-hidden-hides-all-elements.html: * accessibility/aria-hidden-update.html: * accessibility/aria-hidden-updates-alldescendants.html: * accessibility/aria-hidden-with-elements.html: * accessibility/aria-hidden.html: * accessibility/aria-invalid.html: * accessibility/aria-label.html: * accessibility/aria-labelledby-overrides-label.html: * accessibility/aria-list-and-listitem.html: * accessibility/aria-menubar-menuitems.html: * accessibility/aria-option-role.html: * accessibility/aria-presentational-role.html: * accessibility/aria-readonly.html: * accessibility/aria-required.html: * accessibility/aria-scrollbar-role.html: * accessibility/aria-sort.html: * accessibility/aria-tab-role-on-buttons.html: * accessibility/aria-tab-roles.html: * accessibility/aria-text-role.html: * accessibility/aria-toggle-button-with-title.html: * accessibility/aria-used-on-image-maps.html: * accessibility/button-title-uses-inner-img-alt.html: * accessibility/canvas-accessibilitynodeobject.html: * accessibility/canvas-description-and-role.html: * accessibility/canvas-fallback-content-2.html: * accessibility/canvas-fallback-content.html: * accessibility/color-well.html: * accessibility/container-node-delete-causes-crash.html: * accessibility/content-changed-notification-causes-crash.html: * accessibility/contenteditable-hidden-div.html: * accessibility/contenteditable-table-check-causes-crash.html: * accessibility/corresponding-control-deleted-crash.html: * accessibility/crash-adopt-node-from-new-document.html: * accessibility/crash-determining-aria-role-when-label-present.html: * accessibility/crash-with-noelement-selectbox.html: * accessibility/crashing-a-tag-in-map.html: * accessibility/deleting-iframe-destroys-axcache.html: * accessibility/disabled-controls-not-focusable.html: * accessibility/div-within-anchors-causes-crash.html: * accessibility/duplicate-axrenderobject-crash.html: * accessibility/duplicate-child-nodes.html: * accessibility/element-haspopup.html: * accessibility/ellipsis-text.html: * accessibility/empty-image-with-title.html: * accessibility/file-upload-button-with-axpress.html: * accessibility/first-letter-text-transform-causes-crash.html: * accessibility/focusable-div.html: * accessibility/global-aria-attributes-invalidate-presentational.html: * accessibility/hang-in-isignored.html: * accessibility/heading-level.html: * accessibility/heading-title-includes-links.html: * accessibility/hidden-legend.html: * accessibility/html-html-element-is-ignored.html: * accessibility/html5-required-attribute.html: * accessibility/iframe-bastardization.html: * accessibility/image-map-title-causes-crash.html: * accessibility/image-map-update-parent-crash.html: * accessibility/image-map1.html: * accessibility/img-alt-tag-only-whitespace.html: * accessibility/img-aria-button-alt-tag.html: * accessibility/img-fallsback-to-title.html: * accessibility/inline-continuations.html: * accessibility/input-file-causes-crash.html: * accessibility/input-image-alt.html: * accessibility/insert-selected-option-into-select-causes-crash.html: * accessibility/label-element-press.html: * accessibility/label-for-control-hittest.html: * accessibility/legend.html: * accessibility/link-inside-button-accessible-text.html: * accessibility/listbox-enabled-states.html: * accessibility/loading-iframe-sends-notification.html: * accessibility/loading-iframe-updates-axtree.html: * accessibility/media-controls.html: * accessibility/media-element.html: * accessibility/menu-item-crash.html: * accessibility/menu-list-sends-change-notification.html: * accessibility/meter-element.html: * accessibility/multiselect-list-reports-active-option.html: * accessibility/non-native-image-crash.html: * accessibility/noscript-ignored.html: * accessibility/notification-listeners.html: * accessibility/placeholder.html: * accessibility/platform-name.html: * accessibility/poorly-formed-aria-table.html: * accessibility/popup-button-title.html: * accessibility/presentational-elements-with-focus.html: * accessibility/press-works-on-control-types.html: * accessibility/radio-button-title-label.html: * accessibility/removed-anonymous-block-child-causes-crash.html: * accessibility/removed-continuation-element-causes-crash.html: * accessibility/render-counter-text.html: * accessibility/selection-states.html: * accessibility/spinbutton-value.html: * accessibility/svg-bounds.html: * accessibility/svg-group-element-with-title.html: * accessibility/svg-image.html: * accessibility/svg-remote-element.html: * accessibility/table-cell-for-column-and-row-crash.html: * accessibility/table-destroyed-crash.html: * accessibility/table-remove-cell-crash.html: * accessibility/table-with-empty-thead-causes-crash.html: * accessibility/table-with-hidden-head-section.html: * accessibility/table-with-mismatch-column-count-in-initial-section.html: * accessibility/text-role-with-aria-hidden-inside.html: * accessibility/textarea-insertion-point-line-number.html: * accessibility/textbox-role-reports-selection.html: * accessibility/title-ui-element-correctness.html: * accessibility/transformed-bounds.html: * accessibility/updating-attribute-in-table-causes-crash.html: * animations/animation-css-rule-types.html: * animations/animation-events-create.html: * animations/computed-style.html: * animations/keyframes-rule.html: * animations/script-tests/TEMPLATE.html: * batterystatus/add-listener-from-callback.html: * batterystatus/basic-all-types-of-events.html: * batterystatus/basic-operation.html: * batterystatus/event-after-navigation.html: * batterystatus/multiple-frames.html: * batterystatus/updates.html: * batterystatus/window-property.html: Canonical link: https://commits.webkit.org/138878@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@155274 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-09-08 01:18:24 +00:00
<script src="../resources/js-test-pre.js"></script>
AX: Calls to AXObjectCache should prefer Node over Renderer https://bugs.webkit.org/show_bug.cgi?id=91794 Reviewed by Chris Fleizach. Source/WebCore: Now that it's possible for nodes inside a canvas subtree to be focused and represent accessible content, accessibility notifications should be triggered with a Node* rather than with a RenderObject* whenever possible. Every public API in AXObjectCache that took a RenderObject* before now either takes a Node* instead, or has a parallel method that takes a Node*. Tests: accessibility/accessibility-node-memory-management.html accessibility/accessibility-node-reparent.html accessibility/canvas-fallback-content.html * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::focusedImageMapUIElement): (WebCore::AXObjectCache::focusedUIElementForPage): (WebCore::AXObjectCache::get): (WebCore::AXObjectCache::getOrCreate): (WebCore::AXObjectCache::contentChanged): (WebCore): (WebCore::AXObjectCache::updateCacheAfterNodeIsAttached): (WebCore::AXObjectCache::childrenChanged): (WebCore::AXObjectCache::postNotification): (WebCore::AXObjectCache::checkedStateChanged): (WebCore::AXObjectCache::selectedChildrenChanged): (WebCore::AXObjectCache::nodeTextChangeNotification): (WebCore::AXObjectCache::handleAriaExpandedChange): (WebCore::AXObjectCache::handleActiveDescendantChanged): (WebCore::AXObjectCache::handleAriaRoleChanged): (WebCore::AXObjectCache::textMarkerDataForVisiblePosition): (WebCore::AXObjectCache::rootAXEditableElement): (WebCore::AXObjectCache::nodeIsTextControl): * accessibility/AXObjectCache.h: (AXObjectCache): (WebCore::AXObjectCache::setNodeInUse): (WebCore::AXObjectCache::removeNodeForUse): (WebCore::AXObjectCache::isNodeInUse): (WebCore::AXObjectCache::checkedStateChanged): (WebCore::AXObjectCache::childrenChanged): (WebCore::AXObjectCache::contentChanged): (WebCore::AXObjectCache::updateCacheAfterNodeIsAttached): (WebCore::AXObjectCache::handleActiveDescendantChanged): (WebCore::AXObjectCache::handleAriaExpandedChange): (WebCore::AXObjectCache::handleAriaRoleChanged): (WebCore::AXObjectCache::handleFocusedUIElementChanged): (WebCore::AXObjectCache::nodeTextChangeNotification): (WebCore::AXObjectCache::postNotification): (WebCore::AXObjectCache::selectedChildrenChanged): * accessibility/AccessibilityListBoxOption.cpp: (WebCore::AccessibilityListBoxOption::parentObject): * accessibility/AccessibilityObject.cpp: (WebCore::appendAccessibilityObject): (WebCore::replacedNodeNeedsCharacter): * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::menuForMenuButton): (WebCore::AccessibilityRenderObject::menuButtonForMenu): (WebCore::AccessibilityRenderObject::checkboxOrRadioRect): (WebCore::AccessibilityRenderObject::addRadioButtonGroupMembers): (WebCore::AccessibilityRenderObject::titleUIElement): (WebCore::AccessibilityRenderObject::isTabItemSelected): (WebCore::AccessibilityRenderObject::accessibilityParentForImageMap): (WebCore::AccessibilityRenderObject::nodeIsTextControl): (WebCore::AccessibilityRenderObject::activeDescendant): (WebCore::AccessibilityRenderObject::correspondingControlForLabelElement): (WebCore::AccessibilityRenderObject::correspondingLabelForControlElement): * accessibility/AccessibilityRenderObject.h: (AccessibilityRenderObject): * accessibility/AccessibilityScrollView.cpp: (WebCore::AccessibilityScrollView::webAreaObject): (WebCore::AccessibilityScrollView::parentObject): (WebCore::AccessibilityScrollView::parentObjectIfExists): * accessibility/chromium/AXObjectCacheChromium.cpp: (WebCore::AXObjectCache::postPlatformNotification): (WebCore::AXObjectCache::handleFocusedUIElementChanged): * accessibility/gtk/AXObjectCacheAtk.cpp: (WebCore::AXObjectCache::handleFocusedUIElementChanged): * accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXObjectCache::handleFocusedUIElementChanged): * accessibility/win/AXObjectCacheWin.cpp: (WebCore::AXObjectCache::handleFocusedUIElementChanged): * bindings/cpp/WebDOMCustomVoidCallback.cpp: (toWebCore): * dom/Document.cpp: (WebCore::Document::setFocusedNode): * dom/Element.cpp: (WebCore::Element::attributeChanged): * dom/Node.cpp: (WebCore::Node::~Node): (WebCore::Node::attach): * editing/AppendNodeCommand.cpp: (WebCore::sendAXTextChangedIgnoringLineBreaks): * editing/DeleteFromTextNodeCommand.cpp: (WebCore::DeleteFromTextNodeCommand::doApply): (WebCore::DeleteFromTextNodeCommand::doUnapply): * editing/Editor.cpp: (WebCore::Editor::respondToChangedContents): (WebCore::Editor::markAndReplaceFor): * editing/InsertIntoTextNodeCommand.cpp: (WebCore::InsertIntoTextNodeCommand::doApply): (WebCore::InsertIntoTextNodeCommand::doUnapply): * editing/InsertNodeBeforeCommand.cpp: (WebCore::InsertNodeBeforeCommand::doApply): (WebCore::InsertNodeBeforeCommand::doUnapply): * editing/chromium/FrameSelectionChromium.cpp: (WebCore::FrameSelection::notifyAccessibilityForSelectionChange): * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::setChecked): * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::childrenChanged): (WebCore::HTMLSelectElement::optionElementChildrenChanged): * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::setInnerTextValue): * html/InputType.cpp: (WebCore::InputType::applyStep): * html/RangeInputType.cpp: (WebCore::RangeInputType::handleKeydownEvent): * page/FocusController.cpp: (WebCore::FocusController::setInitialFocus): LayoutTests: New tests: - canvas-fallback-content tests that objects in a canvas subtree can be focused and then you can retrieve the role of the accessible object. - accessibility-node-memory-management ensures that an AccessibilityNodeObject is detached when its node is destroyed. - accessibility-node-reparent ensures that if an AccessibilityNodeObject is created for a node without a renderer, but the node later gets a renderer, the AccessibilityNodeObject is detached and an AccessibilityRenderObject is created instead. * accessibility/accessibility-node-memory-management-expected.txt: Added. * accessibility/accessibility-node-memory-management.html: Added. * accessibility/accessibility-node-reparent-expected.txt: Added. * accessibility/accessibility-node-reparent.html: Added. * accessibility/canvas-fallback-content-expected.txt: Added. * accessibility/canvas-fallback-content.html: Added. * platform/gtk/TestExpectations: Canonical link: https://commits.webkit.org/111968@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@125710 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-08-15 21:31:35 +00:00
<div id="container" tabindex="-1"></div>
<canvas id="canvas" tabindex="-1"></canvas>
<div id="console"></div>
<script>
description("This test makes sure that AccessibilityNodeObjects are properly detached when the node they point to is reparented to a location that allows them to have a renderer.");
if (window.testRunner && window.accessibilityController) {
window.testRunner.dumpAsText();
// Create an ordinary button on the page, focus it and get its accessibility role.
var button = document.createElement('button');
document.body.appendChild(button);
button.focus();
window.axElement = accessibilityController.focusedElement;
window.expectedButtonRole = axElement.role;
// Now remove the node from the tree and get the role of the detached accessibility object.
document.body.removeChild(button);
window.expectedDetachedRole = axElement.role;
shouldBeTrue("expectedButtonRole != expectedDetachedRole");
// This time create a button that's a child of a canvas element. It will be focusable but not rendered.
// In particular, this will create an AccessibilityNodeObject rather than an AccessibilityRenderObject.
var canvas = document.getElementById('canvas');
(function() {
var button = document.createElement('button');
canvas.appendChild(button);
// Note: focusing the button and using that to get its accessibility object creates an extra
// reference to the button and it won't get deleted when we want it to. So instead we focus the
// canvas and get its first child.
canvas.focus();
window.axElement = accessibilityController.focusedElement.childAtIndex(0);
window.canvasButtonRole = axElement.role;
shouldBe("canvasButtonRole", "expectedButtonRole");
// Now reparent the node to a container that's not a canvas.
var container = document.getElementById('container');
container.appendChild(button);
container.focus();
window.axReparentedElement = accessibilityController.focusedElement.childAtIndex(0);
})();
// Ensure that the old accessibility object is detached by checking its role.
window.detachedCanvasButtonRole = axElement.role;
shouldBe("detachedCanvasButtonRole", "expectedDetachedRole");
// Ensure that the new accessibility object for the now-reparented node has the correct role.
window.reparentedButtonRole = axReparentedElement.role;
shouldBe("reparentedButtonRole", "expectedButtonRole");
}
</script>
Change LayoutTests' a* and b* files to use pre and post js files in LayoutTests/resources. https://bugs.webkit.org/show_bug.cgi?id=120985. Rubber stamped by Filip Pizlo. * accessibility/accessibility-node-memory-management.html: * accessibility/accessibility-node-reparent.html: * accessibility/accessibility-object-detached.html: * accessibility/adjacent-continuations-cause-assertion-failure.html: * accessibility/anonymous-render-block-in-continuation-causes-crash.html: * accessibility/aria-checkbox-checked.html: * accessibility/aria-checkbox-sends-notification.html: * accessibility/aria-checkbox-text.html: * accessibility/aria-combobox.html: * accessibility/aria-controls-with-tabs.html: * accessibility/aria-disabled.html: * accessibility/aria-fallback-roles.html: * accessibility/aria-help.html: * accessibility/aria-hidden-hides-all-elements.html: * accessibility/aria-hidden-update.html: * accessibility/aria-hidden-updates-alldescendants.html: * accessibility/aria-hidden-with-elements.html: * accessibility/aria-hidden.html: * accessibility/aria-invalid.html: * accessibility/aria-label.html: * accessibility/aria-labelledby-overrides-label.html: * accessibility/aria-list-and-listitem.html: * accessibility/aria-menubar-menuitems.html: * accessibility/aria-option-role.html: * accessibility/aria-presentational-role.html: * accessibility/aria-readonly.html: * accessibility/aria-required.html: * accessibility/aria-scrollbar-role.html: * accessibility/aria-sort.html: * accessibility/aria-tab-role-on-buttons.html: * accessibility/aria-tab-roles.html: * accessibility/aria-text-role.html: * accessibility/aria-toggle-button-with-title.html: * accessibility/aria-used-on-image-maps.html: * accessibility/button-title-uses-inner-img-alt.html: * accessibility/canvas-accessibilitynodeobject.html: * accessibility/canvas-description-and-role.html: * accessibility/canvas-fallback-content-2.html: * accessibility/canvas-fallback-content.html: * accessibility/color-well.html: * accessibility/container-node-delete-causes-crash.html: * accessibility/content-changed-notification-causes-crash.html: * accessibility/contenteditable-hidden-div.html: * accessibility/contenteditable-table-check-causes-crash.html: * accessibility/corresponding-control-deleted-crash.html: * accessibility/crash-adopt-node-from-new-document.html: * accessibility/crash-determining-aria-role-when-label-present.html: * accessibility/crash-with-noelement-selectbox.html: * accessibility/crashing-a-tag-in-map.html: * accessibility/deleting-iframe-destroys-axcache.html: * accessibility/disabled-controls-not-focusable.html: * accessibility/div-within-anchors-causes-crash.html: * accessibility/duplicate-axrenderobject-crash.html: * accessibility/duplicate-child-nodes.html: * accessibility/element-haspopup.html: * accessibility/ellipsis-text.html: * accessibility/empty-image-with-title.html: * accessibility/file-upload-button-with-axpress.html: * accessibility/first-letter-text-transform-causes-crash.html: * accessibility/focusable-div.html: * accessibility/global-aria-attributes-invalidate-presentational.html: * accessibility/hang-in-isignored.html: * accessibility/heading-level.html: * accessibility/heading-title-includes-links.html: * accessibility/hidden-legend.html: * accessibility/html-html-element-is-ignored.html: * accessibility/html5-required-attribute.html: * accessibility/iframe-bastardization.html: * accessibility/image-map-title-causes-crash.html: * accessibility/image-map-update-parent-crash.html: * accessibility/image-map1.html: * accessibility/img-alt-tag-only-whitespace.html: * accessibility/img-aria-button-alt-tag.html: * accessibility/img-fallsback-to-title.html: * accessibility/inline-continuations.html: * accessibility/input-file-causes-crash.html: * accessibility/input-image-alt.html: * accessibility/insert-selected-option-into-select-causes-crash.html: * accessibility/label-element-press.html: * accessibility/label-for-control-hittest.html: * accessibility/legend.html: * accessibility/link-inside-button-accessible-text.html: * accessibility/listbox-enabled-states.html: * accessibility/loading-iframe-sends-notification.html: * accessibility/loading-iframe-updates-axtree.html: * accessibility/media-controls.html: * accessibility/media-element.html: * accessibility/menu-item-crash.html: * accessibility/menu-list-sends-change-notification.html: * accessibility/meter-element.html: * accessibility/multiselect-list-reports-active-option.html: * accessibility/non-native-image-crash.html: * accessibility/noscript-ignored.html: * accessibility/notification-listeners.html: * accessibility/placeholder.html: * accessibility/platform-name.html: * accessibility/poorly-formed-aria-table.html: * accessibility/popup-button-title.html: * accessibility/presentational-elements-with-focus.html: * accessibility/press-works-on-control-types.html: * accessibility/radio-button-title-label.html: * accessibility/removed-anonymous-block-child-causes-crash.html: * accessibility/removed-continuation-element-causes-crash.html: * accessibility/render-counter-text.html: * accessibility/selection-states.html: * accessibility/spinbutton-value.html: * accessibility/svg-bounds.html: * accessibility/svg-group-element-with-title.html: * accessibility/svg-image.html: * accessibility/svg-remote-element.html: * accessibility/table-cell-for-column-and-row-crash.html: * accessibility/table-destroyed-crash.html: * accessibility/table-remove-cell-crash.html: * accessibility/table-with-empty-thead-causes-crash.html: * accessibility/table-with-hidden-head-section.html: * accessibility/table-with-mismatch-column-count-in-initial-section.html: * accessibility/text-role-with-aria-hidden-inside.html: * accessibility/textarea-insertion-point-line-number.html: * accessibility/textbox-role-reports-selection.html: * accessibility/title-ui-element-correctness.html: * accessibility/transformed-bounds.html: * accessibility/updating-attribute-in-table-causes-crash.html: * animations/animation-css-rule-types.html: * animations/animation-events-create.html: * animations/computed-style.html: * animations/keyframes-rule.html: * animations/script-tests/TEMPLATE.html: * batterystatus/add-listener-from-callback.html: * batterystatus/basic-all-types-of-events.html: * batterystatus/basic-operation.html: * batterystatus/event-after-navigation.html: * batterystatus/multiple-frames.html: * batterystatus/updates.html: * batterystatus/window-property.html: Canonical link: https://commits.webkit.org/138878@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@155274 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-09-08 01:18:24 +00:00
<script src="../resources/js-test-post.js"></script>
AX: Calls to AXObjectCache should prefer Node over Renderer https://bugs.webkit.org/show_bug.cgi?id=91794 Reviewed by Chris Fleizach. Source/WebCore: Now that it's possible for nodes inside a canvas subtree to be focused and represent accessible content, accessibility notifications should be triggered with a Node* rather than with a RenderObject* whenever possible. Every public API in AXObjectCache that took a RenderObject* before now either takes a Node* instead, or has a parallel method that takes a Node*. Tests: accessibility/accessibility-node-memory-management.html accessibility/accessibility-node-reparent.html accessibility/canvas-fallback-content.html * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::focusedImageMapUIElement): (WebCore::AXObjectCache::focusedUIElementForPage): (WebCore::AXObjectCache::get): (WebCore::AXObjectCache::getOrCreate): (WebCore::AXObjectCache::contentChanged): (WebCore): (WebCore::AXObjectCache::updateCacheAfterNodeIsAttached): (WebCore::AXObjectCache::childrenChanged): (WebCore::AXObjectCache::postNotification): (WebCore::AXObjectCache::checkedStateChanged): (WebCore::AXObjectCache::selectedChildrenChanged): (WebCore::AXObjectCache::nodeTextChangeNotification): (WebCore::AXObjectCache::handleAriaExpandedChange): (WebCore::AXObjectCache::handleActiveDescendantChanged): (WebCore::AXObjectCache::handleAriaRoleChanged): (WebCore::AXObjectCache::textMarkerDataForVisiblePosition): (WebCore::AXObjectCache::rootAXEditableElement): (WebCore::AXObjectCache::nodeIsTextControl): * accessibility/AXObjectCache.h: (AXObjectCache): (WebCore::AXObjectCache::setNodeInUse): (WebCore::AXObjectCache::removeNodeForUse): (WebCore::AXObjectCache::isNodeInUse): (WebCore::AXObjectCache::checkedStateChanged): (WebCore::AXObjectCache::childrenChanged): (WebCore::AXObjectCache::contentChanged): (WebCore::AXObjectCache::updateCacheAfterNodeIsAttached): (WebCore::AXObjectCache::handleActiveDescendantChanged): (WebCore::AXObjectCache::handleAriaExpandedChange): (WebCore::AXObjectCache::handleAriaRoleChanged): (WebCore::AXObjectCache::handleFocusedUIElementChanged): (WebCore::AXObjectCache::nodeTextChangeNotification): (WebCore::AXObjectCache::postNotification): (WebCore::AXObjectCache::selectedChildrenChanged): * accessibility/AccessibilityListBoxOption.cpp: (WebCore::AccessibilityListBoxOption::parentObject): * accessibility/AccessibilityObject.cpp: (WebCore::appendAccessibilityObject): (WebCore::replacedNodeNeedsCharacter): * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::menuForMenuButton): (WebCore::AccessibilityRenderObject::menuButtonForMenu): (WebCore::AccessibilityRenderObject::checkboxOrRadioRect): (WebCore::AccessibilityRenderObject::addRadioButtonGroupMembers): (WebCore::AccessibilityRenderObject::titleUIElement): (WebCore::AccessibilityRenderObject::isTabItemSelected): (WebCore::AccessibilityRenderObject::accessibilityParentForImageMap): (WebCore::AccessibilityRenderObject::nodeIsTextControl): (WebCore::AccessibilityRenderObject::activeDescendant): (WebCore::AccessibilityRenderObject::correspondingControlForLabelElement): (WebCore::AccessibilityRenderObject::correspondingLabelForControlElement): * accessibility/AccessibilityRenderObject.h: (AccessibilityRenderObject): * accessibility/AccessibilityScrollView.cpp: (WebCore::AccessibilityScrollView::webAreaObject): (WebCore::AccessibilityScrollView::parentObject): (WebCore::AccessibilityScrollView::parentObjectIfExists): * accessibility/chromium/AXObjectCacheChromium.cpp: (WebCore::AXObjectCache::postPlatformNotification): (WebCore::AXObjectCache::handleFocusedUIElementChanged): * accessibility/gtk/AXObjectCacheAtk.cpp: (WebCore::AXObjectCache::handleFocusedUIElementChanged): * accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXObjectCache::handleFocusedUIElementChanged): * accessibility/win/AXObjectCacheWin.cpp: (WebCore::AXObjectCache::handleFocusedUIElementChanged): * bindings/cpp/WebDOMCustomVoidCallback.cpp: (toWebCore): * dom/Document.cpp: (WebCore::Document::setFocusedNode): * dom/Element.cpp: (WebCore::Element::attributeChanged): * dom/Node.cpp: (WebCore::Node::~Node): (WebCore::Node::attach): * editing/AppendNodeCommand.cpp: (WebCore::sendAXTextChangedIgnoringLineBreaks): * editing/DeleteFromTextNodeCommand.cpp: (WebCore::DeleteFromTextNodeCommand::doApply): (WebCore::DeleteFromTextNodeCommand::doUnapply): * editing/Editor.cpp: (WebCore::Editor::respondToChangedContents): (WebCore::Editor::markAndReplaceFor): * editing/InsertIntoTextNodeCommand.cpp: (WebCore::InsertIntoTextNodeCommand::doApply): (WebCore::InsertIntoTextNodeCommand::doUnapply): * editing/InsertNodeBeforeCommand.cpp: (WebCore::InsertNodeBeforeCommand::doApply): (WebCore::InsertNodeBeforeCommand::doUnapply): * editing/chromium/FrameSelectionChromium.cpp: (WebCore::FrameSelection::notifyAccessibilityForSelectionChange): * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::setChecked): * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::childrenChanged): (WebCore::HTMLSelectElement::optionElementChildrenChanged): * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::setInnerTextValue): * html/InputType.cpp: (WebCore::InputType::applyStep): * html/RangeInputType.cpp: (WebCore::RangeInputType::handleKeydownEvent): * page/FocusController.cpp: (WebCore::FocusController::setInitialFocus): LayoutTests: New tests: - canvas-fallback-content tests that objects in a canvas subtree can be focused and then you can retrieve the role of the accessible object. - accessibility-node-memory-management ensures that an AccessibilityNodeObject is detached when its node is destroyed. - accessibility-node-reparent ensures that if an AccessibilityNodeObject is created for a node without a renderer, but the node later gets a renderer, the AccessibilityNodeObject is detached and an AccessibilityRenderObject is created instead. * accessibility/accessibility-node-memory-management-expected.txt: Added. * accessibility/accessibility-node-memory-management.html: Added. * accessibility/accessibility-node-reparent-expected.txt: Added. * accessibility/accessibility-node-reparent.html: Added. * accessibility/canvas-fallback-content-expected.txt: Added. * accessibility/canvas-fallback-content.html: Added. * platform/gtk/TestExpectations: Canonical link: https://commits.webkit.org/111968@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@125710 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-08-15 21:31:35 +00:00
</body>
</html>