Title: [200855] releases/WebKitGTK/webkit-2.12
Revision
200855
Author
[email protected]
Date
2016-05-13 06:41:00 -0700 (Fri, 13 May 2016)

Log Message

Merge r200542 - REGRESSION(r196222): [AX][GTK] accessibility/gtk/caret-offsets.html failing
https://bugs.webkit.org/show_bug.cgi?id=153956

Reviewed by Chris Fleizach.

Source/WebCore:

The reason the test began failing is that it was checking the new caret offset
synchronously. For most of the test cases, this was not a problem. But when the
caret was moved out of a focused link, the focus change (and associated repainting)
delayed the caret-moved event long enough to cause the associated test case to fail.
The test now uses shouldBecomeEqualToString() instead of shouldBeEqualToString().

The test also had a supposedly-correct expectation which was wrong: When moving the
caret to a valid accessible offset, the caret-moved event should be for that offset.
This was not the case for the list item test case because emitTextSelectionChange()
was not adjusting the offset for the RenderListMarker, the text of which is exposed
as part of the ATK_ROLE_LIST_ITEM object. This bug was also fixed and the test case
updated accordingly.

No new tests are needed. The previously-failing test is now passing.

* editing/atk/FrameSelectionAtk.cpp:
(WebCore::emitTextSelectionChange):

LayoutTests:

Change the test to run asynchronously and update the expectations.

* accessibility/gtk/caret-offsets-expected.txt: Updated.
* accessibility/gtk/caret-offsets.html: Updated.
* platform/gtk/TestExpectations: Unskipped the previously-failing test.

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog (200854 => 200855)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog	2016-05-13 13:35:08 UTC (rev 200854)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog	2016-05-13 13:41:00 UTC (rev 200855)
@@ -1,3 +1,16 @@
+2016-05-07  Joanmarie Diggs  <[email protected]>
+
+        REGRESSION(r196222): [AX][GTK] accessibility/gtk/caret-offsets.html failing
+        https://bugs.webkit.org/show_bug.cgi?id=153956
+
+        Reviewed by Chris Fleizach.
+
+        Change the test to run asynchronously and update the expectations.
+
+        * accessibility/gtk/caret-offsets-expected.txt: Updated.
+        * accessibility/gtk/caret-offsets.html: Updated.
+        * platform/gtk/TestExpectations: Unskipped the previously-failing test.
+
 2016-05-05  Zalan Bujtas  <[email protected]>
 
         Do not attempt to compute min/max width.

Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/caret-offsets-expected.txt (200854 => 200855)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/caret-offsets-expected.txt	2016-05-13 13:35:08 UTC (rev 200854)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/caret-offsets-expected.txt	2016-05-13 13:41:00 UTC (rev 200855)
@@ -23,14 +23,14 @@
 PASS caretMovedData is "Heading|5"
 PASS caretMovedData is "Paragraph|5"
 PASS caretMovedData is "Paragraph|20"
-PASS caretMovedData is "Paragraph|30"
+PASS caretMovedData became "Paragraph|30"
 PASS setCaretOffset(link, 5) is true
 PASS caretMovedData is "Paragraph|17"
 PASS list.role is "AXRole: AXList"
 PASS list.childrenCount is 3
 PASS setCaretOffset(listItem, 1) is false
 PASS setCaretOffset(listItem, 5) is true
-PASS caretMovedData is "ListItem|2"
+PASS caretMovedData is "ListItem|5"
 PASS comboBox.role is "AXRole: AXComboBox"
 PASS menuPopup.role is "AXRole: AXMenu"
 PASS comboBoxOption.role is "AXRole: AXMenuItem"
@@ -41,7 +41,7 @@
 PASS table.childrenCount is 1
 PASS row.role is "AXRole: AXRow"
 PASS tableCell.role is "AXRole: AXCell"
-PASS caretMovedData is "Cell|2"
+PASS caretMovedData became "Cell|2"
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/caret-offsets.html (200854 => 200855)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/caret-offsets.html	2016-05-13 13:35:08 UTC (rev 200854)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/caret-offsets.html	2016-05-13 13:41:00 UTC (rev 200855)
@@ -54,6 +54,8 @@
 }
 
 if (window.accessibilityController) {
+    window.jsTestIsAsync = true;
+
     accessibilityController.addNotificationListener(globalListener);
     root = accessibilityController.accessibleElementById('firstChild').parentElement();
     shouldBe('root.childrenCount', '5');
@@ -71,47 +73,48 @@
     resetCaretOffsetForObject(p1, 20);
     shouldBeEqualToString('caretMovedData', 'Paragraph|20');
     resetCaretOffsetForObject(p1, 30);
-    shouldBeEqualToString('caretMovedData', 'Paragraph|30');
-    link = p1.childAtIndex(0);
-    caretMovedData = '';
-    shouldBeTrue('setCaretOffset(link, 5)');
-    /* Positions inside links are reported relative to the paragraph. */
-    shouldBeEqualToString('caretMovedData', 'Paragraph|17');
+    shouldBecomeEqualToString('caretMovedData', 'Paragraph|30', function () { 
+        caretMovedData = '';
+        link = p1.childAtIndex(0);
+        shouldBeTrue('setCaretOffset(link, 5)');
+        /* Positions inside links are reported relative to the paragraph. */
+        shouldBeEqualToString('caretMovedData', 'Paragraph|17');
 
-    list = root.childAtIndex(2);
-    shouldBeEqualToString('list.role', 'AXRole: AXList');
-    shouldBe('list.childrenCount', '3');
-    listItem = list.childAtIndex(2);
-    /* It's not possible to place the caret inside an item's marker. */
-    shouldBe('setCaretOffset(listItem, 1)', 'false');
-    /* It should be possible to place the caret inside an item's text. */
-    caretMovedData = '';
-    shouldBe('setCaretOffset(listItem, 5)', 'true');
-    shouldBeEqualToString('caretMovedData', 'ListItem|2');
+        list = root.childAtIndex(2);
+        shouldBeEqualToString('list.role', 'AXRole: AXList');
+        shouldBe('list.childrenCount', '3');
+        listItem = list.childAtIndex(2);
+        /* It's not possible to place the caret inside an item's marker. */
+        shouldBe('setCaretOffset(listItem, 1)', 'false');
+        /* It should be possible to place the caret inside an item's text. */
+        caretMovedData = '';
+        shouldBe('setCaretOffset(listItem, 5)', 'true');
+        shouldBeEqualToString('caretMovedData', 'ListItem|5');
 
-    panel = root.childAtIndex(3);
-    comboBox = panel.childAtIndex(0);
-    shouldBeEqualToString('comboBox.role', 'AXRole: AXComboBox');
-    menuPopup = comboBox.childAtIndex(0);
-    shouldBeEqualToString('menuPopup.role', 'AXRole: AXMenu');
-    comboBoxOption = menuPopup.childAtIndex(0);
-    shouldBeEqualToString('comboBoxOption.role', 'AXRole: AXMenuItem');
-    /* It's not possible to place the caret inside an option for a combobox. */
-    shouldBe('setCaretOffset(comboBoxOption, 1)', 'false');
-    textEntry = panel.childAtIndex(1);
-    shouldBeEqualToString('textEntry.role', 'AXRole: AXTextField');
-    resetCaretOffsetForObject(textEntry, 5);
-    shouldBeEqualToString('caretMovedData', 'TextField|5');
+        panel = root.childAtIndex(3);
+        comboBox = panel.childAtIndex(0);
+        shouldBeEqualToString('comboBox.role', 'AXRole: AXComboBox');
+        menuPopup = comboBox.childAtIndex(0);
+        shouldBeEqualToString('menuPopup.role', 'AXRole: AXMenu');
+        comboBoxOption = menuPopup.childAtIndex(0);
+        shouldBeEqualToString('comboBoxOption.role', 'AXRole: AXMenuItem');
+        /* It's not possible to place the caret inside an option for a combobox. */
+        shouldBe('setCaretOffset(comboBoxOption, 1)', 'false');
+        textEntry = panel.childAtIndex(1);
+        shouldBeEqualToString('textEntry.role', 'AXRole: AXTextField');
+        resetCaretOffsetForObject(textEntry, 5);
+        shouldBeEqualToString('caretMovedData', 'TextField|5');
 
-    table = root.childAtIndex(4);
-    shouldBeEqualToString('table.role', 'AXRole: AXTable');
-    shouldBe('table.childrenCount', '1');
-    row = table.childAtIndex(0);
-    shouldBeEqualToString('row.role', 'AXRole: AXRow');
-    tableCell = row.childAtIndex(0);
-    shouldBeEqualToString('tableCell.role', 'AXRole: AXCell');
-    resetCaretOffsetForObject(tableCell, 2);
-    shouldBeEqualToString('caretMovedData', 'Cell|2');
+        table = root.childAtIndex(4);
+        shouldBeEqualToString('table.role', 'AXRole: AXTable');
+        shouldBe('table.childrenCount', '1');
+        row = table.childAtIndex(0);
+        shouldBeEqualToString('row.role', 'AXRole: AXRow');
+        tableCell = row.childAtIndex(0);
+        shouldBeEqualToString('tableCell.role', 'AXRole: AXCell');
+        resetCaretOffsetForObject(tableCell, 2);
+        shouldBecomeEqualToString('caretMovedData', 'Cell|2', finishJSTest);
+    });
 }
 
 description("This test is replicated from old file testatk.c and tests various scenarios of caret movement: setting caret offset and receiving text-caret-moved signal.");

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog (200854 => 200855)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog	2016-05-13 13:35:08 UTC (rev 200854)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog	2016-05-13 13:41:00 UTC (rev 200855)
@@ -1,3 +1,28 @@
+2016-05-07  Joanmarie Diggs  <[email protected]>
+
+        REGRESSION(r196222): [AX][GTK] accessibility/gtk/caret-offsets.html failing
+        https://bugs.webkit.org/show_bug.cgi?id=153956
+
+        Reviewed by Chris Fleizach.
+
+        The reason the test began failing is that it was checking the new caret offset
+        synchronously. For most of the test cases, this was not a problem. But when the
+        caret was moved out of a focused link, the focus change (and associated repainting)
+        delayed the caret-moved event long enough to cause the associated test case to fail.
+        The test now uses shouldBecomeEqualToString() instead of shouldBeEqualToString().
+
+        The test also had a supposedly-correct expectation which was wrong: When moving the
+        caret to a valid accessible offset, the caret-moved event should be for that offset.
+        This was not the case for the list item test case because emitTextSelectionChange()
+        was not adjusting the offset for the RenderListMarker, the text of which is exposed
+        as part of the ATK_ROLE_LIST_ITEM object. This bug was also fixed and the test case
+        updated accordingly.
+
+        No new tests are needed. The previously-failing test is now passing.
+
+        * editing/atk/FrameSelectionAtk.cpp:
+        (WebCore::emitTextSelectionChange):
+
 2016-05-05  Zalan Bujtas  <[email protected]>
 
         Do not attempt to compute min/max width.

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/editing/atk/FrameSelectionAtk.cpp (200854 => 200855)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/editing/atk/FrameSelectionAtk.cpp	2016-05-13 13:35:08 UTC (rev 200854)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/editing/atk/FrameSelectionAtk.cpp	2016-05-13 13:41:00 UTC (rev 200855)
@@ -25,6 +25,7 @@
 #include "AXObjectCache.h"
 #include "Document.h"
 #include "Frame.h"
+#include "RenderListItem.h"
 #include "WebKitAccessibleWrapperAtk.h"
 #include <glib.h>
 #include <wtf/NeverDestroyed.h>
@@ -38,6 +39,13 @@
     if (!axObject || !ATK_IS_TEXT(axObject))
         return;
 
+    // We need to adjust the offset for the list item marker in Left-To-Right text because
+    // the list item marker is exposed through the text of the accessible list item rather
+    // than through a separate accessible object.
+    RenderObject* renderer = object->renderer();
+    if (is<RenderListItem>(renderer) && renderer->style().direction() == LTR)
+        offset += downcast<RenderListItem>(*renderer).markerTextWithSuffix().length();
+
     g_signal_emit_by_name(axObject, "text-caret-moved", offset);
     if (selection.isRange())
         g_signal_emit_by_name(axObject, "text-selection-changed");
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to