Use mElement->OwnerDoc to get a global object.

Thanks to khuey for the suggestion:

ok so if you can get the nsISupports* for the window out of
mElement->OwnerDoc() you're good this will be easier once
bug 820170 lands but mElement->OwnerDoc()->GetParentObject()
is probably what you want and if that returns null just fail
then take that pointer and pass it to new TextTrackCue
and everything should work
Fix a missing parentheses.