Bug 188767 - Use VisiblePosition to calculate selection ranges
Summary: Use VisiblePosition to calculate selection ranges
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Megan Gardner
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-08-20 16:47 PDT by Megan Gardner
Modified: 2018-08-21 15:41 PDT (History)
8 users (show)

See Also:


Attachments
Patch (4.16 KB, patch)
2018-08-20 16:52 PDT, Megan Gardner
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews202 for win-future (12.94 MB, application/zip)
2018-08-21 07:00 PDT, EWS Watchlist
no flags Details
Patch for landing (5.42 KB, patch)
2018-08-21 14:33 PDT, Megan Gardner
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.