зеркало из https://github.com/mozilla/gecko-dev.git
Bug 982183 - Put VTTRegion DOM API behind a pref. r=rillian, r=bz
This commit is contained in:
Родитель
0d38ee7229
Коммит
c1ed0c1a19
|
@ -13,6 +13,7 @@
|
|||
#include "nsWrapperCache.h"
|
||||
#include "mozilla/ErrorResult.h"
|
||||
#include "mozilla/dom/TextTrack.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
@ -28,6 +29,12 @@ public:
|
|||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TextTrackRegion)
|
||||
|
||||
static bool RegionsEnabled(JSContext* cx, JSObject* obj)
|
||||
{
|
||||
return Preferences::GetBool("media.webvtt.enabled") &&
|
||||
Preferences::GetBool("media.webvtt.regions.enabled");
|
||||
}
|
||||
|
||||
virtual JSObject* WrapObject(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
|
||||
|
||||
|
|
|
@ -17,7 +17,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=833386
|
|||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [["media.webvtt.enabled", true]]},
|
||||
SpecialPowers.pushPrefEnv({"set": [["media.webvtt.enabled", true],
|
||||
["media.webvtt.regions.enabled", true]]},
|
||||
function() {
|
||||
var video = document.createElement("video");
|
||||
video.src = "seek.webm";
|
||||
|
|
|
@ -17,7 +17,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=917945
|
|||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({"set": [["media.webvtt.enabled", true]]},
|
||||
SpecialPowers.pushPrefEnv({"set": [["media.webvtt.enabled", true],
|
||||
["media.webvtt.regions.enabled", true]]},
|
||||
function() {
|
||||
var video = document.createElement("video");
|
||||
video.src = "seek.webm";
|
||||
|
|
|
@ -1118,7 +1118,7 @@ var interfaceNamesInGlobalScope =
|
|||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
"VTTCue",
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
"VTTRegion",
|
||||
{name: "VTTRegion", pref: "media.webvtt.regions.enabled"},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
"WaveShaperNode",
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
|
|
|
@ -32,6 +32,7 @@ interface VTTCue : EventTarget {
|
|||
attribute double startTime;
|
||||
attribute double endTime;
|
||||
attribute boolean pauseOnExit;
|
||||
[Pref="media.webvtt.regions.enabled"]
|
||||
attribute VTTRegion? region;
|
||||
attribute DirectionSetting vertical;
|
||||
attribute boolean snapToLines;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* http://dev.w3.org/html5/webvtt/#extension-of-the-texttrack-interface-for-region-support
|
||||
*/
|
||||
|
||||
[Constructor, Pref="media.webvtt.enabled"]
|
||||
[Constructor, Func="TextTrackRegion::RegionsEnabled"]
|
||||
interface VTTRegion {
|
||||
[SetterThrows]
|
||||
attribute double width;
|
||||
|
|
|
@ -294,6 +294,7 @@ pref("media.tabstreaming.time_per_frame", 40);
|
|||
|
||||
// TextTrack support
|
||||
pref("media.webvtt.enabled", true);
|
||||
pref("media.webvtt.regions.enabled", false);
|
||||
|
||||
// Whether to enable MediaSource support
|
||||
pref("media.mediasource.enabled", false);
|
||||
|
|
Загрузка…
Ссылка в новой задаче