[webkit-reviews] review granted: [Bug 236584] focus({preventScroll: true}) does not prevent scrolling on iOS : [Attachment 453420] For EWS

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 28 15:43:32 PST 2022


Simon Fraser (smfr) <simon.fraser at apple.com> has granted Wenson Hsieh
<wenson_hsieh at apple.com>'s request for review:
Bug 236584: focus({preventScroll: true}) does not prevent scrolling on iOS
https://bugs.webkit.org/show_bug.cgi?id=236584

Attachment 453420: For EWS

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




--- Comment #4 from Simon Fraser (smfr) <simon.fraser at apple.com> ---
Comment on attachment 453420
  --> https://bugs.webkit.org/attachment.cgi?id=453420
For EWS

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

> Source/WebKit/UIProcess/WebPageProxy.h:1651
> +    enum class PreventScroll : bool { No, Yes };
> +    void startWaitingForEditorStateAfterFocusingElement(PreventScroll
preventScroll) { m_preventScrollAfterWaitingForEditorStateAfterFocusingElement
= preventScroll; }
> +    void stopWaitingForEditorStateAfterFocusingElement() {
m_preventScrollAfterWaitingForEditorStateAfterFocusingElement = std::nullopt; }
> +    bool waitingForEditorStateAfterFocusingElement() const { return
m_preventScrollAfterWaitingForEditorStateAfterFocusingElement.has_value(); }
> +    bool preventScrollAfterWaitingForEditorStateAfterFocusingElement() const
{ return m_preventScrollAfterWaitingForEditorStateAfterFocusingElement ==
PreventScroll::Yes; }

I wish this wasn't so convoluted. Ideally the UI-side "scroll into view" logic
would be closer to the web content "scroll into view" logic.

Would it be any cleaner to put the "preventScroll" bit into
FocusedElementInformation? That was my original plan.


More information about the webkit-reviews mailing list