No issue - Cloned <audio>/<video> elements should respect muted attribute.

This commit is contained in:
Moonchild 2024-12-05 14:16:07 +01:00 committed by roytam1
commit 1bdfca3920

View file

@ -5695,8 +5695,14 @@ HTMLMediaElement::CopyInnerTo(Element* aDest)
{
nsresult rv = nsGenericHTMLElement::CopyInnerTo(aDest);
NS_ENSURE_SUCCESS(rv, rv);
// Make sure cloned <audio> and <video> respect their "muted" attribute.
HTMLMediaElement* dest = static_cast<HTMLMediaElement*>(aDest);
if (HasAttr(nsGkAtoms::muted)) {
dest->mMuted |= MUTED_BY_CONTENT;
}
if (aDest->OwnerDoc()->IsStaticDocument()) {
HTMLMediaElement* dest = static_cast<HTMLMediaElement*>(aDest);
dest->SetMediaInfo(mMediaInfo);
}
return rv;