Backed out changeset 568a08748f67 (bug 1276831) for failure in web-platform-test webvtt/interfaces.html. r=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Tue, 14 Jun 2016 14:34:30 +0200
changeset 341795 017c7d55f22fc67346a9ef2ec45bd33ae88d8c46
parent 341794 803228efe10858012ab159a694d913de136bc9e2
child 341796 c109d0b45e8aa440b588c1a862b0ca5b83ee050e
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1276831
milestone50.0a1
backs out568a08748f673064b01377cfe75785990c84aafa
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 568a08748f67 (bug 1276831) for failure in web-platform-test webvtt/interfaces.html. r=backout
dom/media/TextTrackCue.cpp
dom/media/TextTrackCue.h
dom/webidl/VTTCue.webidl
--- a/dom/media/TextTrackCue.cpp
+++ b/dom/media/TextTrackCue.cpp
@@ -28,17 +28,17 @@ NS_INTERFACE_MAP_END_INHERITING(DOMEvent
 
 StaticRefPtr<nsIWebVTTParserWrapper> TextTrackCue::sParserWrapper;
 
 // Set cue setting defaults based on step 19 & seq.
 // in http://dev.w3.org/html5/webvtt/#parsing
 void
 TextTrackCue::SetDefaultCueSettings()
 {
-  mPositionIsAutoKeyword = true;
+  mPosition = 50;
   mPositionAlign = PositionAlignSetting::Center;
   mSize = 100.0;
   mPauseOnExit = false;
   mSnapToLines = true;
   mLineIsAutoKeyword = true;
   mAlign = AlignSetting::Middle;
   mLineAlign = LineAlignSetting::Start;
   mVertical = DirectionSetting::_empty;
@@ -199,30 +199,16 @@ TextTrackCue::ComputedLine()
     if (mTrack == track) {
       break;
     }
   }
 
   return (-1.0) * showingTracksNum;
 }
 
-double
-TextTrackCue::ComputedPosition()
-{
-  // See spec https://w3c.github.io/webvtt/#cue-computed-position
-  if (!mPositionIsAutoKeyword) {
-    return mPosition;
-  } else if (mAlign == AlignSetting::Left) {
-    return 0.0;
-  } else if (mAlign == AlignSetting::Right) {
-    return 100.0;
-  }
-  return 50.0;
-}
-
 PositionAlignSetting
 TextTrackCue::ComputedPositionAlign()
 {
   // See spec https://w3c.github.io/webvtt/#cue-computed-position-alignment
   if (mPositionAlign != PositionAlignSetting::Auto) {
     return mPositionAlign;
   } else if (mAlign == AlignSetting::Left) {
     return PositionAlignSetting::Line_left;
--- a/dom/media/TextTrackCue.h
+++ b/dom/media/TextTrackCue.h
@@ -185,45 +185,34 @@ public:
     if (mLineAlign == aLineAlign) {
       return;
     }
 
     mReset = true;
     mLineAlign = aLineAlign;
   }
 
-  void GetPosition(OwningDoubleOrAutoKeyword& aPosition) const
+  int32_t Position() const
   {
-    if (mPositionIsAutoKeyword) {
-      aPosition.SetAsAutoKeyword() = AutoKeyword::Auto;
+    return mPosition;
+  }
+
+  void SetPosition(int32_t aPosition, ErrorResult& aRv)
+  {
+    if (mPosition == aPosition) {
       return;
     }
-    aPosition.SetAsDouble() = mPosition;
-  }
 
-  void SetPosition(const DoubleOrAutoKeyword& aPosition, ErrorResult& aRv)
-  {
-    if (!aPosition.IsAutoKeyword() &&
-        (aPosition.GetAsDouble() > 100.0 || aPosition.GetAsDouble() < 0.0)){
+    if (aPosition > 100 || aPosition < 0){
       aRv.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
       return;
     }
 
-    if (aPosition.IsDouble() &&
-        (mPositionIsAutoKeyword || (aPosition.GetAsDouble() != mPosition))) {
-      mPositionIsAutoKeyword = false;
-      mPosition = aPosition.GetAsDouble();
-      mReset = true;
-      return;
-    }
-
-    if (aPosition.IsAutoKeyword() && !mPositionIsAutoKeyword) {
-      mPositionIsAutoKeyword = true;
-      mReset = true;
-    }
+    mReset = true;
+    mPosition = aPosition;
   }
 
   PositionAlignSetting PositionAlign() const
   {
     return mPositionAlign;
   }
 
   void SetPositionAlign(PositionAlignSetting aPositionAlign, ErrorResult& aRv)
@@ -306,17 +295,16 @@ public:
   }
 
   bool HasBeenReset()
   {
     return mReset;
   }
 
   double ComputedLine();
-  double ComputedPosition();
   PositionAlignSetting ComputedPositionAlign();
 
   // Helper functions for implementation.
   bool
   operator==(const TextTrackCue& rhs) const
   {
     return mId.Equals(rhs.mId);
   }
@@ -367,18 +355,17 @@ private:
   RefPtr<nsIDocument> mDocument;
   nsString mText;
   double mStartTime;
   double mEndTime;
 
   RefPtr<TextTrack> mTrack;
   RefPtr<HTMLTrackElement> mTrackElement;
   nsString mId;
-  double mPosition;
-  bool mPositionIsAutoKeyword;
+  int32_t mPosition;
   PositionAlignSetting mPositionAlign;
   double mSize;
   bool mPauseOnExit;
   bool mSnapToLines;
   RefPtr<TextTrackRegion> mRegion;
   DirectionSetting mVertical;
   bool mLineIsAutoKeyword;
   double mLine;
--- a/dom/webidl/VTTCue.webidl
+++ b/dom/webidl/VTTCue.webidl
@@ -42,17 +42,17 @@ interface VTTCue : TextTrackCue {
   [Pref="media.webvtt.regions.enabled"]
   attribute VTTRegion? region;
   attribute DirectionSetting vertical;
   attribute boolean snapToLines;
   attribute (double or AutoKeyword) line;
   [SetterThrows]
   attribute LineAlignSetting lineAlign;
   [SetterThrows]
-  attribute (double or AutoKeyword) position;
+  attribute long position;
   [SetterThrows]
   attribute PositionAlignSetting positionAlign;
   [SetterThrows]
   attribute double size;
   attribute AlignSetting align;
   attribute DOMString text;
   DocumentFragment getCueAsHTML();
 };
@@ -61,12 +61,10 @@ interface VTTCue : TextTrackCue {
 partial interface VTTCue {
   [ChromeOnly]
   attribute HTMLDivElement? displayState;
   [ChromeOnly]
   readonly attribute boolean hasBeenReset;
   [ChromeOnly]
   readonly attribute double computedLine;
   [ChromeOnly]
-  readonly attribute double computedPosition;
-  [ChromeOnly]
   readonly attribute PositionAlignSetting computedPositionAlign;
 };