Title: [198895] trunk
Revision
198895
Author
n_w...@apple.com
Date
2016-03-31 09:17:17 -0700 (Thu, 31 Mar 2016)

Log Message

AX: aria-hidden=false causes video fallback content to be exposed to AX API
https://bugs.webkit.org/show_bug.cgi?id=149278

Reviewed by Chris Fleizach.

Source/WebCore:

The comment says when aria-hidden="false" and object is not rendered, we should
check each parent's aria-hidden status until we encounter a rendered object. So
added a check for the rendered parent in order to break out of the loop earlier.

Test case covered in modified accessibility/aria-hidden-negates-no-visibility.html

* accessibility/AXObjectCache.cpp:
(WebCore::isNodeAriaVisible):

LayoutTests:

* accessibility/aria-hidden-negates-no-visibility-expected.txt:
* accessibility/aria-hidden-negates-no-visibility.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (198894 => 198895)


--- trunk/LayoutTests/ChangeLog	2016-03-31 16:12:26 UTC (rev 198894)
+++ trunk/LayoutTests/ChangeLog	2016-03-31 16:17:17 UTC (rev 198895)
@@ -1,3 +1,13 @@
+2016-03-31  Nan Wang  <n_w...@apple.com>
+
+        AX: aria-hidden=false causes video fallback content to be exposed to AX API
+        https://bugs.webkit.org/show_bug.cgi?id=149278
+
+        Reviewed by Chris Fleizach.
+
+        * accessibility/aria-hidden-negates-no-visibility-expected.txt:
+        * accessibility/aria-hidden-negates-no-visibility.html:
+
 2016-03-31  Brent Fulgham  <bfulg...@apple.com>
 
         [WK2] Support download attribute feature

Modified: trunk/LayoutTests/accessibility/aria-hidden-negates-no-visibility-expected.txt (198894 => 198895)


--- trunk/LayoutTests/accessibility/aria-hidden-negates-no-visibility-expected.txt	2016-03-31 16:12:26 UTC (rev 198894)
+++ trunk/LayoutTests/accessibility/aria-hidden-negates-no-visibility-expected.txt	2016-03-31 16:17:17 UTC (rev 198895)
@@ -2,6 +2,7 @@
 
 
 
+
 This tests ensures that aria-hidden=false will allow a node to be in the AX hierarchy even if it's not rendered or visible
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
@@ -17,6 +18,7 @@
 PASS heading4.role is 'AXRole: AXHeading'
 PASS parent.childAtIndex(2).isEqual(heading4) is true
 Textfield Title: AXTitle: 
+PASS video.childrenCount is 0
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/accessibility/aria-hidden-negates-no-visibility.html (198894 => 198895)


--- trunk/LayoutTests/accessibility/aria-hidden-negates-no-visibility.html	2016-03-31 16:12:26 UTC (rev 198894)
+++ trunk/LayoutTests/accessibility/aria-hidden-negates-no-visibility.html	2016-03-31 16:17:17 UTC (rev 198895)
@@ -16,6 +16,12 @@
 <div hidden aria-hidden="false" id="hiddenDiv">HiddenText1</div>
 <input type="text" aria-labelledby="hiddenDiv" id="textFieldWithHiddenLabeller">
 
+<div aria-hidden="false">
+<video id="video">
+Hidden content
+</video>
+</div>
+
 <p id="description"></p>
 <div id="console"></div>
 
@@ -54,6 +60,10 @@
         // The aria-labelledby attribute should work even though hidden.
         var textField = accessibilityController.accessibleElementById("textFieldWithHiddenLabeller");
         debug("Textfield Title: " + textField.title);
+        
+        // aria-hidden="false" need to be on each parent, including rendered parents.
+        var video = accessibilityController.accessibleElementById("video");
+        shouldBe("video.childrenCount", "0");
     }
 
 </script>

Modified: trunk/Source/WebCore/ChangeLog (198894 => 198895)


--- trunk/Source/WebCore/ChangeLog	2016-03-31 16:12:26 UTC (rev 198894)
+++ trunk/Source/WebCore/ChangeLog	2016-03-31 16:17:17 UTC (rev 198895)
@@ -1,3 +1,19 @@
+2016-03-31  Nan Wang  <n_w...@apple.com>
+
+        AX: aria-hidden=false causes video fallback content to be exposed to AX API
+        https://bugs.webkit.org/show_bug.cgi?id=149278
+
+        Reviewed by Chris Fleizach.
+
+        The comment says when aria-hidden="false" and object is not rendered, we should
+        check each parent's aria-hidden status until we encounter a rendered object. So 
+        added a check for the rendered parent in order to break out of the loop earlier.
+
+        Test case covered in modified accessibility/aria-hidden-negates-no-visibility.html
+
+        * accessibility/AXObjectCache.cpp:
+        (WebCore::isNodeAriaVisible):
+
 2016-03-31  Brent Fulgham  <bfulg...@apple.com>
 
         [WK2] Support download attribute feature

Modified: trunk/Source/WebCore/accessibility/AXObjectCache.cpp (198894 => 198895)


--- trunk/Source/WebCore/accessibility/AXObjectCache.cpp	2016-03-31 16:12:26 UTC (rev 198894)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.cpp	2016-03-31 16:17:17 UTC (rev 198895)
@@ -2514,6 +2514,9 @@
                 return false;
             if (!ariaHiddenFalsePresent && ariaHiddenFalse)
                 ariaHiddenFalsePresent = true;
+            // We should break early when it gets to a rendered object.
+            if (testNode->renderer())
+                break;
         }
     }
     
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to