Commit 8afb6434 authored by yoichio's avatar yoichio Committed by Commit bot

Null check in SelectionController::handleGestureLongPress.

In following CL, I accidentally skipped null check for |innerNode|:
https://chromium.googlesource.com/chromium/src/+/66f8f14f5560949660ad6efc0b00484d8342a
15e%5E%21/#F4

This has caused null-ref error.

BUG=633073

Review-Url: https://codereview.chromium.org/2390613002
Cr-Commit-Position: refs/heads/master@{#422713}
parent fc431404
<!doctype HTML>
<html hidden id="html">
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script>
test(function () {
assert_not_equals(window.eventSender, undefined, 'This test requires eventSender.');
var x = html.offsetLeft + 10;
var y = html.offsetTop + 40;
eventSender.gestureLongPress(x, y);
html.hidden = "";
});
</script>
</html>
\ No newline at end of file
...@@ -706,9 +706,11 @@ bool SelectionController::handleGestureLongPress( ...@@ -706,9 +706,11 @@ bool SelectionController::handleGestureLongPress(
return false; return false;
Node* innerNode = hitTestResult.innerNode(); Node* innerNode = hitTestResult.innerNode();
if (!innerNode)
return false;
innerNode->document().updateStyleAndLayoutTree(); innerNode->document().updateStyleAndLayoutTree();
bool innerNodeIsSelectable = innerNode && (hasEditableStyle(*innerNode) || bool innerNodeIsSelectable =
innerNode->canStartSelection()); hasEditableStyle(*innerNode) || innerNode->canStartSelection();
if (!innerNodeIsSelectable) if (!innerNodeIsSelectable)
return false; return false;
......
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