Some test cases in accessibility/mac/selection-notification-focus-change.html fail
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Feb 2018 23:11:13 +0000 (23:11 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Feb 2018 23:11:13 +0000 (23:11 +0000)
commit02149972b884136428881255cc9549ecca2c4bf6
treebf5413dd6d0fd46c2a90fbab7ff417023f9cfd3d
parent7d13fa98ca9917742c705f532fb51791ace033d0
Some test cases in accessibility/mac/selection-notification-focus-change.html fail
https://bugs.webkit.org/show_bug.cgi?id=182212
<rdar://problem/36937147>

Reviewed by Antti Koivisto and Wenson Hsieh.

Source/WebCore:

The failure was caused by the async update of the selection appearance not preserving selection reveal intent.
Fixed the bug by storing the intent in a member variable and using it later.

* dom/Element.cpp:
(WebCore::Element::focus): Removed an unnecessary synchronous layout update.
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setNeedsSelectionUpdate): Use the default intent to preserve the old behavior.
(WebCore::FrameSelection::respondToNodeModification): Ditto.
(WebCore::FrameSelection::setSelection): Save the selection reveal intent.
(WebCore::FrameSelection::updateAppearanceAfterLayoutOrStyleChange): Use the saved intent.
* editing/FrameSelection.h:
* page/FocusController.cpp:
(WebCore::FocusController::advanceFocusDirectionally): Always update the layout before invoking
nodeRectInAbsoluteCoordinates.

LayoutTests:

Updated and rebaselined the tests.

* accessibility/ios-simulator/header-elements.html: Force the layout after each call to element.focus
now that element.focus no longer updates the layout synchronously. Ordinarily, this will happen next time
the layout is updated for paint, by JS API, etc... but we have to force the accessibility tree to be
up-to-date for testing purposes.
* accessibility/ios-simulator/table-cell-for-row-col.html: Ditto.
* accessibility/mac/selection-notification-focus-change-expected.txt: Now all the test cases are passing.
* accessibility/mac/table-with-row-col-of-headers.html: Force the layout after each call to element.focus.
* accessibility/mac/table-with-zebra-rows.html: Ditto.
* accessibility/scroll-to-global-point-main-window.html: Ditto.
* accessibility/scroll-to-make-visible-with-subfocus.html: Ditto.
* editing/input/caret-at-the-edge-of-input.html: Wait for the focused element to reveal itself by a timer.
* fast/forms/input-text-scroll-left-on-blur.html: Ditto.
* fast/forms/textarea-no-scroll-on-blur.html: Ditto.
* fast/forms/textarea-scrolled-type.html: Ditto.
* platform/mac-wk2/accessibility/mac/selection-notification-focus-change-expected.txt: Rebaselined. We now
get one less AXTextSelectionChangedFocus notification because selection updates are now coalesced as expected.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227983 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/ios-simulator/header-elements.html
LayoutTests/accessibility/ios-simulator/table-cell-for-row-col.html
LayoutTests/accessibility/mac/selection-notification-focus-change-expected.txt
LayoutTests/accessibility/mac/table-with-row-col-of-headers.html
LayoutTests/accessibility/mac/table-with-zebra-rows.html
LayoutTests/accessibility/scroll-to-global-point-main-window.html
LayoutTests/accessibility/scroll-to-make-visible-with-subfocus.html
LayoutTests/editing/input/caret-at-the-edge-of-input.html
LayoutTests/fast/forms/input-text-scroll-left-on-blur.html
LayoutTests/fast/forms/textarea-no-scroll-on-blur.html
LayoutTests/fast/forms/textarea-scrolled-type.html
LayoutTests/platform/mac-wk2/accessibility/mac/selection-notification-focus-change-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/dom/Element.cpp
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/editing/FrameSelection.h
Source/WebCore/page/FocusController.cpp