[webkit-reviews] review granted: [Bug 211087] [iOS] Marked text editor state only needs to be set when layout is up-to-date : [Attachment 397710] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Apr 27 12:06:36 PDT 2020


Darin Adler <darin at apple.com> has granted Daniel Bates <dbates at webkit.org>'s
request for review:
Bug 211087: [iOS] Marked text editor state only needs to be set when layout is
up-to-date
https://bugs.webkit.org/show_bug.cgi?id=211087

Attachment 397710: Patch

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




--- Comment #7 from Darin Adler <darin at apple.com> ---
Comment on attachment 397710
  --> https://bugs.webkit.org/attachment.cgi?id=397710
Patch

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

> Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:-246
> +    // We only set the remaining EditorState entries if layout is done as a
performance optimization
> +    // to avoid the need to force a synchronous layout here to compute these
entries.
> +    if (!view || view->needsLayout() || result.isMissingPostLayoutData)
>	   return;
> -    }

Seems like this only needs to check isMissingPostLayoutData. The other
conditions are already guaranteed by the editorState function before this is
called. Maybe even change the interface to getPlatformEditorState to make this
clearer.

Also seems like isMissingPostLayoutData should eventually be dumped and instead
we should use Optional for m_postLayoutData. That way the two can’t get out of
sync.


More information about the webkit-reviews mailing list