Title: [126941] trunk
- Revision
- 126941
- Author
- [email protected]
- Date
- 2012-08-28 16:47:10 -0700 (Tue, 28 Aug 2012)
Log Message
Implement AccessibilityUIElement::titleUIElement() and AccessibilityUIElement::stringValue()
https://bugs.webkit.org/show_bug.cgi?id=95185
Patch by Joanmarie Diggs <[email protected]> on 2012-08-28
Reviewed by Chris Fleizach.
Tools:
* DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
(AccessibilityUIElement::titleUIElement): Implemented
Gets the ATK_RELATION_LABELLED_BY target.
(AccessibilityUIElement::stringValue): Implemented for all roles but ATK_ROLE_PANEL.
Gets the string from atk_text_get_text(). Will implement for ATK_ROLE_PANEL after
bug 95180 is fixed.
LayoutTests:
Updated layout test expected results. In all three cases below:
1) Remove objects from the tree representation which did not belong,
but were included as a side effect of AccessibilityUIElement::stringValue()
not having been implemented.
2) Add the stringValue() return value to the tree representation.
Note that the implementation of AccessibilityUIElement::titleUIElement()
will be tested by the existing legend.html layout text. See bug 84137.
* platform/gtk/accessibility/adjacent-continuations-cause-assertion-failure-expected.txt: Updated.
* platform/gtk/accessibility/deleting-iframe-destroys-axcache-expected.txt: Updated.
* platform/gtk/accessibility/div-within-anchors-causes-crash-expected.txt: Updated.
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (126940 => 126941)
--- trunk/LayoutTests/ChangeLog 2012-08-28 23:35:37 UTC (rev 126940)
+++ trunk/LayoutTests/ChangeLog 2012-08-28 23:47:10 UTC (rev 126941)
@@ -1,3 +1,22 @@
+2012-08-28 Joanmarie Diggs <[email protected]>
+
+ Implement AccessibilityUIElement::titleUIElement() and AccessibilityUIElement::stringValue()
+ https://bugs.webkit.org/show_bug.cgi?id=95185
+
+ Reviewed by Chris Fleizach.
+
+ Updated layout test expected results. In all three cases below:
+ 1) Remove objects from the tree representation which did not belong,
+ but were included as a side effect of AccessibilityUIElement::stringValue()
+ not having been implemented.
+ 2) Add the stringValue() return value to the tree representation.
+ Note that the implementation of AccessibilityUIElement::titleUIElement()
+ will be tested by the existing legend.html layout text. See bug 84137.
+
+ * platform/gtk/accessibility/adjacent-continuations-cause-assertion-failure-expected.txt: Updated.
+ * platform/gtk/accessibility/deleting-iframe-destroys-axcache-expected.txt: Updated.
+ * platform/gtk/accessibility/div-within-anchors-causes-crash-expected.txt: Updated.
+
2012-08-28 Julien Chaffraix <[email protected]>
Unreviewed gardening, more rebaselining after r126911.
Modified: trunk/LayoutTests/platform/gtk/accessibility/adjacent-continuations-cause-assertion-failure-expected.txt (126940 => 126941)
--- trunk/LayoutTests/platform/gtk/accessibility/adjacent-continuations-cause-assertion-failure-expected.txt 2012-08-28 23:35:37 UTC (rev 126940)
+++ trunk/LayoutTests/platform/gtk/accessibility/adjacent-continuations-cause-assertion-failure-expected.txt 2012-08-28 23:47:10 UTC (rev 126941)
@@ -8,10 +8,8 @@
AXRole: document frame
- AXRole: section
- AXRole: section
- AXRole: paragraph
- AXRole: paragraph
+ AXRole: section AXValue: y
+ AXRole: section AXValue: End of test
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/platform/gtk/accessibility/deleting-iframe-destroys-axcache-expected.txt (126940 => 126941)
--- trunk/LayoutTests/platform/gtk/accessibility/deleting-iframe-destroys-axcache-expected.txt 2012-08-28 23:35:37 UTC (rev 126940)
+++ trunk/LayoutTests/platform/gtk/accessibility/deleting-iframe-destroys-axcache-expected.txt 2012-08-28 23:47:10 UTC (rev 126941)
@@ -13,28 +13,22 @@
Before:
AXRole: scroll pane
AXRole: document frame
- AXRole: paragraph
+ AXRole: paragraph AXValue: Before
AXRole: panel
AXRole: scroll pane
AXRole: document frame
AXRole: panel
AXRole: push button
- AXRole: paragraph
- AXRole: paragraph
- AXRole: paragraph
- AXRole: paragraph
- AXRole: section
+ AXRole: paragraph AXValue: After
+ AXRole: paragraph AXValue: End of test
After:
AXRole: scroll pane
AXRole: document frame
- AXRole: paragraph
+ AXRole: paragraph AXValue: Before
AXRole: panel
- AXRole: paragraph
- AXRole: paragraph
- AXRole: paragraph
- AXRole: paragraph
- AXRole: section
+ AXRole: paragraph AXValue: After
+ AXRole: paragraph AXValue: End of test
PASS frameBodyRole == frameBody.role is false
PASS frameGroupRole == frameGroup.role is false
Modified: trunk/LayoutTests/platform/gtk/accessibility/div-within-anchors-causes-crash-expected.txt (126940 => 126941)
--- trunk/LayoutTests/platform/gtk/accessibility/div-within-anchors-causes-crash-expected.txt 2012-08-28 23:35:37 UTC (rev 126940)
+++ trunk/LayoutTests/platform/gtk/accessibility/div-within-anchors-causes-crash-expected.txt 2012-08-28 23:47:10 UTC (rev 126941)
@@ -1,17 +1,11 @@
End of test
Before:
AXRole: document frame
- AXRole: link
- AXRole: section
- AXRole: panel
- AXRole: paragraph
- AXRole: paragraph
+ AXRole: link AXValue:
+ AXRole: section AXValue: End of test
After:
AXRole: document frame
- AXRole: section
- AXRole: panel
- AXRole: paragraph
- AXRole: paragraph
+ AXRole: section AXValue: End of test
This can cause a crash.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Modified: trunk/Tools/ChangeLog (126940 => 126941)
--- trunk/Tools/ChangeLog 2012-08-28 23:35:37 UTC (rev 126940)
+++ trunk/Tools/ChangeLog 2012-08-28 23:47:10 UTC (rev 126941)
@@ -1,3 +1,17 @@
+2012-08-28 Joanmarie Diggs <[email protected]>
+
+ Implement AccessibilityUIElement::titleUIElement() and AccessibilityUIElement::stringValue()
+ https://bugs.webkit.org/show_bug.cgi?id=95185
+
+ Reviewed by Chris Fleizach.
+
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::titleUIElement): Implemented
+ Gets the ATK_RELATION_LABELLED_BY target.
+ (AccessibilityUIElement::stringValue): Implemented for all roles but ATK_ROLE_PANEL.
+ Gets the string from atk_text_get_text(). Will implement for ATK_ROLE_PANEL after
+ bug 95180 is fixed.
+
2012-08-28 Dominic Mazzoni <[email protected]>
AX: Crash due to object getting deleted inside updateBackingStore
Modified: trunk/Tools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp (126940 => 126941)
--- trunk/Tools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp 2012-08-28 23:35:37 UTC (rev 126940)
+++ trunk/Tools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp 2012-08-28 23:47:10 UTC (rev 126941)
@@ -176,8 +176,27 @@
AccessibilityUIElement AccessibilityUIElement::titleUIElement()
{
- // FIXME: implement
- return 0;
+
+ if (!m_element)
+ return 0;
+
+ AtkRelationSet* set = atk_object_ref_relation_set(ATK_OBJECT(m_element));
+ if (!set)
+ return 0;
+
+ AtkObject* target = 0;
+ int count = atk_relation_set_get_n_relations(set);
+ for (int i = 0; i < count; i++) {
+ AtkRelation* relation = atk_relation_set_get_relation(set, i);
+ if (atk_relation_get_relation_type(relation) == ATK_RELATION_LABELLED_BY) {
+ GPtrArray* targetList = atk_relation_get_target(relation);
+ if (targetList->len)
+ target = static_cast<AtkObject*>(g_ptr_array_index(targetList, 0));
+ }
+ g_object_unref(set);
+ }
+
+ return target ? AccessibilityUIElement(target) : 0;
}
AccessibilityUIElement AccessibilityUIElement::parentElement()
@@ -252,8 +271,21 @@
JSStringRef AccessibilityUIElement::stringValue()
{
- // FIXME: implement
- return JSStringCreateWithCharacters(0, 0);
+ if (!m_element || !ATK_IS_TEXT(m_element))
+ return JSStringCreateWithCharacters(0, 0);
+
+ // FIXME: implement properly for ATK_ROLE_PANEL. Prior to doing so, we need
+ // to fix bug 95180 as well as determine which panels we wish to keep in the
+ // accessible hierarchy. See, for instance, bug 72811.
+ AtkRole role = atk_object_get_role(ATK_OBJECT(m_element));
+ if (role == ATK_ROLE_PANEL)
+ return JSStringCreateWithCharacters(0, 0);
+
+ gchar* text =text = atk_text_get_text(ATK_TEXT(m_element), 0, -1);
+ GOwnPtr<gchar> axValue(g_strdup_printf("AXValue: %s", text));
+ g_free(text);
+
+ return JSStringCreateWithUTF8CString(axValue.get());
}
JSStringRef AccessibilityUIElement::language()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes