[webkit-reviews] review granted: [Bug 210396] Stop using live ranges in functions that return range of the selection : [Attachment 397317] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Apr 25 18:41:55 PDT 2020


Sam Weinig <sam at webkit.org> has granted Darin Adler <darin at apple.com>'s request
for review:
Bug 210396: Stop using live ranges in functions that return range of the
selection
https://bugs.webkit.org/show_bug.cgi?id=210396

Attachment 397317: Patch

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




--- Comment #13 from Sam Weinig <sam at webkit.org> ---
Comment on attachment 397317
  --> https://bugs.webkit.org/attachment.cgi?id=397317
Patch

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

So many good and juicy follow ups here. Very nice.

> Source/WebCore/editing/cocoa/HTMLConverter.mm:422
>      if (documentAttributes)
> -	   *documentAttributes = [[_documentAttrs retain] autorelease];
> +	   *documentAttributes = _documentAttrs;

Makes me wonder if this family of functions should always return a
std::pair<RetainPtr<NSAttributedString>, RetainPtr<NSDictionary>>, rather than
making this optional. Will trade off a branch for a retain. Doesn't really
matter, but the out parameter has always bugged me and now that we can use
structured bindings, the pair is not a mess anymore.


More information about the webkit-reviews mailing list