[Webkit-unassigned] [Bug 109422] [Qt] Add Page Visibility API support

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 15 12:27:50 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=109422





--- Comment #43 from Arunprasad <ararunprasad at gmail.com>  2013-03-15 12:30:16 PST ---
View in context: https://bugs.webkit.org/attachment.cgi?id=193154&action=review

https://developer.mozilla.org/en-US/docs/DOM/Using_the_Page_Visibility_API says,

"Developers have historically used imperfect proxies to detect this. For example, registering an onblur/onfocus handler on the window helps you know when your page is not the active page, but it does not tell you that your page is hidden to the user. The Page Visibility API addresses this. (When compared with registering onblur/onfocus handlers on the window, __a key difference is that a page does not become hidden when another window is made active and the browser window loses focus.  A page only becomes hidden when the user switches to a different tab or minimizes the browser window__.)"

> Source/WebKit/qt/WidgetApi/qwebview.cpp:712
> +    if ((e->type() == QEvent::Show) || (e->type() == QEvent::WindowActivate))
> +        d->page->d->setVisibilityState(true);
> +    else if ((e->type() == QEvent::Hide) || (e->type() == QEvent::WindowDeactivate))
> +        d->page->d->setVisibilityState(false);

WindowActive/WindowDeactivate will be called when the window lost/gains focus. But the main aim of the page __visibilitychange__ is to notify when the window becomes really hidden from user(either tab switching or minimizing). But if we do it implicitly in WindowActivate/WindowDeactivate events then there will be no difference between onfocus/onblur(DOM window events).

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list