diff --git a/dom/media/TextTrackCue.cpp b/dom/media/TextTrackCue.cpp index 2f44a0311fa1..e0a45670ac87 100644 --- a/dom/media/TextTrackCue.cpp +++ b/dom/media/TextTrackCue.cpp @@ -39,7 +39,7 @@ TextTrackCue::SetDefaultCueSettings() mSnapToLines = true; mLineIsAutoKeyword = true; mAlign = AlignSetting::Middle; - mLineAlign = AlignSetting::Start; + mLineAlign = LineAlignSetting::Start; mVertical = DirectionSetting::_empty; mActive = false; } diff --git a/dom/media/TextTrackCue.h b/dom/media/TextTrackCue.h index 24e28edd0c9d..ee716d91d885 100644 --- a/dom/media/TextTrackCue.h +++ b/dom/media/TextTrackCue.h @@ -172,19 +172,15 @@ public: } } - AlignSetting LineAlign() const + LineAlignSetting LineAlign() const { return mLineAlign; } - void SetLineAlign(AlignSetting& aLineAlign, ErrorResult& aRv) + void SetLineAlign(LineAlignSetting& aLineAlign, ErrorResult& aRv) { - if (mLineAlign == aLineAlign) + if (mLineAlign == aLineAlign) { return; - - if (aLineAlign == AlignSetting::Left || - aLineAlign == AlignSetting::Right) { - return aRv.Throw(NS_ERROR_DOM_SYNTAX_ERR); } mReset = true; @@ -364,7 +360,7 @@ private: bool mLineIsAutoKeyword; long mLineLong; AlignSetting mAlign; - AlignSetting mLineAlign; + LineAlignSetting mLineAlign; // Holds the computed DOM elements that represent the parsed cue text. // http://www.whatwg.org/specs/web-apps/current-work/#text-track-cue-display-state diff --git a/dom/webidl/VTTCue.webidl b/dom/webidl/VTTCue.webidl index 684d98fc5bc9..424c0ad900c2 100644 --- a/dom/webidl/VTTCue.webidl +++ b/dom/webidl/VTTCue.webidl @@ -9,6 +9,12 @@ enum AutoKeyword { "auto" }; +enum LineAlignSetting { + "start", + "center", + "end" +}; + enum PositionAlignSetting { "line-left", "center", @@ -39,7 +45,7 @@ interface VTTCue : TextTrackCue { attribute boolean snapToLines; attribute (long or AutoKeyword) line; [SetterThrows] - attribute AlignSetting lineAlign; + attribute LineAlignSetting lineAlign; [SetterThrows] attribute long position; [SetterThrows]