Bug 894104 - Part 1: Retain a document reference for GetCueAsHTML.

From 447985000db919e2f054012ca10f03d626c401b1 Mon Sep 17 00:00:00 2001
 r=bz
Save a copy of the owning document at creation time instead
of looking it up from mGlobal in each call. This ensures it
is available even if we're called after our window is unlinked
at teardown.

Make the constructors throw if a window is not available,
so we can return an INVALID_STATE_ERR if we're called
in an incomplete environment.
Bug 894104 - Part 2: Add testcase to crashtests. r=bz

From d94dd7dde357ccf7f6de53c1fae20a9bdb916a86 Mon Sep 17 00:00:00 2001
Bug 894104 - Part 3: remove TextTrackCue's mGlobal. r=bz

From 095c76c72dd5915b2fa8ec74f4e2b0b45de244f1 Mon Sep 17 00:00:00 2001
Since we keep a document reference we no longer need the
separate global. It was only used in GetParentObject() and
we can return nullptr there (meaning 'use whatever magic global')
or return the document instead, which is what this patch does.