From 34bca311c8205ee40379adac2ef4da01e401600e Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Mon, 7 Dec 2009 10:36:50 -0500 Subject: [PATCH] fix crash reading readonly node state Something about rebuildTextView() invalidates the current cached frame -- reading the last obtained frame after calling it may crash. Why, I don't know. Until I figure that out, read the cached state first. Also remove some tests for null frame and node since the null case has already been handled earlierin motionUp(). fixes http://b/2307964 --- WebKit/android/nav/WebView.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp index d59fdeb52..af9227daf 100644 --- a/WebKit/android/nav/WebView.cpp +++ b/WebKit/android/nav/WebView.cpp @@ -941,15 +941,15 @@ bool motionUp(int x, int y, int slop) bool syntheticLink = result->isSyntheticLink(); if (!syntheticLink) { sendMotionUp( - frame ? (WebCore::Frame*) frame->framePointer() : 0, - result ? (WebCore::Node*) result->nodePointer() : 0, rx, ry); + (WebCore::Frame*) frame->framePointer(), + (WebCore::Node*) result->nodePointer(), rx, ry); } viewInvalidate(); if (result->isTextInput()) { + bool isReadOnly = frame->textInput(result)->isReadOnly(); rebuildWebTextView(true); - if (!frame->textInput(result)->isReadOnly()) { + if (!isReadOnly) displaySoftKeyboard(true); - } } else { clearTextEntry(); setFollowedLink(true); -- 2.11.0