- Revision
- 110963
- Author
- commit-qu...@webkit.org
- Date
- 2012-03-16 01:19:28 -0700 (Fri, 16 Mar 2012)
Log Message
[BlackBerry] Enable PAGE_VISIBILITY_API
https://bugs.webkit.org/show_bug.cgi?id=81257
Source/WebKit/blackberry:
Set Page visibility state for BlackBerry port.
Patch by Andrew Lo <a...@rim.com> on 2012-03-16
Reviewed by Rob Buis.
* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::WebPagePrivate):
(WebKit):
(BlackBerry::WebKit::WebPagePrivate::setPageVisibilityState):
(BlackBerry::WebKit::WebPagePrivate::setVisible):
(BlackBerry::WebKit::WebPage::setVisible):
(BlackBerry::WebKit::WebPagePrivate::notifyAppActivationStateChange):
(BlackBerry::WebKit::WebPage::notifyAppActivationStateChange):
* Api/WebPage_p.h:
(WebPagePrivate):
Tools:
Enable Page Visibility API for BlackBerry.
Patch by Andrew Lo <a...@rim.com> on 2012-03-16
Reviewed by Rob Buis.
* Scripts/build-webkit:
Modified Paths
Diff
Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (110962 => 110963)
--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp 2012-03-16 08:12:44 UTC (rev 110962)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp 2012-03-16 08:19:28 UTC (rev 110963)
@@ -272,6 +272,7 @@
, m_currentContextNode(0)
, m_webSettings(0) // Initialized by init.
, m_visible(false)
+ , m_activationState(ActivationActive)
, m_shouldResetTilesWhenShown(false)
, m_userScalable(true)
, m_userPerformedManualZoom(false)
@@ -2894,12 +2895,31 @@
return d->m_visible;
}
+#if ENABLE(PAGE_VISIBILITY_API)
+void WebPagePrivate::setPageVisibilityState()
+{
+ static bool s_initialVisibilityState = true;
+
+ m_page->setVisibilityState(m_visible && m_activationState == ActivationActive ? PageVisibilityStateVisible : PageVisibilityStateHidden, s_initialVisibilityState);
+ s_initialVisibilityState = false;
+}
+#endif
+
+void WebPagePrivate::setVisible(bool visible)
+{
+ m_visible = visible;
+
+#if ENABLE(PAGE_VISIBILITY_API)
+ setPageVisibilityState();
+#endif
+}
+
void WebPage::setVisible(bool visible)
{
if (d->m_visible == visible)
return;
- d->m_visible = visible;
+ d->setVisible(visible);
if (!visible) {
d->suspendBackingStore();
@@ -4958,6 +4978,15 @@
(*it)->handleIdleEvent(enterIdle);
}
+void WebPagePrivate::notifyAppActivationStateChange(ActivationStateType activationState)
+{
+ m_activationState = activationState;
+
+#if ENABLE(PAGE_VISIBILITY_API)
+ setPageVisibilityState();
+#endif
+}
+
void WebPage::notifyAppActivationStateChange(ActivationStateType activationState)
{
#if ENABLE(VIDEO)
@@ -4980,6 +5009,8 @@
break;
}
}
+
+ d->notifyAppActivationStateChange(activationState);
}
void WebPage::notifySwipeEvent()
Modified: trunk/Source/WebKit/blackberry/Api/WebPage_p.h (110962 => 110963)
--- trunk/Source/WebKit/blackberry/Api/WebPage_p.h 2012-03-16 08:12:44 UTC (rev 110962)
+++ trunk/Source/WebKit/blackberry/Api/WebPage_p.h 2012-03-16 08:19:28 UTC (rev 110963)
@@ -400,6 +400,12 @@
static WebCore::IntSize defaultMaxLayoutSize();
+ void setVisible(bool);
+#if ENABLE(PAGE_VISIBILITY_API)
+ void setPageVisibilityState();
+#endif
+ void notifyAppActivationStateChange(ActivationStateType);
+
WebPage* m_webPage;
WebPageClient* m_client;
WebCore::Page* m_page;
@@ -412,6 +418,7 @@
#endif
bool m_visible;
+ ActivationStateType m_activationState;
bool m_shouldResetTilesWhenShown;
bool m_userScalable;
bool m_userPerformedManualZoom;
Modified: trunk/Source/WebKit/blackberry/ChangeLog (110962 => 110963)
--- trunk/Source/WebKit/blackberry/ChangeLog 2012-03-16 08:12:44 UTC (rev 110962)
+++ trunk/Source/WebKit/blackberry/ChangeLog 2012-03-16 08:19:28 UTC (rev 110963)
@@ -1,3 +1,23 @@
+2012-03-16 Andrew Lo <a...@rim.com>
+
+ [BlackBerry] Enable PAGE_VISIBILITY_API
+ https://bugs.webkit.org/show_bug.cgi?id=81257
+
+ Set Page visibility state for BlackBerry port.
+
+ Reviewed by Rob Buis.
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::WebPagePrivate):
+ (WebKit):
+ (BlackBerry::WebKit::WebPagePrivate::setPageVisibilityState):
+ (BlackBerry::WebKit::WebPagePrivate::setVisible):
+ (BlackBerry::WebKit::WebPage::setVisible):
+ (BlackBerry::WebKit::WebPagePrivate::notifyAppActivationStateChange):
+ (BlackBerry::WebKit::WebPage::notifyAppActivationStateChange):
+ * Api/WebPage_p.h:
+ (WebPagePrivate):
+
2012-03-14 Arvid Nilsson <anils...@rim.com>
[BlackBerry] Make sure WebPage and BackingStore don't crash without a Window
Modified: trunk/Tools/ChangeLog (110962 => 110963)
--- trunk/Tools/ChangeLog 2012-03-16 08:12:44 UTC (rev 110962)
+++ trunk/Tools/ChangeLog 2012-03-16 08:19:28 UTC (rev 110963)
@@ -1,3 +1,14 @@
+2012-03-16 Andrew Lo <a...@rim.com>
+
+ [BlackBerry] Enable PAGE_VISIBILITY_API
+ https://bugs.webkit.org/show_bug.cgi?id=81257
+
+ Enable Page Visibility API for BlackBerry.
+
+ Reviewed by Rob Buis.
+
+ * Scripts/build-webkit:
+
2012-03-16 Zan Dobersek <zandober...@gmail.com>
[Gtk] Add computedStyleIncludingVisitedInfo to DumpRenderTreeSupport
Modified: trunk/Tools/Scripts/build-webkit (110962 => 110963)
--- trunk/Tools/Scripts/build-webkit 2012-03-16 08:12:44 UTC (rev 110962)
+++ trunk/Tools/Scripts/build-webkit 2012-03-16 08:19:28 UTC (rev 110963)
@@ -293,7 +293,7 @@
define => "ENABLE_ORIENTATION_EVENTS", default => isBlackBerry(), value => \$orientationEventsSupport },
{ option => "page-visibility-api", desc => "Page Visibility API support",
- define => "ENABLE_PAGE_VISIBILITY_API", default => isEfl(), value => \$pageVisibilityApiSupport },
+ define => "ENABLE_PAGE_VISIBILITY_API", default => (isBlackBerry() || isEfl()), value => \$pageVisibilityApiSupport },
{ option => "progress-tag", desc => "Progress Tag support",
define => "ENABLE_PROGRESS_TAG", default => 1, value => \$progressTagSupport },