From 5e94197e015dc3dbd11749ac96124b757ac46e5b Mon Sep 17 00:00:00 2001 From: Rick Eyre Date: Fri, 20 Sep 2013 14:42:35 -0400 Subject: [PATCH] Bug 917945 - Part 1: Expose TextTrackRegion* as VTTRegion*. r=rillian, r=bz --HG-- rename : dom/webidl/TextTrackRegion.webidl => dom/webidl/VTTRegion.webidl rename : dom/webidl/TextTrackRegionList.webidl => dom/webidl/VTTRegionList.webidl --- content/media/TextTrackRegion.cpp | 4 +-- content/media/TextTrackRegionList.cpp | 4 +-- dom/bindings/Bindings.conf | 8 +++++ dom/webidl/TextTrack.webidl | 6 ++-- ...extTrackRegion.webidl => VTTRegion.webidl} | 35 +++++++++---------- ...RegionList.webidl => VTTRegionList.webidl} | 8 ++--- dom/webidl/moz.build | 4 +-- 7 files changed, 37 insertions(+), 32 deletions(-) rename dom/webidl/{TextTrackRegion.webidl => VTTRegion.webidl} (95%) rename dom/webidl/{TextTrackRegionList.webidl => VTTRegionList.webidl} (79%) diff --git a/content/media/TextTrackRegion.cpp b/content/media/TextTrackRegion.cpp index 08bcf5dadca..24f5c3ba319 100644 --- a/content/media/TextTrackRegion.cpp +++ b/content/media/TextTrackRegion.cpp @@ -6,7 +6,7 @@ #include "mozilla/dom/TextTrack.h" #include "mozilla/dom/TextTrackRegion.h" -#include "mozilla/dom/TextTrackRegionBinding.h" +#include "mozilla/dom/VTTRegionBinding.h" namespace mozilla { namespace dom { @@ -22,7 +22,7 @@ NS_INTERFACE_MAP_END JSObject* TextTrackRegion::WrapObject(JSContext* aCx, JS::Handle aScope) { - return TextTrackRegionBinding::Wrap(aCx, aScope, this); + return VTTRegionBinding::Wrap(aCx, aScope, this); } already_AddRefed diff --git a/content/media/TextTrackRegionList.cpp b/content/media/TextTrackRegionList.cpp index 89b205475ea..81893e30e79 100644 --- a/content/media/TextTrackRegionList.cpp +++ b/content/media/TextTrackRegionList.cpp @@ -5,7 +5,7 @@ #include "mozilla/dom/TextTrackRegion.h" #include "mozilla/dom/TextTrackRegionList.h" -#include "mozilla/dom/TextTrackRegionListBinding.h" +#include "mozilla/dom/VTTRegionListBinding.h" namespace mozilla { namespace dom { @@ -23,7 +23,7 @@ NS_INTERFACE_MAP_END JSObject* TextTrackRegionList::WrapObject(JSContext* aCx, JS::Handle aScope) { - return TextTrackRegionListBinding::Wrap(aCx, aScope, this); + return VTTRegionListBinding::Wrap(aCx, aScope, this); } TextTrackRegionList::TextTrackRegionList(nsISupports* aGlobal) diff --git a/dom/bindings/Bindings.conf b/dom/bindings/Bindings.conf index 134d0e8c136..acf7775cf2b 100644 --- a/dom/bindings/Bindings.conf +++ b/dom/bindings/Bindings.conf @@ -1254,6 +1254,14 @@ DOMInterfaces = { 'nativeType': 'mozilla::dom::TextTrackCue' }, +'VTTRegion': { + 'nativeType': 'mozilla::dom::TextTrackRegion', +}, + +'VTTRegionList': { + 'nativeType': 'mozilla::dom::TextTrackRegionList', +}, + 'WebGLActiveInfo': { 'nativeType': 'mozilla::WebGLActiveInfo', 'headerFile': 'WebGLActiveInfo.h', diff --git a/dom/webidl/TextTrack.webidl b/dom/webidl/TextTrack.webidl index 391bf411916..00d9b51d703 100644 --- a/dom/webidl/TextTrack.webidl +++ b/dom/webidl/TextTrack.webidl @@ -34,7 +34,7 @@ interface TextTrack : EventTarget { readonly attribute TextTrackCueList? cues; readonly attribute TextTrackCueList? activeCues; - readonly attribute TextTrackRegionList? regions; + readonly attribute VTTRegionList? regions; void addCue(VTTCue cue); [Throws] @@ -42,6 +42,6 @@ interface TextTrack : EventTarget { attribute EventHandler oncuechange; [Throws] - void removeRegion(TextTrackRegion region); - void addRegion(TextTrackRegion region); + void removeRegion(VTTRegion region); + void addRegion(VTTRegion region); }; diff --git a/dom/webidl/TextTrackRegion.webidl b/dom/webidl/VTTRegion.webidl similarity index 95% rename from dom/webidl/TextTrackRegion.webidl rename to dom/webidl/VTTRegion.webidl index cb0bb5afa59..3c524d21e09 100644 --- a/dom/webidl/TextTrackRegion.webidl +++ b/dom/webidl/VTTRegion.webidl @@ -7,25 +7,24 @@ * http://dev.w3.org/html5/webvtt/#extension-of-the-texttrack-interface-for-region-support */ - [Constructor, Pref="media.webvtt.enabled"] -interface TextTrackRegion { - readonly attribute TextTrack? track; - attribute DOMString id; - - [SetterThrows] - attribute double width; - - attribute long lines; - - [SetterThrows] - attribute double regionAnchorX; - [SetterThrows] - attribute double regionAnchorY; - [SetterThrows] - attribute double viewportAnchorX; - [SetterThrows] +interface VTTRegion { + readonly attribute TextTrack? track; + attribute DOMString id; + + [SetterThrows] + attribute double width; + + attribute long lines; + + [SetterThrows] + attribute double regionAnchorX; + [SetterThrows] + attribute double regionAnchorY; + [SetterThrows] + attribute double viewportAnchorX; + [SetterThrows] attribute double viewportAnchorY; - [SetterThrows] + [SetterThrows] attribute DOMString scroll; }; diff --git a/dom/webidl/TextTrackRegionList.webidl b/dom/webidl/VTTRegionList.webidl similarity index 79% rename from dom/webidl/TextTrackRegionList.webidl rename to dom/webidl/VTTRegionList.webidl index 6c2644c74e6..5b755b1969d 100644 --- a/dom/webidl/TextTrackRegionList.webidl +++ b/dom/webidl/VTTRegionList.webidl @@ -7,11 +7,9 @@ * http://dev.w3.org/html5/webvtt/#extension-of-the-texttrack-interface-for-region-support */ - [Pref="media.webvtt.enabled"] -interface TextTrackRegionList { +interface VTTRegionList { readonly attribute unsigned long length; - getter TextTrackRegion (unsigned long index); - TextTrackRegion? getRegionById(DOMString id); + getter VTTRegion (unsigned long index); + VTTRegion? getRegionById(DOMString id); }; - diff --git a/dom/webidl/moz.build b/dom/webidl/moz.build index 93bffeca668..81d95ad5ff6 100644 --- a/dom/webidl/moz.build +++ b/dom/webidl/moz.build @@ -381,8 +381,6 @@ WEBIDL_FILES = [ 'TextTrack.webidl', 'TextTrackCueList.webidl', 'TextTrackList.webidl', - 'TextTrackRegion.webidl', - 'TextTrackRegionList.webidl', 'TimeEvent.webidl', 'TimeRanges.webidl', 'Touch.webidl', @@ -397,6 +395,8 @@ WEBIDL_FILES = [ 'URLUtils.webidl', 'URLUtilsReadOnly.webidl', 'VTTCue.webidl', + 'VTTRegion.webidl', + 'VTTRegionList.webidl', 'ValidityState.webidl', 'VideoPlaybackQuality.webidl', 'VideoStreamTrack.webidl',