Diff
Modified: trunk/LayoutTests/ChangeLog (165828 => 165829)
--- trunk/LayoutTests/ChangeLog 2014-03-18 19:07:12 UTC (rev 165828)
+++ trunk/LayoutTests/ChangeLog 2014-03-18 19:16:01 UTC (rev 165829)
@@ -1,3 +1,16 @@
+2014-03-18 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r165815.
+ https://bugs.webkit.org/show_bug.cgi?id=130410
+
+ Broke many VTT tests (Requested by bfulgham on #webkit).
+
+ Reverted changeset:
+
+ "TextTrackRegion Not Implemented"
+ https://bugs.webkit.org/show_bug.cgi?id=116546
+ http://trac.webkit.org/changeset/165815
+
2014-03-18 Renata Hodovan <[email protected]>
Bad cast with toRenderBox in WebCore::RenderView::repaintViewRectangle
Deleted: trunk/LayoutTests/media/track/captions-webvtt/captions-regions.vtt (165828 => 165829)
--- trunk/LayoutTests/media/track/captions-webvtt/captions-regions.vtt 2014-03-18 19:07:12 UTC (rev 165828)
+++ trunk/LayoutTests/media/track/captions-webvtt/captions-regions.vtt 2014-03-18 19:16:01 UTC (rev 165829)
@@ -1,19 +0,0 @@
-WEBVTT FILE
-Region: id=fred width=50% height=2 regionanchor=50%,100% viewportanchor=10%,40%
-
-1
-00:00:00.000 --> 00:00:01.500 region:fred
-We are in New York City
-
-2
-00:00:00.500 --> 00:00:01.500 region:fred
-Second cue
-
-3
-00:00:01.000 --> 00:00:02.500 region:fred
-Multiline
-Cue
-
-4
-00:00:02.000 --> 00:00:03.000 region:fred
-Fourth cue!
\ No newline at end of file
Modified: trunk/LayoutTests/media/track/regions-webvtt/text-track-cue-region-attribute-expected.txt (165828 => 165829)
--- trunk/LayoutTests/media/track/regions-webvtt/text-track-cue-region-attribute-expected.txt 2014-03-18 19:07:12 UTC (rev 165828)
+++ trunk/LayoutTests/media/track/regions-webvtt/text-track-cue-region-attribute-expected.txt 2014-03-18 19:16:01 UTC (rev 165829)
@@ -1,7 +1,6 @@
Tests the regionId attribute of a cue.
-
** Test the setter and getter through the JS API **
EXPECTED (cue.regionId == '') OK
EXPECTED (cue.regionId == 'someId') OK
Deleted: trunk/LayoutTests/media/track/regions-webvtt/text-track-region-display-expected.txt (165828 => 165829)
--- trunk/LayoutTests/media/track/regions-webvtt/text-track-region-display-expected.txt 2014-03-18 19:07:12 UTC (rev 165828)
+++ trunk/LayoutTests/media/track/regions-webvtt/text-track-region-display-expected.txt 2014-03-18 19:16:01 UTC (rev 165829)
@@ -1,53 +0,0 @@
-Tests default rendering for TextTrackCues that belong to a TextTrackRegion.
-
-
-EVENT(canplaythrough)
-** The text track has only one region **
-EXPECTED (testTrack.regions.length == '1') OK
-
-** Inspecting cues displayed within region**
-
-RUN(video.currentTime = 0.2)
-EVENT(seeked)
-Total cues in region: 1
-Cue content is: We are in New York City
-Cue lines visible from this cue: 1
-EXPECTED (totalVisibleLines <= testTrack.regions[0].height == 'true') OK
-
-RUN(video.currentTime = 0.5)
-EVENT(seeked)
-Total cues in region: 2
-Cue content is: We are in New York City
-Cue lines visible from this cue: 1
-Cue content is: Second cue
-Cue lines visible from this cue: 1
-EXPECTED (totalVisibleLines <= testTrack.regions[0].height == 'true') OK
-
-RUN(video.currentTime = 1)
-EVENT(seeked)
-Total cues in region: 3
-Cue content is: We are in New York City
-Cue lines visible from this cue: 1
-Cue content is: Second cue
-Cue lines visible from this cue: 1
-Cue content is: Multiline Cue
-Cue lines visible from this cue: 0
-EXPECTED (totalVisibleLines <= testTrack.regions[0].height == 'true') OK
-
-RUN(video.currentTime = 2.3)
-EVENT(seeked)
-Total cues in region: 2
-Cue content is: Multiline Cue
-Cue lines visible from this cue: 2
-Cue content is: Fourth cue!
-Cue lines visible from this cue: 0
-EXPECTED (totalVisibleLines <= testTrack.regions[0].height == 'true') OK
-
-RUN(video.currentTime = 3)
-EVENT(seeked)
-Total cues in region: 1
-Cue content is: Fourth cue!
-Cue lines visible from this cue: 1
-EXPECTED (totalVisibleLines <= testTrack.regions[0].height == 'true') OK
-END OF TEST
-
Deleted: trunk/LayoutTests/media/track/regions-webvtt/text-track-region-display.html (165828 => 165829)
--- trunk/LayoutTests/media/track/regions-webvtt/text-track-region-display.html 2014-03-18 19:07:12 UTC (rev 165828)
+++ trunk/LayoutTests/media/track/regions-webvtt/text-track-region-display.html 2014-03-18 19:16:01 UTC (rev 165829)
@@ -1,108 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <script src=""
- <script src=""
- <script src=""
- <script>
- var testTrack;
- var region;
- var container;
- var totalVisibleLines;
-
- var seekTimes = [0.2, 0.5, 1.0, 2.3, 3.0];
- var crtSeekTime = 0;
-
- function countVisibleLines(cueElement)
- {
- var cueRect = cueElement.getBoundingClientRect();
- var regionRect = region.getBoundingClientRect();
-
- var linesMatch = cueElement.textContent.match(/\n/g);
- var linesCount = 1 + (linesMatch == null ? 0 : linesMatch.length);
- var lineHeight = cueRect.height / linesCount;
-
- var visibleLines = 0;
- for (i = 0; i < linesCount; ++i) {
- var lineTop = cueRect.top + i * lineHeight;
- var lineBottom = cueRect.top + (i+1) * lineHeight;
-
- if (lineTop >= regionRect.top && lineBottom <= regionRect.bottom)
- visibleLines++;
- }
-
- return visibleLines;
- }
-
- function testRegionsDisplay()
- {
- testTrack = video.textTracks[0];
-
- consoleWrite("** The text track has only one region **");
- testExpected("testTrack.regions.length", 1);
-
- try {
- region = textTrackDisplayElement(video, 'region');
- container = textTrackDisplayElement(video, 'region-container');
- } catch(e) {
- consoleWrite(e);
- }
-
- consoleWrite("<br>** Inspecting cues displayed within region**");
-
- waitForEvent("seeked", inspectRegionTree);
- seekVideo();
- }
-
- function seekVideo()
- {
- consoleWrite("");
- run("video.currentTime = " + seekTimes[crtSeekTime++]);
- }
-
- function inspectRegionTree()
- {
- consoleWrite("Total cues in region: " + container.children.length);
- totalVisibleLines = 0;
-
- for (var i = 0; i < container.children.length; ++i) {
- var cue = container.children[i];
- var cueVisibleLines = countVisibleLines(cue);
- consoleWrite("Cue content is: " + cue.textContent);
- consoleWrite("Cue lines visible from this cue: " + cueVisibleLines);
-
- totalVisibleLines += cueVisibleLines;
- }
-
- testExpected("totalVisibleLines <= testTrack.regions[0].height", true);
-
- if (crtSeekTime == seekTimes.length)
- endTest();
- else
- seekVideo();
- }
-
- function startTest()
- {
- if (!window.TextTrackRegion) {
- failTest();
- return;
- }
-
- findMediaElement();
-
- video.src = "" '../../content/test');
- waitForEvent('canplaythrough', testRegionsDisplay);
- }
-
- </script>
- </head>
- <body>
- <p>Tests default rendering for TextTrackCues that belong to a TextTrackRegion.</p>
- <video controls>
- <track src="" kind="captions" default _onload_="startTest()">
- </video>
- </body>
-</html>
\ No newline at end of file
Deleted: trunk/LayoutTests/media/track/regions-webvtt/text-track-region-dom-layout-expected.txt (165828 => 165829)
--- trunk/LayoutTests/media/track/regions-webvtt/text-track-region-dom-layout-expected.txt 2014-03-18 19:07:12 UTC (rev 165828)
+++ trunk/LayoutTests/media/track/regions-webvtt/text-track-region-dom-layout-expected.txt 2014-03-18 19:16:01 UTC (rev 165829)
@@ -1,20 +0,0 @@
-Tests default DOM layout structure for a TextTrackRegion.
-
-
-EVENT(canplaythrough)
-** The text track has only one region **
-EXPECTED (testTrack.regions.length == '1') OK
-
-** Inspecting the default DOM layout used for regions display **
-
-** Only one region should be displayed **
-EXPECTED (region.children.length == '1') OK
-
-** The child of the region should be the container **
-EXPECTED (region.children[0] == container == 'true') OK
-
-** Default pseudo IDs should be set properly
-EXPECTED (region.getAttribute('pseudo') == '-webkit-media-text-track-region') OK
-EXPECTED (container.getAttribute('pseudo') == '-webkit-media-text-track-region-container') OK
-END OF TEST
-
Deleted: trunk/LayoutTests/media/track/regions-webvtt/text-track-region-dom-layout.html (165828 => 165829)
--- trunk/LayoutTests/media/track/regions-webvtt/text-track-region-dom-layout.html 2014-03-18 19:07:12 UTC (rev 165828)
+++ trunk/LayoutTests/media/track/regions-webvtt/text-track-region-dom-layout.html 2014-03-18 19:16:01 UTC (rev 165829)
@@ -1,64 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <script src=""
- <script src=""
- <script src=""
- <script>
- var testTrack;
- var region;
- var container;
-
- function testRegionsDisplay()
- {
- testTrack = video.textTracks[0];
-
- consoleWrite("** The text track has only one region **");
- testExpected("testTrack.regions.length", 1);
-
- try {
- region = textTrackDisplayElement(video, 'region');
- container = textTrackDisplayElement(video, 'region-container');
- } catch(e) {
- consoleWrite(e);
- }
-
- consoleWrite("<br>** Inspecting the default DOM layout used for regions display **");
-
- consoleWrite("<br>** Only one region should be displayed **");
- testExpected("region.children.length", 1);
-
- consoleWrite("<br>** The child of the region should be the container **");
- testExpected("region.children[0] == container", true);
-
- consoleWrite("<br>** Default pseudo IDs should be set properly");
- testExpected("region.getAttribute('pseudo')", "-webkit-media-text-track-region");
- testExpected("container.getAttribute('pseudo')", "-webkit-media-text-track-region-container");
-
- endTest();
- }
-
- function startTest()
- {
- if (!window.TextTrackRegion) {
- failTest();
- return;
- }
-
- findMediaElement();
-
- video.src = "" '../../content/test');
- waitForEvent('canplaythrough', testRegionsDisplay);
- }
-
- </script>
- </head>
- <body>
- <p>Tests default DOM layout structure for a TextTrackRegion.</p>
- <video controls>
- <track src="" kind="captions" default _onload_="startTest()">
- </video>
- </body>
-</html>
\ No newline at end of file
Modified: trunk/LayoutTests/media/track/regions-webvtt/text-track-region-list-expected.txt (165828 => 165829)
--- trunk/LayoutTests/media/track/regions-webvtt/text-track-region-list-expected.txt 2014-03-18 19:07:12 UTC (rev 165828)
+++ trunk/LayoutTests/media/track/regions-webvtt/text-track-region-list-expected.txt 2014-03-18 19:16:01 UTC (rev 165829)
@@ -1,7 +1,6 @@
Tests TextTrackRegionList functionality: length, operator[], and getRegionById()
-
** Implicit mode disabled and the regions attribute is null **
EXPECTED (testTrack.track.mode == 'disabled') OK
EXPECTED (testTrack.track.regions == 'null') OK
Modified: trunk/LayoutTests/media/track/regions-webvtt/text-track-region-parser-expected.txt (165828 => 165829)
--- trunk/LayoutTests/media/track/regions-webvtt/text-track-region-parser-expected.txt 2014-03-18 19:07:12 UTC (rev 165828)
+++ trunk/LayoutTests/media/track/regions-webvtt/text-track-region-parser-expected.txt 2014-03-18 19:16:01 UTC (rev 165829)
@@ -1,6 +1,5 @@
Tests proper parsing of various regions present in WebVTT header area.
-
EXPECTED (video.textTracks[0].regions.length == '5') OK
EXPECTED (region.id == 'region_without_settings') OK
Modified: trunk/Source/WebCore/ChangeLog (165828 => 165829)
--- trunk/Source/WebCore/ChangeLog 2014-03-18 19:07:12 UTC (rev 165828)
+++ trunk/Source/WebCore/ChangeLog 2014-03-18 19:16:01 UTC (rev 165829)
@@ -1,3 +1,16 @@
+2014-03-18 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r165815.
+ https://bugs.webkit.org/show_bug.cgi?id=130410
+
+ Broke many VTT tests (Requested by bfulgham on #webkit).
+
+ Reverted changeset:
+
+ "TextTrackRegion Not Implemented"
+ https://bugs.webkit.org/show_bug.cgi?id=116546
+ http://trac.webkit.org/changeset/165815
+
2014-03-18 Renata Hodovan <[email protected]>
Bad cast with toRenderBox in WebCore::RenderView::repaintViewRectangle
Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (165828 => 165829)
--- trunk/Source/WebCore/html/HTMLMediaElement.cpp 2014-03-18 19:07:12 UTC (rev 165828)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp 2014-03-18 19:16:01 UTC (rev 165829)
@@ -1690,14 +1690,6 @@
CueInterval interval = m_cueTree.createInterval(cue->startTime(), endTime, cue.get());
m_cueTree.remove(interval);
-#if ENABLE(WEBVTT_REGIONS)
- // Since the cue will be removed from the media element and likely the
- // TextTrack might also be destructed, notifying the region of the cue
- // removal shouldn't be done.
- if (cue->isRenderable())
- toVTTCue(cue.get())->notifyRegionWhenRemovingDisplayTree(false);
-#endif
-
size_t index = m_currentlyActiveCues.find(interval);
if (index != notFound) {
cue->setIsActive(false);
@@ -1707,11 +1699,6 @@
if (cue->isRenderable())
toVTTCue(cue.get())->removeDisplayTree();
updateActiveTextTrackCues(currentTime());
-
-#if ENABLE(WEBVTT_REGIONS)
- if (cue->isRenderable())
- toVTTCue(cue.get())->notifyRegionWhenRemovingDisplayTree(true);
-#endif
}
#endif
Modified: trunk/Source/WebCore/html/track/LoadableTextTrack.cpp (165828 => 165829)
--- trunk/Source/WebCore/html/track/LoadableTextTrack.cpp 2014-03-18 19:07:12 UTC (rev 165828)
+++ trunk/Source/WebCore/html/track/LoadableTextTrack.cpp 2014-03-18 19:16:01 UTC (rev 165829)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011, 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2011 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -142,7 +142,7 @@
for (size_t i = 0; i < newRegions.size(); ++i) {
newRegions[i]->setTrack(this);
- regions()->add(newRegions[i]);
+ regionList()->add(newRegions[i]);
}
}
#endif
Modified: trunk/Source/WebCore/html/track/TextTrack.cpp (165828 => 165829)
--- trunk/Source/WebCore/html/track/TextTrack.cpp 2014-03-18 19:07:12 UTC (rev 165828)
+++ trunk/Source/WebCore/html/track/TextTrack.cpp 2014-03-18 19:16:01 UTC (rev 165829)
@@ -343,6 +343,11 @@
}
#if ENABLE(VIDEO_TRACK) && ENABLE(WEBVTT_REGIONS)
+TextTrackRegionList* TextTrack::regionList()
+{
+ return ensureTextTrackRegionList();
+}
+
TextTrackRegionList* TextTrack::ensureTextTrackRegionList()
{
if (!m_regions)
Modified: trunk/Source/WebCore/html/track/TextTrack.h (165828 => 165829)
--- trunk/Source/WebCore/html/track/TextTrack.h 2014-03-18 19:07:12 UTC (rev 165828)
+++ trunk/Source/WebCore/html/track/TextTrack.h 2014-03-18 19:16:01 UTC (rev 165829)
@@ -159,6 +159,9 @@
protected:
TextTrack(ScriptExecutionContext*, TextTrackClient*, const AtomicString& kind, const AtomicString& id, const AtomicString& label, const AtomicString& language, TextTrackType);
+#if ENABLE(VIDEO_TRACK) && ENABLE(WEBVTT_REGIONS)
+ TextTrackRegionList* regionList();
+#endif
RefPtr<TextTrackCueList> m_cues;
Modified: trunk/Source/WebCore/html/track/TextTrackRegion.cpp (165828 => 165829)
--- trunk/Source/WebCore/html/track/TextTrackRegion.cpp 2014-03-18 19:07:12 UTC (rev 165828)
+++ trunk/Source/WebCore/html/track/TextTrackRegion.cpp 2014-03-18 19:16:01 UTC (rev 165829)
@@ -76,8 +76,8 @@
, m_regionAnchor(FloatPoint(defaultAnchorPointX, defaultAnchorPointY))
, m_viewportAnchor(FloatPoint(defaultAnchorPointX, defaultAnchorPointY))
, m_scroll(defaultScroll)
- , m_cueContainer(nullptr)
, m_regionDisplayTree(nullptr)
+ , m_cueContainer(nullptr)
, m_track(nullptr)
, m_currentTop(0)
, m_scrollTimer(this, &TextTrackRegion::scrollTimerFired)
@@ -354,8 +354,6 @@
void TextTrackRegion::appendTextTrackCueBox(PassRefPtr<VTTCueBox> displayBox)
{
- ASSERT(m_cueContainer);
-
if (m_cueContainer->contains(displayBox.get()))
return;
Modified: trunk/Source/WebCore/html/track/TextTrackRegion.h (165828 => 165829)
--- trunk/Source/WebCore/html/track/TextTrackRegion.h 2014-03-18 19:07:12 UTC (rev 165828)
+++ trunk/Source/WebCore/html/track/TextTrackRegion.h 2014-03-18 19:16:01 UTC (rev 165829)
@@ -136,10 +136,11 @@
bool m_scroll;
+ RefPtr<HTMLDivElement> m_regionDisplayTree;
+
// The cue container is the container that is scrolled up to obtain the
// effect of scrolling cues when this is enabled for the regions.
RefPtr<HTMLDivElement> m_cueContainer;
- RefPtr<HTMLDivElement> m_regionDisplayTree;
// The member variable track can be a raw pointer as it will never
// reference a destroyed TextTrack, as this member variable
Modified: trunk/Source/WebCore/html/track/VTTCue.cpp (165828 => 165829)
--- trunk/Source/WebCore/html/track/VTTCue.cpp 2014-03-18 19:07:12 UTC (rev 165828)
+++ trunk/Source/WebCore/html/track/VTTCue.cpp 2014-03-18 19:16:01 UTC (rev 165829)
@@ -207,7 +207,6 @@
, m_displayDirection(CSSValueLtr)
, m_displayWritingMode(CSSValueInherit)
, m_displaySize(0)
- , m_notifyRegion(true)
{
// 4. If the text track cue writing direction is horizontal, then let
// writing-mode be 'horizontal-tb'. Otherwise, if the text track cue writing
@@ -461,11 +460,6 @@
m_regionId = regionId;
didChange();
}
-
-void VTTCue::notifyRegionWhenRemovingDisplayTree(bool notifyRegion)
-{
- m_notifyRegion = notifyRegion;
-}
#endif
void VTTCue::setIsActive(bool active)
@@ -753,7 +747,7 @@
{
#if ENABLE(WEBVTT_REGIONS)
// The region needs to be informed about the cue removal.
- if (m_notifyRegion && track()) {
+ if (track()) {
if (TextTrackRegionList* regions = track()->regions()) {
if (TextTrackRegion* region = regions->getRegionById(m_regionId))
region->willRemoveTextTrackCueBox(m_displayTree.get());
Modified: trunk/Source/WebCore/html/track/VTTCue.h (165828 => 165829)
--- trunk/Source/WebCore/html/track/VTTCue.h 2014-03-18 19:07:12 UTC (rev 165828)
+++ trunk/Source/WebCore/html/track/VTTCue.h 2014-03-18 19:16:01 UTC (rev 165829)
@@ -109,7 +109,6 @@
#if ENABLE(WEBVTT_REGIONS)
const String& regionId() const { return m_regionId; }
void setRegionId(const String&);
- void notifyRegionWhenRemovingDisplayTree(bool);
#endif
virtual void setIsActive(bool);
@@ -217,7 +216,6 @@
#if ENABLE(WEBVTT_REGIONS)
String m_regionId;
#endif
- bool m_notifyRegion;
};
VTTCue* toVTTCue(TextTrackCue*);
Modified: trunk/Source/WebCore/html/track/WebVTTParser.cpp (165828 => 165829)
--- trunk/Source/WebCore/html/track/WebVTTParser.cpp 2014-03-18 19:07:12 UTC (rev 165828)
+++ trunk/Source/WebCore/html/track/WebVTTParser.cpp 2014-03-18 19:16:01 UTC (rev 165829)
@@ -167,10 +167,8 @@
break;
case Header:
+ // 13-18 - Allow a header (comment area) under the WEBVTT line.
#if ENABLE(WEBVTT_REGIONS)
- collectMetadataHeader(line);
-
- // 13-18 - Allow a header (comment area) under the WEBVTT line.
if (line.isEmpty()) {
if (m_client && m_regionList.size())
m_client->newRegionsParsed();
@@ -178,7 +176,14 @@
m_state = Id;
break;
}
+ collectHeader(line);
+
+ break;
+
+ case Metadata:
#endif
+ if (line.isEmpty())
+ m_state = Id;
break;
case Id:
@@ -247,7 +252,7 @@
}
#if ENABLE(WEBVTT_REGIONS)
-void WebVTTParser::collectMetadataHeader(const String& line)
+void WebVTTParser::collectHeader(const String& line)
{
// 4.1 Extension of WebVTT header parsing (11 - 15)
DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, regionHeaderName, ("Region", AtomicString::ConstructFromLiteral));
Modified: trunk/Source/WebCore/html/track/WebVTTParser.h (165828 => 165829)
--- trunk/Source/WebCore/html/track/WebVTTParser.h 2014-03-18 19:07:12 UTC (rev 165828)
+++ trunk/Source/WebCore/html/track/WebVTTParser.h 2014-03-18 19:16:01 UTC (rev 165829)
@@ -100,6 +100,9 @@
enum ParseState {
Initial,
Header,
+#if ENABLE(WEBVTT_REGIONS)
+ Metadata,
+#endif
Id,
TimingsAndSettings,
CueText,
@@ -166,7 +169,7 @@
void resetCueValues();
#if ENABLE(WEBVTT_REGIONS)
- void collectMetadataHeader(const String&);
+ void collectHeader(const String&);
void createNewRegion();
#endif