Bug 131933 - AX: [ATK] caret-moved not emitted by text directly in html body
: AX: [ATK] caret-moved not emitted by text directly in html body
Status: NEW
Product: WebKit
Classification: Unclassified
Component: Accessibility
: 528+ (Nightly build)
: PC Linux
: P2 Normal
Assigned To: Nobody
: Gtk, InRadar
Depends on:
  Show dependency treegraph
Reported: 2014-04-21 04:35 PDT by Jarek Czekalski
Modified: 2014-04-26 08:07 PDT (History)
2 users (show)

See Also:

patch with a test case (6.73 KB, patch)
2014-04-21 04:35 PDT, Jarek Czekalski
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jarek Czekalski 2014-04-21 04:35:37 PDT
Created attachment 229799 [details]
patch with a test case

Under some circumstances text enclosed directly in <body> does not behave like text. atk_text_set_caret_offset does not allow to position the cursor inside it and caret-moved events are not emitted.

The simple example is as follows:


Divs are accessible, but the text between them is not. If there were no misleading divs, the text alone is accessible. Once a div after or before is added, the problem arises.

I prepared a test case for that. To make such tests easier I prepared a helper testWebkitAtkCaretWalk method. So in this testatk.c diff there is also a test case for bug #130941 included. The name of the test for this bug report is caretInBody.
Comment 1 Radar WebKit Bug Importer 2014-04-21 04:37:14 PDT
Comment 2 Jarek Czekalski 2014-04-26 08:07:17 PDT
First clue.

In Source/WebCore/accessibility/AccessibilityRenderObject.cpp, function AccessibilityRenderObject::textUnderElement, line 664, we have a comment:
            // For anonymous blocks, we work around not having a direct node to create a range from
            // defining one based in the two external positions defining the boundaries of the subtree.

But when we set cursor position, we rely on visiblePositionForIndex, the same file, line 1859. There it returns empty position for anonymous blocks (!node).