Bug 188767

Summary: Use VisiblePosition to calculate selection ranges
Product: WebKit Reporter: Megan Gardner <megan_gardner>
Component: New BugsAssignee: Megan Gardner <megan_gardner>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, commit-queue, ews-watchlist, rniwa, simon.fraser, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from ews202 for win-future
none
Patch for landing none

Description Megan Gardner 2018-08-20 16:47:29 PDT
Use VisiblePosition to calculate selection ranges
Comment 1 Megan Gardner 2018-08-20 16:52:20 PDT
Created attachment 347572 [details]
Patch
Comment 2 Ryosuke Niwa 2018-08-20 19:01:26 PDT
Comment on attachment 347572 [details]
Patch

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

> Source/WebKit/ChangeLog:11
> +        when trying to snap a selection. VisiblePosition gives us the correct information, and does not 
> +        result is collapsed ranges.

does not result *in*?

> Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:1233
>      

This function seems to have a lot of whitespace on blank lines :(
Could you please fix them while we're at it?

> Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:1235
> +        if (comparePositions(result.deepEquivalent(), selectionStart.deepEquivalent()) <= 0)

This isn't right. comparePositions in Editing.h takes VisiblePositions.

> Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:1239
> +        

Nit: Whitespace.

> Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:1243
> -        if (comparePositions(selectionEnd, result) <= 0)
> +        if (comparePositions(selectionEnd.deepEquivalent(), result.deepEquivalent()) <= 0)

This isn't right. comparePositions in Editing.h takes VisiblePositions.

> Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:1247
> +        

Nit: Whitespace.
Comment 3 EWS Watchlist 2018-08-21 07:00:32 PDT
Comment on attachment 347572 [details]
Patch

Attachment 347572 [details] did not pass win-ews (win):
Output: https://webkit-queues.webkit.org/results/8929866

New failing tests:
http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-video.html
Comment 4 EWS Watchlist 2018-08-21 07:00:44 PDT
Created attachment 347639 [details]
Archive of layout-test-results from ews202 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews202  Port: win-future  Platform: CYGWIN_NT-6.1-2.10.0-0.325-5-3-x86_64-64bit
Comment 5 Radar WebKit Bug Importer 2018-08-21 14:23:56 PDT
<rdar://problem/43577166>
Comment 6 Megan Gardner 2018-08-21 14:33:44 PDT
Created attachment 347696 [details]
Patch for landing
Comment 7 WebKit Commit Bot 2018-08-21 15:41:18 PDT
Comment on attachment 347696 [details]
Patch for landing

Clearing flags on attachment: 347696

Committed r235143: <https://trac.webkit.org/changeset/235143>
Comment 8 WebKit Commit Bot 2018-08-21 15:41:20 PDT
All reviewed patches have been landed.  Closing bug.