[Webkit-unassigned] [Bug 204758] Add helper methods for description and equality to text manipulation SPI

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Dec 2 13:04:35 PST 2019


https://bugs.webkit.org/show_bug.cgi?id=204758

--- Comment #5 from Louie Livon-Bemel <llivonbemel at apple.com> ---
(In reply to Wenson Hsieh from comment #4)
> Comment on attachment 384640 [details]
> 57438200.patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=384640&action=review
> 
> > Source/WebKit/UIProcess/API/Cocoa/_WKTextManipulationItem.mm:62
> > +    if (![self.identifier isEqualToString:otherItem.identifier] || self.tokens.count != otherItem.tokens.count)
> 
> This would return NO in the case where both self and otherItem have nil
> identifiers (it’s unclear to me if that is desired).

I think we would want both having nil identifiers but being otherwise equal to be considered equal. I can't re-declare `isEqualOrBothNil()` in this file because of Unified Source compilation saying it's redeclared, but I'll just add the logic directly here. And I'll add a test for this as well.
> 
> > Tools/TestWebKitAPI/Tests/WebKitCocoa/TextManipulation.mm:687
> > +    NSString *debugDescription = item.get().description;
> 
> Nit - We usually just use [item description] for this (or [item
> debugDescription], per David’s earlier comments).

I'll change this to message syntax. Per David's suggestion, I'm also making -description be the privacy preserving method, removing -privacyPreservingDescription, and adding -debugDescription which shows the full content.
> 
> > Tools/TestWebKitAPI/Tests/WebKitCocoa/TextManipulation.mm:694
> > +    NSString *privacyPreservingDescription = item.get().privacyPreservingDescription;
> 
> Ditto.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20191202/ef40fc02/attachment.htm>


More information about the webkit-unassigned mailing list