Bug 159910 - AX: Incorrect behavior for word related text marker functions when there's collapsed whitespace
Summary: AX: Incorrect behavior for word related text marker functions when there's co...
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-07-18 17:10 PDT by Nan Wang
Modified: 2016-07-19 11:15 PDT (History)
11 users (show)

See Also:


Attachments
Initial patch (15.92 KB, patch)
2016-07-18 17:21 PDT, Nan Wang
no flags Details | Formatted Diff | Diff
patch (15.94 KB, patch)
2016-07-19 08:50 PDT, Nan Wang
no flags Details | Formatted Diff | Diff
patch (15.94 KB, patch)
2016-07-19 08:52 PDT, Nan Wang
no flags Details | Formatted Diff | Diff
patch (15.94 KB, patch)
2016-07-19 09:18 PDT, Nan Wang
no flags Details | Formatted Diff | Diff
patch (15.95 KB, patch)
2016-07-19 10:31 PDT, Nan Wang
no flags 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-07-18 17:10:45 PDT
When there's collapsed whitespace, we are getting incorrect text marker ranges for words.
Comment 1 Radar WebKit Bug Importer 2016-07-18 17:11:23 PDT
<rdar://problem/27414506>
Comment 2 Nan Wang 2016-07-18 17:11:51 PDT
<rdar://problem/26898984>
Comment 3 Nan Wang 2016-07-18 17:21:25 PDT
Created attachment 283964 [details]
Initial patch
Comment 4 chris fleizach 2016-07-19 00:11:51 PDT
Comment on attachment 283964 [details]
Initial patch

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

> Source/WebCore/ChangeLog:8
> +        We are getting bad CharacterOffset when there's collapsed whitespace. Added a TraverseOptionValidateOffset

getting "a" bad

> Source/WebCore/ChangeLog:10
> +        fixed word navigation issue based on that.

fixed "a" word

> Source/WebCore/accessibility/AXObjectCache.cpp:1645
> +    // For replaced node without children, we should inluce itself in the range.

inluce -> include

> Source/WebCore/accessibility/AXObjectCache.cpp:1650
> +    if (ec)

it looks like the ec case is handled directly below
Comment 5 Nan Wang 2016-07-19 08:50:50 PDT
Created attachment 284009 [details]
patch

update from review.
Comment 6 Nan Wang 2016-07-19 08:52:07 PDT
Created attachment 284010 [details]
patch

fixed typo
Comment 7 chris fleizach 2016-07-19 09:08:32 PDT
Comment on attachment 284009 [details]
patch

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

> Source/WebCore/accessibility/AXObjectCache.cpp:1590
> +        bool cumulateEnough = validateOffset ? cumulativeOffset + lastStartOffset >= offset : cumulativeOffset >= offset;

the name of this variable is strange: cumulateEnough
what purpose do you want it to serve?

it seems like it could be "bool validOffset"

> Source/WebCore/accessibility/AXObjectCache.cpp:2307
> +    // SimplifiedBackwardsTextIterator ignores replaced element

period after this sentence
Comment 8 Nan Wang 2016-07-19 09:12:29 PDT
Comment on attachment 284009 [details]
patch

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

>> Source/WebCore/accessibility/AXObjectCache.cpp:1590
>> +        bool cumulateEnough = validateOffset ? cumulativeOffset + lastStartOffset >= offset : cumulativeOffset >= offset;
> 
> the name of this variable is strange: cumulateEnough
> what purpose do you want it to serve?
> 
> it seems like it could be "bool validOffset"

This is to check if we have cumulated enough characters so that we can break early.
Comment 9 Nan Wang 2016-07-19 09:18:06 PDT
Created attachment 284012 [details]
patch

more review comments
Comment 10 chris fleizach 2016-07-19 10:16:51 PDT
Comment on attachment 284009 [details]
patch

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

>>> Source/WebCore/accessibility/AXObjectCache.cpp:1590
>>> +        bool cumulateEnough = validateOffset ? cumulativeOffset + lastStartOffset >= offset : cumulativeOffset >= offset;
>> 
>> the name of this variable is strange: cumulateEnough
>> what purpose do you want it to serve?
>> 
>> it seems like it could be "bool validOffset"
> 
> This is to check if we have cumulated enough characters so that we can break early.

bool offsetLimitReached
Comment 11 Nan Wang 2016-07-19 10:31:24 PDT
Created attachment 284018 [details]
patch

Changed variable name.
Comment 12 WebKit Commit Bot 2016-07-19 11:14:58 PDT
Comment on attachment 284018 [details]
patch

Clearing flags on attachment: 284018

Committed r203412: <http://trac.webkit.org/changeset/203412>
Comment 13 WebKit Commit Bot 2016-07-19 11:15:03 PDT
All reviewed patches have been landed.  Closing bug.