Commit 2f015a26 authored by Tommy Steimel's avatar Tommy Steimel Committed by Commit Bot

[Media Controls] Fix overlay play button crash for legacy controls

This CL adds a ModernMediaControls check before checking whether an
event is over the internal overlay play button, since the internal
button only exists on modern controls. This fixes a crash in the legacy
controls which dereferenced this null internal button.

Bug: 870490
Change-Id: Ic0990ffd1f4eb5c1f576c38191eb27848eedd9c9
Reviewed-on: https://chromium-review.googlesource.com/1163284Reviewed-by: default avatarMounir Lamouri <mlamouri@chromium.org>
Commit-Queue: Tommy Steimel <steimel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581083}
parent 96cfcfde
......@@ -273,7 +273,7 @@ bool MediaControlOverlayPlayButtonElement::KeepEventInNode(Event* event) {
return false;
// For mouse events, only keep in node if they're on the internal button.
if (event->IsMouseEvent())
if (event->IsMouseEvent() && MediaControlsImpl::IsModern())
return IsMouseEventOnInternalButton(ToMouseEvent(event));
return true;
......
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