Bug 141893 - AX: iOS: scrollable elements do not allow 3-finger swipe (with VoiceOver)
Summary: AX: iOS: scrollable elements do not allow 3-finger swipe (with VoiceOver)
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: 528+ (Nightly build)
Hardware: iPhone / iPad iOS 8.1
: P2 Normal
Assignee: chris fleizach
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-02-23 00:03 PST by Michael Johnston
Modified: 2015-07-24 16:28 PDT (History)
13 users (show)

See Also:


Attachments
patch (45.94 KB, patch)
2015-07-20 16:36 PDT, chris fleizach
no flags Details | Formatted Diff | Diff
patch (45.94 KB, patch)
2015-07-21 10:23 PDT, chris fleizach
no flags Details | Formatted Diff | Diff
patch (45.53 KB, patch)
2015-07-21 14:39 PDT, chris fleizach
mario: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Johnston 2015-02-23 00:03:18 PST
Elements which have overflow: scroll; + -webkit-overflow-scrolling: touch; do not work with the 3-finger swipe gesture when VoiceOver is enabled. This worked in iOS 7.

Expected result: VoiceOver should announce "Page N of M" where N is the current page and M is the total number of pages determined by scroll height
Actual result: VoiceOver announces "Page 1 of 1" regardless of the scroll height
Comment 1 Radar WebKit Bug Importer 2015-02-23 00:03:47 PST
<rdar://problem/19918933>
Comment 2 chris fleizach 2015-07-20 16:36:39 PDT
Created attachment 257143 [details]
patch
Comment 3 chris fleizach 2015-07-21 10:23:31 PDT
Created attachment 257185 [details]
patch
Comment 4 chris fleizach 2015-07-21 14:39:52 PDT
Created attachment 257204 [details]
patch
Comment 5 Mario Sanchez Prada 2015-07-24 02:37:36 PDT
Comment on attachment 257204 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=257204&action=review

Overall looks good to me (and I like the idea of moving that into AccessibilityObject, too).

Setting r+ with just a few small comments below...

> Source/WebCore/ChangeLog:15
> +        (WebCore::AccessibilityObject::scrollToGlobalPoint):

It does not look like you modified this

> Source/WebCore/ChangeLog:21
> +        (WebCore::AccessibilityObject::lastKnownIsIgnoredValue):

Same for this one (not modified)

> Source/WebCore/ChangeLog:24
> +        (WebCore::AccessibilityObject::getScrollableAreaIfScrollable):
> +        (WebCore::AccessibilityObject::scrollTo):

Ditto for these two.

> Source/WebCore/accessibility/AccessibilityObject.cpp:2538
> +    for (; scrollers.second && !(scrollers.first = scrollers.second->getScrollableAreaIfScrollable()); scrollers.second = scrollers.second->parentObject()) { }

I find this line a bit hard to read. What about this:

// Search up the parent chain until we find the first one that's scrollable.
scrollers.first = nullptr;
scrollers.second = parentObject();
while (!scrollers.first && scrollers.second) {
  scrollers.first = scrollers.second->getScrollableAreaIfScrollable());
  scrollers.second = scrollers.second->parentObject());
}

Or even:

// Search up the parent chain until we find the first one that's scrollable.
scrollers.first = nullptr;
for (scrollers.second = parentObject(); !scrollers.first && scrollers.second; scrollers.second = scrollers.second->parentObject())
  scrollers.first = scrollers.second->getScrollableAreaIfScrollable());

> Source/WebCore/accessibility/AccessibilityObject.cpp:2565
> +    std::pair<ScrollableArea*, AccessibilityObject*> scrollers;
> +    scrollAreaAndAncestor(scrollers);
> +    if (!scrollers.first)

It looks like you could put these three lines in a separate function returning a ScrollableArea*, and use it from this and the previous two functions (but not from scrollByPage, as you also need the .second element there)

> Tools/DumpRenderTree/mac/AccessibilityNotificationHandler.mm:183
> -        JSObjectCallAsFunction([mainFrame globalContext], m_notificationFunctionCallback, 0, 2, arguments, 0);
> +        JSObjectCallAsFunction([mainFrame globalContext], m_notificationFunctionCallback, 0, 3, arguments, 0);

Nice catch
Comment 6 chris fleizach 2015-07-24 16:28:21 PDT
http://trac.webkit.org/changeset/187371