Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[GTK] Fix some test failures in ATK selection handling.
https://bugs.webkit.org/show_bug.cgi?id=168369
<rdar://problem/30534881>

Reviewed by Joanmarie Diggs.

Source/WebCore:

In r208479, selectionBelongsToObject was changed to return false if the
intersectsNode call returns an exception.

In particular, this caused accessibility/gtk/text-at-offset-textarea.html
to fail. In this test, the selection is situated in the shadow DOM of the
textarea, while the node that is checked for intersection is the textarea
itself. In line with the standard, intersectsNode returns an exception in
this case.

This caused webkitAccessibleText{Word, Line, Sentence}ForBoundary to stop
returning the expected text in the tested case. Removing this check fixes
the test, along with some others.

Tests: accessibility/gtk/text-at-offset-textarea.html
       accessibility/gtk/text-at-offset-textinput.html
       accessibility/selected-text-range-aria-elements.html
       accessibility/textarea-selected-text-range.html

* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
(getSelectionOffsetsForObject): Remove the selectionBelongsToObject() call.

LayoutTests:

Update test expectations for tests that pass again.

* platform/gtk/TestExpectations:


Canonical link: https://commits.webkit.org/197875@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227523 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Ms2ger committed Jan 24, 2018
1 parent 647a522 commit 086ebb1
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 12 deletions.
12 changes: 12 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
2018-01-24 Ms2ger <Ms2ger@igalia.com>

[GTK] Fix some test failures in ATK selection handling.
https://bugs.webkit.org/show_bug.cgi?id=168369
<rdar://problem/30534881>

Reviewed by Joanmarie Diggs.

Update test expectations for tests that pass again.

* platform/gtk/TestExpectations:

2018-01-24 Manuel Rego Casasnovas <rego@igalia.com>

Update paths of CSS tests from WPT
Expand Down
5 changes: 0 additions & 5 deletions LayoutTests/platform/gtk/TestExpectations
Expand Up @@ -2935,8 +2935,6 @@ webkit.org/b/151267 imported/blink/svg/canvas/canvas-draw-pattern-size.html [ Im
webkit.org/b/151267 imported/blink/svg/filters/feDropShadow-linearrgb-flood-color.svg [ ImageOnlyFailure ]
webkit.org/b/151267 imported/blink/webexposed/webkit-focus-ring-exposed-to-quirks-mode.html [ ImageOnlyFailure ]

webkit.org/b/152057 accessibility/textarea-selected-text-range.html [ Failure Timeout ]

webkit.org/b/152788 imported/mozilla/svg/filter-scaled-02.html [ ImageOnlyFailure Pass ]

webkit.org/b/152821 imported/w3c/css/css-multicol-1/multicol-basic-001.html [ ImageOnlyFailure ]
Expand Down Expand Up @@ -3079,10 +3077,7 @@ webkit.org/b/168191 css3/font-synthesis-small-caps.html [ ImageOnlyFailure ]

webkit.org/b/168192 http/tests/media/hls/video-duration-accessibility.html [ Timeout Failure ]

webkit.org/b/168369 accessibility/gtk/text-at-offset-textarea.html [ Failure ]
webkit.org/b/168369 accessibility/gtk/text-at-offset-textinput.html [ Failure ]
webkit.org/b/168370 accessibility/hidden-th-still-column-header.html [ Failure ]
webkit.org/b/168370 accessibility/selected-text-range-aria-elements.html [ Failure ]

webkit.org/b/168373 fullscreen/video-controls-rtl.html [ Failure ]
webkit.org/b/168373 media/media-preload-no-delay-loadevent.html [ Failure ]
Expand Down
29 changes: 29 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,32 @@
2018-01-24 Ms2ger <Ms2ger@igalia.com>

[GTK] Fix some test failures in ATK selection handling.
https://bugs.webkit.org/show_bug.cgi?id=168369
<rdar://problem/30534881>

Reviewed by Joanmarie Diggs.

In r208479, selectionBelongsToObject was changed to return false if the
intersectsNode call returns an exception.

In particular, this caused accessibility/gtk/text-at-offset-textarea.html
to fail. In this test, the selection is situated in the shadow DOM of the
textarea, while the node that is checked for intersection is the textarea
itself. In line with the standard, intersectsNode returns an exception in
this case.

This caused webkitAccessibleText{Word, Line, Sentence}ForBoundary to stop
returning the expected text in the tested case. Removing this check fixes
the test, along with some others.

Tests: accessibility/gtk/text-at-offset-textarea.html
accessibility/gtk/text-at-offset-textinput.html
accessibility/selected-text-range-aria-elements.html
accessibility/textarea-selected-text-range.html

* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
(getSelectionOffsetsForObject): Remove the selectionBelongsToObject() call.

2018-01-18 Sergio Villar Senin <svillar@igalia.com>

[WebVR] Add OpenVR to the tree and to the build
Expand Down
Expand Up @@ -391,13 +391,6 @@ static void getSelectionOffsetsForObject(AccessibilityObject* coreObject, Visibl
Position firstValidPosition = firstPositionInOrBeforeNode(node->firstDescendant());
Position lastValidPosition = lastPositionInOrAfterNode(node->lastDescendant());

// Early return with proper values if the selection falls entirely out of the object.
if (!selectionBelongsToObject(coreObject, selection)) {
startOffset = comparePositions(selection.start(), firstValidPosition) <= 0 ? 0 : accessibilityObjectLength(coreObject);
endOffset = startOffset;
return;
}

// Find the proper range for the selection that falls inside the object.
Position nodeRangeStart = selection.start();
if (comparePositions(nodeRangeStart, firstValidPosition) < 0)
Expand Down

0 comments on commit 086ebb1

Please sign in to comment.