Title: [158841] trunk
Revision
158841
Author
[email protected]
Date
2013-11-07 03:12:23 -0800 (Thu, 07 Nov 2013)

Log Message

AX: [ATK] Video and audio elements are not properly exposed
https://bugs.webkit.org/show_bug.cgi?id=123894

Reviewed by Chris Fleizach.

Source/WebCore:

Expose <audio> and <video> elements with ATK_ROLE_EMBEDDED, so we
can identify them properly from ATK/AT-SPI based ATs.

Tests: platform/gtk/accessibility/media-controls-panel-title.html
       platform/efl/accessibility/media-emits-object-replacement.html
       platform/gtk/accessibility/media-emits-object-replacement.html

* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(atkRole): Add the new mapping.

Tools:

Update DRT and WKTR to handle the ATK_ROLE_EMBEDDED role.

* DumpRenderTree/atk/AccessibilityUIElementAtk.cpp: Updated.
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: Updated.

LayoutTests:

Updated tests and expectations according to the new behavior.

Updated failing test to reflect the new reality.
* platform/gtk/accessibility/media-element-expected.txt: Updated.

Extended GTK specific test by adding an <audio> element besides
the <video> one and printing all the information about those
related to their media nature.

* platform/gtk/accessibility/media-controls-panel-title.html: Extended.
* platform/gtk/accessibility/media-controls-panel-title-expected.txt: Updated.

Added new tests for GTK and EFL to check that the replaced
character is being properly emitter for both <video> and <audio>
elements. Inspired in the ones in platform/mac, we use a different
approach here to print the test since we don't have the
textMarkerRangeForElement functionality in our DRT/WKTR, and
because we expect embedded objects to show up in the results in a
GTK/EFL specific way (using the "<obj>" string).

* platform/efl/accessibility/media-emits-object-replacement-expected.txt: Added.
* platform/efl/accessibility/media-emits-object-replacement.html: Added.
* platform/gtk/accessibility/media-emits-object-replacement-expected.txt: Added.
* platform/gtk/accessibility/media-emits-object-replacement.html: Added.

Removed tests with failure expectations that are now passing.

* platform/gtk/TestExpectations: Removed passing tests.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (158840 => 158841)


--- trunk/LayoutTests/ChangeLog	2013-11-07 11:04:16 UTC (rev 158840)
+++ trunk/LayoutTests/ChangeLog	2013-11-07 11:12:23 UTC (rev 158841)
@@ -1,3 +1,39 @@
+2013-11-07  Mario Sanchez Prada  <[email protected]>
+
+        AX: [ATK] Video and audio elements are not properly exposed
+        https://bugs.webkit.org/show_bug.cgi?id=123894
+
+        Reviewed by Chris Fleizach.
+
+        Updated tests and expectations according to the new behavior.
+
+        Updated failing test to reflect the new reality.
+        * platform/gtk/accessibility/media-element-expected.txt: Updated.
+
+        Extended GTK specific test by adding an <audio> element besides
+        the <video> one and printing all the information about those
+        related to their media nature.
+
+        * platform/gtk/accessibility/media-controls-panel-title.html: Extended.
+        * platform/gtk/accessibility/media-controls-panel-title-expected.txt: Updated.
+
+        Added new tests for GTK and EFL to check that the replaced
+        character is being properly emitter for both <video> and <audio>
+        elements. Inspired in the ones in platform/mac, we use a different
+        approach here to print the test since we don't have the
+        textMarkerRangeForElement functionality in our DRT/WKTR, and
+        because we expect embedded objects to show up in the results in a
+        GTK/EFL specific way (using the "<obj>" string).
+
+        * platform/efl/accessibility/media-emits-object-replacement-expected.txt: Added.
+        * platform/efl/accessibility/media-emits-object-replacement.html: Added.
+        * platform/gtk/accessibility/media-emits-object-replacement-expected.txt: Added.
+        * platform/gtk/accessibility/media-emits-object-replacement.html: Added.
+
+        Removed tests with failure expectations that are now passing.
+
+        * platform/gtk/TestExpectations: Removed passing tests.
+
 2013-11-06  Sergio Villar Senin  <[email protected]>
 
         [CSS Grid Layout] CSSParser should reject <track-list> without a <track-size>

Added: trunk/LayoutTests/platform/efl/accessibility/media-emits-object-replacement-expected.txt (0 => 158841)


--- trunk/LayoutTests/platform/efl/accessibility/media-emits-object-replacement-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/efl/accessibility/media-emits-object-replacement-expected.txt	2013-11-07 11:12:23 UTC (rev 158841)
@@ -0,0 +1,28 @@
+a  b
+
+a  b
+End of test
+AXRole: AXWebArea 
+    AXRole: AXDiv AXValue: a <obj> b
+        AXRole: AXEmbedded 
+            AXRole: AXToolbar 
+                AXRole: AXToolbar 
+                    AXRole: AXButton 
+                    AXRole: AXSlider 
+    AXRole: AXGroup AXValue: <\n>
+    AXRole: AXDiv AXValue: a <obj> b
+        AXRole: AXEmbedded 
+            AXRole: AXToolbar 
+                AXRole: AXToolbar 
+                    AXRole: AXButton 
+                    AXRole: AXSlider 
+    AXRole: AXDiv AXValue: End of test
+This tests ensures that if video or audio tags are used, they will emit an object replacement character in a range for string operation.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/efl/accessibility/media-emits-object-replacement.html (0 => 158841)


--- trunk/LayoutTests/platform/efl/accessibility/media-emits-object-replacement.html	                        (rev 0)
+++ trunk/LayoutTests/platform/efl/accessibility/media-emits-object-replacement.html	2013-11-07 11:12:23 UTC (rev 158841)
@@ -0,0 +1,60 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<script>
+function buildAccessibilityTree(accessibilityObject, indent) {
+    var str = "";
+    for (var i = 0; i < indent; i++)
+        str += "    ";
+    str += accessibilityObject.role;
+    str += " " + accessibilityObject.stringValue;
+    str += "\n";
+    document.getElementById("tree").innerText += str;
+
+    if (accessibilityObject.stringValue.indexOf('End of test') >= 0)
+        return false;
+
+    var count = accessibilityObject.childrenCount;
+    for (var i = 0; i < count; ++i) {
+        if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), indent + 1))
+            return false;
+    }
+
+    return true;
+}
+</script>
+<script src=""
+</head>
+<body>
+
+<div id="text1">
+a <video width=100 height=100 controls></video> b
+</div>
+
+<br>
+
+<div id="text2">
+a <audio width=100 height=100 controls></audio> b
+</div>
+
+</div>
+
+<div>End of test</div>
+
+<pre id="tree"></pre>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("This tests ensures that if video or audio tags are used, they will emit an object replacement character in a range for string operation.")
+
+if (window.accessibilityController) {
+    // Build the accessibility tree up until 'End of test' is encountered.
+    document.body.focus();
+    buildAccessibilityTree(accessibilityController.focusedElement, 0);
+}
+</script>
+<script src=""
+</body>
+</html>

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (158840 => 158841)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2013-11-07 11:04:16 UTC (rev 158840)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2013-11-07 11:12:23 UTC (rev 158841)
@@ -1326,9 +1326,6 @@
 webkit.org/b/123885 platform/gtk/accessibility/spans-paragraphs-and-divs.html [ Failure ]
 webkit.org/b/123885 platform/gtk/accessibility/spans.html [ Failure ]
 
-webkit.org/b/123894 accessibility/media-element.html [ Failure ]
-webkit.org/b/123894 platform/gtk/accessibility/media-controls-panel-title.html [ Failure ]
-
 webkit.org/b/114612 editing/style/block-style-005.html [ Failure ]
 
 webkit.org/b/115025 fast/events/constructors/mouse-event-constructor.html [ Failure ]

Modified: trunk/LayoutTests/platform/gtk/accessibility/media-controls-panel-title-expected.txt (158840 => 158841)


--- trunk/LayoutTests/platform/gtk/accessibility/media-controls-panel-title-expected.txt	2013-11-07 11:04:16 UTC (rev 158840)
+++ trunk/LayoutTests/platform/gtk/accessibility/media-controls-panel-title-expected.txt	2013-11-07 11:12:23 UTC (rev 158841)
@@ -1,3 +1,4 @@
+ 
 This tests that the media controls panel has the correct name and role
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
@@ -3,8 +4,14 @@
 
 
-PASS element.role is 'AXRole: AXGroup'
+PASS mainBlock.role is 'AXRole: AXGroup'
+PASS mainBlock.title is 'AXTitle: '
+PASS element.role is 'AXRole: AXEmbedded'
 PASS element.title is 'AXTitle: '
 PASS element.role is 'AXRole: AXToolbar'
 PASS element.title is 'AXTitle: video playback'
+PASS element.role is 'AXRole: AXEmbedded'
+PASS element.title is 'AXTitle: '
+PASS element.role is 'AXRole: AXToolbar'
+PASS element.title is 'AXTitle: audio playback'
 PASS successfullyParsed is true
 

Modified: trunk/LayoutTests/platform/gtk/accessibility/media-controls-panel-title.html (158840 => 158841)


--- trunk/LayoutTests/platform/gtk/accessibility/media-controls-panel-title.html	2013-11-07 11:04:16 UTC (rev 158840)
+++ trunk/LayoutTests/platform/gtk/accessibility/media-controls-panel-title.html	2013-11-07 11:12:23 UTC (rev 158841)
@@ -5,6 +5,7 @@
 </head>
 <body id="body">
 <video controls="" autoplay="" name="media" src=""
+<audio controls="" autoplay="" name="media" src=""
 <p id="description"></p>
 <div id="console"></div>
 <script>
@@ -12,12 +13,25 @@
 if (window.accessibilityController) {
     document.getElementById("body").focus();
     var webArea = accessibilityController.focusedElement;
-    var element = webArea.childAtIndex(0);
-    shouldBe("element.role", "'AXRole: AXGroup'");
+    var mainBlock = webArea.childAtIndex(0);
+    shouldBe("mainBlock.role", "'AXRole: AXGroup'");
+    shouldBe("mainBlock.title", "'AXTitle: '");
+
+    // Video element.
+    var element = mainBlock.childAtIndex(0);
+    shouldBe("element.role", "'AXRole: AXEmbedded'");
     shouldBe("element.title", "'AXTitle: '");
     element = element.childAtIndex(0);
     shouldBe("element.role", "'AXRole: AXToolbar'");
     shouldBe("element.title", "'AXTitle: video playback'");
+
+    // Audio element.
+    element = mainBlock.childAtIndex(1);
+    shouldBe("element.role", "'AXRole: AXEmbedded'");
+    shouldBe("element.title", "'AXTitle: '");
+    element = element.childAtIndex(0);
+    shouldBe("element.role", "'AXRole: AXToolbar'");
+    shouldBe("element.title", "'AXTitle: audio playback'");
 }
 
 </script>

Modified: trunk/LayoutTests/platform/gtk/accessibility/media-element-expected.txt (158840 => 158841)


--- trunk/LayoutTests/platform/gtk/accessibility/media-element-expected.txt	2013-11-07 11:04:16 UTC (rev 158840)
+++ trunk/LayoutTests/platform/gtk/accessibility/media-element-expected.txt	2013-11-07 11:12:23 UTC (rev 158841)
@@ -1,3 +1,4 @@
+
 Dump <video> element controller accessibility object tree at 'canplaythrough' event.
 
 +++++++++++++++++++++++++++++++++++
@@ -5,7 +6,7 @@
 State at 'canplaythrough' event:
 
     description: AXDescription: 
-    role: AXRole: AXGroup
+    role: AXRole: AXEmbedded
 
 
         description: AXDescription: video playback

Added: trunk/LayoutTests/platform/gtk/accessibility/media-emits-object-replacement-expected.txt (0 => 158841)


--- trunk/LayoutTests/platform/gtk/accessibility/media-emits-object-replacement-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/gtk/accessibility/media-emits-object-replacement-expected.txt	2013-11-07 11:12:23 UTC (rev 158841)
@@ -0,0 +1,28 @@
+a  b
+
+a  b
+End of test
+AXRole: AXWebArea 
+    AXRole: AXDiv AXValue: a <obj> b
+        AXRole: AXEmbedded 
+            AXRole: AXToolbar 
+                AXRole: AXToolbar 
+                    AXRole: AXButton 
+                    AXRole: AXSlider 
+    AXRole: AXGroup AXValue: <\n>
+    AXRole: AXDiv AXValue: a <obj> b
+        AXRole: AXEmbedded 
+            AXRole: AXToolbar 
+                AXRole: AXToolbar 
+                    AXRole: AXButton 
+                    AXRole: AXSlider 
+    AXRole: AXDiv AXValue: End of test
+This tests ensures that if video or audio tags are used, they will emit an object replacement character in a range for string operation.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/gtk/accessibility/media-emits-object-replacement.html (0 => 158841)


--- trunk/LayoutTests/platform/gtk/accessibility/media-emits-object-replacement.html	                        (rev 0)
+++ trunk/LayoutTests/platform/gtk/accessibility/media-emits-object-replacement.html	2013-11-07 11:12:23 UTC (rev 158841)
@@ -0,0 +1,60 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<script>
+function buildAccessibilityTree(accessibilityObject, indent) {
+    var str = "";
+    for (var i = 0; i < indent; i++)
+        str += "    ";
+    str += accessibilityObject.role;
+    str += " " + accessibilityObject.stringValue;
+    str += "\n";
+    document.getElementById("tree").innerText += str;
+
+    if (accessibilityObject.stringValue.indexOf('End of test') >= 0)
+        return false;
+
+    var count = accessibilityObject.childrenCount;
+    for (var i = 0; i < count; ++i) {
+        if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), indent + 1))
+            return false;
+    }
+
+    return true;
+}
+</script>
+<script src=""
+</head>
+<body>
+
+<div id="text1">
+a <video width=100 height=100 controls></video> b
+</div>
+
+<br>
+
+<div id="text2">
+a <audio width=100 height=100 controls></audio> b
+</div>
+
+</div>
+
+<div>End of test</div>
+
+<pre id="tree"></pre>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("This tests ensures that if video or audio tags are used, they will emit an object replacement character in a range for string operation.")
+
+if (window.accessibilityController) {
+    // Build the accessibility tree up until 'End of test' is encountered.
+    document.body.focus();
+    buildAccessibilityTree(accessibilityController.focusedElement, 0);
+}
+</script>
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (158840 => 158841)


--- trunk/Source/WebCore/ChangeLog	2013-11-07 11:04:16 UTC (rev 158840)
+++ trunk/Source/WebCore/ChangeLog	2013-11-07 11:12:23 UTC (rev 158841)
@@ -1,3 +1,20 @@
+2013-11-07  Mario Sanchez Prada  <[email protected]>
+
+        AX: [ATK] Video and audio elements are not properly exposed
+        https://bugs.webkit.org/show_bug.cgi?id=123894
+
+        Reviewed by Chris Fleizach.
+
+        Expose <audio> and <video> elements with ATK_ROLE_EMBEDDED, so we
+        can identify them properly from ATK/AT-SPI based ATs.
+
+        Tests: platform/gtk/accessibility/media-controls-panel-title.html
+               platform/efl/accessibility/media-emits-object-replacement.html
+               platform/gtk/accessibility/media-emits-object-replacement.html
+
+        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
+        (atkRole): Add the new mapping.
+
 2013-11-07  Laszlo Vidacs  <[email protected]>
         
         Fix crash in BitmapImage::destroyDecodedData()

Modified: trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp (158840 => 158841)


--- trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp	2013-11-07 11:04:16 UTC (rev 158840)
+++ trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp	2013-11-07 11:12:23 UTC (rev 158841)
@@ -536,6 +536,9 @@
     switch (role) {
     case UnknownRole:
         return ATK_ROLE_UNKNOWN;
+    case AudioRole:
+    case VideoRole:
+        return ATK_ROLE_EMBEDDED;
     case ButtonRole:
         return ATK_ROLE_PUSH_BUTTON;
     case ToggleButtonRole:

Modified: trunk/Tools/ChangeLog (158840 => 158841)


--- trunk/Tools/ChangeLog	2013-11-07 11:04:16 UTC (rev 158840)
+++ trunk/Tools/ChangeLog	2013-11-07 11:12:23 UTC (rev 158841)
@@ -1,3 +1,15 @@
+2013-11-07  Mario Sanchez Prada  <[email protected]>
+
+        AX: [ATK] Video and audio elements are not properly exposed
+        https://bugs.webkit.org/show_bug.cgi?id=123894
+
+        Reviewed by Chris Fleizach.
+
+        Update DRT and WKTR to handle the ATK_ROLE_EMBEDDED role.
+
+        * DumpRenderTree/atk/AccessibilityUIElementAtk.cpp: Updated.
+        * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: Updated.
+
 2013-11-07  Peter Molnar  <[email protected]>
 
         Change git_commit_from_svn_revision() to work in a pure git checkout

Modified: trunk/Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp (158840 => 158841)


--- trunk/Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp	2013-11-07 11:04:16 UTC (rev 158840)
+++ trunk/Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp	2013-11-07 11:12:23 UTC (rev 158841)
@@ -190,6 +190,8 @@
         return "AXComboBox";
     case ATK_ROLE_DOCUMENT_FRAME:
         return "AXWebArea";
+    case ATK_ROLE_EMBEDDED:
+        return "AXEmbedded";
     case ATK_ROLE_ENTRY:
         return "AXTextField";
     case ATK_ROLE_FOOTER:

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp (158840 => 158841)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp	2013-11-07 11:04:16 UTC (rev 158840)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp	2013-11-07 11:12:23 UTC (rev 158841)
@@ -279,6 +279,8 @@
         return "AXComboBox";
     case ATK_ROLE_DOCUMENT_FRAME:
         return "AXWebArea";
+    case ATK_ROLE_EMBEDDED:
+        return "AXEmbedded";
     case ATK_ROLE_ENTRY:
         return "AXTextField";
     case ATK_ROLE_FOOTER:
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to