[webkit-dev] Changes to window.focus/window.blur controlled by a setting?

Andrew Wilson atwilson at google.com
Mon May 21 12:52:10 PDT 2012

On Mon, May 21, 2012 at 12:32 PM, Andy Estes <aestes at apple.com> wrote:

> On May 21, 2012, at 12:25 PM, Andrew Wilson <atwilson at google.com> wrote:
> No, because the setTimeout() callback would be executed outside the
> context of a user gesture.
> This isn't always true. User gesture state is forwarded to the timeout's
> callback if the timeout was scheduled in the context of a user gesture and
> the interval is one second or less.

Yes, I just saw this. So it's not as simple as just keeping a flag around,
because someone may have already created a timer that propagated the user
gesture context to the timer callback.

BTW, currently it looks like it's left up to the individual port to
determine whether a window is allowed to call focus/blur() outside the
context of a user gesture (there's no restriction built in to

If we're going to be changing this logic, should we also explicitly put a
check for processingUserGesture() in focus()/blur()? Or do any ports *want*
to allow this behavior to be controlled by the port? As it stands, if a
port doesn't explicitly check for processingUserGesture() in its
focusDocumentView() handler, then any window can focus itself at any time.

> -Andy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20120521/1ea35348/attachment-0001.html>

More information about the webkit-dev mailing list