Skip to content

Commit

Permalink
Merge branch 'eng/1400' into wpe-2.38
Browse files Browse the repository at this point in the history
When I applied the suggested patch upstream I saw that there was some part of
the code that was already upstream from another patch, so I backported both as
part of the fix for this.
  • Loading branch information
calvaris committed Sep 30, 2024
2 parents 0dc5f2c + 73f49fd commit 22b825d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,4 +248,16 @@ class MediaControls extends LayoutNode
else
super.commitProperty(propertyName);
}

disable()
{
this.element.removeEventListener("focusin", this);
window.removeEventListener("dragstart", this, true);
}

reenable()
{
this.element.addEventListener("focusin", this);
window.addEventListener("dragstart", this, true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@ class MediaController
deinitialize()
{
this.shadowRoot.removeChild(this.container);
window.removeEventListener("keydown", this);
if (this.controls)
this.controls.disable();
return true;
}

Expand All @@ -232,6 +235,9 @@ class MediaController
this.mediaWeakRef = new WeakRef(media);
this.host = host;
shadowRoot.appendChild(this.container);
window.addEventListener("keydown", this);
if (this.controls)
this.controls.reenable();
return true;
}

Expand Down Expand Up @@ -269,6 +275,9 @@ class MediaController
supportingObject.disable();
}

if (previousControls)
previousControls.disable();

this.controls = new ControlsClass;
this.controls.delegate = this;

Expand Down

0 comments on commit 22b825d

Please sign in to comment.