summaryrefslogtreecommitdiffstats
path: root/WebKit/android
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2010-03-15 15:41:48 +0000
committerKristian Monsen <kristianm@google.com>2010-03-17 11:21:19 +0000
commitbf8327f47de10e9f3d583f226176772f8662b830 (patch)
tree720b434aa400c13441b260fb7706bc7558aa2dc8 /WebKit/android
parentb0c2f7b33106420933e04a3b0a69ca4d1d1b3fd8 (diff)
downloadexternal_webkit-bf8327f47de10e9f3d583f226176772f8662b830.zip
external_webkit-bf8327f47de10e9f3d583f226176772f8662b830.tar.gz
external_webkit-bf8327f47de10e9f3d583f226176772f8662b830.tar.bz2
Fix for Bug 2486292, transparent backgrounds not transparent in Froyo.
Recreating the transparent and color of old window when creating a new one, and setting transparent if all the colors are 0. Updated patch to fix comments from Grace. Change-Id: I934401630fd7041e7e4ae1cbeeaa198271025c87
Diffstat (limited to 'WebKit/android')
-rw-r--r--WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp11
-rw-r--r--WebKit/android/jni/WebFrameView.h4
-rw-r--r--WebKit/android/jni/WebViewCore.cpp4
3 files changed, 14 insertions, 5 deletions
diff --git a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
index 60598f8..10cd0b3 100644
--- a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
+++ b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
@@ -891,11 +891,12 @@ void FrameLoaderClientAndroid::transitionToCommittedForNewPage() {
Retain(webViewCore);
// Save the old WebFrameView's bounds and apply them to the new WebFrameView
- WebFrameView* oldFrameView = static_cast<WebFrameView*> (m_frame->view()->platformWidget());
- IntRect bounds = oldFrameView->getBounds();
- IntRect windowBounds = oldFrameView->getWindowBounds();
- // we only support opaque, white background for now
- m_frame->createView(bounds.size(), Color::white, false, IntSize(), false);
+ WebFrameView* oldWebFrameView = static_cast<WebFrameView*> (m_frame->view()->platformWidget());
+ IntRect bounds = oldWebFrameView->getBounds();
+ IntRect windowBounds = oldWebFrameView->getWindowBounds();
+ WebCore::FrameView* oldFrameView = oldWebFrameView->view();
+ m_frame->createView(bounds.size(), oldFrameView->baseBackgroundColor(), oldFrameView->isTransparent(), IntSize(), false);
+
// Create a new WebFrameView for the new FrameView
WebFrameView* newFrameView = new WebFrameView(m_frame->view(), webViewCore);
newFrameView->setLocation(bounds.x(), bounds.y());
diff --git a/WebKit/android/jni/WebFrameView.h b/WebKit/android/jni/WebFrameView.h
index d83def1..823f2b4 100644
--- a/WebKit/android/jni/WebFrameView.h
+++ b/WebKit/android/jni/WebFrameView.h
@@ -49,6 +49,10 @@ namespace android {
void setView(WebCore::FrameView* frameView);
+ WebCore::FrameView* view() const {
+ return mFrameView;
+ }
+
virtual bool forFrameView() const { return true; }
private:
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp
index 6e0ef43..8556dd8 100644
--- a/WebKit/android/jni/WebViewCore.cpp
+++ b/WebKit/android/jni/WebViewCore.cpp
@@ -2365,6 +2365,10 @@ void WebViewCore::setBackgroundColor(SkColor c)
WebCore::Color bcolor((int)SkColorGetR(c), (int)SkColorGetG(c),
(int)SkColorGetB(c), (int)SkColorGetA(c));
view->setBaseBackgroundColor(bcolor);
+
+ // Background color of 0 indicates we want a transparent background
+ if (c == 0)
+ view->setTransparent(true);
}
jclass WebViewCore::getPluginClass(const WebCore::String& libName, const char* className)