Commit 4807e647 authored by amaralp's avatar amaralp Committed by Commit bot

Adding null check of |layoutObject()| before calling |visiblePositionOfHitTestResult()|

BUG=667567

Review-Url: https://codereview.chromium.org/2537243002
Cr-Commit-Position: refs/heads/master@{#439073}
parent 1a6bd503
......@@ -652,9 +652,6 @@ void SelectionController::setNonDirectionalSelectionIfNeeded(
void SelectionController::setCaretAtHitTestResult(
const HitTestResult& hitTestResult) {
Node* innerNode = hitTestResult.innerNode();
if (!innerNode)
return;
const VisiblePositionInFlatTree& visibleHitPos =
visiblePositionOfHitTestResult(hitTestResult);
const VisiblePositionInFlatTree& visiblePos =
......@@ -892,8 +889,6 @@ bool SelectionController::handleGestureLongPress(
return false;
Node* innerNode = hitTestResult.innerNode();
if (!innerNode)
return false;
innerNode->document().updateStyleAndLayoutTree();
bool innerNodeIsSelectable = hasEditableStyle(*innerNode) ||
innerNode->isTextNode() ||
......
......@@ -318,7 +318,9 @@ WebInputEventResult GestureManager::handleGestureLongPress(
return WebInputEventResult::HandledSystem;
}
if (m_selectionController->handleGestureLongPress(gestureEvent,
Node* innerNode = hitTestResult.innerNode();
if (innerNode && innerNode->layoutObject() &&
m_selectionController->handleGestureLongPress(gestureEvent,
hitTestResult)) {
m_mouseEventManager->focusDocumentView();
return WebInputEventResult::HandledSystem;
......@@ -332,6 +334,8 @@ WebInputEventResult GestureManager::handleGestureLongTap(
#if !OS(ANDROID)
if (m_longTapShouldInvokeContextMenu) {
m_longTapShouldInvokeContextMenu = false;
Node* innerNode = targetedEvent.hitTestResult().innerNode();
if (innerNode && innerNode->layoutObject())
m_selectionController->handleGestureLongTap(targetedEvent);
return sendContextMenuEventForGesture(targetedEvent);
}
......@@ -341,6 +345,8 @@ WebInputEventResult GestureManager::handleGestureLongTap(
WebInputEventResult GestureManager::handleGestureTwoFingerTap(
const GestureEventWithHitTestResults& targetedEvent) {
Node* innerNode = targetedEvent.hitTestResult().innerNode();
if (innerNode && innerNode->layoutObject())
m_selectionController->handleGestureTwoFingerTap(targetedEvent);
return sendContextMenuEventForGesture(targetedEvent);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment