Diff
Modified: branches/safari-600.1.4.11-branch/LayoutTests/ChangeLog (172751 => 172752)
--- branches/safari-600.1.4.11-branch/LayoutTests/ChangeLog 2014-08-19 13:09:27 UTC (rev 172751)
+++ branches/safari-600.1.4.11-branch/LayoutTests/ChangeLog 2014-08-19 15:43:56 UTC (rev 172752)
@@ -1,3 +1,21 @@
+2014-08-18 Babak Shafiei <[email protected]>
+
+ Merge r172213.
+
+ 2014-08-06 Brent Fulgham <[email protected]>
+
+ [Mac, iOS] Captions are appearing multiple times during repeated video play through
+ https://bugs.webkit.org/show_bug.cgi?id=135680
+ <rdar://problem/17926802>
+
+ Reviewed by Eric Carlson.
+
+ Reactivate the 'track-in-band-cues-added-once.html' test. We would have caught
+ this bug immediately if the test had been enabled.
+
+ * platform/mac/TestExpectations: Turn 'track-in-band-cues-added-once.html' back
+ on.
+
2014-08-15 Matthew Hanson <[email protected]>
Merge r172603. <rdar://problem/18008488>
Modified: branches/safari-600.1.4.11-branch/LayoutTests/platform/mac/TestExpectations (172751 => 172752)
--- branches/safari-600.1.4.11-branch/LayoutTests/platform/mac/TestExpectations 2014-08-19 13:09:27 UTC (rev 172751)
+++ branches/safari-600.1.4.11-branch/LayoutTests/platform/mac/TestExpectations 2014-08-19 15:43:56 UTC (rev 172752)
@@ -1195,8 +1195,6 @@
webkit.org/b/123490 [ Mavericks ] webaudio/oscillator-sawtooth.html [ Failure ]
-webkit.org/b/123498 [ Mavericks ] media/track/track-in-band-cues-added-once.html [ Failure ]
-
webkit.org/b/123522 [ Mavericks ] media/track/track-in-band-legacy-api.html [ Pass Failure ]
# Audio and video tracks aren't supported on mac
Modified: branches/safari-600.1.4.11-branch/Source/WebCore/ChangeLog (172751 => 172752)
--- branches/safari-600.1.4.11-branch/Source/WebCore/ChangeLog 2014-08-19 13:09:27 UTC (rev 172751)
+++ branches/safari-600.1.4.11-branch/Source/WebCore/ChangeLog 2014-08-19 15:43:56 UTC (rev 172752)
@@ -1,5 +1,36 @@
2014-08-18 Babak Shafiei <[email protected]>
+ Merge r172213.
+
+ 2014-08-06 Brent Fulgham <[email protected]>
+
+ [Mac, iOS] Captions are appearing multiple times during repeated video play through
+ https://bugs.webkit.org/show_bug.cgi?id=135680
+ <rdar://problem/17926802>
+
+ Reviewed by Eric Carlson.
+
+ Test: media/track/track-in-band-cues-added-once.html
+
+ Revert TextTrackCueGeneric::isOrderedBefore logic to its original form, and add
+ a new 'isOrderedBeforeDuringDisplay' for the special case of displaying captions.
+
+ * html/shadow/MediaControlElements.cpp:
+ (WebCore::compareCueIntervalForDisplay): Added helper function.
+ (WebCore::MediaControlTextTrackContainerElement::updateDisplay): Use the new
+ 'isOrderedBeforeDuringDisplay' to order the cues for display.
+ * html/track/TextTrackCue.h:
+ (WebCore::TextTrackCue::isOrderedBeforeDuringDisplay): Added. This just
+ calls the existing 'isOrderedBefore' method.
+ * html/track/TextTrackCueGeneric.cpp:
+ (WebCore::TextTrackCueGeneric::isOrderedBefore): Revert to logic used
+ prior to r171700.
+ (WebCore::TextTrackCueGeneric::isOrderedBeforeDuringDisplay): New method that
+ implements the behavior in r171700.
+ * html/track/TextTrackCueGeneric.h:
+
+2014-08-18 Babak Shafiei <[email protected]>
+
Merge r172317.
2014-08-07 Simon Fraser <[email protected]>
Modified: branches/safari-600.1.4.11-branch/Source/WebCore/html/shadow/MediaControlElements.cpp (172751 => 172752)
--- branches/safari-600.1.4.11-branch/Source/WebCore/html/shadow/MediaControlElements.cpp 2014-08-19 13:09:27 UTC (rev 172751)
+++ branches/safari-600.1.4.11-branch/Source/WebCore/html/shadow/MediaControlElements.cpp 2014-08-19 15:43:56 UTC (rev 172752)
@@ -1257,6 +1257,11 @@
return textTrackContainerElementShadowPseudoId();
}
+static bool compareCueIntervalForDisplay(const CueInterval& one, const CueInterval& two)
+{
+ return one.data()->isPositionedAbove(two.data());
+};
+
void MediaControlTextTrackContainerElement::updateDisplay()
{
if (!mediaController()->closedCaptionsVisible())
@@ -1310,7 +1315,12 @@
// them so that the new cue is at the bottom.
if (childNodeCount() < activeCues.size())
removeChildren();
-
+
+ // Sort the active cues for the appropriate display order. For example, for roll-up
+ // or paint-on captions, we need to add the cues in reverse chronological order,
+ // so that the newest captions appear at the bottom.
+ std::sort(activeCues.begin(), activeCues.end(), &compareCueIntervalForDisplay);
+
// 10. For each text track cue cue in cues that has not yet had
// corresponding CSS boxes added to output, in text track cue order, run the
// following substeps:
Modified: branches/safari-600.1.4.11-branch/Source/WebCore/html/track/TextTrackCue.h (172751 => 172752)
--- branches/safari-600.1.4.11-branch/Source/WebCore/html/track/TextTrackCue.h 2014-08-19 13:09:27 UTC (rev 172751)
+++ branches/safari-600.1.4.11-branch/Source/WebCore/html/track/TextTrackCue.h 2014-08-19 15:43:56 UTC (rev 172752)
@@ -82,6 +82,7 @@
virtual ScriptExecutionContext* scriptExecutionContext() const override final { return &m_scriptExecutionContext; }
virtual bool isOrderedBefore(const TextTrackCue*) const;
+ virtual bool isPositionedAbove(const TextTrackCue* cue) const { return isOrderedBefore(cue); }
bool hasEquivalentStartTime(const TextTrackCue&) const;
Modified: branches/safari-600.1.4.11-branch/Source/WebCore/html/track/TextTrackCueGeneric.cpp (172751 => 172752)
--- branches/safari-600.1.4.11-branch/Source/WebCore/html/track/TextTrackCueGeneric.cpp 2014-08-19 13:09:27 UTC (rev 172751)
+++ branches/safari-600.1.4.11-branch/Source/WebCore/html/track/TextTrackCueGeneric.cpp 2014-08-19 15:43:56 UTC (rev 172752)
@@ -202,6 +202,9 @@
bool TextTrackCueGeneric::isOrderedBefore(const TextTrackCue* that) const
{
+ if (VTTCue::isOrderedBefore(that))
+ return true;
+
if (that->cueType() == Generic && startTime() == that->startTime() && endTime() == that->endTime()) {
// Further order generic cues by their calculated line value.
std::pair<double, double> thisPosition = getPositionCoordinates();
@@ -209,6 +212,18 @@
return thisPosition.second > thatPosition.second || (thisPosition.second == thatPosition.second && thisPosition.first < thatPosition.first);
}
+ return false;
+}
+
+bool TextTrackCueGeneric::isPositionedAbove(const TextTrackCue* that) const
+{
+ if (that->cueType() == Generic && startTime() == that->startTime() && endTime() == that->endTime()) {
+ // Further order generic cues by their calculated line value.
+ std::pair<double, double> thisPosition = getPositionCoordinates();
+ std::pair<double, double> thatPosition = toVTTCue(that)->getPositionCoordinates();
+ return thisPosition.second > thatPosition.second || (thisPosition.second == thatPosition.second && thisPosition.first < thatPosition.first);
+ }
+
if (that->cueType() == Generic)
return startTime() > that->startTime();
Modified: branches/safari-600.1.4.11-branch/Source/WebCore/html/track/TextTrackCueGeneric.h (172751 => 172752)
--- branches/safari-600.1.4.11-branch/Source/WebCore/html/track/TextTrackCueGeneric.h 2014-08-19 13:09:27 UTC (rev 172751)
+++ branches/safari-600.1.4.11-branch/Source/WebCore/html/track/TextTrackCueGeneric.h 2014-08-19 15:43:56 UTC (rev 172752)
@@ -80,6 +80,7 @@
private:
virtual bool isOrderedBefore(const TextTrackCue*) const override;
+ virtual bool isPositionedAbove(const TextTrackCue*) const override;
TextTrackCueGeneric(ScriptExecutionContext&, double start, double end, const String&);