[Webkit-unassigned] [Bug 200398] Add an SPI to suppress all WKWebView interactions except scrolling or zooming

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 2 21:53:52 PDT 2019


--- Comment #5 from Geoffrey Garen <ggaren at apple.com> ---
A similar API that suppressed loading proved super easy to use wrong, and we ended up with many cases when someone called _suppress... but did not balance it with a call to _restore...., and then everything mysteriously stopped working.

Is there something you can do to make this API harder to use wrong?

Some suggestions to consider:

(1) Add release logging that tracks this state, so we can diagnose bugs in the field;

(2) Instead of accepting a BOOL argument, return a token object, which offers a -cancel method, and which also calls -cancel automatically in its -dealloc method;

(3) Throw an exception if someone invokes this API while a token is still outstanding;

(4) Add a watchdog timer that will unconditionally cancel a token after a certain amount of time;

(5) Don't use a special mode on the content view at all, and instead install another view on top, whose job is to intercept events and only forward scroll and zoom events.

Also, we usually require automated API tests for new APIs like this.

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/20190803/d2874d61/attachment-0001.html>

More information about the webkit-unassigned mailing list