Title: [158757] trunk
Revision
158757
Author
[email protected]
Date
2013-11-06 10:17:03 -0800 (Wed, 06 Nov 2013)

Log Message

[ATK] accessibility/title-ui-element-correctness.html fails
https://bugs.webkit.org/show_bug.cgi?id=99825

Reviewed by Mario Sanchez Prada.

Source/WebCore:

When calling setAtkRelationSetFromCoreObject a new ATK_LABELLED_BY_RELATION
is added, adding proper label element as a relation. When the document structure
has been changed and a different label should be linked as a relation, current ATK
implementation adds it as a next target on relation's target list, while
WTR/DumpRenderTree implementation takes only first one into account.
This patch adds a new function removing current relations before adding new ones.

Covered by existing tests.

* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(removeAtkRelationFromRelationSetByType):
(setAtkRelationSetFromCoreObject):

LayoutTests:

Remove failure test expectation for the test fixed by this patch.

* platform/efl-wk1/TestExpectations:
* platform/efl-wk2/TestExpectations:
* platform/gtk/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (158756 => 158757)


--- trunk/LayoutTests/ChangeLog	2013-11-06 18:12:48 UTC (rev 158756)
+++ trunk/LayoutTests/ChangeLog	2013-11-06 18:17:03 UTC (rev 158757)
@@ -1,3 +1,16 @@
+2013-11-06  Michał Pakuła vel Rutka  <[email protected]>
+
+        [ATK] accessibility/title-ui-element-correctness.html fails
+        https://bugs.webkit.org/show_bug.cgi?id=99825
+
+        Reviewed by Mario Sanchez Prada.
+
+        Remove failure test expectation for the test fixed by this patch.
+
+        * platform/efl-wk1/TestExpectations:
+        * platform/efl-wk2/TestExpectations:
+        * platform/gtk/TestExpectations:
+
 2013-11-06  Mario Sanchez Prada  <[email protected]>
 
         Unreviewed GTK gardening. Media elements wrongly exposed after r158743.

Modified: trunk/LayoutTests/platform/efl-wk1/TestExpectations (158756 => 158757)


--- trunk/LayoutTests/platform/efl-wk1/TestExpectations	2013-11-06 18:12:48 UTC (rev 158756)
+++ trunk/LayoutTests/platform/efl-wk1/TestExpectations	2013-11-06 18:17:03 UTC (rev 158757)
@@ -131,7 +131,6 @@
 webkit.org/b/112012 accessibility/svg-bounds.html [ Failure ]
 webkit.org/b/112014 accessibility/textarea-insertion-point-line-number.html [ Failure ]
 webkit.org/b/112018 accessibility/th-as-title-ui.html [ Failure ]
-webkit.org/b/112019 accessibility/title-ui-element-correctness.html [ Failure ]
 webkit.org/b/112021 accessibility/visible-elements.html [ Failure Crash ]
 
 accessibility/aria-checkbox-sends-notification.html [ Skip ]

Modified: trunk/LayoutTests/platform/efl-wk2/TestExpectations (158756 => 158757)


--- trunk/LayoutTests/platform/efl-wk2/TestExpectations	2013-11-06 18:12:48 UTC (rev 158756)
+++ trunk/LayoutTests/platform/efl-wk2/TestExpectations	2013-11-06 18:17:03 UTC (rev 158757)
@@ -163,7 +163,6 @@
 webkit.org/b/112012 accessibility/svg-bounds.html [ Failure ]
 webkit.org/b/112014 accessibility/textarea-insertion-point-line-number.html [ Failure ]
 webkit.org/b/112018 accessibility/th-as-title-ui.html [ Failure ]
-webkit.org/b/112019 accessibility/title-ui-element-correctness.html [ Failure ]
 webkit.org/b/112021 accessibility/visible-elements.html [ Failure Crash ]
 
 # New accessibility test added in r149858 that is failing for EFL.

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (158756 => 158757)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2013-11-06 18:12:48 UTC (rev 158756)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2013-11-06 18:17:03 UTC (rev 158757)
@@ -1222,8 +1222,6 @@
 
 webkit.org/b/98950 transitions/blendmode-transitions.html [ Failure ]
 
-webkit.org/b/99825 accessibility/title-ui-element-correctness.html [ Failure ]
-
 webkit.org/b/98718 svg/animations/animate-css-xml-attributeType.html [ Failure ]
 
 webkit.org/b/100424 editing/selection/user-select-all-selection.html [ Failure ]

Modified: trunk/Source/WebCore/ChangeLog (158756 => 158757)


--- trunk/Source/WebCore/ChangeLog	2013-11-06 18:12:48 UTC (rev 158756)
+++ trunk/Source/WebCore/ChangeLog	2013-11-06 18:17:03 UTC (rev 158757)
@@ -1,3 +1,23 @@
+2013-11-06  Michał Pakuła vel Rutka  <[email protected]>
+
+        [ATK] accessibility/title-ui-element-correctness.html fails
+        https://bugs.webkit.org/show_bug.cgi?id=99825
+
+        Reviewed by Mario Sanchez Prada.
+
+        When calling setAtkRelationSetFromCoreObject a new ATK_LABELLED_BY_RELATION
+        is added, adding proper label element as a relation. When the document structure
+        has been changed and a different label should be linked as a relation, current ATK
+        implementation adds it as a next target on relation's target list, while
+        WTR/DumpRenderTree implementation takes only first one into account.
+        This patch adds a new function removing current relations before adding new ones.
+
+        Covered by existing tests.
+
+        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
+        (removeAtkRelationFromRelationSetByType):
+        (setAtkRelationSetFromCoreObject):
+
 2013-11-06  Daniel Bates  <[email protected]>
 
         Add ENABLE(TEXT_SELECTION)

Modified: trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp (158756 => 158757)


--- trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp	2013-11-06 18:12:48 UTC (rev 158756)
+++ trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp	2013-11-06 18:17:03 UTC (rev 158757)
@@ -191,12 +191,26 @@
     return cacheAndReturnAtkProperty(object, AtkCachedAccessibleDescription, accessibilityDescription(coreObject));
 }
 
+static void removeAtkRelationByType(AtkRelationSet* relationSet, AtkRelationType relationType)
+{
+    int count = atk_relation_set_get_n_relations(relationSet);
+    for (int i = 0; i < count; i++) {
+        AtkRelation* relation = atk_relation_set_get_relation(relationSet, i);
+        if (atk_relation_get_relation_type(relation) == relationType) {
+            atk_relation_set_remove(relationSet, relation);
+            break;
+        }
+    }
+}
+
 static void setAtkRelationSetFromCoreObject(AccessibilityObject* coreObject, AtkRelationSet* relationSet)
 {
     if (coreObject->isFieldset()) {
         AccessibilityObject* label = coreObject->titleUIElement();
-        if (label)
+        if (label) {
+            removeAtkRelationByType(relationSet, ATK_RELATION_LABELLED_BY);
             atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_LABELLED_BY, label->wrapper());
+        }
         return;
     }
 
@@ -212,8 +226,10 @@
 
     if (coreObject->isControl()) {
         AccessibilityObject* label = coreObject->correspondingLabelForControlElement();
-        if (label)
+        if (label) {
+            removeAtkRelationByType(relationSet, ATK_RELATION_LABELLED_BY);
             atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_LABELLED_BY, label->wrapper());
+        }
     } else {
         AccessibilityObject* control = coreObject->correspondingControlForLabelElement();
         if (control)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to