From c8238eccbdd8de109a5d7c28b514ee36033ed4ba Mon Sep 17 00:00:00 2001 From: Patrick Scott Date: Wed, 30 Sep 2009 08:32:50 -0400 Subject: Fix the user gesture change to be more like donut. Bug: 2151004 --- WebCore/loader/FrameLoader.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'WebCore') diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp index 5c81cfc..8e8540d 100644 --- a/WebCore/loader/FrameLoader.cpp +++ b/WebCore/loader/FrameLoader.cpp @@ -519,6 +519,9 @@ void FrameLoader::submitForm(const char* action, const String& url, PassRefPtrdocument()->baseTarget() : target; Frame* targetFrame = findFrameForNavigation(targetOrBaseTarget); @@ -1538,7 +1541,7 @@ void FrameLoader::loadURLIntoChildFrame(const KURL& url, const String& referer, else #endif #ifdef ANDROID_USER_GESTURE - childFrame->loader()->loadURL(workingURL, referer, String(), false, childLoadType, 0, 0, true); + childFrame->loader()->loadURL(workingURL, referer, String(), false, childLoadType, 0, 0, false); #else childFrame->loader()->loadURL(workingURL, referer, String(), false, childLoadType, 0, 0); #endif -- cgit v1.1 From 99fa56b298722aebfd2f987e8a88b5b25d7386fe Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Wed, 30 Sep 2009 14:05:03 -0400 Subject: always update the WebTextView from the input element Even if the input element doesn't have focus, synchronize the WebTextView if the pointers match. fixes http://b/issue?id=2096746 --- WebCore/html/HTMLInputElement.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'WebCore') diff --git a/WebCore/html/HTMLInputElement.cpp b/WebCore/html/HTMLInputElement.cpp index 88e14fd..59e4e2f 100644 --- a/WebCore/html/HTMLInputElement.cpp +++ b/WebCore/html/HTMLInputElement.cpp @@ -1113,16 +1113,12 @@ void HTMLInputElement::setValue(const String& value) if (isTextField()) { unsigned max = m_data.value().length(); - if (document()->focusedNode() == this) #ifdef ANDROID_ACCEPT_CHANGES_TO_FOCUSED_TEXTFIELDS - { - // Make sure our UI side textfield changes to match the RenderTextControl - android::WebViewCore::getWebViewCore(document()->view())->updateTextfield(this, false, value); + // Make sure our UI side textfield changes to match the RenderTextControl + android::WebViewCore::getWebViewCore(document()->view())->updateTextfield(this, false, value); #endif + if (document()->focusedNode() == this) InputElement::updateSelectionRange(this, this, max, max); -#ifdef ANDROID_ACCEPT_CHANGES_TO_FOCUSED_TEXTFIELDS - } -#endif else cacheSelection(max, max); } -- cgit v1.1 From 30027e43592c7246954056a89ce410c01d4dd86f Mon Sep 17 00:00:00 2001 From: Patrick Scott Date: Tue, 29 Sep 2009 14:11:16 -0400 Subject: Fix the random crash around iframes. The problem is that if updateWidgetPosition calls layout, the FrameView will layout with 0x0 dimensions. Then, we resize the view and try to relayout. This causes the body to be marked as needing a layout. But, the body does not get a chance to relayout. If updateWidgetPosition does not layout, the view size will match and the body will not be marked for layout. This makes everything sane after layout of the iframe. The root of the problem is that we are calling FrameView::layout() while in the midst of a layout. This is causing a child RenderObject to need a layout without the parent object needing a layout. We avoid this by not laying out until we set the FrameView dimensions. Bug: 2048855, 2134215 --- WebCore/rendering/RenderPartObject.cpp | 26 ++++++++++++++++++++++---- WebCore/rendering/RenderWidget.cpp | 2 ++ 2 files changed, 24 insertions(+), 4 deletions(-) (limited to 'WebCore') diff --git a/WebCore/rendering/RenderPartObject.cpp b/WebCore/rendering/RenderPartObject.cpp index 5f6d903..72298c6 100644 --- a/WebCore/rendering/RenderPartObject.cpp +++ b/WebCore/rendering/RenderPartObject.cpp @@ -386,11 +386,13 @@ void RenderPartObject::layout() h = 0; if (w != view->width() || h != view->height()) { view->resize(w, h); - root->setNeedsLayout(true, false); } + // Layout the view. - if (view->needsLayout()) + do { view->layout(); + } while (view->layoutPending() || root->needsLayout()); + int contentHeight = view->contentsHeight(); int contentWidth = view->contentsWidth(); // Only change the width or height if scrollbars are visible or @@ -403,6 +405,20 @@ void RenderPartObject::layout() // Update one last time updateWidgetPosition(); + +#if !ASSERT_DISABLED + ASSERT(!view->layoutPending()); + ASSERT(!root->needsLayout()); + // Sanity check when assertions are enabled. + RenderObject* c = root->nextInPreOrder(); + while (c) { + ASSERT(!c->needsLayout()); + c = c->nextInPreOrder(); + } + Node* body = document()->body(); + if (body) + ASSERT(!body->renderer()->needsLayout()); +#endif } } } @@ -446,8 +462,9 @@ void RenderPartObject::calcWidth() { updateWidgetPosition(); // Layout to get the content width - while (view->needsLayout()) + do { view->layout(); + } while (view->layoutPending() || root->needsLayout()); setWidth(max(width(), view->contentsWidth() + extraWidth)); @@ -471,8 +488,9 @@ void RenderPartObject::calcHeight() { updateWidgetPosition(); // Layout to get the content height - while (view->needsLayout()) + do { view->layout(); + } while (view->layoutPending() || root->needsLayout()); int extraHeight = paddingTop() + paddingBottom() + borderTop() + borderBottom(); setHeight(max(width(), view->contentsHeight() + extraHeight)); diff --git a/WebCore/rendering/RenderWidget.cpp b/WebCore/rendering/RenderWidget.cpp index 16526ca..36f4fed 100644 --- a/WebCore/rendering/RenderWidget.cpp +++ b/WebCore/rendering/RenderWidget.cpp @@ -255,6 +255,7 @@ void RenderWidget::updateWidgetPosition() deref(arena); } +#ifndef FLATTEN_IFRAME // if the frame bounds got changed, or if view needs layout (possibly indicating // content size is wrong) we have to do a layout to set the right widget size if (m_widget->isFrameView()) { @@ -262,6 +263,7 @@ void RenderWidget::updateWidgetPosition() if (boundsChanged || frameView->needsLayout()) frameView->layout(); } +#endif } void RenderWidget::setSelectionState(SelectionState state) -- cgit v1.1 From 2b3d345465fdf225609499ffc5b1732157cafa22 Mon Sep 17 00:00:00 2001 From: Andrei Popescu Date: Mon, 28 Sep 2009 16:20:09 +0100 Subject: Update