Changeset 200855 in webkit


Ignore:
Timestamp:
May 13, 2016, 6:41:00 AM (9 years ago)
Author:
Carlos Garcia Campos
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.
Location:
releases/WebKitGTK/webkit-2.12
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog

    r200854 r200855  
     12016-05-07  Joanmarie Diggs  <jdiggs@igalia.com>
     2
     3        REGRESSION(r196222): [AX][GTK] accessibility/gtk/caret-offsets.html failing
     4        https://bugs.webkit.org/show_bug.cgi?id=153956
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Change the test to run asynchronously and update the expectations.
     9
     10        * accessibility/gtk/caret-offsets-expected.txt: Updated.
     11        * accessibility/gtk/caret-offsets.html: Updated.
     12        * platform/gtk/TestExpectations: Unskipped the previously-failing test.
     13
    1142016-05-05  Zalan Bujtas  <zalan@apple.com>
    215
  • releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/caret-offsets-expected.txt

    r187777 r200855  
    2424PASS caretMovedData is "Paragraph|5"
    2525PASS caretMovedData is "Paragraph|20"
    26 PASS caretMovedData is "Paragraph|30"
     26PASS caretMovedData became "Paragraph|30"
    2727PASS setCaretOffset(link, 5) is true
    2828PASS caretMovedData is "Paragraph|17"
     
    3131PASS setCaretOffset(listItem, 1) is false
    3232PASS setCaretOffset(listItem, 5) is true
    33 PASS caretMovedData is "ListItem|2"
     33PASS caretMovedData is "ListItem|5"
    3434PASS comboBox.role is "AXRole: AXComboBox"
    3535PASS menuPopup.role is "AXRole: AXMenu"
     
    4242PASS row.role is "AXRole: AXRow"
    4343PASS tableCell.role is "AXRole: AXCell"
    44 PASS caretMovedData is "Cell|2"
     44PASS caretMovedData became "Cell|2"
    4545PASS successfullyParsed is true
    4646
  • releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/caret-offsets.html

    r187804 r200855  
    5555
    5656if (window.accessibilityController) {
     57    window.jsTestIsAsync = true;
     58
    5759    accessibilityController.addNotificationListener(globalListener);
    5860    root = accessibilityController.accessibleElementById('firstChild').parentElement();
     
    7274    shouldBeEqualToString('caretMovedData', 'Paragraph|20');
    7375    resetCaretOffsetForObject(p1, 30);
    74     shouldBeEqualToString('caretMovedData', 'Paragraph|30');
    75     link = p1.childAtIndex(0);
    76     caretMovedData = '';
    77     shouldBeTrue('setCaretOffset(link, 5)');
    78     /* Positions inside links are reported relative to the paragraph. */
    79     shouldBeEqualToString('caretMovedData', 'Paragraph|17');
     76    shouldBecomeEqualToString('caretMovedData', 'Paragraph|30', function () {
     77        caretMovedData = '';
     78        link = p1.childAtIndex(0);
     79        shouldBeTrue('setCaretOffset(link, 5)');
     80        /* Positions inside links are reported relative to the paragraph. */
     81        shouldBeEqualToString('caretMovedData', 'Paragraph|17');
    8082
    81     list = root.childAtIndex(2);
    82     shouldBeEqualToString('list.role', 'AXRole: AXList');
    83     shouldBe('list.childrenCount', '3');
    84     listItem = list.childAtIndex(2);
    85     /* It's not possible to place the caret inside an item's marker. */
    86     shouldBe('setCaretOffset(listItem, 1)', 'false');
    87     /* It should be possible to place the caret inside an item's text. */
    88     caretMovedData = '';
    89     shouldBe('setCaretOffset(listItem, 5)', 'true');
    90     shouldBeEqualToString('caretMovedData', 'ListItem|2');
     83        list = root.childAtIndex(2);
     84        shouldBeEqualToString('list.role', 'AXRole: AXList');
     85        shouldBe('list.childrenCount', '3');
     86        listItem = list.childAtIndex(2);
     87        /* It's not possible to place the caret inside an item's marker. */
     88        shouldBe('setCaretOffset(listItem, 1)', 'false');
     89        /* It should be possible to place the caret inside an item's text. */
     90        caretMovedData = '';
     91        shouldBe('setCaretOffset(listItem, 5)', 'true');
     92        shouldBeEqualToString('caretMovedData', 'ListItem|5');
    9193
    92     panel = root.childAtIndex(3);
    93     comboBox = panel.childAtIndex(0);
    94     shouldBeEqualToString('comboBox.role', 'AXRole: AXComboBox');
    95     menuPopup = comboBox.childAtIndex(0);
    96     shouldBeEqualToString('menuPopup.role', 'AXRole: AXMenu');
    97     comboBoxOption = menuPopup.childAtIndex(0);
    98     shouldBeEqualToString('comboBoxOption.role', 'AXRole: AXMenuItem');
    99     /* It's not possible to place the caret inside an option for a combobox. */
    100     shouldBe('setCaretOffset(comboBoxOption, 1)', 'false');
    101     textEntry = panel.childAtIndex(1);
    102     shouldBeEqualToString('textEntry.role', 'AXRole: AXTextField');
    103     resetCaretOffsetForObject(textEntry, 5);
    104     shouldBeEqualToString('caretMovedData', 'TextField|5');
     94        panel = root.childAtIndex(3);
     95        comboBox = panel.childAtIndex(0);
     96        shouldBeEqualToString('comboBox.role', 'AXRole: AXComboBox');
     97        menuPopup = comboBox.childAtIndex(0);
     98        shouldBeEqualToString('menuPopup.role', 'AXRole: AXMenu');
     99        comboBoxOption = menuPopup.childAtIndex(0);
     100        shouldBeEqualToString('comboBoxOption.role', 'AXRole: AXMenuItem');
     101        /* It's not possible to place the caret inside an option for a combobox. */
     102        shouldBe('setCaretOffset(comboBoxOption, 1)', 'false');
     103        textEntry = panel.childAtIndex(1);
     104        shouldBeEqualToString('textEntry.role', 'AXRole: AXTextField');
     105        resetCaretOffsetForObject(textEntry, 5);
     106        shouldBeEqualToString('caretMovedData', 'TextField|5');
    105107
    106     table = root.childAtIndex(4);
    107     shouldBeEqualToString('table.role', 'AXRole: AXTable');
    108     shouldBe('table.childrenCount', '1');
    109     row = table.childAtIndex(0);
    110     shouldBeEqualToString('row.role', 'AXRole: AXRow');
    111     tableCell = row.childAtIndex(0);
    112     shouldBeEqualToString('tableCell.role', 'AXRole: AXCell');
    113     resetCaretOffsetForObject(tableCell, 2);
    114     shouldBeEqualToString('caretMovedData', 'Cell|2');
     108        table = root.childAtIndex(4);
     109        shouldBeEqualToString('table.role', 'AXRole: AXTable');
     110        shouldBe('table.childrenCount', '1');
     111        row = table.childAtIndex(0);
     112        shouldBeEqualToString('row.role', 'AXRole: AXRow');
     113        tableCell = row.childAtIndex(0);
     114        shouldBeEqualToString('tableCell.role', 'AXRole: AXCell');
     115        resetCaretOffsetForObject(tableCell, 2);
     116        shouldBecomeEqualToString('caretMovedData', 'Cell|2', finishJSTest);
     117    });
    115118}
    116119
  • releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog

    r200854 r200855  
     12016-05-07  Joanmarie Diggs  <jdiggs@igalia.com>
     2
     3        REGRESSION(r196222): [AX][GTK] accessibility/gtk/caret-offsets.html failing
     4        https://bugs.webkit.org/show_bug.cgi?id=153956
     5
     6        Reviewed by Chris Fleizach.
     7
     8        The reason the test began failing is that it was checking the new caret offset
     9        synchronously. For most of the test cases, this was not a problem. But when the
     10        caret was moved out of a focused link, the focus change (and associated repainting)
     11        delayed the caret-moved event long enough to cause the associated test case to fail.
     12        The test now uses shouldBecomeEqualToString() instead of shouldBeEqualToString().
     13
     14        The test also had a supposedly-correct expectation which was wrong: When moving the
     15        caret to a valid accessible offset, the caret-moved event should be for that offset.
     16        This was not the case for the list item test case because emitTextSelectionChange()
     17        was not adjusting the offset for the RenderListMarker, the text of which is exposed
     18        as part of the ATK_ROLE_LIST_ITEM object. This bug was also fixed and the test case
     19        updated accordingly.
     20
     21        No new tests are needed. The previously-failing test is now passing.
     22
     23        * editing/atk/FrameSelectionAtk.cpp:
     24        (WebCore::emitTextSelectionChange):
     25
    1262016-05-05  Zalan Bujtas  <zalan@apple.com>
    227
  • releases/WebKitGTK/webkit-2.12/Source/WebCore/editing/atk/FrameSelectionAtk.cpp

    r183368 r200855  
    2626#include "Document.h"
    2727#include "Frame.h"
     28#include "RenderListItem.h"
    2829#include "WebKitAccessibleWrapperAtk.h"
    2930#include <glib.h>
     
    3839    if (!axObject || !ATK_IS_TEXT(axObject))
    3940        return;
     41
     42    // We need to adjust the offset for the list item marker in Left-To-Right text because
     43    // the list item marker is exposed through the text of the accessible list item rather
     44    // than through a separate accessible object.
     45    RenderObject* renderer = object->renderer();
     46    if (is<RenderListItem>(renderer) && renderer->style().direction() == LTR)
     47        offset += downcast<RenderListItem>(*renderer).markerTextWithSuffix().length();
    4048
    4149    g_signal_emit_by_name(axObject, "text-caret-moved", offset);
Note: See TracChangeset for help on using the changeset viewer.