summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Scott <phanna@android.com>2011-01-18 16:24:08 -0500
committerPatrick Scott <phanna@android.com>2011-01-18 16:24:08 -0500
commit211634993282bd9d5c18b26d70e7909aa4a3cfdc (patch)
tree1240ddd560d467b7979a74c713538f43316dd1e0
parentf42f297f9d1e499b6b54e6c73ddb46dbb4745ede (diff)
downloadexternal_webkit-211634993282bd9d5c18b26d70e7909aa4a3cfdc.zip
external_webkit-211634993282bd9d5c18b26d70e7909aa4a3cfdc.tar.gz
external_webkit-211634993282bd9d5c18b26d70e7909aa4a3cfdc.tar.bz2
Layout before creating the base layer.
WebKit asserts during draw that the frame does not need a layout. Do the layout to also get the most updated data. Move the bridge assert after the parent check as some frames are never attached and no history item is created. Change-Id: If646d6ed2b409a3078d2f7a6793b7aed94ffecaf
-rw-r--r--WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp8
-rw-r--r--WebKit/android/jni/WebViewCore.cpp8
2 files changed, 10 insertions, 6 deletions
diff --git a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
index d165afa..52fa4ee 100644
--- a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
+++ b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
@@ -807,12 +807,12 @@ void FrameLoaderClientAndroid::frameLoadCompleted() {
void FrameLoaderClientAndroid::saveViewStateToItem(HistoryItem* item) {
ASSERT(m_frame);
ASSERT(item);
- // We should have added a bridge when the child item was added to its
- // parent.
- AndroidWebHistoryBridge* bridge = item->bridge();
- ASSERT(bridge);
// store the current scale (only) for the top frame
if (!m_frame->tree()->parent()) {
+ // We should have added a bridge when the child item was added to its
+ // parent.
+ AndroidWebHistoryBridge* bridge = item->bridge();
+ ASSERT(bridge);
WebViewCore* webViewCore = WebViewCore::getWebViewCore(m_frame->view());
bridge->setScale(webViewCore->scale());
bridge->setTextWrapScale(webViewCore->textWrapScale());
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp
index 80de32f..914bcfb 100644
--- a/WebKit/android/jni/WebViewCore.cpp
+++ b/WebKit/android/jni/WebViewCore.cpp
@@ -863,6 +863,10 @@ BaseLayerAndroid* WebViewCore::createBaseLayer()
BaseLayerAndroid* base = new BaseLayerAndroid();
base->setContent(m_content);
+ bool layoutSucceeded = layoutIfNeededRecursive(m_mainFrame);
+ // Layout only fails if called during a layout.
+ LOG_ASSERT(layoutSucceeded, "Can never be called recursively");
+
#if USE(ACCELERATED_COMPOSITING)
// We set the background color
if (m_mainFrame && m_mainFrame->document()
@@ -915,8 +919,8 @@ BaseLayerAndroid* WebViewCore::recordContent(SkRegion* region, SkIPoint* point)
void WebViewCore::splitContent(PictureSet* content)
{
- bool layoutSuceeded = layoutIfNeededRecursive(m_mainFrame);
- LOG_ASSERT(layoutSuceeded, "Can never be called recursively");
+ bool layoutSucceeded = layoutIfNeededRecursive(m_mainFrame);
+ LOG_ASSERT(layoutSucceeded, "Can never be called recursively");
content->split(&m_content);
rebuildPictureSet(&m_content);
content->set(m_content);