Bug 157403 - AX: String for document range is empty if end visible position anchors to a ignored replaced node
Summary: AX: String for document range is empty if end visible position anchors to a i...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-05-05 18:11 PDT by Nan Wang
Modified: 2016-05-06 12:23 PDT (History)
11 users (show)

See Also:


Attachments
Initial patch (5.96 KB, patch)
2016-05-05 18:25 PDT, Nan Wang
cfleizach: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nan Wang 2016-05-05 18:11:28 PDT
The CharacterOffset that is converted from the VisiblePosition is wrong in such case.
Comment 1 Nan Wang 2016-05-05 18:11:50 PDT
<rdar://problem/26071274>
Comment 2 Radar WebKit Bug Importer 2016-05-05 18:12:00 PDT
<rdar://problem/26131216>
Comment 3 Nan Wang 2016-05-05 18:25:20 PDT
Created attachment 278215 [details]
Initial patch
Comment 4 chris fleizach 2016-05-05 23:25:40 PDT
Comment on attachment 278215 [details]
Initial patch

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

> Source/WebCore/accessibility/AXObjectCache.cpp:2000
> +    // Sometimes when the node is a replaced node and is ignored in accessibility, we get wrong CharacterOffset from it.

we get "a" wrong

> Source/WebCore/accessibility/AXObjectCache.cpp:2002
> +    if  (result.remainingOffset > 0 && !result.isNull() && isRendererReplacedElement(result.node->renderer()))

is remainingOffset signed or unsigned.... if unsigned you can drop the > 0
Comment 5 Nan Wang 2016-05-06 00:23:16 PDT
Comment on attachment 278215 [details]
Initial patch

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

>> Source/WebCore/accessibility/AXObjectCache.cpp:2002
>> +    if  (result.remainingOffset > 0 && !result.isNull() && isRendererReplacedElement(result.node->renderer()))
> 
> is remainingOffset signed or unsigned.... if unsigned you can drop the > 0

It's signed int.
Comment 6 Nan Wang 2016-05-06 00:26:41 PDT
Committed r200508: <http://trac.webkit.org/changeset/200508>
Comment 7 Darin Adler 2016-05-06 12:23:28 PDT
Comment on attachment 278215 [details]
Initial patch

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

>>> Source/WebCore/accessibility/AXObjectCache.cpp:2002
>>> +    if  (result.remainingOffset > 0 && !result.isNull() && isRendererReplacedElement(result.node->renderer()))
>> 
>> is remainingOffset signed or unsigned.... if unsigned you can drop the > 0
> 
> It's signed int.

Extra space after "if" before "(".