Commit 0e2033fa authored by Brad Werth's avatar Brad Werth
Browse files

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
parent f4d3fe18
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -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();