Title: [102051] trunk
Revision
102051
Author
[email protected]
Date
2011-12-05 14:44:28 -0800 (Mon, 05 Dec 2011)

Log Message

AX: aria-hidden doesn't work on iframe elements
https://bugs.webkit.org/show_bug.cgi?id=73857

Reviewed by Darin Adler.

Source/WebCore: 

Test: platform/mac/accessibility/iframe-aria-hidden.html

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::addAttachmentChildren):
(WebCore::AccessibilityRenderObject::addChildren):
* accessibility/AccessibilityRenderObject.h:
* accessibility/AccessibilityScrollView.cpp:
(WebCore::AccessibilityScrollView::accessibilityIsIgnored):
(WebCore::AccessibilityScrollView::addChildren):
* accessibility/AccessibilityScrollView.h:

LayoutTests: 

* platform/mac/accessibility/iframe-aria-hidden-expected.txt: Added.
* platform/mac/accessibility/iframe-aria-hidden.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (102050 => 102051)


--- trunk/LayoutTests/ChangeLog	2011-12-05 22:43:24 UTC (rev 102050)
+++ trunk/LayoutTests/ChangeLog	2011-12-05 22:44:28 UTC (rev 102051)
@@ -1,5 +1,15 @@
 2011-12-05  Chris Fleizach  <[email protected]>
 
+        AX: aria-hidden doesn't work on iframe elements
+        https://bugs.webkit.org/show_bug.cgi?id=73857
+
+        Reviewed by Darin Adler.
+
+        * platform/mac/accessibility/iframe-aria-hidden-expected.txt: Added.
+        * platform/mac/accessibility/iframe-aria-hidden.html: Added.
+
+2011-12-05  Chris Fleizach  <[email protected]>
+
         AX: web search mechanism does not work with frames
         https://bugs.webkit.org/show_bug.cgi?id=73836
 

Added: trunk/LayoutTests/platform/mac/accessibility/iframe-aria-hidden-expected.txt (0 => 102051)


--- trunk/LayoutTests/platform/mac/accessibility/iframe-aria-hidden-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/iframe-aria-hidden-expected.txt	2011-12-05 22:44:28 UTC (rev 102051)
@@ -0,0 +1,14 @@
+
+This tests that aria-hidden will affect the visibility of the web area and scroll view.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS body.childrenCount is 3
+PASS body.childAtIndex(0).childrenCount is 0
+PASS body.childrenCount is 4
+PASS body.childAtIndex(0).childAtIndex(0).childAtIndex(0).role is 'AXRole: AXWebArea'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/mac/accessibility/iframe-aria-hidden.html (0 => 102051)


--- trunk/LayoutTests/platform/mac/accessibility/iframe-aria-hidden.html	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/iframe-aria-hidden.html	2011-12-05 22:44:28 UTC (rev 102051)
@@ -0,0 +1,40 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script>
+var successfullyParsed = false;
+</script>
+<script src=""
+</head>
+<body id="body">
+
+<iframe aria-hidden="true" id="iframe" src="" width="400" height="500" scrolling="auto" frameborder="1">fall back content</iframe>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that aria-hidden will affect the visibility of the web area and scroll view.");
+
+    if (window.accessibilityController) {
+
+        document.getElementById("body").focus();
+
+        // Get the iframe reference.
+        var body = accessibilityController.focusedElement;
+        shouldBe("body.childrenCount", "3");
+        shouldBe("body.childAtIndex(0).childrenCount", "0");
+
+        document.getElementById("iframe").setAttribute("aria-hidden", "false");
+        shouldBe("body.childrenCount", "4");
+        shouldBe("body.childAtIndex(0).childAtIndex(0).childAtIndex(0).role", "'AXRole: AXWebArea'");
+    }
+
+    successfullyParsed = true;
+</script>
+
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (102050 => 102051)


--- trunk/Source/WebCore/ChangeLog	2011-12-05 22:43:24 UTC (rev 102050)
+++ trunk/Source/WebCore/ChangeLog	2011-12-05 22:44:28 UTC (rev 102051)
@@ -1,5 +1,23 @@
 2011-12-05  Chris Fleizach  <[email protected]>
 
+        AX: aria-hidden doesn't work on iframe elements
+        https://bugs.webkit.org/show_bug.cgi?id=73857
+
+        Reviewed by Darin Adler.
+
+        Test: platform/mac/accessibility/iframe-aria-hidden.html
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::addAttachmentChildren):
+        (WebCore::AccessibilityRenderObject::addChildren):
+        * accessibility/AccessibilityRenderObject.h:
+        * accessibility/AccessibilityScrollView.cpp:
+        (WebCore::AccessibilityScrollView::accessibilityIsIgnored):
+        (WebCore::AccessibilityScrollView::addChildren):
+        * accessibility/AccessibilityScrollView.h:
+
+2011-12-05  Chris Fleizach  <[email protected]>
+
         AX: web search mechanism does not work with frames
         https://bugs.webkit.org/show_bug.cgi?id=73836
 

Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (102050 => 102051)


--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2011-12-05 22:43:24 UTC (rev 102050)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2011-12-05 22:44:28 UTC (rev 102051)
@@ -3500,6 +3500,21 @@
     m_children.append(axSpinButton);
 }
 
+void AccessibilityRenderObject::addAttachmentChildren()
+{
+    if (!isAttachment())
+        return;
+
+    // FrameView's need to be inserted into the AX hierarchy when encountered.
+    Widget* widget = widgetForAttachmentView();
+    if (!widget || !widget->isFrameView())
+        return;
+    
+    AccessibilityObject* axWidget = axObjectCache()->getOrCreate(widget);
+    if (!axWidget->accessibilityIsIgnored())
+        m_children.append(axWidget);
+}
+    
 void AccessibilityRenderObject::addChildren()
 {
     // If the need to add more children in addition to existing children arises, 
@@ -3534,13 +3549,7 @@
         }
     }
     
-    // FrameView's need to be inserted into the AX hierarchy when encountered.
-    if (isAttachment()) {
-        Widget* widget = widgetForAttachmentView();
-        if (widget && widget->isFrameView())
-            m_children.append(axObjectCache()->getOrCreate(widget));
-    }
-    
+    addAttachmentChildren();
     addImageMapChildren();
     addTextFieldChildren();
 }

Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.h (102050 => 102051)


--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.h	2011-12-05 22:43:24 UTC (rev 102050)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.h	2011-12-05 22:44:28 UTC (rev 102051)
@@ -303,6 +303,7 @@
 
     void addTextFieldChildren();
     void addImageMapChildren();
+    void addAttachmentChildren();
     
     void ariaSelectedRows(AccessibilityChildrenVector&);
     

Modified: trunk/Source/WebCore/accessibility/AccessibilityScrollView.cpp (102050 => 102051)


--- trunk/Source/WebCore/accessibility/AccessibilityScrollView.cpp	2011-12-05 22:43:24 UTC (rev 102050)
+++ trunk/Source/WebCore/accessibility/AccessibilityScrollView.cpp	2011-12-05 22:44:28 UTC (rev 102051)
@@ -129,14 +129,23 @@
     m_verticalScrollbar = 0;
     m_horizontalScrollbar = 0;
 }
+
+bool AccessibilityScrollView::accessibilityIsIgnored() const
+{
+    AccessibilityObject* webArea = webAreaObject();
+    if (!webArea)
+        return true;
     
+    return webArea->accessibilityIsIgnored();
+}
+
 void AccessibilityScrollView::addChildren()
 {
     ASSERT(!m_haveChildren);
     m_haveChildren = true;
     
     AccessibilityObject* webArea = webAreaObject();
-    if (webArea)
+    if (webArea && !webArea->accessibilityIsIgnored())
         m_children.append(webArea);
     
     updateScrollbars();

Modified: trunk/Source/WebCore/accessibility/AccessibilityScrollView.h (102050 => 102051)


--- trunk/Source/WebCore/accessibility/AccessibilityScrollView.h	2011-12-05 22:43:24 UTC (rev 102050)
+++ trunk/Source/WebCore/accessibility/AccessibilityScrollView.h	2011-12-05 22:44:28 UTC (rev 102051)
@@ -43,7 +43,7 @@
 private:
     AccessibilityScrollView(ScrollView*);
     
-    virtual bool accessibilityIsIgnored() const { return false; }
+    virtual bool accessibilityIsIgnored() const;
     virtual bool isAccessibilityScrollView() const { return true; }
     virtual bool isEnabled() const { return true; }
     
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to