[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

cfleizach at apple.com cfleizach at apple.com
Thu Apr 8 00:57:37 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit bdd022bf79a643985d245f18ac2c54bf8850325a
Author: cfleizach at apple.com <cfleizach at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jan 7 20:24:53 2010 +0000

    AX: contentEditable DIVs are not AX accessible
    https://bugs.webkit.org/show_bug.cgi?id=33325
    
    Reviewed by Beth Dakin.
    
    WebCore:
    
    Test: accessibility/contenteditable-hidden-div.html
    
    * accessibility/AccessibilityRenderObject.cpp:
    (WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
    (WebCore::AccessibilityRenderObject::canSetValueAttribute):
    
    LayoutTests:
    
    * accessibility/contenteditable-hidden-div-expected.txt: Added.
    * accessibility/contenteditable-hidden-div.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52941 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 6d23f85..dd5b7b8 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-01-07  Chris Fleizach  <cfleizach at apple.com>
+
+        Reviewed by Beth Dakin.
+
+        AX: contentEditable DIVs are not AX accessible
+        https://bugs.webkit.org/show_bug.cgi?id=33325
+
+        * accessibility/contenteditable-hidden-div-expected.txt: Added.
+        * accessibility/contenteditable-hidden-div.html: Added.
+
 2010-01-07  Eric Carlson  <eric.carlson at apple.com>
 
         Unreviewed, build fix.
diff --git a/LayoutTests/accessibility/contenteditable-hidden-div-expected.txt b/LayoutTests/accessibility/contenteditable-hidden-div-expected.txt
new file mode 100644
index 0000000..15ecbcf
--- /dev/null
+++ b/LayoutTests/accessibility/contenteditable-hidden-div-expected.txt
@@ -0,0 +1,12 @@
+test
+
+This tests that a contenteditable element will not be ignored by accessibility.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS accessibilityController.focusedElement.isEqual(editableDiv) is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/accessibility/contenteditable-hidden-div.html b/LayoutTests/accessibility/contenteditable-hidden-div.html
new file mode 100644
index 0000000..3d8dcc1
--- /dev/null
+++ b/LayoutTests/accessibility/contenteditable-hidden-div.html
@@ -0,0 +1,39 @@
+<!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 contentEditable=true style="outline:1px solid"></div>
+
+<h3 id="h3" tabindex=0>test</h3>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that a contenteditable element will not be ignored by accessibility.");
+
+    if (window.accessibilityController) {
+
+        document.getElementById("body").focus();
+
+        // make sure this element is NOT the h3 element (which otherwise would be the first element)
+        var editableDiv = accessibilityController.focusedElement.childAtIndex(0);
+
+        document.getElementById("h3").focus();
+        shouldBe("accessibilityController.focusedElement.isEqual(editableDiv)", "false");
+    }
+
+    successfullyParsed = true;
+</script>
+
+<script src="../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 59e3463..7b2952f 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-01-07  Chris Fleizach  <cfleizach at apple.com>
+
+        Reviewed by Beth Dakin.
+
+        AX: contentEditable DIVs are not AX accessible
+        https://bugs.webkit.org/show_bug.cgi?id=33325
+
+        Test: accessibility/contenteditable-hidden-div.html
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
+        (WebCore::AccessibilityRenderObject::canSetValueAttribute):
+
 2010-01-07  Adam Barth  <abarth at webkit.org>
 
         Unreviewed.  Resolve merge conflict.
diff --git a/WebCore/accessibility/AccessibilityRenderObject.cpp b/WebCore/accessibility/AccessibilityRenderObject.cpp
index 63df802..3f00dd7 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.cpp
+++ b/WebCore/accessibility/AccessibilityRenderObject.cpp
@@ -1524,6 +1524,16 @@ bool AccessibilityRenderObject::accessibilityIsIgnored() const
     if (node && node->hasTagName(labelTag))
         return false;
     
+    // Anything that is content editable should not be ignored.
+    // However, one cannot just call node->isContentEditable() since that will ask if its parents
+    // are also editable. Only the top level content editable region should be exposed.
+    if (node && node->isElementNode()) {
+        Element* element = static_cast<Element*>(node);
+        const AtomicString& contentEditable = element->getAttribute(contenteditableAttr);
+        if (equalIgnoringCase(contentEditable, "true"))
+            return false;
+    }
+    
     if (m_renderer->isBlockFlow() && m_renderer->childrenInline())
         return !toRenderBlock(m_renderer)->firstLineBox() && !mouseButtonListener();
     
@@ -2791,10 +2801,9 @@ bool AccessibilityRenderObject::canSetValueAttribute() const
     if (equalIgnoringCase(getAttribute(aria_readonlyAttr).string(), "true"))
         return false;
 
-    if (isWebArea() || isTextControl()) 
-        return !isReadOnly();
-
-    return isProgressIndicator() || isSlider();
+    // Any node could be contenteditable, so isReadOnly should be relied upon
+    // for this information for all elements.
+    return isProgressIndicator() || isSlider() || !isReadOnly();
 }
 
 bool AccessibilityRenderObject::canSetTextRangeAttributes() const

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list