Bug 157403

Summary: AX: String for document range is empty if end visible position anchors to a ignored replaced node
Product: WebKit Reporter: Nan Wang <n_wang>
Component: AccessibilityAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, apinheiro, cfleizach, commit-queue, dmazzoni, jcraig, jdiggs, mario, n_wang, samuel_white, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Initial patch cfleizach: review+

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 "(".