Commit b344dd9c authored by Ria Jiang's avatar Ria Jiang Committed by Commit Bot

Return empty hit-test result when the local main frame is not valid.

When we do async hit-testing for OOPIF, we can be trying to do
hit-testing when the local main frame is not valid anymore. Add null
check for that and return empty hit-test result in that case; it would
then be handled in RenderWidgetInputHandler::GetFrameSinkIdAtPoint [1].

[1] https://cs.chromium.org/chromium/src/content/renderer/input/render_widget_input_handler.cc?type=cs&g=0&l=194

Bug: 842458
Change-Id: Ic6a90de54840973a8262ea88472ae9d295c6f773
Reviewed-on: https://chromium-review.googlesource.com/1058343Reviewed-by: default avatarRick Byers <rbyers@chromium.org>
Reviewed-by: default avatarKen Buchanan <kenrb@chromium.org>
Commit-Queue: Ria Jiang <riajiang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558794}
parent 94702bc9
......@@ -3117,6 +3117,12 @@ WebHitTestResult WebViewImpl::HitTestResultAt(const WebPoint& point) {
HitTestResult WebViewImpl::CoreHitTestResultAt(
const WebPoint& point_in_viewport) {
// TODO(crbug.com/843128): When we do async hit-testing, we might try to do
// hit-testing when the local main frame is not valid anymore. Look into if we
// can avoid getting here earlier in the pipeline.
if (!MainFrameImpl() || !MainFrameImpl()->GetFrameView())
return HitTestResult();
DocumentLifecycle::AllowThrottlingScope throttling_scope(
MainFrameImpl()->GetFrame()->GetDocument()->Lifecycle());
LocalFrameView* view = MainFrameImpl()->GetFrameView();
......
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