Bug 167677 - AX: Incorrect range from index and length in text controls when there are newlines
Summary: AX: Incorrect range from index and length in text controls when there are new...
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: 2017-01-31 17:52 PST by Nan Wang
Modified: 2017-02-01 10:13 PST (History)
11 users (show)

See Also:


Attachments
patch (6.36 KB, patch)
2017-01-31 18:03 PST, Nan Wang
no flags Details | Formatted Diff | Diff
patch (6.74 KB, patch)
2017-01-31 18:14 PST, Nan Wang
no flags Details | Formatted Diff | Diff
patch (6.79 KB, patch)
2017-01-31 18:22 PST, Nan Wang
cfleizach: review+
Details | Formatted Diff | Diff
patch (8.35 KB, patch)
2017-02-01 09:50 PST, 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 2017-01-31 17:52:38 PST
doAXStringForRange(const PlainTextRange&) and doAXBoundsForRange(const PlainTextRange&) sometimes return wrong information when the text control contains newlines. 

<rdar://problem/30187854>
Comment 1 Radar WebKit Bug Importer 2017-01-31 17:52:49 PST
<rdar://problem/30300099>
Comment 2 Nan Wang 2017-01-31 18:03:30 PST
Created attachment 300290 [details]
patch
Comment 3 chris fleizach 2017-01-31 18:07:44 PST
Comment on attachment 300290 [details]
patch

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

> LayoutTests/accessibility/mac/range-for-contenteditable-newline.html:9
> +<div id="textcontrol" contenteditable="true">some<div>hello world</div><div>test</div></div>

can you also add an input type=text test case too
Comment 4 Nan Wang 2017-01-31 18:14:34 PST
Created attachment 300291 [details]
patch

added test case
Comment 5 chris fleizach 2017-01-31 18:16:47 PST
Comment on attachment 300291 [details]
patch

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

> LayoutTests/accessibility/mac/range-for-contenteditable-newline.html:10
> +<input type="text" id="input" value="hello world">

I guess input type=text doesn't have newlines. we should also check <textarea>

sorry
Comment 6 Nan Wang 2017-01-31 18:22:34 PST
Created attachment 300292 [details]
patch

sure, test <textarea> instead
Comment 7 Nan Wang 2017-02-01 09:50:22 PST
Created attachment 300333 [details]
patch

Found an issue where a wrong position is retrieved if there are multiple <br> in the text control.
Comment 8 WebKit Commit Bot 2017-02-01 10:13:33 PST
Comment on attachment 300333 [details]
patch

Clearing flags on attachment: 300333

Committed r211491: <http://trac.webkit.org/changeset/211491>
Comment 9 WebKit Commit Bot 2017-02-01 10:13:38 PST
All reviewed patches have been landed.  Closing bug.