summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/android/jni
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit/android/jni')
-rw-r--r--Source/WebKit/android/jni/JavaSharedClient.cpp4
-rw-r--r--Source/WebKit/android/jni/PictureSet.cpp21
-rw-r--r--Source/WebKit/android/jni/WebViewCore.cpp17
3 files changed, 19 insertions, 23 deletions
diff --git a/Source/WebKit/android/jni/JavaSharedClient.cpp b/Source/WebKit/android/jni/JavaSharedClient.cpp
index e884c99..4f40355 100644
--- a/Source/WebKit/android/jni/JavaSharedClient.cpp
+++ b/Source/WebKit/android/jni/JavaSharedClient.cpp
@@ -117,7 +117,7 @@ namespace android {
void (*proc)(void*) = 0;
void* payload = 0;
const FuncPtrRec* rec;
-
+
// we have to copy the proc/payload (if present). we do this so we
// don't call the proc inside the mutex (possible deadlock!)
gFuncPtrQMutex.acquire();
@@ -128,7 +128,7 @@ namespace android {
gFuncPtrQ.pop_front();
}
gFuncPtrQMutex.release();
-
+
if (!rec)
break;
proc(payload);
diff --git a/Source/WebKit/android/jni/PictureSet.cpp b/Source/WebKit/android/jni/PictureSet.cpp
index e6a9ed5..f61e0f1 100644
--- a/Source/WebKit/android/jni/PictureSet.cpp
+++ b/Source/WebKit/android/jni/PictureSet.cpp
@@ -356,23 +356,10 @@ void PictureSet::splitAdd(const SkIRect& rect)
SkIRect newRect;
int deltaX = i * maxSize;
int deltaY = j * maxSize;
- int left, top, right, bottom;
- if (i == firstTileX)
- left = rect.fLeft;
- else
- left = 0;
- if (j == firstTileY)
- top = rect.fTop;
- else
- top = 0;
- if (i == lastTileX)
- right = rect.fRight % maxSize;
- else
- right = maxSize;
- if (j == lastTileY)
- bottom = rect.fBottom % maxSize;
- else
- bottom = maxSize;
+ int left = (i == firstTileX) ? rect.fLeft - deltaX : 0;
+ int top = (j == firstTileY) ? rect.fTop - deltaY : 0;
+ int right = (i == lastTileX) ? rect.fRight % maxSize : maxSize;
+ int bottom = (j == lastTileY) ? rect.fBottom % maxSize : maxSize;
newRect.set(left, top, right, bottom);
addToBucket(bucket, deltaX, deltaY, newRect);
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp
index 9b5a6fa..24266f6 100644
--- a/Source/WebKit/android/jni/WebViewCore.cpp
+++ b/Source/WebKit/android/jni/WebViewCore.cpp
@@ -1729,7 +1729,7 @@ Vector<IntRect> WebViewCore::getTouchHighlightRects(int x, int y, int slop)
Node* eventNode = it->get();
while (eventNode) {
RenderObject* render = eventNode->renderer();
- if (render->isBody() || render->isRenderView())
+ if (render && (render->isBody() || render->isRenderView()))
break;
if (eventNode->supportsFocus()
|| eventNode->hasEventListeners(eventNames().clickEvent)
@@ -1755,7 +1755,7 @@ Vector<IntRect> WebViewCore::getTouchHighlightRects(int x, int y, int slop)
// If the fat point touches everyone, the order in the list should be "b", "d", "c"
// and "a". When we search for the event node for "b", we really don't want "a" as
// in the z-order it is behind everything else.
- if (!render->style()->hasAutoZIndex())
+ if (render && !render->style()->hasAutoZIndex())
break;
eventNode = eventNode->parentNode();
}
@@ -2189,6 +2189,11 @@ void WebViewCore::setSelection(int start, int end)
String WebViewCore::modifySelection(const int direction, const int axis)
{
DOMSelection* selection = m_mainFrame->domWindow()->getSelection();
+ ASSERT(selection);
+ // We've seen crashes where selection is null, but we don't know why
+ // See http://b/5244036
+ if (!selection)
+ return String();
if (selection->rangeCount() > 1)
selection->removeAllRanges();
switch (axis) {
@@ -2219,12 +2224,16 @@ void WebViewCore::scrollNodeIntoView(Frame* frame, Node* node)
if (!node->isElementNode()) {
HTMLElement* body = frame->document()->body();
do {
- if (!node || node == body)
+ if (node == body)
return;
node = node->parentNode();
- } while (!node->isElementNode() && !isVisible(node));
+ } while (node && !node->isElementNode() && !isVisible(node));
}
+ // Couldn't find a visible predecessor.
+ if (!node)
+ return;
+
elementNode = static_cast<Element*>(node);
elementNode->scrollIntoViewIfNeeded(true);
}