Bug 1834049: Permit canvas captureStream without initializing the context. r=lsalzman

The spec does not seem to require a current context, so there's no reason
to require it here. If later calls within
`HTMLCanvasElement::CaptureStream` need a current context, they'll have
their own failure messages which will hopefully clarify where exactly we
need the context to exist.

Differential Revision: https://phabricator.services.mozilla.com/D178985
This commit is contained in:
Brad Werth 2023-05-25 16:08:29 +00:00
parent f86da890ec
commit 5bc65aa678

View File

@ -821,11 +821,6 @@ already_AddRefed<CanvasCaptureMediaStream> HTMLCanvasElement::CaptureStream(
return nullptr;
}
if (!mCurrentContext) {
aRv.Throw(NS_ERROR_NOT_INITIALIZED);
return nullptr;
}
auto stream = MakeRefPtr<CanvasCaptureMediaStream>(window, this);
nsCOMPtr<nsIPrincipal> principal = NodePrincipal();