Commit 33fac969 authored by Rune Lillesveen's avatar Rune Lillesveen Committed by Commit Bot

Move Hide() to RemovedFrom() for disconnected media controls.

Found when debugging nested remove() issue for CSS update roots.
Resolves TODO.

TEST=media/
TEST=external/wpt/media*

Bug: 868810
Change-Id: If2d13a9167ed331b562f55ca7e5a5802e7751362
Reviewed-on: https://chromium-review.googlesource.com/1202142Reviewed-by: default avatarBecca Hughes <beccahughes@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#588932}
parent ce711bbc
......@@ -720,7 +720,6 @@ void HTMLMediaElement::RemovedFrom(ContainerNode& insertion_point) {
HTMLElement::RemovedFrom(insertion_point);
if (insertion_point.InActiveDocument()) {
UpdateControlsVisibility();
if (network_state_ > kNetworkEmpty)
PauseInternal();
}
......@@ -3826,11 +3825,8 @@ void HTMLMediaElement::EnsureMediaControls() {
}
void HTMLMediaElement::UpdateControlsVisibility() {
if (!isConnected()) {
if (GetMediaControls())
GetMediaControls()->Hide();
if (!isConnected())
return;
}
bool native_controls = ShouldShowControls(RecordMetricsBehavior::kDoRecord);
......
......@@ -813,8 +813,7 @@ void MediaControlsImpl::RemovedFrom(ContainerNode& insertion_point) {
HTMLDivElement::RemovedFrom(insertion_point);
// TODO(mlamouri): we hide show the controls instead of having
// HTMLMediaElement do it.
Hide();
media_event_listener_->Detach();
if (orientation_lock_delegate_)
......
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