Skip to content
Permalink
Browse files
2010-03-05 Chris Fleizach <cfleizach@apple.com>
        Reviewed by Eric Seidel.

        WAI-ARIA live region doesn't appear when <div> only has a <div> child
        https://bugs.webkit.org/show_bug.cgi?id=35751

        * platform/mac/accessibility/div-containing-div-with-aria-expected.txt: Added.
        * platform/mac/accessibility/div-containing-div-with-aria.html: Added.
2010-03-05  Chris Fleizach  <cfleizach@apple.com>

        Reviewed by Eric Seidel.

        WAI-ARIA live region doesn't appear when <div> only has a <div> child
        https://bugs.webkit.org/show_bug.cgi?id=35751

        Elements should not be ignored if they carry ARIA attributes in them.

        Test: platform/mac/accessibility/div-containing-div-with-aria.html

        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::supportsARIAAttributes):
        * accessibility/AccessibilityObject.h:
        (WebCore::AccessibilityObject::supportsARIADropping):
        (WebCore::AccessibilityObject::supportsARIADragging):
        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::supportsARIADropping):
        (WebCore::AccessibilityRenderObject::supportsARIADragging):
        (WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
        * accessibility/AccessibilityRenderObject.h:

Canonical link: https://commits.webkit.org/46908@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@55611 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
eseidel committed Mar 6, 2010
1 parent 31e6d47 commit 89b98dffba96438db8ad7954f4e87cde7add5c19
Showing 8 changed files with 100 additions and 6 deletions.
@@ -1,3 +1,13 @@
2010-03-05 Chris Fleizach <cfleizach@apple.com>

Reviewed by Eric Seidel.

WAI-ARIA live region doesn't appear when <div> only has a <div> child
https://bugs.webkit.org/show_bug.cgi?id=35751

* platform/mac/accessibility/div-containing-div-with-aria-expected.txt: Added.
* platform/mac/accessibility/div-containing-div-with-aria.html: Added.

2010-03-05 Dmitry Titov <dimich@chromium.org>

Reviewed by David Levin.
@@ -0,0 +1,13 @@
0
This tests that any element that has ARIA attributes is not ignored

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".


PASS outerDiv.description is 'AXDescription: test'
PASS outerDiv.childAtIndex(0).role is 'AXRole: AXGroup'
PASS outerDiv.childAtIndex(0).childAtIndex(0).role is 'AXRole: AXStaticText'
PASS successfullyParsed is true

TEST COMPLETE

@@ -0,0 +1,38 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
<script>
var successfullyParsed = false;
</script>
<script src="../../../fast/js/resources/js-test-pre.js"></script>
</head>
<body id="body">

<div id="outer" aria-live="polite" aria-relevant="text" tabindex=0 aria-label="test">
<div id="display" class="LCD">0</div>
</div>


<p id="description"></p>
<div id="console"></div>

<script>

description("This tests that any element that has ARIA attributes is not ignored");

if (window.accessibilityController) {

document.getElementById("outer").focus();
var outerDiv = accessibilityController.focusedElement;
shouldBe("outerDiv.description", "'AXDescription: test'");
shouldBe("outerDiv.childAtIndex(0).role", "'AXRole: AXGroup'");
shouldBe("outerDiv.childAtIndex(0).childAtIndex(0).role", "'AXRole: AXStaticText'");
}

successfullyParsed = true;
</script>

<script src="../../../fast/js/resources/js-test-post.js"></script>
</body>
</html>
@@ -1,3 +1,25 @@
2010-03-05 Chris Fleizach <cfleizach@apple.com>

Reviewed by Eric Seidel.

WAI-ARIA live region doesn't appear when <div> only has a <div> child
https://bugs.webkit.org/show_bug.cgi?id=35751

Elements should not be ignored if they carry ARIA attributes in them.

Test: platform/mac/accessibility/div-containing-div-with-aria.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::supportsARIAAttributes):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::supportsARIADropping):
(WebCore::AccessibilityObject::supportsARIADragging):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::supportsARIADropping):
(WebCore::AccessibilityRenderObject::supportsARIADragging):
(WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
* accessibility/AccessibilityRenderObject.h:

2010-03-05 Dmitry Titov <dimich@chromium.org>

Reviewed by Oliver Hunt.
@@ -961,6 +961,11 @@ bool AccessibilityObject::isInsideARIALiveRegion() const
return false;
}

bool AccessibilityObject::supportsARIAAttributes() const
{
return supportsARIALiveRegion() || supportsARIADragging() || supportsARIADropping() || supportsARIAFlowTo() || supportsARIAOwns();
}

bool AccessibilityObject::supportsARIALiveRegion() const
{
const AtomicString& liveRegion = ariaLiveRegionStatus();
@@ -347,8 +347,8 @@ class AccessibilityObject : public RefCounted<AccessibilityObject> {
virtual void ariaFlowToElements(AccessibilityChildrenVector&) const { }

// ARIA drag and drop
virtual bool supportsARIADropping() { return false; }
virtual bool supportsARIADragging() { return false; }
virtual bool supportsARIADropping() const { return false; }
virtual bool supportsARIADragging() const { return false; }
virtual bool isARIAGrabbed() { return false; }
virtual void setARIAGrabbed(bool) { }
virtual void determineARIADropEffects(Vector<String>&) { }
@@ -519,6 +519,8 @@ class AccessibilityObject : public RefCounted<AccessibilityObject> {
virtual bool ariaLiveRegionAtomic() const { return false; }
virtual bool ariaLiveRegionBusy() const { return false; }

bool supportsARIAAttributes() const;

#if HAVE(ACCESSIBILITY)
#if PLATFORM(GTK)
AccessibilityObjectWrapper* wrapper() const;
@@ -1341,13 +1341,13 @@ void AccessibilityRenderObject::ariaFlowToElements(AccessibilityChildrenVector&

}

bool AccessibilityRenderObject::supportsARIADropping()
bool AccessibilityRenderObject::supportsARIADropping() const
{
const AtomicString& dropEffect = getAttribute(aria_dropeffectAttr).string();
return !dropEffect.isEmpty();
}

bool AccessibilityRenderObject::supportsARIADragging()
bool AccessibilityRenderObject::supportsARIADragging() const
{
const AtomicString& grabbed = getAttribute(aria_grabbedAttr).string();
return equalIgnoringCase(grabbed, "true") || equalIgnoringCase(grabbed, "false");
@@ -1549,6 +1549,10 @@ bool AccessibilityRenderObject::accessibilityIsIgnored() const
return false;
}

// if this element has aria attributes on it, it should not be ignored.
if (supportsARIAAttributes())
return false;

if (m_renderer->isBlockFlow() && m_renderer->childrenInline())
return !toRenderBlock(m_renderer)->firstLineBox() && !mouseButtonListener();

@@ -227,8 +227,8 @@ class AccessibilityRenderObject : public AccessibilityObject {
virtual bool supportsARIAFlowTo() const;
virtual void ariaFlowToElements(AccessibilityChildrenVector&) const;

virtual bool supportsARIADropping();
virtual bool supportsARIADragging();
virtual bool supportsARIADropping() const;
virtual bool supportsARIADragging() const;
virtual bool isARIAGrabbed();
virtual void setARIAGrabbed(bool);
virtual void determineARIADropEffects(Vector<String>&);

0 comments on commit 89b98df

Please sign in to comment.