- Revision
- 140849
- Author
- commit-qu...@webkit.org
- Date
- 2013-01-25 11:00:37 -0800 (Fri, 25 Jan 2013)
Log Message
[BlackBerry] Pop-up WebViews should not take ownership of the backing store.
https://bugs.webkit.org/show_bug.cgi?id=107957
Patch by Andrew Lo <a...@rim.com> on 2013-01-25
Reviewed by Rob Buis.
Internally reviewed by Jakob Petsovits.
Internal PR 274581.
Add web setting for whether a WebPage should take the backing store.
Prevent pop-up WebView from taking ownership of the backing
store when it becomes visible.
* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPage::setVisible):
* Api/WebSettings.cpp:
(WebKit):
(BlackBerry::WebKit::WebSettings::standardSettings):
(BlackBerry::WebKit::WebSettings::isBackingStoreEnabled):
(BlackBerry::WebKit::WebSettings::setBackingStoreEnabled):
* Api/WebSettings.h:
* WebCoreSupport/PagePopupBlackBerry.cpp:
(WebCore::PagePopupBlackBerry::PagePopupBlackBerry):
(WebCore::PagePopupBlackBerry::init):
Modified Paths
Diff
Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (140848 => 140849)
--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp 2013-01-25 18:45:23 UTC (rev 140848)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp 2013-01-25 19:00:37 UTC (rev 140849)
@@ -3260,6 +3260,16 @@
d->resumeRootLayerCommit();
#endif
+ // We want to become visible but not get backing store ownership.
+ if (d->m_backingStore->d->isOpenGLCompositing() && !d->m_webSettings->isBackingStoreEnabled()) {
+ d->setCompositorDrawsRootLayer(true);
+#if USE(ACCELERATED_COMPOSITING)
+ d->setNeedsOneShotDrawingSynchronization();
+#endif
+ d->setShouldResetTilesWhenShown(true);
+ return;
+ }
+
// Push this WebPage to the top of the visible pages list.
if (!visibleWebPages()->isEmpty() && visibleWebPages()->last() != this) {
size_t foundIndex = visibleWebPages()->find(this);
Modified: trunk/Source/WebKit/blackberry/Api/WebSettings.cpp (140848 => 140849)
--- trunk/Source/WebKit/blackberry/Api/WebSettings.cpp 2013-01-25 18:45:23 UTC (rev 140848)
+++ trunk/Source/WebKit/blackberry/Api/WebSettings.cpp 2013-01-25 19:00:37 UTC (rev 140849)
@@ -61,7 +61,8 @@
DEFINE_STATIC_LOCAL(String, BlackBerryFullScreenVideoCapable, (ASCIILiteral("BlackBerryFullScreenVideoCapable")));
DEFINE_STATIC_LOCAL(String, BlackBerryCredentialAutofillEnabled, (ASCIILiteral("BlackBerryCredentialAutofillEnabled")));
DEFINE_STATIC_LOCAL(String, BlackBerryFormAutofillEnabled, (ASCIILiteral("BlackBerryFormAutofillEnabled")));
-DEFINE_STATIC_LOCAL(String, BlackBerryDevicePixelRatio, (ASCCIILiteral("BlackBerryDevicePixelRatio")));
+DEFINE_STATIC_LOCAL(String, BlackBerryDevicePixelRatio, (ASCIILiteral("BlackBerryDevicePixelRatio")));
+DEFINE_STATIC_LOCAL(String, BlackBerryBackingStoreEnabled, (ASCIILiteral("BlackBerryBackingStoreEnabled")));
DEFINE_STATIC_LOCAL(String, SpatialNavigationEnabled, (ASCIILiteral("SpatialNavigationEnabled")));
DEFINE_STATIC_LOCAL(String, WebKitDatabasePath, (ASCIILiteral("WebKitDatabasePath")));
DEFINE_STATIC_LOCAL(String, WebKitDatabasesEnabled, (ASCIILiteral("WebKitDatabasesEnabled")));
@@ -161,6 +162,7 @@
settings->m_private->setBoolean(BlackBerryAllowCrossSiteRequests, false);
settings->m_private->setUnsigned(BlackBerryBackgroundColor, WebCore::Color::white);
settings->m_private->setBoolean(BlackBerryCookiesEnabled, true);
+ settings->m_private->setBoolean(BlackBerryBackingStoreEnabled, true);
settings->m_private->setDouble(BlackBerryInitialScale, -1);
settings->m_private->setUnsigned(BlackBerryMaxPluginInstances, 1);
settings->m_private->setUnsigned(BlackBerryOverScrollColor, WebCore::Color::white);
@@ -750,6 +752,16 @@
m_private->setBoolean(BlackBerryDirectRenderingToWindowEnabled, enable);
}
+bool WebSettings::isBackingStoreEnabled() const
+{
+ return m_private->getBoolean(BlackBerryBackingStoreEnabled);
+}
+
+void WebSettings::setBackingStoreEnabled(bool enable)
+{
+ m_private->setBoolean(BlackBerryBackingStoreEnabled, enable);
+}
+
unsigned WebSettings::maxPluginInstances() const
{
return m_private->getUnsigned(BlackBerryMaxPluginInstances);
Modified: trunk/Source/WebKit/blackberry/Api/WebSettings.h (140848 => 140849)
--- trunk/Source/WebKit/blackberry/Api/WebSettings.h 2013-01-25 18:45:23 UTC (rev 140848)
+++ trunk/Source/WebKit/blackberry/Api/WebSettings.h 2013-01-25 19:00:37 UTC (rev 140849)
@@ -241,6 +241,9 @@
double devicePixelRatio() const;
void setDevicePixelRatio(double);
+ bool isBackingStoreEnabled() const;
+ void setBackingStoreEnabled(bool);
+
private:
WebSettingsPrivate* m_private;
WebSettings();
Modified: trunk/Source/WebKit/blackberry/ChangeLog (140848 => 140849)
--- trunk/Source/WebKit/blackberry/ChangeLog 2013-01-25 18:45:23 UTC (rev 140848)
+++ trunk/Source/WebKit/blackberry/ChangeLog 2013-01-25 19:00:37 UTC (rev 140849)
@@ -1,3 +1,28 @@
+2013-01-25 Andrew Lo <a...@rim.com>
+
+ [BlackBerry] Pop-up WebViews should not take ownership of the backing store.
+ https://bugs.webkit.org/show_bug.cgi?id=107957
+
+ Reviewed by Rob Buis.
+ Internally reviewed by Jakob Petsovits.
+
+ Internal PR 274581.
+ Add web setting for whether a WebPage should take the backing store.
+ Prevent pop-up WebView from taking ownership of the backing
+ store when it becomes visible.
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPage::setVisible):
+ * Api/WebSettings.cpp:
+ (WebKit):
+ (BlackBerry::WebKit::WebSettings::standardSettings):
+ (BlackBerry::WebKit::WebSettings::isBackingStoreEnabled):
+ (BlackBerry::WebKit::WebSettings::setBackingStoreEnabled):
+ * Api/WebSettings.h:
+ * WebCoreSupport/PagePopupBlackBerry.cpp:
+ (WebCore::PagePopupBlackBerry::PagePopupBlackBerry):
+ (WebCore::PagePopupBlackBerry::init):
+
2013-01-25 Arvid Nilsson <anils...@rim.com>
[BlackBerry] AC layers appear in the wrong place on RTL page
Modified: trunk/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.cpp (140848 => 140849)
--- trunk/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.cpp 2013-01-25 18:45:23 UTC (rev 140848)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.cpp 2013-01-25 19:00:37 UTC (rev 140849)
@@ -39,8 +39,6 @@
#include <_javascript_Core/JSStringRef.h>
#include <_javascript_Core/JSValueRef.h>
-// Fixme: should get the height from runtime.
-#define URL_BAR_HEIGHT 70
#define PADDING 80
using namespace BlackBerry::Platform::Graphics;
@@ -52,7 +50,7 @@
, m_client(adoptPtr(client))
, m_sharedClientPointer(adoptRef(new PagePopupBlackBerry::SharedClientPointer(client)))
{
- m_rect = IntRect(rect.x(), rect.y() - URL_BAR_HEIGHT, client->contentSize().width(), client->contentSize().height());
+ m_rect = IntRect(rect.x(), rect.y(), client->contentSize().width(), client->contentSize().height());
}
PagePopupBlackBerry::~PagePopupBlackBerry()
@@ -67,12 +65,17 @@
bool PagePopupBlackBerry::init(WebPage* webpage)
{
+ // Don't use backing store for the pop-up web page.
+ webpage->settings()->setBackingStoreEnabled(false);
+
webpage->d->setLoadState(WebPagePrivate::Committed);
generateHTML(webpage);
installDOMFunction(webpage->d->mainFrame());
webpage->d->setLoadState(WebPagePrivate::Finished);
+ webpage->client()->notifyLoadFinished(0);
+
return true;
}