[webkit-reviews] review granted: [Bug 205142] -requestDocumentContext always returns 1 text unit more granularity than requested : [Attachment 385620] Patch and unit tests

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Dec 13 13:53:06 PST 2019


Darin Adler <darin at apple.com> has granted Daniel Bates <dbates at webkit.org>'s
request for review:
Bug 205142: -requestDocumentContext always returns 1 text unit more granularity
than requested
https://bugs.webkit.org/show_bug.cgi?id=205142

Attachment 385620: Patch and unit tests

https://bugs.webkit.org/attachment.cgi?id=385620&action=review




--- Comment #5 from Darin Adler <darin at apple.com> ---
Comment on attachment 385620
  --> https://bugs.webkit.org/attachment.cgi?id=385620
Patch and unit tests

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

> Source/WebCore/ChangeLog:13
> +	   Fix up the code to actaully determine if the specified position is
at a sentence
> +	   boundary. Currently the code will always return false when asking
whether the
> +	   specified position is at a sentence boundary because it compares it
to the position
> +	   of the end of the next sentence or the beginning of the current
sentence when selecting
> +	   forward or backwards, respecitvely.

Why does this same problem not affect the other granularities?

> Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:3880
>  static VisiblePosition moveByGranularityRespectingWordBoundary(const
VisiblePosition& position, TextGranularity granularity, uint64_t
granularityCount, SelectionDirection direction)

Strange to have this code in an iOS-specific source file. Does this operation
only come up with implementing some iOS-specific feature?

Feels to me like a remnant of old times when we had a separate team working on
an iOS overlay for WebKit. I’d love to see more of this in core code and tested
on all platforms, etc. But I suppose if it’s really a unique requirement of iOS
UI then that’s a different story.


More information about the webkit-reviews mailing list