<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[166022] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/166022">166022</a></dd>
<dt>Author</dt> <dd>bfulgham@apple.com</dd>
<dt>Date</dt> <dd>2014-03-20 16:47:16 -0700 (Thu, 20 Mar 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Rename TextTrackRegion/TextTrackRegionList to VTTRegion/VTTRegionList
https://bugs.webkit.org/show_bug.cgi?id=130543
Reviewed by Dean Jackson.
Merged from Blink (patch by philipj@opera.com):
https://chromium.googlesource.com/chromium/blink/+/69ee6d3399d64163e4936ac1bde222036c54c4b8
http://crbug.com/55653003
Source/WebCore:
Tests: media/track/regions-webvtt/vtt-region-constructor.html
media/track/regions-webvtt/vtt-region-display.html
media/track/regions-webvtt/vtt-region-dom-layout.html
media/track/regions-webvtt/vtt-region-list.html
media/track/regions-webvtt/vtt-region-parser.html
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateDisplay):
* html/track/LoadableTextTrack.cpp:
(WebCore::LoadableTextTrack::newRegionsAvailable):
* html/track/TextTrack.cpp:
(WebCore::TextTrack::ensureVTTRegionList):
(WebCore::TextTrack::regions):
(WebCore::TextTrack::addRegion):
(WebCore::TextTrack::removeRegion):
* html/track/TextTrack.h:
* html/track/TextTrack.idl:
* html/track/TextTrackCue.cpp:
* html/track/TextTrackRegion.cpp: Removed.
* html/track/TextTrackRegion.h: Removed.
* html/track/TextTrackRegion.idl: Removed.
* html/track/TextTrackRegionList.cpp: Removed.
* html/track/TextTrackRegionList.h: Removed.
* html/track/TextTrackRegionList.idl: Removed.
* html/track/VTTCue.cpp:
(WebCore::VTTCue::removeDisplayTree):
* html/track/VTTRegion.cpp: Copied from Source/WebCore/html/track/TextTrackRegion.cpp.
(WebCore::VTTRegion::VTTRegion):
(WebCore::VTTRegion::~VTTRegion):
(WebCore::VTTRegion::setTrack):
(WebCore::VTTRegion::setId):
(WebCore::VTTRegion::setWidth):
(WebCore::VTTRegion::setHeight):
(WebCore::VTTRegion::setRegionAnchorX):
(WebCore::VTTRegion::setRegionAnchorY):
(WebCore::VTTRegion::setViewportAnchorX):
(WebCore::VTTRegion::setViewportAnchorY):
(WebCore::VTTRegion::scroll):
(WebCore::VTTRegion::setScroll):
(WebCore::VTTRegion::updateParametersFromRegion):
(WebCore::VTTRegion::setRegionSettings):
(WebCore::VTTRegion::getSettingFromString):
(WebCore::VTTRegion::parseSettingValue):
(WebCore::VTTRegion::parseSetting):
(WebCore::VTTRegion::textTrackCueContainerScrollingClass):
(WebCore::VTTRegion::textTrackCueContainerShadowPseudoId):
(WebCore::VTTRegion::textTrackRegionShadowPseudoId):
(WebCore::VTTRegion::appendTextTrackCueBox):
(WebCore::VTTRegion::displayLastTextTrackCueBox):
(WebCore::VTTRegion::willRemoveTextTrackCueBox):
(WebCore::VTTRegion::getDisplayTree):
(WebCore::VTTRegion::prepareRegionDisplayTree):
(WebCore::VTTRegion::startTimer):
(WebCore::VTTRegion::stopTimer):
(WebCore::VTTRegion::scrollTimerFired):
* html/track/VTTRegion.h: Copied from Source/WebCore/html/track/TextTrackRegion.h.
(WebCore::VTTRegion::create):
* html/track/VTTRegion.idl: Copied from Source/WebCore/html/track/TextTrackRegion.idl.
* html/track/VTTRegionList.cpp: Copied from Source/WebCore/html/track/TextTrackRegionList.cpp.
(WebCore::VTTRegionList::VTTRegionList):
(WebCore::VTTRegionList::length):
(WebCore::VTTRegionList::item):
(WebCore::VTTRegionList::getRegionById):
(WebCore::VTTRegionList::add):
(WebCore::VTTRegionList::remove):
(WebCore::VTTRegionList::clear):
* html/track/VTTRegionList.h: Copied from Source/WebCore/html/track/TextTrackRegionList.h.
(WebCore::VTTRegionList::create):
(WebCore::VTTRegionList::~VTTRegionList):
* html/track/VTTRegionList.idl: Copied from Source/WebCore/html/track/TextTrackRegionList.idl.
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::parseFloatPercentageValue):
(WebCore::WebVTTParser::getNewRegions):
(WebCore::WebVTTParser::createNewRegion):
* html/track/WebVTTParser.h:
* loader/TextTrackLoader.cpp:
(WebCore::TextTrackLoader::getNewRegions):
* loader/TextTrackLoader.h:
LayoutTests:
* media/track/regions-webvtt/text-track-cue-region-attribute.html:
* media/track/regions-webvtt/text-track-region-constructor-expected.txt: Removed.
* media/track/regions-webvtt/text-track-region-constructor.html: Removed.
* media/track/regions-webvtt/text-track-region-display-expected.txt: Removed.
* media/track/regions-webvtt/text-track-region-display.html: Removed.
* media/track/regions-webvtt/text-track-region-dom-layout-expected.txt: Removed.
* media/track/regions-webvtt/text-track-region-dom-layout.html: Removed.
* media/track/regions-webvtt/text-track-region-list-expected.txt: Removed.
* media/track/regions-webvtt/text-track-region-list.html: Removed.
* media/track/regions-webvtt/text-track-region-parser-expected.txt: Removed.
* media/track/regions-webvtt/text-track-region-parser.html: Removed.
* media/track/regions-webvtt/vtt-region-constructor-expected.txt: Copied from LayoutTests/media/track/regions-webvtt/text-track-region-constructor-expected.txt.
* media/track/regions-webvtt/vtt-region-constructor.html: Copied from LayoutTests/media/track/regions-webvtt/text-track-region-constructor.html.
* media/track/regions-webvtt/vtt-region-display-expected.txt: Copied from LayoutTests/media/track/regions-webvtt/text-track-region-display-expected.txt.
* media/track/regions-webvtt/vtt-region-display.html: Copied from LayoutTests/media/track/regions-webvtt/text-track-region-display.html.
* media/track/regions-webvtt/vtt-region-dom-layout-expected.txt: Copied from LayoutTests/media/track/regions-webvtt/text-track-region-dom-layout-expected.txt.
* media/track/regions-webvtt/vtt-region-dom-layout.html: Copied from LayoutTests/media/track/regions-webvtt/text-track-region-dom-layout.html.
* media/track/regions-webvtt/vtt-region-list-expected.txt: Copied from LayoutTests/media/track/regions-webvtt/text-track-region-list-expected.txt.
* media/track/regions-webvtt/vtt-region-list.html: Copied from LayoutTests/media/track/regions-webvtt/text-track-region-list.html.
* media/track/regions-webvtt/vtt-region-parser-expected.txt: Copied from LayoutTests/media/track/regions-webvtt/text-track-region-parser-expected.txt.
* media/track/regions-webvtt/vtt-region-parser.html: Copied from LayoutTests/media/track/regions-webvtt/text-track-region-parser.html.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsmediatrackregionswebvtttexttrackcueregionattributehtml">trunk/LayoutTests/media/track/regions-webvtt/text-track-cue-region-attribute.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesmake">trunk/Source/WebCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorehtmlshadowMediaControlElementscpp">trunk/Source/WebCore/html/shadow/MediaControlElements.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackLoadableTextTrackcpp">trunk/Source/WebCore/html/track/LoadableTextTrack.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackcpp">trunk/Source/WebCore/html/track/TextTrack.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackh">trunk/Source/WebCore/html/track/TextTrack.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackidl">trunk/Source/WebCore/html/track/TextTrack.idl</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackCuecpp">trunk/Source/WebCore/html/track/TextTrackCue.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackVTTCuecpp">trunk/Source/WebCore/html/track/VTTCue.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackWebVTTParsercpp">trunk/Source/WebCore/html/track/WebVTTParser.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackWebVTTParserh">trunk/Source/WebCore/html/track/WebVTTParser.h</a></li>
<li><a href="#trunkSourceWebCoreloaderTextTrackLoadercpp">trunk/Source/WebCore/loader/TextTrackLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderTextTrackLoaderh">trunk/Source/WebCore/loader/TextTrackLoader.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsmediatrackregionswebvttvttregionconstructorexpectedtxt">trunk/LayoutTests/media/track/regions-webvtt/vtt-region-constructor-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmediatrackregionswebvttvttregionconstructorhtml">trunk/LayoutTests/media/track/regions-webvtt/vtt-region-constructor.html</a></li>
<li><a href="#trunkLayoutTestsmediatrackregionswebvttvttregiondisplayexpectedtxt">trunk/LayoutTests/media/track/regions-webvtt/vtt-region-display-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmediatrackregionswebvttvttregiondisplayhtml">trunk/LayoutTests/media/track/regions-webvtt/vtt-region-display.html</a></li>
<li><a href="#trunkLayoutTestsmediatrackregionswebvttvttregiondomlayoutexpectedtxt">trunk/LayoutTests/media/track/regions-webvtt/vtt-region-dom-layout-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmediatrackregionswebvttvttregiondomlayouthtml">trunk/LayoutTests/media/track/regions-webvtt/vtt-region-dom-layout.html</a></li>
<li><a href="#trunkLayoutTestsmediatrackregionswebvttvttregionlistexpectedtxt">trunk/LayoutTests/media/track/regions-webvtt/vtt-region-list-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmediatrackregionswebvttvttregionlisthtml">trunk/LayoutTests/media/track/regions-webvtt/vtt-region-list.html</a></li>
<li><a href="#trunkLayoutTestsmediatrackregionswebvttvttregionparserexpectedtxt">trunk/LayoutTests/media/track/regions-webvtt/vtt-region-parser-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmediatrackregionswebvttvttregionparserhtml">trunk/LayoutTests/media/track/regions-webvtt/vtt-region-parser.html</a></li>
<li><a href="#trunkSourceWebCorehtmltrackVTTRegioncpp">trunk/Source/WebCore/html/track/VTTRegion.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackVTTRegionh">trunk/Source/WebCore/html/track/VTTRegion.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackVTTRegionidl">trunk/Source/WebCore/html/track/VTTRegion.idl</a></li>
<li><a href="#trunkSourceWebCorehtmltrackVTTRegionListcpp">trunk/Source/WebCore/html/track/VTTRegionList.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackVTTRegionListh">trunk/Source/WebCore/html/track/VTTRegionList.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackVTTRegionListidl">trunk/Source/WebCore/html/track/VTTRegionList.idl</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsmediatrackregionswebvtttexttrackregionconstructorexpectedtxt">trunk/LayoutTests/media/track/regions-webvtt/text-track-region-constructor-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmediatrackregionswebvtttexttrackregionconstructorhtml">trunk/LayoutTests/media/track/regions-webvtt/text-track-region-constructor.html</a></li>
<li><a href="#trunkLayoutTestsmediatrackregionswebvtttexttrackregiondisplayexpectedtxt">trunk/LayoutTests/media/track/regions-webvtt/text-track-region-display-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmediatrackregionswebvtttexttrackregiondisplayhtml">trunk/LayoutTests/media/track/regions-webvtt/text-track-region-display.html</a></li>
<li><a href="#trunkLayoutTestsmediatrackregionswebvtttexttrackregiondomlayoutexpectedtxt">trunk/LayoutTests/media/track/regions-webvtt/text-track-region-dom-layout-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmediatrackregionswebvtttexttrackregiondomlayouthtml">trunk/LayoutTests/media/track/regions-webvtt/text-track-region-dom-layout.html</a></li>
<li><a href="#trunkLayoutTestsmediatrackregionswebvtttexttrackregionlistexpectedtxt">trunk/LayoutTests/media/track/regions-webvtt/text-track-region-list-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmediatrackregionswebvtttexttrackregionlisthtml">trunk/LayoutTests/media/track/regions-webvtt/text-track-region-list.html</a></li>
<li><a href="#trunkLayoutTestsmediatrackregionswebvtttexttrackregionparserexpectedtxt">trunk/LayoutTests/media/track/regions-webvtt/text-track-region-parser-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmediatrackregionswebvtttexttrackregionparserhtml">trunk/LayoutTests/media/track/regions-webvtt/text-track-region-parser.html</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackRegioncpp">trunk/Source/WebCore/html/track/TextTrackRegion.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackRegionh">trunk/Source/WebCore/html/track/TextTrackRegion.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackRegionidl">trunk/Source/WebCore/html/track/TextTrackRegion.idl</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackRegionListcpp">trunk/Source/WebCore/html/track/TextTrackRegionList.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackRegionListh">trunk/Source/WebCore/html/track/TextTrackRegionList.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackRegionListidl">trunk/Source/WebCore/html/track/TextTrackRegionList.idl</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/LayoutTests/ChangeLog        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2014-03-20 Brent Fulgham <bfulgham@apple.com>
+
+ Rename TextTrackRegion/TextTrackRegionList to VTTRegion/VTTRegionList
+ https://bugs.webkit.org/show_bug.cgi?id=130543
+
+ Reviewed by Dean Jackson.
+
+ Merged from Blink (patch by philipj@opera.com):
+ https://chromium.googlesource.com/chromium/blink/+/69ee6d3399d64163e4936ac1bde222036c54c4b8
+ http://crbug.com/55653003
+
+ * media/track/regions-webvtt/text-track-cue-region-attribute.html:
+ * media/track/regions-webvtt/text-track-region-constructor-expected.txt: Removed.
+ * media/track/regions-webvtt/text-track-region-constructor.html: Removed.
+ * media/track/regions-webvtt/text-track-region-display-expected.txt: Removed.
+ * media/track/regions-webvtt/text-track-region-display.html: Removed.
+ * media/track/regions-webvtt/text-track-region-dom-layout-expected.txt: Removed.
+ * media/track/regions-webvtt/text-track-region-dom-layout.html: Removed.
+ * media/track/regions-webvtt/text-track-region-list-expected.txt: Removed.
+ * media/track/regions-webvtt/text-track-region-list.html: Removed.
+ * media/track/regions-webvtt/text-track-region-parser-expected.txt: Removed.
+ * media/track/regions-webvtt/text-track-region-parser.html: Removed.
+ * media/track/regions-webvtt/vtt-region-constructor-expected.txt: Copied from LayoutTests/media/track/regions-webvtt/text-track-region-constructor-expected.txt.
+ * media/track/regions-webvtt/vtt-region-constructor.html: Copied from LayoutTests/media/track/regions-webvtt/text-track-region-constructor.html.
+ * media/track/regions-webvtt/vtt-region-display-expected.txt: Copied from LayoutTests/media/track/regions-webvtt/text-track-region-display-expected.txt.
+ * media/track/regions-webvtt/vtt-region-display.html: Copied from LayoutTests/media/track/regions-webvtt/text-track-region-display.html.
+ * media/track/regions-webvtt/vtt-region-dom-layout-expected.txt: Copied from LayoutTests/media/track/regions-webvtt/text-track-region-dom-layout-expected.txt.
+ * media/track/regions-webvtt/vtt-region-dom-layout.html: Copied from LayoutTests/media/track/regions-webvtt/text-track-region-dom-layout.html.
+ * media/track/regions-webvtt/vtt-region-list-expected.txt: Copied from LayoutTests/media/track/regions-webvtt/text-track-region-list-expected.txt.
+ * media/track/regions-webvtt/vtt-region-list.html: Copied from LayoutTests/media/track/regions-webvtt/text-track-region-list.html.
+ * media/track/regions-webvtt/vtt-region-parser-expected.txt: Copied from LayoutTests/media/track/regions-webvtt/text-track-region-parser-expected.txt.
+ * media/track/regions-webvtt/vtt-region-parser.html: Copied from LayoutTests/media/track/regions-webvtt/text-track-region-parser.html.
+
</ins><span class="cx"> 2014-03-20 Hans Muller <hmuller@adobe.com>
</span><span class="cx">
</span><span class="cx"> [CSS Shapes] clamp RasterShape shapeMargin to reference box size
</span></span></pre></div>
<a id="trunkLayoutTestsmediatrackregionswebvtttexttrackcueregionattributehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/media/track/regions-webvtt/text-track-cue-region-attribute.html (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/regions-webvtt/text-track-cue-region-attribute.html        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/LayoutTests/media/track/regions-webvtt/text-track-cue-region-attribute.html        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -10,7 +10,7 @@
</span><span class="cx">
</span><span class="cx"> function startTest()
</span><span class="cx"> {
</span><del>- if (!window.TextTrackRegion) {
</del><ins>+ if (!window.VTTRegion) {
</ins><span class="cx"> failTest();
</span><span class="cx"> return;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkLayoutTestsmediatrackregionswebvtttexttrackregionconstructorexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/media/track/regions-webvtt/text-track-region-constructor-expected.txt (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/regions-webvtt/text-track-region-constructor-expected.txt        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/LayoutTests/media/track/regions-webvtt/text-track-region-constructor-expected.txt        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -1,120 +0,0 @@
</span><del>-Tests the constructor and mutation of TextTrackRegion.
-
-** Test the default indexs of a region. **
-EXPECTED (region.track == 'null') OK
-EXPECTED (region.scroll == '') OK
-EXPECTED (region.viewportAnchorX == '0') OK
-EXPECTED (region.viewportAnchorY == '100') OK
-EXPECTED (region.regionAnchorX == '0') OK
-EXPECTED (region.regionAnchorY == '100') OK
-EXPECTED (region.height == '3') OK
-EXPECTED (region.width == '100') OK
-
-** Test that incorrect mutation keeps previous valid values. **
-RUN(region.scroll = 'invalid-scroll-value')
-Error: SyntaxError: DOM Exception 12
-EXPECTED (region.scroll == '') OK
-
-Invalid percentage value: -1
-RUN(region.viewportAnchorX = invalidPercentageValues[index])
-Error: IndexSizeError: DOM Exception 1
-EXPECTED (region.viewportAnchorX == '0') OK
-RUN(region.viewportAnchorY = invalidPercentageValues[index])
-Error: IndexSizeError: DOM Exception 1
-EXPECTED (region.viewportAnchorY == '100') OK
-RUN(region.regionAnchorX = invalidPercentageValues[index])
-Error: IndexSizeError: DOM Exception 1
-EXPECTED (region.regionAnchorX == '0') OK
-RUN(region.regionAnchorY = invalidPercentageValues[index])
-Error: IndexSizeError: DOM Exception 1
-EXPECTED (region.regionAnchorY == '100') OK
-RUN(region.width = invalidPercentageValues[index])
-Error: IndexSizeError: DOM Exception 1
-EXPECTED (region.width == '100') OK
-
-Invalid percentage value: 101
-RUN(region.viewportAnchorX = invalidPercentageValues[index])
-Error: IndexSizeError: DOM Exception 1
-EXPECTED (region.viewportAnchorX == '0') OK
-RUN(region.viewportAnchorY = invalidPercentageValues[index])
-Error: IndexSizeError: DOM Exception 1
-EXPECTED (region.viewportAnchorY == '100') OK
-RUN(region.regionAnchorX = invalidPercentageValues[index])
-Error: IndexSizeError: DOM Exception 1
-EXPECTED (region.regionAnchorX == '0') OK
-RUN(region.regionAnchorY = invalidPercentageValues[index])
-Error: IndexSizeError: DOM Exception 1
-EXPECTED (region.regionAnchorY == '100') OK
-RUN(region.width = invalidPercentageValues[index])
-Error: IndexSizeError: DOM Exception 1
-EXPECTED (region.width == '100') OK
-
-Invalid percentage value: -Infinity
-RUN(region.viewportAnchorX = invalidPercentageValues[index])
-TypeError: Type error
-EXPECTED (region.viewportAnchorX == '0') OK
-RUN(region.viewportAnchorY = invalidPercentageValues[index])
-TypeError: Type error
-EXPECTED (region.viewportAnchorY == '100') OK
-RUN(region.regionAnchorX = invalidPercentageValues[index])
-TypeError: Type error
-EXPECTED (region.regionAnchorX == '0') OK
-RUN(region.regionAnchorY = invalidPercentageValues[index])
-TypeError: Type error
-EXPECTED (region.regionAnchorY == '100') OK
-RUN(region.width = invalidPercentageValues[index])
-TypeError: Type error
-EXPECTED (region.width == '100') OK
-
-Invalid percentage value: Infinity
-RUN(region.viewportAnchorX = invalidPercentageValues[index])
-TypeError: Type error
-EXPECTED (region.viewportAnchorX == '0') OK
-RUN(region.viewportAnchorY = invalidPercentageValues[index])
-TypeError: Type error
-EXPECTED (region.viewportAnchorY == '100') OK
-RUN(region.regionAnchorX = invalidPercentageValues[index])
-TypeError: Type error
-EXPECTED (region.regionAnchorX == '0') OK
-RUN(region.regionAnchorY = invalidPercentageValues[index])
-TypeError: Type error
-EXPECTED (region.regionAnchorY == '100') OK
-RUN(region.width = invalidPercentageValues[index])
-TypeError: Type error
-EXPECTED (region.width == '100') OK
-
-Invalid percentage value: NaN
-RUN(region.viewportAnchorX = invalidPercentageValues[index])
-TypeError: Type error
-EXPECTED (region.viewportAnchorX == '0') OK
-RUN(region.viewportAnchorY = invalidPercentageValues[index])
-TypeError: Type error
-EXPECTED (region.viewportAnchorY == '100') OK
-RUN(region.regionAnchorX = invalidPercentageValues[index])
-TypeError: Type error
-EXPECTED (region.regionAnchorX == '0') OK
-RUN(region.regionAnchorY = invalidPercentageValues[index])
-TypeError: Type error
-EXPECTED (region.regionAnchorY == '100') OK
-RUN(region.width = invalidPercentageValues[index])
-TypeError: Type error
-EXPECTED (region.width == '100') OK
-RUN(region.height = -1)
-Error: IndexSizeError: DOM Exception 1
-EXPECTED (region.height == '3') OK
-
-** Test that proper mutation keeps assigned value. **
-RUN(region.height = 130)
-EXPECTED (region.height == '130') OK
-RUN(region.viewportAnchorX = 64)
-EXPECTED (region.viewportAnchorX == '64') OK
-RUN(region.viewportAnchorY = 32)
-EXPECTED (region.viewportAnchorY == '32') OK
-RUN(region.regionAnchorX = 16)
-EXPECTED (region.regionAnchorX == '16') OK
-RUN(region.regionAnchorY = 8)
-EXPECTED (region.regionAnchorY == '8') OK
-RUN(region.width = 42)
-EXPECTED (region.width == '42') OK
-END OF TEST
-
</del></span></pre></div>
<a id="trunkLayoutTestsmediatrackregionswebvtttexttrackregionconstructorhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/media/track/regions-webvtt/text-track-region-constructor.html (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/regions-webvtt/text-track-region-constructor.html        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/LayoutTests/media/track/regions-webvtt/text-track-region-constructor.html        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -1,77 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <script src=../../media-file.js></script>
- <script src=../../video-test.js></script>
- <script>
- var region;
- var invalidPercentageValues;
-
- function startTest()
- {
- if (!window.TextTrackRegion) {
- failTest();
- return;
- }
-
- region = new TextTrackRegion();
-
- consoleWrite("** Test the default indexs of a region. **");
- testExpected("region.track", null);
- testExpected("region.scroll", "");
- testExpected("region.viewportAnchorX", 0);
- testExpected("region.viewportAnchorY", 100);
- testExpected("region.regionAnchorX", 0);
- testExpected("region.regionAnchorY", 100);
- testExpected("region.height", 3);
- testExpected("region.width", 100);
-
- consoleWrite("<br>** Test that incorrect mutation keeps previous valid values. **");
- run("region.scroll = 'invalid-scroll-value'");
- testExpected("region.scroll", "");
-
- invalidPercentageValues = [-1, 101, -Infinity, Infinity, NaN];
- for (index in invalidPercentageValues) {
- consoleWrite("<br>Invalid percentage value: " + invalidPercentageValues[index]);
- run("region.viewportAnchorX = invalidPercentageValues[index]");
- testExpected("region.viewportAnchorX", 0);
- run("region.viewportAnchorY = invalidPercentageValues[index]");
- testExpected("region.viewportAnchorY", 100);
- run("region.regionAnchorX = invalidPercentageValues[index]");
- testExpected("region.regionAnchorX", 0);
- run("region.regionAnchorY = invalidPercentageValues[index]");
- testExpected("region.regionAnchorY", 100);
- run("region.width = invalidPercentageValues[index]");
- testExpected("region.width", 100);
- }
-
- run("region.height = -1");
- testExpected("region.height", 3);
-
- consoleWrite("<br>** Test that proper mutation keeps assigned value. **");
- run("region.height = 130");
- testExpected("region.height", 130);
-
- run("region.viewportAnchorX = 64");
- testExpected("region.viewportAnchorX", 64);
- run("region.viewportAnchorY = 32");
- testExpected("region.viewportAnchorY", 32);
- run("region.regionAnchorX = 16");
- testExpected("region.regionAnchorX", 16);
- run("region.regionAnchorY = 8");
- testExpected("region.regionAnchorY", 8);
-
- run("region.width = 42");
- testExpected("region.width", 42);
-
- endTest();
- }
-
- </script>
- </head>
- <body onload="startTest()">
- <p>Tests the constructor and mutation of TextTrackRegion.</p>
- </body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestsmediatrackregionswebvtttexttrackregiondisplayexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/media/track/regions-webvtt/text-track-region-display-expected.txt (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/regions-webvtt/text-track-region-display-expected.txt        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/LayoutTests/media/track/regions-webvtt/text-track-region-display-expected.txt        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -1,53 +0,0 @@
</span><del>-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
-
</del></span></pre></div>
<a id="trunkLayoutTestsmediatrackregionswebvtttexttrackregiondisplayhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/media/track/regions-webvtt/text-track-region-display.html (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/regions-webvtt/text-track-region-display.html        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/LayoutTests/media/track/regions-webvtt/text-track-region-display.html        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -1,108 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <script src=../../media-controls.js></script>
- <script src=../../media-file.js></script>
- <script src=../../video-test.js></script>
- <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 = findMediaFile('video', '../../content/test');
- waitForEvent('canplaythrough', testRegionsDisplay);
- }
-
- </script>
- </head>
- <body>
- <p>Tests default rendering for TextTrackCues that belong to a TextTrackRegion.</p>
- <video controls>
- <track src="../captions-webvtt/captions-regions.vtt" kind="captions" default onload="startTest()">
- </video>
- </body>
-</html>
</del><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsmediatrackregionswebvtttexttrackregiondomlayoutexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/media/track/regions-webvtt/text-track-region-dom-layout-expected.txt (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/regions-webvtt/text-track-region-dom-layout-expected.txt        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/LayoutTests/media/track/regions-webvtt/text-track-region-dom-layout-expected.txt        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -1,20 +0,0 @@
</span><del>-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
-
</del></span></pre></div>
<a id="trunkLayoutTestsmediatrackregionswebvtttexttrackregiondomlayouthtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/media/track/regions-webvtt/text-track-region-dom-layout.html (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/regions-webvtt/text-track-region-dom-layout.html        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/LayoutTests/media/track/regions-webvtt/text-track-region-dom-layout.html        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -1,64 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <script src=../../media-controls.js></script>
- <script src=../../media-file.js></script>
- <script src=../../video-test.js></script>
- <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 = findMediaFile('video', '../../content/test');
- waitForEvent('canplaythrough', testRegionsDisplay);
- }
-
- </script>
- </head>
- <body>
- <p>Tests default DOM layout structure for a TextTrackRegion.</p>
- <video controls>
- <track src="../captions-webvtt/captions-regions.vtt" kind="captions" default onload="startTest()">
- </video>
- </body>
-</html>
</del><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsmediatrackregionswebvtttexttrackregionlistexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/media/track/regions-webvtt/text-track-region-list-expected.txt (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/regions-webvtt/text-track-region-list-expected.txt        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/LayoutTests/media/track/regions-webvtt/text-track-region-list-expected.txt        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -1,42 +0,0 @@
</span><del>-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
-
-** The regions attribute should be an empty TextTrackRegionList **
-EXPECTED (regions != null == 'true') OK
-EXPECTED (regions.length == '0') OK
-
-** The default value of the track attribute of the region is null**
-EXPECTED (region.track == 'null') OK
-
-** The addRegion() method properly updates the TextTrackRegionList object **
-EXPECTED (regions.length == '1') OK
-EXPECTED (regions[0] == region == 'true') OK
-EXPECTED (regions[0].track == testTrack.track == 'true') OK
-
-** The track attribute should correctly reflect the track to which the region was added to**
-EXPECTED (region.track == testTrack.track == 'true') OK
-
-** Adding a region with an existing id should update the existing region **
-EXPECTED (regions[0].viewportAnchorX == '59') OK
-EXPECTED (regions[0].viewportAnchorY == '68') OK
-EXPECTED (regions[0].regionAnchorX == '20') OK
-EXPECTED (regions[0].regionAnchorY == '30') OK
-EXPECTED (regions[0].height == '5') OK
-EXPECTED (regions[0].width == '87') OK
-EXPECTED (regions[0].scroll == 'up') OK
-EXPECTED (regions[0] != updatedRegion == 'true') OK
-
-** Add the region back and check if removeRegion() removes it properly **
-EXPECTED (regions.length == '1') OK
-EXPECTED (regions.length == '0') OK
-
-** In case the region is not found, NotFoundError should be thrown **
-Error: NotFoundError: DOM Exception 8
-
-END OF TEST
-
</del></span></pre></div>
<a id="trunkLayoutTestsmediatrackregionswebvtttexttrackregionlisthtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/media/track/regions-webvtt/text-track-region-list.html (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/regions-webvtt/text-track-region-list.html        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/LayoutTests/media/track/regions-webvtt/text-track-region-list.html        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -1,98 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <script src=../../media-file.js></script>
- <script src=../../video-test.js></script>
- <script>
- var testTrack;
- var region;
- var regions;
- var updatedRegion;
-
- function startTest()
- {
- testTrack = document.getElementsByTagName('track')[0];
-
- consoleWrite("<br>** Implicit mode disabled and the regions attribute is null **");
- testExpected("testTrack.track.mode", "disabled");
- testExpected("testTrack.track.regions", null);
-
- testTrack.track.mode = "hidden";
- regions = testTrack.track.regions;
-
- consoleWrite("<br>** The regions attribute should be an empty TextTrackRegionList **");
- testExpected("regions != null", true);
- testExpected("regions.length", 0);
-
- region = new TextTrackRegion();
- region.id = "TestId";
-
- consoleWrite("<br>** The default value of the track attribute of the region is null**");
- testExpected("region.track", null);
-
- testTrack.track.addRegion(region);
-
- consoleWrite("<br>** The addRegion() method properly updates the TextTrackRegionList object **");
- testExpected("regions.length", 1);
- testExpected("regions[0] == region", true);
- testExpected("regions[0].track == testTrack.track", true);
-
- consoleWrite("<br>** The track attribute should correctly reflect the track to which the region was added to**");
- testExpected("region.track == testTrack.track", true);
-
- updatedRegion = new TextTrackRegion();
- updatedRegion.id = region.id;
- updatedRegion.viewportAnchorX = 59;
- updatedRegion.viewportAnchorY = 68;
- updatedRegion.regionAnchorX = 20;
- updatedRegion.regionAnchorY = 30;
- updatedRegion.height = 5;
- updatedRegion.width = 87;
- updatedRegion.scroll = "up";
-
- consoleWrite("<br>** Adding a region with an existing id should update the existing region **");
- testTrack.track.addRegion(updatedRegion);
- testExpected("regions[0].viewportAnchorX", updatedRegion.viewportAnchorX);
- testExpected("regions[0].viewportAnchorY", updatedRegion.viewportAnchorY);
- testExpected("regions[0].regionAnchorX", updatedRegion.regionAnchorX);
- testExpected("regions[0].regionAnchorY", updatedRegion.regionAnchorY);
- testExpected("regions[0].height", updatedRegion.height);
- testExpected("regions[0].width", updatedRegion.width);
- testExpected("regions[0].scroll", updatedRegion.scroll);
-
- testExpected("regions[0] != updatedRegion", true);
-
- consoleWrite("<br>** Add the region back and check if removeRegion() removes it properly **");
- testTrack.track.addRegion(region);
- testExpected("regions.length", 1);
- testTrack.track.removeRegion(region);
- testExpected("regions.length", 0);
-
- consoleWrite("<br>** In case the region is not found, NotFoundError should be thrown **");
- try {
- testTrack.track.removeRegion(region);
- } catch(e) {
- consoleWrite(e);
- }
-
- // FIXME(109818): Update test for multiple initial regions (after parsing is supported).
-
- consoleWrite("");
- endTest();
- }
-
- function startTestWithDelay()
- {
- setTimeout(startTest, 100);
- }
- </script>
- </head>
- <body onload="startTestWithDelay()">
- <p>Tests TextTrackRegionList functionality: length, operator[], and getRegionById()</p>
- <video>
- <track id="testTrack" src="captions-webvtt/captions-fast.vtt">
- </video>
- </body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestsmediatrackregionswebvtttexttrackregionparserexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/media/track/regions-webvtt/text-track-region-parser-expected.txt (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/regions-webvtt/text-track-region-parser-expected.txt        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/LayoutTests/media/track/regions-webvtt/text-track-region-parser-expected.txt        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -1,29 +0,0 @@
</span><del>-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
-
-EXPECTED (region.id == 'region_with_all_settings') OK
-EXPECTED (region.width == '32') OK
-EXPECTED (region.height == '5') OK
-EXPECTED (region.regionAnchorX == '41') OK
-EXPECTED (region.regionAnchorY == '20') OK
-EXPECTED (region.viewportAnchorX == '31') OK
-EXPECTED (region.viewportAnchorY == '84') OK
-EXPECTED (region.scroll == 'up') OK
-
-EXPECTED (region.id == 'region_floating_point_anchor') OK
-EXPECTED (Math.round(region.regionAnchorX * 1000) == '41133') OK
-EXPECTED (Math.round(region.regionAnchorY * 1000) == '20420') OK
-EXPECTED (Math.round(region.viewportAnchorX * 1000) == '32330') OK
-EXPECTED (Math.round(region.viewportAnchorY * 1000) == '32440') OK
-
-EXPECTED (region.id == 'not_unique_id') OK
-EXPECTED (region.width == '67') OK
-
-EXPECTED (region.id == '') OK
-
-END OF TEST
-
</del></span></pre></div>
<a id="trunkLayoutTestsmediatrackregionswebvtttexttrackregionparserhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/media/track/regions-webvtt/text-track-region-parser.html (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/regions-webvtt/text-track-region-parser.html        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/LayoutTests/media/track/regions-webvtt/text-track-region-parser.html        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -1,67 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <script src=../../media-file.js></script>
- <script src=../../video-test.js></script>
- <script>
- var region;
-
- function startTest()
- {
- if (!window.TextTrackRegion) {
- failTest();
- return;
- }
-
- findMediaElement();
- testExpected("video.textTracks[0].regions.length", 5);
-
- consoleWrite("");
- region = video.textTracks[0].regions[0];
- testExpected("region.id", "region_without_settings");
-
- consoleWrite("");
- region = video.textTracks[0].regions[1];
- testExpected("region.id", "region_with_all_settings");
- testExpected("region.width", 32);
- testExpected("region.height", 5);
- testExpected("region.regionAnchorX", 41);
- testExpected("region.regionAnchorY", 20);
- testExpected("region.viewportAnchorX", 31);
- testExpected("region.viewportAnchorY", 84);
- testExpected("region.scroll", "up");
-
- consoleWrite("");
- region = video.textTracks[0].regions[2];
- testExpected("region.id", "region_floating_point_anchor");
- testExpected("Math.round(region.regionAnchorX * 1000)", 41133);
- testExpected("Math.round(region.regionAnchorY * 1000)", 20420);
- testExpected("Math.round(region.viewportAnchorX * 1000)", 32330);
- testExpected("Math.round(region.viewportAnchorY * 1000)", 32440);
-
- consoleWrite("");
- region = video.textTracks[0].regions[3];
- testExpected("region.id", "not_unique_id");
- testExpected("region.width", 67);
-
- consoleWrite("");
- region = video.textTracks[0].regions[4];
- testExpected("region.id", "");
-
- consoleWrite("");
- endTest();
- }
-
- setCaptionDisplayMode('Automatic');
- </script>
- </head>
- <body>
- <p>Tests proper parsing of various regions present in WebVTT header area.</p>
- <video controls>
- <track src="../captions-webvtt/header-regions.vtt" kind="captions" default onload="startTest()">
- </video>
-
- </body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestsmediatrackregionswebvttvttregionconstructorexpectedtxtfromrev165996trunkLayoutTestsmediatrackregionswebvtttexttrackregionconstructorexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/media/track/regions-webvtt/vtt-region-constructor-expected.txt (from rev 165996, trunk/LayoutTests/media/track/regions-webvtt/text-track-region-constructor-expected.txt) (0 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/regions-webvtt/vtt-region-constructor-expected.txt         (rev 0)
+++ trunk/LayoutTests/media/track/regions-webvtt/vtt-region-constructor-expected.txt        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -0,0 +1,122 @@
</span><ins>+Tests the constructor and mutation of VTTRegion.
+
+** Test instanceof VTTRegion. **
+EXPECTED (region instanceof VTTRegion == 'true') OK
+** Test the default indexs of a region. **
+EXPECTED (region.track == 'null') OK
+EXPECTED (region.scroll == '') OK
+EXPECTED (region.viewportAnchorX == '0') OK
+EXPECTED (region.viewportAnchorY == '100') OK
+EXPECTED (region.regionAnchorX == '0') OK
+EXPECTED (region.regionAnchorY == '100') OK
+EXPECTED (region.height == '3') OK
+EXPECTED (region.width == '100') OK
+
+** Test that incorrect mutation keeps previous valid values. **
+RUN(region.scroll = 'invalid-scroll-value')
+Error: SyntaxError: DOM Exception 12
+EXPECTED (region.scroll == '') OK
+
+Invalid percentage value: -1
+RUN(region.viewportAnchorX = invalidPercentageValues[index])
+Error: IndexSizeError: DOM Exception 1
+EXPECTED (region.viewportAnchorX == '0') OK
+RUN(region.viewportAnchorY = invalidPercentageValues[index])
+Error: IndexSizeError: DOM Exception 1
+EXPECTED (region.viewportAnchorY == '100') OK
+RUN(region.regionAnchorX = invalidPercentageValues[index])
+Error: IndexSizeError: DOM Exception 1
+EXPECTED (region.regionAnchorX == '0') OK
+RUN(region.regionAnchorY = invalidPercentageValues[index])
+Error: IndexSizeError: DOM Exception 1
+EXPECTED (region.regionAnchorY == '100') OK
+RUN(region.width = invalidPercentageValues[index])
+Error: IndexSizeError: DOM Exception 1
+EXPECTED (region.width == '100') OK
+
+Invalid percentage value: 101
+RUN(region.viewportAnchorX = invalidPercentageValues[index])
+Error: IndexSizeError: DOM Exception 1
+EXPECTED (region.viewportAnchorX == '0') OK
+RUN(region.viewportAnchorY = invalidPercentageValues[index])
+Error: IndexSizeError: DOM Exception 1
+EXPECTED (region.viewportAnchorY == '100') OK
+RUN(region.regionAnchorX = invalidPercentageValues[index])
+Error: IndexSizeError: DOM Exception 1
+EXPECTED (region.regionAnchorX == '0') OK
+RUN(region.regionAnchorY = invalidPercentageValues[index])
+Error: IndexSizeError: DOM Exception 1
+EXPECTED (region.regionAnchorY == '100') OK
+RUN(region.width = invalidPercentageValues[index])
+Error: IndexSizeError: DOM Exception 1
+EXPECTED (region.width == '100') OK
+
+Invalid percentage value: -Infinity
+RUN(region.viewportAnchorX = invalidPercentageValues[index])
+TypeError: Type error
+EXPECTED (region.viewportAnchorX == '0') OK
+RUN(region.viewportAnchorY = invalidPercentageValues[index])
+TypeError: Type error
+EXPECTED (region.viewportAnchorY == '100') OK
+RUN(region.regionAnchorX = invalidPercentageValues[index])
+TypeError: Type error
+EXPECTED (region.regionAnchorX == '0') OK
+RUN(region.regionAnchorY = invalidPercentageValues[index])
+TypeError: Type error
+EXPECTED (region.regionAnchorY == '100') OK
+RUN(region.width = invalidPercentageValues[index])
+TypeError: Type error
+EXPECTED (region.width == '100') OK
+
+Invalid percentage value: Infinity
+RUN(region.viewportAnchorX = invalidPercentageValues[index])
+TypeError: Type error
+EXPECTED (region.viewportAnchorX == '0') OK
+RUN(region.viewportAnchorY = invalidPercentageValues[index])
+TypeError: Type error
+EXPECTED (region.viewportAnchorY == '100') OK
+RUN(region.regionAnchorX = invalidPercentageValues[index])
+TypeError: Type error
+EXPECTED (region.regionAnchorX == '0') OK
+RUN(region.regionAnchorY = invalidPercentageValues[index])
+TypeError: Type error
+EXPECTED (region.regionAnchorY == '100') OK
+RUN(region.width = invalidPercentageValues[index])
+TypeError: Type error
+EXPECTED (region.width == '100') OK
+
+Invalid percentage value: NaN
+RUN(region.viewportAnchorX = invalidPercentageValues[index])
+TypeError: Type error
+EXPECTED (region.viewportAnchorX == '0') OK
+RUN(region.viewportAnchorY = invalidPercentageValues[index])
+TypeError: Type error
+EXPECTED (region.viewportAnchorY == '100') OK
+RUN(region.regionAnchorX = invalidPercentageValues[index])
+TypeError: Type error
+EXPECTED (region.regionAnchorX == '0') OK
+RUN(region.regionAnchorY = invalidPercentageValues[index])
+TypeError: Type error
+EXPECTED (region.regionAnchorY == '100') OK
+RUN(region.width = invalidPercentageValues[index])
+TypeError: Type error
+EXPECTED (region.width == '100') OK
+RUN(region.height = -1)
+Error: IndexSizeError: DOM Exception 1
+EXPECTED (region.height == '3') OK
+
+** Test that proper mutation keeps assigned value. **
+RUN(region.height = 130)
+EXPECTED (region.height == '130') OK
+RUN(region.viewportAnchorX = 64)
+EXPECTED (region.viewportAnchorX == '64') OK
+RUN(region.viewportAnchorY = 32)
+EXPECTED (region.viewportAnchorY == '32') OK
+RUN(region.regionAnchorX = 16)
+EXPECTED (region.regionAnchorX == '16') OK
+RUN(region.regionAnchorY = 8)
+EXPECTED (region.regionAnchorY == '8') OK
+RUN(region.width = 42)
+EXPECTED (region.width == '42') OK
+END OF TEST
+
</ins></span></pre></div>
<a id="trunkLayoutTestsmediatrackregionswebvttvttregionconstructorhtmlfromrev165996trunkLayoutTestsmediatrackregionswebvtttexttrackregionconstructorhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/media/track/regions-webvtt/vtt-region-constructor.html (from rev 165996, trunk/LayoutTests/media/track/regions-webvtt/text-track-region-constructor.html) (0 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/regions-webvtt/vtt-region-constructor.html         (rev 0)
+++ trunk/LayoutTests/media/track/regions-webvtt/vtt-region-constructor.html        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -0,0 +1,79 @@
</span><ins>+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+ <script src=../../media-file.js></script>
+ <script src=../../video-test.js></script>
+ <script>
+ var region;
+ var invalidPercentageValues;
+
+ function startTest()
+ {
+ if (!window.VTTRegion) {
+ failTest();
+ return;
+ }
+
+ region = new VTTRegion();
+ consoleWrite("** Test instanceof VTTRegion. **");
+ testExpected("region instanceof VTTRegion", true);
+
+ consoleWrite("** Test the default indexs of a region. **");
+ testExpected("region.track", null);
+ testExpected("region.scroll", "");
+ testExpected("region.viewportAnchorX", 0);
+ testExpected("region.viewportAnchorY", 100);
+ testExpected("region.regionAnchorX", 0);
+ testExpected("region.regionAnchorY", 100);
+ testExpected("region.height", 3);
+ testExpected("region.width", 100);
+
+ consoleWrite("<br>** Test that incorrect mutation keeps previous valid values. **");
+ run("region.scroll = 'invalid-scroll-value'");
+ testExpected("region.scroll", "");
+
+ invalidPercentageValues = [-1, 101, -Infinity, Infinity, NaN];
+ for (index in invalidPercentageValues) {
+ consoleWrite("<br>Invalid percentage value: " + invalidPercentageValues[index]);
+ run("region.viewportAnchorX = invalidPercentageValues[index]");
+ testExpected("region.viewportAnchorX", 0);
+ run("region.viewportAnchorY = invalidPercentageValues[index]");
+ testExpected("region.viewportAnchorY", 100);
+ run("region.regionAnchorX = invalidPercentageValues[index]");
+ testExpected("region.regionAnchorX", 0);
+ run("region.regionAnchorY = invalidPercentageValues[index]");
+ testExpected("region.regionAnchorY", 100);
+ run("region.width = invalidPercentageValues[index]");
+ testExpected("region.width", 100);
+ }
+
+ run("region.height = -1");
+ testExpected("region.height", 3);
+
+ consoleWrite("<br>** Test that proper mutation keeps assigned value. **");
+ run("region.height = 130");
+ testExpected("region.height", 130);
+
+ run("region.viewportAnchorX = 64");
+ testExpected("region.viewportAnchorX", 64);
+ run("region.viewportAnchorY = 32");
+ testExpected("region.viewportAnchorY", 32);
+ run("region.regionAnchorX = 16");
+ testExpected("region.regionAnchorX", 16);
+ run("region.regionAnchorY = 8");
+ testExpected("region.regionAnchorY", 8);
+
+ run("region.width = 42");
+ testExpected("region.width", 42);
+
+ endTest();
+ }
+
+ </script>
+ </head>
+ <body onload="startTest()">
+ <p>Tests the constructor and mutation of VTTRegion.</p>
+ </body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsmediatrackregionswebvttvttregiondisplayexpectedtxtfromrev165996trunkLayoutTestsmediatrackregionswebvtttexttrackregiondisplayexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/media/track/regions-webvtt/vtt-region-display-expected.txt (from rev 165996, trunk/LayoutTests/media/track/regions-webvtt/text-track-region-display-expected.txt) (0 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/regions-webvtt/vtt-region-display-expected.txt         (rev 0)
+++ trunk/LayoutTests/media/track/regions-webvtt/vtt-region-display-expected.txt        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+Tests default rendering for TextTrackCues that belong to a VTTRegion.
+
+
+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
+
</ins></span></pre></div>
<a id="trunkLayoutTestsmediatrackregionswebvttvttregiondisplayhtmlfromrev165996trunkLayoutTestsmediatrackregionswebvtttexttrackregiondisplayhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/media/track/regions-webvtt/vtt-region-display.html (from rev 165996, trunk/LayoutTests/media/track/regions-webvtt/text-track-region-display.html) (0 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/regions-webvtt/vtt-region-display.html         (rev 0)
+++ trunk/LayoutTests/media/track/regions-webvtt/vtt-region-display.html        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -0,0 +1,108 @@
</span><ins>+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+ <script src=../../media-controls.js></script>
+ <script src=../../media-file.js></script>
+ <script src=../../video-test.js></script>
+ <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.VTTRegion) {
+ failTest();
+ return;
+ }
+
+ findMediaElement();
+
+ video.src = findMediaFile('video', '../../content/test');
+ waitForEvent('canplaythrough', testRegionsDisplay);
+ }
+
+ </script>
+ </head>
+ <body>
+ <p>Tests default rendering for TextTrackCues that belong to a VTTRegion.</p>
+ <video controls>
+ <track src="../captions-webvtt/captions-regions.vtt" kind="captions" default onload="startTest()">
+ </video>
+ </body>
+</html>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsmediatrackregionswebvttvttregiondomlayoutexpectedtxtfromrev165996trunkLayoutTestsmediatrackregionswebvtttexttrackregiondomlayoutexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/media/track/regions-webvtt/vtt-region-dom-layout-expected.txt (from rev 165996, trunk/LayoutTests/media/track/regions-webvtt/text-track-region-dom-layout-expected.txt) (0 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/regions-webvtt/vtt-region-dom-layout-expected.txt         (rev 0)
+++ trunk/LayoutTests/media/track/regions-webvtt/vtt-region-dom-layout-expected.txt        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+Tests default DOM layout structure for a VTTRegion.
+
+
+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
+
</ins></span></pre></div>
<a id="trunkLayoutTestsmediatrackregionswebvttvttregiondomlayouthtmlfromrev165996trunkLayoutTestsmediatrackregionswebvtttexttrackregiondomlayouthtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/media/track/regions-webvtt/vtt-region-dom-layout.html (from rev 165996, trunk/LayoutTests/media/track/regions-webvtt/text-track-region-dom-layout.html) (0 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/regions-webvtt/vtt-region-dom-layout.html         (rev 0)
+++ trunk/LayoutTests/media/track/regions-webvtt/vtt-region-dom-layout.html        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -0,0 +1,64 @@
</span><ins>+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+ <script src=../../media-controls.js></script>
+ <script src=../../media-file.js></script>
+ <script src=../../video-test.js></script>
+ <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.VTTRegion) {
+ failTest();
+ return;
+ }
+
+ findMediaElement();
+
+ video.src = findMediaFile('video', '../../content/test');
+ waitForEvent('canplaythrough', testRegionsDisplay);
+ }
+
+ </script>
+ </head>
+ <body>
+ <p>Tests default DOM layout structure for a VTTRegion.</p>
+ <video controls>
+ <track src="../captions-webvtt/captions-regions.vtt" kind="captions" default onload="startTest()">
+ </video>
+ </body>
+</html>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsmediatrackregionswebvttvttregionlistexpectedtxtfromrev165996trunkLayoutTestsmediatrackregionswebvtttexttrackregionlistexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/media/track/regions-webvtt/vtt-region-list-expected.txt (from rev 165996, trunk/LayoutTests/media/track/regions-webvtt/text-track-region-list-expected.txt) (0 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/regions-webvtt/vtt-region-list-expected.txt         (rev 0)
+++ trunk/LayoutTests/media/track/regions-webvtt/vtt-region-list-expected.txt        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+Tests VTTRegionList 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
+
+** The regions attribute should be an empty VTTRegionList **
+EXPECTED (regions != null == 'true') OK
+EXPECTED (regions.length == '0') OK
+
+** The default value of the track attribute of the region is null**
+EXPECTED (region.track == 'null') OK
+
+** The addRegion() method properly updates the VTTRegionList object **
+EXPECTED (regions.length == '1') OK
+EXPECTED (regions[0] == region == 'true') OK
+EXPECTED (regions[0].track == testTrack.track == 'true') OK
+
+** The track attribute should correctly reflect the track to which the region was added to**
+EXPECTED (region.track == testTrack.track == 'true') OK
+
+** Adding a region with an existing id should update the existing region **
+EXPECTED (regions[0].viewportAnchorX == '59') OK
+EXPECTED (regions[0].viewportAnchorY == '68') OK
+EXPECTED (regions[0].regionAnchorX == '20') OK
+EXPECTED (regions[0].regionAnchorY == '30') OK
+EXPECTED (regions[0].height == '5') OK
+EXPECTED (regions[0].width == '87') OK
+EXPECTED (regions[0].scroll == 'up') OK
+EXPECTED (regions[0] != updatedRegion == 'true') OK
+
+** Add the region back and check if removeRegion() removes it properly **
+EXPECTED (regions.length == '1') OK
+EXPECTED (regions.length == '0') OK
+
+** In case the region is not found, NotFoundError should be thrown **
+Error: NotFoundError: DOM Exception 8
+
+END OF TEST
+
</ins></span></pre></div>
<a id="trunkLayoutTestsmediatrackregionswebvttvttregionlisthtmlfromrev165996trunkLayoutTestsmediatrackregionswebvtttexttrackregionlisthtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/media/track/regions-webvtt/vtt-region-list.html (from rev 165996, trunk/LayoutTests/media/track/regions-webvtt/text-track-region-list.html) (0 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/regions-webvtt/vtt-region-list.html         (rev 0)
+++ trunk/LayoutTests/media/track/regions-webvtt/vtt-region-list.html        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -0,0 +1,98 @@
</span><ins>+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+ <script src=../../media-file.js></script>
+ <script src=../../video-test.js></script>
+ <script>
+ var testTrack;
+ var region;
+ var regions;
+ var updatedRegion;
+
+ function startTest()
+ {
+ testTrack = document.getElementsByTagName('track')[0];
+
+ consoleWrite("<br>** Implicit mode disabled and the regions attribute is null **");
+ testExpected("testTrack.track.mode", "disabled");
+ testExpected("testTrack.track.regions", null);
+
+ testTrack.track.mode = "hidden";
+ regions = testTrack.track.regions;
+
+ consoleWrite("<br>** The regions attribute should be an empty VTTRegionList **");
+ testExpected("regions != null", true);
+ testExpected("regions.length", 0);
+
+ region = new VTTRegion();
+ region.id = "TestId";
+
+ consoleWrite("<br>** The default value of the track attribute of the region is null**");
+ testExpected("region.track", null);
+
+ testTrack.track.addRegion(region);
+
+ consoleWrite("<br>** The addRegion() method properly updates the VTTRegionList object **");
+ testExpected("regions.length", 1);
+ testExpected("regions[0] == region", true);
+ testExpected("regions[0].track == testTrack.track", true);
+
+ consoleWrite("<br>** The track attribute should correctly reflect the track to which the region was added to**");
+ testExpected("region.track == testTrack.track", true);
+
+ updatedRegion = new VTTRegion();
+ updatedRegion.id = region.id;
+ updatedRegion.viewportAnchorX = 59;
+ updatedRegion.viewportAnchorY = 68;
+ updatedRegion.regionAnchorX = 20;
+ updatedRegion.regionAnchorY = 30;
+ updatedRegion.height = 5;
+ updatedRegion.width = 87;
+ updatedRegion.scroll = "up";
+
+ consoleWrite("<br>** Adding a region with an existing id should update the existing region **");
+ testTrack.track.addRegion(updatedRegion);
+ testExpected("regions[0].viewportAnchorX", updatedRegion.viewportAnchorX);
+ testExpected("regions[0].viewportAnchorY", updatedRegion.viewportAnchorY);
+ testExpected("regions[0].regionAnchorX", updatedRegion.regionAnchorX);
+ testExpected("regions[0].regionAnchorY", updatedRegion.regionAnchorY);
+ testExpected("regions[0].height", updatedRegion.height);
+ testExpected("regions[0].width", updatedRegion.width);
+ testExpected("regions[0].scroll", updatedRegion.scroll);
+
+ testExpected("regions[0] != updatedRegion", true);
+
+ consoleWrite("<br>** Add the region back and check if removeRegion() removes it properly **");
+ testTrack.track.addRegion(region);
+ testExpected("regions.length", 1);
+ testTrack.track.removeRegion(region);
+ testExpected("regions.length", 0);
+
+ consoleWrite("<br>** In case the region is not found, NotFoundError should be thrown **");
+ try {
+ testTrack.track.removeRegion(region);
+ } catch(e) {
+ consoleWrite(e);
+ }
+
+ // FIXME(109818): Update test for multiple initial regions (after parsing is supported).
+
+ consoleWrite("");
+ endTest();
+ }
+
+ function startTestWithDelay()
+ {
+ setTimeout(startTest, 100);
+ }
+ </script>
+ </head>
+ <body onload="startTestWithDelay()">
+ <p>Tests VTTRegionList functionality: length, operator[], and getRegionById()</p>
+ <video>
+ <track id="testTrack" src="../captions-webvtt/captions-fast.vtt">
+ </video>
+ </body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsmediatrackregionswebvttvttregionparserexpectedtxtfromrev165996trunkLayoutTestsmediatrackregionswebvtttexttrackregionparserexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/media/track/regions-webvtt/vtt-region-parser-expected.txt (from rev 165996, trunk/LayoutTests/media/track/regions-webvtt/text-track-region-parser-expected.txt) (0 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/regions-webvtt/vtt-region-parser-expected.txt         (rev 0)
+++ trunk/LayoutTests/media/track/regions-webvtt/vtt-region-parser-expected.txt        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+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
+
+EXPECTED (region.id == 'region_with_all_settings') OK
+EXPECTED (region.width == '32') OK
+EXPECTED (region.height == '5') OK
+EXPECTED (region.regionAnchorX == '41') OK
+EXPECTED (region.regionAnchorY == '20') OK
+EXPECTED (region.viewportAnchorX == '31') OK
+EXPECTED (region.viewportAnchorY == '84') OK
+EXPECTED (region.scroll == 'up') OK
+
+EXPECTED (region.id == 'region_floating_point_anchor') OK
+EXPECTED (Math.round(region.regionAnchorX * 1000) == '41133') OK
+EXPECTED (Math.round(region.regionAnchorY * 1000) == '20420') OK
+EXPECTED (Math.round(region.viewportAnchorX * 1000) == '32330') OK
+EXPECTED (Math.round(region.viewportAnchorY * 1000) == '32440') OK
+
+EXPECTED (region.id == 'not_unique_id') OK
+EXPECTED (region.width == '67') OK
+
+EXPECTED (region.id == '') OK
+
+END OF TEST
+
</ins></span></pre></div>
<a id="trunkLayoutTestsmediatrackregionswebvttvttregionparserhtmlfromrev165996trunkLayoutTestsmediatrackregionswebvtttexttrackregionparserhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/media/track/regions-webvtt/vtt-region-parser.html (from rev 165996, trunk/LayoutTests/media/track/regions-webvtt/text-track-region-parser.html) (0 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/regions-webvtt/vtt-region-parser.html         (rev 0)
+++ trunk/LayoutTests/media/track/regions-webvtt/vtt-region-parser.html        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -0,0 +1,67 @@
</span><ins>+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+ <script src=../../media-file.js></script>
+ <script src=../../video-test.js></script>
+ <script>
+ var region;
+
+ function startTest()
+ {
+ if (!window.VTTRegion) {
+ failTest();
+ return;
+ }
+
+ findMediaElement();
+ testExpected("video.textTracks[0].regions.length", 5);
+
+ consoleWrite("");
+ region = video.textTracks[0].regions[0];
+ testExpected("region.id", "region_without_settings");
+
+ consoleWrite("");
+ region = video.textTracks[0].regions[1];
+ testExpected("region.id", "region_with_all_settings");
+ testExpected("region.width", 32);
+ testExpected("region.height", 5);
+ testExpected("region.regionAnchorX", 41);
+ testExpected("region.regionAnchorY", 20);
+ testExpected("region.viewportAnchorX", 31);
+ testExpected("region.viewportAnchorY", 84);
+ testExpected("region.scroll", "up");
+
+ consoleWrite("");
+ region = video.textTracks[0].regions[2];
+ testExpected("region.id", "region_floating_point_anchor");
+ testExpected("Math.round(region.regionAnchorX * 1000)", 41133);
+ testExpected("Math.round(region.regionAnchorY * 1000)", 20420);
+ testExpected("Math.round(region.viewportAnchorX * 1000)", 32330);
+ testExpected("Math.round(region.viewportAnchorY * 1000)", 32440);
+
+ consoleWrite("");
+ region = video.textTracks[0].regions[3];
+ testExpected("region.id", "not_unique_id");
+ testExpected("region.width", 67);
+
+ consoleWrite("");
+ region = video.textTracks[0].regions[4];
+ testExpected("region.id", "");
+
+ consoleWrite("");
+ endTest();
+ }
+
+ setCaptionDisplayMode('Automatic');
+ </script>
+ </head>
+ <body>
+ <p>Tests proper parsing of various regions present in WebVTT header area.</p>
+ <video controls>
+ <track src="../captions-webvtt/header-regions.vtt" kind="captions" default onload="startTest()">
+ </video>
+
+ </body>
+</html>
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/Source/WebCore/ChangeLog        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -1,3 +1,96 @@
</span><ins>+2014-03-20 Brent Fulgham <bfulgham@apple.com>
+
+ Rename TextTrackRegion/TextTrackRegionList to VTTRegion/VTTRegionList
+ https://bugs.webkit.org/show_bug.cgi?id=130543
+
+ Reviewed by Dean Jackson.
+
+ Merged from Blink (patch by philipj@opera.com):
+ https://chromium.googlesource.com/chromium/blink/+/69ee6d3399d64163e4936ac1bde222036c54c4b8
+ http://crbug.com/55653003
+
+ Tests: media/track/regions-webvtt/vtt-region-constructor.html
+ media/track/regions-webvtt/vtt-region-display.html
+ media/track/regions-webvtt/vtt-region-dom-layout.html
+ media/track/regions-webvtt/vtt-region-list.html
+ media/track/regions-webvtt/vtt-region-parser.html
+
+ * Configurations/FeatureDefines.xcconfig:
+ * DerivedSources.make:
+ * WebCore.xcodeproj/project.pbxproj:
+ * html/shadow/MediaControlElements.cpp:
+ (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
+ * html/track/LoadableTextTrack.cpp:
+ (WebCore::LoadableTextTrack::newRegionsAvailable):
+ * html/track/TextTrack.cpp:
+ (WebCore::TextTrack::ensureVTTRegionList):
+ (WebCore::TextTrack::regions):
+ (WebCore::TextTrack::addRegion):
+ (WebCore::TextTrack::removeRegion):
+ * html/track/TextTrack.h:
+ * html/track/TextTrack.idl:
+ * html/track/TextTrackCue.cpp:
+ * html/track/TextTrackRegion.cpp: Removed.
+ * html/track/TextTrackRegion.h: Removed.
+ * html/track/TextTrackRegion.idl: Removed.
+ * html/track/TextTrackRegionList.cpp: Removed.
+ * html/track/TextTrackRegionList.h: Removed.
+ * html/track/TextTrackRegionList.idl: Removed.
+ * html/track/VTTCue.cpp:
+ (WebCore::VTTCue::removeDisplayTree):
+ * html/track/VTTRegion.cpp: Copied from Source/WebCore/html/track/TextTrackRegion.cpp.
+ (WebCore::VTTRegion::VTTRegion):
+ (WebCore::VTTRegion::~VTTRegion):
+ (WebCore::VTTRegion::setTrack):
+ (WebCore::VTTRegion::setId):
+ (WebCore::VTTRegion::setWidth):
+ (WebCore::VTTRegion::setHeight):
+ (WebCore::VTTRegion::setRegionAnchorX):
+ (WebCore::VTTRegion::setRegionAnchorY):
+ (WebCore::VTTRegion::setViewportAnchorX):
+ (WebCore::VTTRegion::setViewportAnchorY):
+ (WebCore::VTTRegion::scroll):
+ (WebCore::VTTRegion::setScroll):
+ (WebCore::VTTRegion::updateParametersFromRegion):
+ (WebCore::VTTRegion::setRegionSettings):
+ (WebCore::VTTRegion::getSettingFromString):
+ (WebCore::VTTRegion::parseSettingValue):
+ (WebCore::VTTRegion::parseSetting):
+ (WebCore::VTTRegion::textTrackCueContainerScrollingClass):
+ (WebCore::VTTRegion::textTrackCueContainerShadowPseudoId):
+ (WebCore::VTTRegion::textTrackRegionShadowPseudoId):
+ (WebCore::VTTRegion::appendTextTrackCueBox):
+ (WebCore::VTTRegion::displayLastTextTrackCueBox):
+ (WebCore::VTTRegion::willRemoveTextTrackCueBox):
+ (WebCore::VTTRegion::getDisplayTree):
+ (WebCore::VTTRegion::prepareRegionDisplayTree):
+ (WebCore::VTTRegion::startTimer):
+ (WebCore::VTTRegion::stopTimer):
+ (WebCore::VTTRegion::scrollTimerFired):
+ * html/track/VTTRegion.h: Copied from Source/WebCore/html/track/TextTrackRegion.h.
+ (WebCore::VTTRegion::create):
+ * html/track/VTTRegion.idl: Copied from Source/WebCore/html/track/TextTrackRegion.idl.
+ * html/track/VTTRegionList.cpp: Copied from Source/WebCore/html/track/TextTrackRegionList.cpp.
+ (WebCore::VTTRegionList::VTTRegionList):
+ (WebCore::VTTRegionList::length):
+ (WebCore::VTTRegionList::item):
+ (WebCore::VTTRegionList::getRegionById):
+ (WebCore::VTTRegionList::add):
+ (WebCore::VTTRegionList::remove):
+ (WebCore::VTTRegionList::clear):
+ * html/track/VTTRegionList.h: Copied from Source/WebCore/html/track/TextTrackRegionList.h.
+ (WebCore::VTTRegionList::create):
+ (WebCore::VTTRegionList::~VTTRegionList):
+ * html/track/VTTRegionList.idl: Copied from Source/WebCore/html/track/TextTrackRegionList.idl.
+ * html/track/WebVTTParser.cpp:
+ (WebCore::WebVTTParser::parseFloatPercentageValue):
+ (WebCore::WebVTTParser::getNewRegions):
+ (WebCore::WebVTTParser::createNewRegion):
+ * html/track/WebVTTParser.h:
+ * loader/TextTrackLoader.cpp:
+ (WebCore::TextTrackLoader::getNewRegions):
+ * loader/TextTrackLoader.h:
+
</ins><span class="cx"> 2014-03-20 Simon Fraser <simon.fraser@apple.com>
</span><span class="cx">
</span><span class="cx"> Fix the iOS build.
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/Source/WebCore/DerivedSources.make        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -450,8 +450,8 @@
</span><span class="cx"> $(WebCore)/html/track/TextTrackCue.idl \
</span><span class="cx"> $(WebCore)/html/track/TextTrackCueList.idl \
</span><span class="cx"> $(WebCore)/html/track/TextTrackList.idl \
</span><del>- $(WebCore)/html/track/TextTrackRegion.idl \
- $(WebCore)/html/track/TextTrackRegionList.idl \
</del><ins>+ $(WebCore)/html/track/VTTRegion.idl \
+ $(WebCore)/html/track/VTTRegionList.idl \
</ins><span class="cx"> $(WebCore)/html/track/TrackEvent.idl \
</span><span class="cx"> $(WebCore)/html/track/VideoTrack.idl \
</span><span class="cx"> $(WebCore)/html/track/VideoTrackList.idl \
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -2303,14 +2303,14 @@
</span><span class="cx">                 7ACD88D314C08BD60084EDD2 /* InspectorIndexedDBAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7ACD88D114C08BD60084EDD2 /* InspectorIndexedDBAgent.cpp */; };
</span><span class="cx">                 7ACD88D414C08BD60084EDD2 /* InspectorIndexedDBAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ACD88D214C08BD60084EDD2 /* InspectorIndexedDBAgent.h */; };
</span><span class="cx">                 7ADE722610CBBB9B006B3B3A /* ContextMenuProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ADE722510CBBB9B006B3B3A /* ContextMenuProvider.h */; };
</span><del>-                7AF9B20218CFB2DF00C64BEF /* TextTrackRegion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AF9B1FC18CFB2DF00C64BEF /* TextTrackRegion.cpp */; };
-                7AF9B20318CFB2DF00C64BEF /* TextTrackRegion.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AF9B1FD18CFB2DF00C64BEF /* TextTrackRegion.h */; };
-                7AF9B20518CFB2DF00C64BEF /* TextTrackRegionList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AF9B1FF18CFB2DF00C64BEF /* TextTrackRegionList.cpp */; };
-                7AF9B20618CFB2DF00C64BEF /* TextTrackRegionList.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AF9B20018CFB2DF00C64BEF /* TextTrackRegionList.h */; };
-                7AF9B20C18CFB5F400C64BEF /* JSTextTrackRegion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AF9B20818CFB5F200C64BEF /* JSTextTrackRegion.cpp */; };
-                7AF9B20D18CFB5F400C64BEF /* JSTextTrackRegion.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AF9B20918CFB5F200C64BEF /* JSTextTrackRegion.h */; };
-                7AF9B20E18CFB5F400C64BEF /* JSTextTrackRegionList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AF9B20A18CFB5F300C64BEF /* JSTextTrackRegionList.cpp */; };
-                7AF9B20F18CFB5F400C64BEF /* JSTextTrackRegionList.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AF9B20B18CFB5F300C64BEF /* JSTextTrackRegionList.h */; };
</del><ins>+                7AF9B20218CFB2DF00C64BEF /* VTTRegion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AF9B1FC18CFB2DF00C64BEF /* VTTRegion.cpp */; };
+                7AF9B20318CFB2DF00C64BEF /* VTTRegion.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AF9B1FD18CFB2DF00C64BEF /* VTTRegion.h */; };
+                7AF9B20518CFB2DF00C64BEF /* VTTRegionList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AF9B1FF18CFB2DF00C64BEF /* VTTRegionList.cpp */; };
+                7AF9B20618CFB2DF00C64BEF /* VTTRegionList.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AF9B20018CFB2DF00C64BEF /* VTTRegionList.h */; };
+                7AF9B20C18CFB5F400C64BEF /* JSVTTRegion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AF9B20818CFB5F200C64BEF /* JSVTTRegion.cpp */; };
+                7AF9B20D18CFB5F400C64BEF /* JSVTTRegion.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AF9B20918CFB5F200C64BEF /* JSVTTRegion.h */; };
+                7AF9B20E18CFB5F400C64BEF /* JSVTTRegionList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AF9B20A18CFB5F300C64BEF /* JSVTTRegionList.cpp */; };
+                7AF9B20F18CFB5F400C64BEF /* JSVTTRegionList.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AF9B20B18CFB5F300C64BEF /* JSVTTRegionList.h */; };
</ins><span class="cx">                 7BE7427381FA906FBB4F0F2C /* JSSVGGraphicsElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 950C4C02BED8936F818E2F99 /* JSSVGGraphicsElement.h */; };
</span><span class="cx">                 7C2BDD3D17C7F98C0038FF15 /* JSDOMGlobalObjectTask.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C2BDD3B17C7F98B0038FF15 /* JSDOMGlobalObjectTask.cpp */; };
</span><span class="cx">                 7C2BDD3E17C7F98C0038FF15 /* JSDOMGlobalObjectTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C2BDD3C17C7F98B0038FF15 /* JSDOMGlobalObjectTask.h */; };
</span><span class="lines">@@ -9308,16 +9308,16 @@
</span><span class="cx">                 7ACD88D114C08BD60084EDD2 /* InspectorIndexedDBAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorIndexedDBAgent.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 7ACD88D214C08BD60084EDD2 /* InspectorIndexedDBAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorIndexedDBAgent.h; sourceTree = "<group>"; };
</span><span class="cx">                 7ADE722510CBBB9B006B3B3A /* ContextMenuProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContextMenuProvider.h; sourceTree = "<group>"; };
</span><del>-                7AF9B1FC18CFB2DF00C64BEF /* TextTrackRegion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextTrackRegion.cpp; sourceTree = "<group>"; };
-                7AF9B1FD18CFB2DF00C64BEF /* TextTrackRegion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextTrackRegion.h; sourceTree = "<group>"; };
-                7AF9B1FE18CFB2DF00C64BEF /* TextTrackRegion.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TextTrackRegion.idl; sourceTree = "<group>"; };
-                7AF9B1FF18CFB2DF00C64BEF /* TextTrackRegionList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextTrackRegionList.cpp; sourceTree = "<group>"; };
-                7AF9B20018CFB2DF00C64BEF /* TextTrackRegionList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextTrackRegionList.h; sourceTree = "<group>"; };
-                7AF9B20118CFB2DF00C64BEF /* TextTrackRegionList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TextTrackRegionList.idl; sourceTree = "<group>"; };
-                7AF9B20818CFB5F200C64BEF /* JSTextTrackRegion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTextTrackRegion.cpp; sourceTree = "<group>"; };
-                7AF9B20918CFB5F200C64BEF /* JSTextTrackRegion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTextTrackRegion.h; sourceTree = "<group>"; };
-                7AF9B20A18CFB5F300C64BEF /* JSTextTrackRegionList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTextTrackRegionList.cpp; sourceTree = "<group>"; };
-                7AF9B20B18CFB5F300C64BEF /* JSTextTrackRegionList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTextTrackRegionList.h; sourceTree = "<group>"; };
</del><ins>+                7AF9B1FC18CFB2DF00C64BEF /* VTTRegion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VTTRegion.cpp; sourceTree = "<group>"; };
+                7AF9B1FD18CFB2DF00C64BEF /* VTTRegion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VTTRegion.h; sourceTree = "<group>"; };
+                7AF9B1FE18CFB2DF00C64BEF /* VTTRegion.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VTTRegion.idl; sourceTree = "<group>"; };
+                7AF9B1FF18CFB2DF00C64BEF /* VTTRegionList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VTTRegionList.cpp; sourceTree = "<group>"; };
+                7AF9B20018CFB2DF00C64BEF /* VTTRegionList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VTTRegionList.h; sourceTree = "<group>"; };
+                7AF9B20118CFB2DF00C64BEF /* VTTRegionList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VTTRegionList.idl; sourceTree = "<group>"; };
+                7AF9B20818CFB5F200C64BEF /* JSVTTRegion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVTTRegion.cpp; sourceTree = "<group>"; };
+                7AF9B20918CFB5F200C64BEF /* JSVTTRegion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVTTRegion.h; sourceTree = "<group>"; };
+                7AF9B20A18CFB5F300C64BEF /* JSVTTRegionList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVTTRegionList.cpp; sourceTree = "<group>"; };
+                7AF9B20B18CFB5F300C64BEF /* JSVTTRegionList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVTTRegionList.h; sourceTree = "<group>"; };
</ins><span class="cx">                 7C2BDD3B17C7F98B0038FF15 /* JSDOMGlobalObjectTask.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMGlobalObjectTask.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 7C2BDD3C17C7F98B0038FF15 /* JSDOMGlobalObjectTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMGlobalObjectTask.h; sourceTree = "<group>"; };
</span><span class="cx">                 7C522D4915B477E8009B7C95 /* InspectorOverlay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorOverlay.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -18409,10 +18409,10 @@
</span><span class="cx">                                 070756DA14239B4E00414161 /* JSTextTrackCueList.h */,
</span><span class="cx">                                 07B5A2D91464320A00A81ECE /* JSTextTrackList.cpp */,
</span><span class="cx">                                 07B5A2DA1464320A00A81ECE /* JSTextTrackList.h */,
</span><del>-                                7AF9B20818CFB5F200C64BEF /* JSTextTrackRegion.cpp */,
-                                7AF9B20918CFB5F200C64BEF /* JSTextTrackRegion.h */,
-                                7AF9B20A18CFB5F300C64BEF /* JSTextTrackRegionList.cpp */,
-                                7AF9B20B18CFB5F300C64BEF /* JSTextTrackRegionList.h */,
</del><ins>+                                7AF9B20818CFB5F200C64BEF /* JSVTTRegion.cpp */,
+                                7AF9B20918CFB5F200C64BEF /* JSVTTRegion.h */,
+                                7AF9B20A18CFB5F300C64BEF /* JSVTTRegionList.cpp */,
+                                7AF9B20B18CFB5F300C64BEF /* JSVTTRegionList.h */,
</ins><span class="cx">                                 E44614120CD6826900FADA75 /* JSTimeRanges.cpp */,
</span><span class="cx">                                 E44614130CD6826900FADA75 /* JSTimeRanges.h */,
</span><span class="cx">                                 07846340145B151A00A58DF1 /* JSTrackEvent.cpp */,
</span><span class="lines">@@ -19285,12 +19285,12 @@
</span><span class="cx">                                 076970841463AD8700F502CF /* TextTrackList.cpp */,
</span><span class="cx">                                 076970851463AD8700F502CF /* TextTrackList.h */,
</span><span class="cx">                                 07B5A3061468537100A81ECE /* TextTrackList.idl */,
</span><del>-                                7AF9B1FC18CFB2DF00C64BEF /* TextTrackRegion.cpp */,
-                                7AF9B1FD18CFB2DF00C64BEF /* TextTrackRegion.h */,
-                                7AF9B1FE18CFB2DF00C64BEF /* TextTrackRegion.idl */,
-                                7AF9B1FF18CFB2DF00C64BEF /* TextTrackRegionList.cpp */,
-                                7AF9B20018CFB2DF00C64BEF /* TextTrackRegionList.h */,
-                                7AF9B20118CFB2DF00C64BEF /* TextTrackRegionList.idl */,
</del><ins>+                                7AF9B1FC18CFB2DF00C64BEF /* VTTRegion.cpp */,
+                                7AF9B1FD18CFB2DF00C64BEF /* VTTRegion.h */,
+                                7AF9B1FE18CFB2DF00C64BEF /* VTTRegion.idl */,
+                                7AF9B1FF18CFB2DF00C64BEF /* VTTRegionList.cpp */,
+                                7AF9B20018CFB2DF00C64BEF /* VTTRegionList.h */,
+                                7AF9B20118CFB2DF00C64BEF /* VTTRegionList.idl */,
</ins><span class="cx">                                 070334D8145A006F008D8D45 /* TrackBase.cpp */,
</span><span class="cx">                                 070334D61459FFD5008D8D45 /* TrackBase.h */,
</span><span class="cx">                                 070334D01459FFAC008D8D45 /* TrackEvent.cpp */,
</span><span class="lines">@@ -23151,7 +23151,7 @@
</span><span class="cx">                                 BC64B4DC0CB4298A005F2B62 /* CSSFontSelector.h in Headers */,
</span><span class="cx">                                 A80E6CED0A1989CA007FB8C5 /* CSSFontValue.h in Headers */,
</span><span class="cx">                                 BC02A63C0E09A9CF004B6D2B /* CSSFunctionValue.h in Headers */,
</span><del>-                                7AF9B20318CFB2DF00C64BEF /* TextTrackRegion.h in Headers */,
</del><ins>+                                7AF9B20318CFB2DF00C64BEF /* VTTRegion.h in Headers */,
</ins><span class="cx">                                 BC53C6920DA591140021EB5D /* CSSGradientValue.h in Headers */,
</span><span class="cx">                                 650F53DC09D15DDA00C9B0C8 /* CSSGrammar.h in Headers */,
</span><span class="cx">                                 CD3E252418046BCD00E27F56 /* CSSGridTemplateAreasValue.h in Headers */,
</span><span class="lines">@@ -23581,7 +23581,7 @@
</span><span class="cx">                                 85E711D70AC5D5350053270F /* DOMStyleSheetListInternal.h in Headers */,
</span><span class="cx">                                 BC1A37BD097C715F0019F3D8 /* DOMStylesheets.h in Headers */,
</span><span class="cx">                                 85ACA99C0A9B575900671E90 /* DOMText.h in Headers */,
</span><del>-                                7AF9B20618CFB2DF00C64BEF /* TextTrackRegionList.h in Headers */,
</del><ins>+                                7AF9B20618CFB2DF00C64BEF /* VTTRegionList.h in Headers */,
</ins><span class="cx">                                 DDE63ED50B7D45A800226998 /* DOMTextEvent.h in Headers */,
</span><span class="cx">                                 85E711D90AC5D5350053270F /* DOMTextInternal.h in Headers */,
</span><span class="cx">                                 188604B40F2E654A000B6443 /* DOMTimer.h in Headers */,
</span><span class="lines">@@ -24648,8 +24648,8 @@
</span><span class="cx">                                 070756DE14239B4E00414161 /* JSTextTrackCue.h in Headers */,
</span><span class="cx">                                 070756E014239B4E00414161 /* JSTextTrackCueList.h in Headers */,
</span><span class="cx">                                 07B5A2DC1464320A00A81ECE /* JSTextTrackList.h in Headers */,
</span><del>-                                7AF9B20D18CFB5F400C64BEF /* JSTextTrackRegion.h in Headers */,
-                                7AF9B20F18CFB5F400C64BEF /* JSTextTrackRegionList.h in Headers */,
</del><ins>+                                7AF9B20D18CFB5F400C64BEF /* JSVTTRegion.h in Headers */,
+                                7AF9B20F18CFB5F400C64BEF /* JSVTTRegionList.h in Headers */,
</ins><span class="cx">                                 E446141B0CD6826900FADA75 /* JSTimeRanges.h in Headers */,
</span><span class="cx">                                 0FDA7C17188322EB00C954B5 /* JSTouch.h in Headers */,
</span><span class="cx">                                 0FDA7C19188322EB00C954B5 /* JSTouchEvent.h in Headers */,
</span><span class="lines">@@ -27058,7 +27058,7 @@
</span><span class="cx">                                 0F54DCD61880F867003EEDBB /* DOMTouch.mm in Sources */,
</span><span class="cx">                                 0F54DCD81880F867003EEDBB /* DOMTouchEvent.mm in Sources */,
</span><span class="cx">                                 0F54DCDC1880F867003EEDBB /* DOMTouchList.mm in Sources */,
</span><del>-                                7AF9B20518CFB2DF00C64BEF /* TextTrackRegionList.cpp in Sources */,
</del><ins>+                                7AF9B20518CFB2DF00C64BEF /* VTTRegionList.cpp in Sources */,
</ins><span class="cx">                                 E145349816A9BB6A000F6FD2 /* DOMTransitionEvent.mm in Sources */,
</span><span class="cx">                                 85526CD30AB0B7DA000302EA /* DOMTreeWalker.mm in Sources */,
</span><span class="cx">                                 85C7F4920AAF79DC004014DD /* DOMUIEvent.mm in Sources */,
</span><span class="lines">@@ -28116,8 +28116,8 @@
</span><span class="cx">                                 07E116B11489C9A100EC5ACE /* JSTextTrackCustom.cpp in Sources */,
</span><span class="cx">                                 07B5A2DB1464320A00A81ECE /* JSTextTrackList.cpp in Sources */,
</span><span class="cx">                                 07B5A30D14687D7100A81ECE /* JSTextTrackListCustom.cpp in Sources */,
</span><del>-                                7AF9B20C18CFB5F400C64BEF /* JSTextTrackRegion.cpp in Sources */,
-                                7AF9B20E18CFB5F400C64BEF /* JSTextTrackRegionList.cpp in Sources */,
</del><ins>+                                7AF9B20C18CFB5F400C64BEF /* JSVTTRegion.cpp in Sources */,
+                                7AF9B20E18CFB5F400C64BEF /* JSVTTRegionList.cpp in Sources */,
</ins><span class="cx">                                 E446141A0CD6826900FADA75 /* JSTimeRanges.cpp in Sources */,
</span><span class="cx">                                 0FDA7C16188322EB00C954B5 /* JSTouch.cpp in Sources */,
</span><span class="cx">                                 0FDA7C18188322EB00C954B5 /* JSTouchEvent.cpp in Sources */,
</span><span class="lines">@@ -29348,7 +29348,7 @@
</span><span class="cx">                                 A136A00C1134DBD200CC8D50 /* XMLHttpRequestProgressEventThrottle.cpp in Sources */,
</span><span class="cx">                                 BCDFD48F0E305290009D10AD /* XMLHttpRequestUpload.cpp in Sources */,
</span><span class="cx">                                 A833C80C0A2CF25600D57664 /* XMLNames.cpp in Sources */,
</span><del>-                                7AF9B20218CFB2DF00C64BEF /* TextTrackRegion.cpp in Sources */,
</del><ins>+                                7AF9B20218CFB2DF00C64BEF /* VTTRegion.cpp in Sources */,
</ins><span class="cx">                                 E15A36D91104572700B7B639 /* XMLNSNames.cpp in Sources */,
</span><span class="cx">                                 1ACE53EA0A8D18E70022947D /* XMLSerializer.cpp in Sources */,
</span><span class="cx">                                 5905ADBF1302F3CE00F116DF /* XMLTreeViewer.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlshadowMediaControlElementscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/shadow/MediaControlElements.cpp (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/shadow/MediaControlElements.cpp        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/Source/WebCore/html/shadow/MediaControlElements.cpp        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -60,7 +60,7 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(WEBVTT_REGIONS)
</span><del>-#include "TextTrackRegionList.h"
</del><ins>+#include "VTTRegionList.h"
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -1300,7 +1300,7 @@
</span><span class="cx"> if (cue->track()->mode() == TextTrack::disabledKeyword())
</span><span class="cx"> continue;
</span><span class="cx">
</span><del>- TextTrackRegion* region = cue->track()->regions()->getRegionById(cue->regionId());
</del><ins>+ VTTRegion* region = cue->track()->regions()->getRegionById(cue->regionId());
</ins><span class="cx"> if (!region) {
</span><span class="cx"> // If cue has an empty text track cue region identifier or there is no
</span><span class="cx"> // WebVTT region whose region identifier is identical to cue's text
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackLoadableTextTrackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/LoadableTextTrack.cpp (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/LoadableTextTrack.cpp        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/Source/WebCore/html/track/LoadableTextTrack.cpp        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx"> #include "TextTrackCueList.h"
</span><span class="cx">
</span><span class="cx"> #if ENABLE(WEBVTT_REGIONS)
</span><del>-#include "TextTrackRegionList.h"
</del><ins>+#include "VTTRegionList.h"
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -137,7 +137,7 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT_UNUSED(loader, m_loader.get() == loader);
</span><span class="cx">
</span><del>- Vector<RefPtr<TextTrackRegion>> newRegions;
</del><ins>+ Vector<RefPtr<VTTRegion>> newRegions;
</ins><span class="cx"> m_loader->getNewRegions(newRegions);
</span><span class="cx">
</span><span class="cx"> for (size_t i = 0; i < newRegions.size(); ++i) {
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/TextTrack.cpp (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrack.cpp        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/Source/WebCore/html/track/TextTrack.cpp        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -40,7 +40,8 @@
</span><span class="cx"> #include "SourceBuffer.h"
</span><span class="cx"> #include "TextTrackCueList.h"
</span><span class="cx"> #include "TextTrackList.h"
</span><del>-#include "TextTrackRegionList.h"
</del><ins>+#include "VTTRegion.h"
+#include "VTTRegionList.h"
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -343,35 +344,35 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO_TRACK) && ENABLE(WEBVTT_REGIONS)
</span><del>-TextTrackRegionList* TextTrack::ensureTextTrackRegionList()
</del><ins>+VTTRegionList* TextTrack::ensureVTTRegionList()
</ins><span class="cx"> {
</span><span class="cx"> if (!m_regions)
</span><del>- m_regions = TextTrackRegionList::create();
</del><ins>+ m_regions = VTTRegionList::create();
</ins><span class="cx">
</span><span class="cx"> return m_regions.get();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-TextTrackRegionList* TextTrack::regions()
</del><ins>+VTTRegionList* TextTrack::regions()
</ins><span class="cx"> {
</span><span class="cx"> // If the text track mode of the text track that the TextTrack object
</span><span class="cx"> // represents is not the text track disabled mode, then the regions
</span><del>- // attribute must return a live TextTrackRegionList object that represents
</del><ins>+ // attribute must return a live VTTRegionList object that represents
</ins><span class="cx"> // the text track list of regions of the text track. Otherwise, it must
</span><span class="cx"> // return null. When an object is returned, the same object must be returned
</span><span class="cx"> // each time.
</span><span class="cx"> if (m_mode != disabledKeyword())
</span><del>- return ensureTextTrackRegionList();
</del><ins>+ return ensureVTTRegionList();
</ins><span class="cx">
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void TextTrack::addRegion(PassRefPtr<TextTrackRegion> prpRegion)
</del><ins>+void TextTrack::addRegion(PassRefPtr<VTTRegion> prpRegion)
</ins><span class="cx"> {
</span><span class="cx"> if (!prpRegion)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- RefPtr<TextTrackRegion> region = prpRegion;
- TextTrackRegionList* regionList = ensureTextTrackRegionList();
</del><ins>+ RefPtr<VTTRegion> region = prpRegion;
+ VTTRegionList* regionList = ensureVTTRegionList();
</ins><span class="cx">
</span><span class="cx"> // 1. If the given region is in a text track list of regions, then remove
</span><span class="cx"> // region from that text track list of regions.
</span><span class="lines">@@ -383,7 +384,7 @@
</span><span class="cx"> // a region with the same identifier as region replace the values of that
</span><span class="cx"> // region's width, height, anchor point, viewport anchor point and scroll
</span><span class="cx"> // attributes with those of region.
</span><del>- TextTrackRegion* existingRegion = regionList->getRegionById(region->id());
</del><ins>+ VTTRegion* existingRegion = regionList->getRegionById(region->id());
</ins><span class="cx"> if (existingRegion) {
</span><span class="cx"> existingRegion->updateParametersFromRegion(region.get());
</span><span class="cx"> return;
</span><span class="lines">@@ -395,7 +396,7 @@
</span><span class="cx"> regionList->add(region);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void TextTrack::removeRegion(TextTrackRegion* region, ExceptionCode &ec)
</del><ins>+void TextTrack::removeRegion(VTTRegion* region, ExceptionCode &ec)
</ins><span class="cx"> {
</span><span class="cx"> if (!region)
</span><span class="cx"> return;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/TextTrack.h (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrack.h        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/Source/WebCore/html/track/TextTrack.h        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -46,8 +46,8 @@
</span><span class="cx"> class TextTrack;
</span><span class="cx"> class TextTrackCueList;
</span><span class="cx"> #if ENABLE(WEBVTT_REGIONS)
</span><del>-class TextTrackRegion;
-class TextTrackRegionList;
</del><ins>+class VTTRegion;
+class VTTRegionList;
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> class TextTrackClient {
</span><span class="lines">@@ -113,9 +113,9 @@
</span><span class="cx"> bool hasCue(VTTCue*, VTTCue::CueMatchRules = VTTCue::MatchAllFields);
</span><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO_TRACK) && ENABLE(WEBVTT_REGIONS)
</span><del>- TextTrackRegionList* regions();
- void addRegion(PassRefPtr<TextTrackRegion>);
- void removeRegion(TextTrackRegion*, ExceptionCode&);
</del><ins>+ VTTRegionList* regions();
+ void addRegion(PassRefPtr<VTTRegion>);
+ void removeRegion(VTTRegion*, ExceptionCode&);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> void cueWillChange(TextTrackCue*);
</span><span class="lines">@@ -171,8 +171,8 @@
</span><span class="cx"> virtual void derefEventTarget() override final { deref(); }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO_TRACK) && ENABLE(WEBVTT_REGIONS)
</span><del>- TextTrackRegionList* ensureTextTrackRegionList();
- RefPtr<TextTrackRegionList> m_regions;
</del><ins>+ VTTRegionList* ensureVTTRegionList();
+ RefPtr<VTTRegionList> m_regions;
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if USE(PLATFORM_TEXT_TRACK_MENU)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/TextTrack.idl (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrack.idl        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/Source/WebCore/html/track/TextTrack.idl        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -45,9 +45,9 @@
</span><span class="cx"> [RaisesException] void removeCue(TextTrackCue cue);
</span><span class="cx">
</span><span class="cx"> #if defined(ENABLE_WEBVTT_REGIONS) && ENABLE_WEBVTT_REGIONS
</span><del>- readonly attribute TextTrackRegionList regions;
- void addRegion(TextTrackRegion region);
- [RaisesException] void removeRegion(TextTrackRegion region);
</del><ins>+ readonly attribute VTTRegionList regions;
+ void addRegion(VTTRegion region);
+ [RaisesException] void removeRegion(VTTRegion region);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> // EventTarget interface
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackCuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/TextTrackCue.cpp (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrackCue.cpp        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/Source/WebCore/html/track/TextTrackCue.cpp        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx"> #include <wtf/text/StringBuilder.h>
</span><span class="cx">
</span><span class="cx"> #if ENABLE(WEBVTT_REGIONS)
</span><del>-#include "TextTrackRegionList.h"
</del><ins>+#include "VTTRegionList.h"
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackRegioncpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/html/track/TextTrackRegion.cpp (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrackRegion.cpp        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/Source/WebCore/html/track/TextTrackRegion.cpp        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -1,482 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- * Copyright (C) 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if ENABLE(VIDEO_TRACK) && ENABLE(WEBVTT_REGIONS)
-
-#include "TextTrackRegion.h"
-
-#include "ClientRect.h"
-#include "DOMTokenList.h"
-#include "ExceptionCodePlaceholder.h"
-#include "HTMLDivElement.h"
-#include "Logging.h"
-#include "RenderElement.h"
-#include "VTTCue.h"
-#include "WebVTTParser.h"
-#include <wtf/MathExtras.h>
-
-namespace WebCore {
-
-// The following values default values are defined within the WebVTT Regions Spec.
-// https://dvcs.w3.org/hg/text-tracks/raw-file/default/608toVTT/region.html
-
-// The region occupies by default 100% of the width of the video viewport.
-static const float defaultWidth = 100;
-
-// The region has, by default, 3 lines of text.
-static const long defaultHeightInLines = 3;
-
-// The region and viewport are anchored in the bottom left corner.
-static const float defaultAnchorPointX = 0;
-static const float defaultAnchorPointY = 100;
-
-// The region doesn't have scrolling text, by default.
-static const bool defaultScroll = false;
-
-// Default region line-height (vh units)
-static const float lineHeight = 5.33;
-
-// Default scrolling animation time period (s).
-static const float scrollTime = 0.433;
-
-TextTrackRegion::TextTrackRegion(ScriptExecutionContext& context)
- : ContextDestructionObserver(&context)
- , m_id(emptyString())
- , m_width(defaultWidth)
- , m_heightInLines(defaultHeightInLines)
- , m_regionAnchor(FloatPoint(defaultAnchorPointX, defaultAnchorPointY))
- , m_viewportAnchor(FloatPoint(defaultAnchorPointX, defaultAnchorPointY))
- , m_scroll(defaultScroll)
- , m_cueContainer(nullptr)
- , m_regionDisplayTree(nullptr)
- , m_track(nullptr)
- , m_currentTop(0)
- , m_scrollTimer(this, &TextTrackRegion::scrollTimerFired)
-{
-}
-
-TextTrackRegion::~TextTrackRegion()
-{
-}
-
-void TextTrackRegion::setTrack(TextTrack* track)
-{
- m_track = track;
-}
-
-void TextTrackRegion::setId(const String& id)
-{
- m_id = id;
-}
-
-void TextTrackRegion::setWidth(double value, ExceptionCode& ec)
-{
- if (std::isinf(value) || std::isnan(value)) {
- ec = TypeError;
- return;
- }
-
- if (value < 0 || value > 100) {
- ec = INDEX_SIZE_ERR;
- return;
- }
-
- m_width = value;
-}
-
-void TextTrackRegion::setHeight(long value, ExceptionCode& ec)
-{
- if (value < 0) {
- ec = INDEX_SIZE_ERR;
- return;
- }
-
- m_heightInLines = value;
-}
-
-void TextTrackRegion::setRegionAnchorX(double value, ExceptionCode& ec)
-{
- if (std::isinf(value) || std::isnan(value)) {
- ec = TypeError;
- return;
- }
-
- if (value < 0 || value > 100) {
- ec = INDEX_SIZE_ERR;
- return;
- }
-
- m_regionAnchor.setX(value);
-}
-
-void TextTrackRegion::setRegionAnchorY(double value, ExceptionCode& ec)
-{
- if (std::isinf(value) || std::isnan(value)) {
- ec = TypeError;
- return;
- }
-
- if (value < 0 || value > 100) {
- ec = INDEX_SIZE_ERR;
- return;
- }
-
- m_regionAnchor.setY(value);
-}
-
-void TextTrackRegion::setViewportAnchorX(double value, ExceptionCode& ec)
-{
- if (std::isinf(value) || std::isnan(value)) {
- ec = TypeError;
- return;
- }
-
- if (value < 0 || value > 100) {
- ec = INDEX_SIZE_ERR;
- return;
- }
-
- m_viewportAnchor.setX(value);
-}
-
-void TextTrackRegion::setViewportAnchorY(double value, ExceptionCode& ec)
-{
- if (std::isinf(value) || std::isnan(value)) {
- ec = TypeError;
- return;
- }
-
- if (value < 0 || value > 100) {
- ec = INDEX_SIZE_ERR;
- return;
- }
-
- m_viewportAnchor.setY(value);
-}
-
-const AtomicString TextTrackRegion::scroll() const
-{
- DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, upScrollValueKeyword, ("up", AtomicString::ConstructFromLiteral));
-
- if (m_scroll)
- return upScrollValueKeyword;
-
- return "";
-}
-
-void TextTrackRegion::setScroll(const AtomicString& value, ExceptionCode& ec)
-{
- DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, upScrollValueKeyword, ("up", AtomicString::ConstructFromLiteral));
-
- if (value != emptyString() && value != upScrollValueKeyword) {
- ec = SYNTAX_ERR;
- return;
- }
-
- m_scroll = value == upScrollValueKeyword;
-}
-
-void TextTrackRegion::updateParametersFromRegion(TextTrackRegion* region)
-{
- m_heightInLines = region->height();
- m_width = region->width();
-
- m_regionAnchor = FloatPoint(region->regionAnchorX(), region->regionAnchorY());
- m_viewportAnchor = FloatPoint(region->viewportAnchorX(), region->viewportAnchorY());
-
- setScroll(region->scroll(), ASSERT_NO_EXCEPTION);
-}
-
-void TextTrackRegion::setRegionSettings(const String& input)
-{
- m_settings = input;
- unsigned position = 0;
-
- while (position < input.length()) {
- while (position < input.length() && WebVTTParser::isValidSettingDelimiter(input[position]))
- position++;
-
- if (position >= input.length())
- break;
-
- parseSetting(input, &position);
- }
-}
-
-TextTrackRegion::RegionSetting TextTrackRegion::getSettingFromString(const String& setting)
-{
- DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, idKeyword, ("id", AtomicString::ConstructFromLiteral));
- DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, heightKeyword, ("height", AtomicString::ConstructFromLiteral));
- DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, widthKeyword, ("width", AtomicString::ConstructFromLiteral));
- DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, regionAnchorKeyword, ("regionanchor", AtomicString::ConstructFromLiteral));
- DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, viewportAnchorKeyword, ("viewportanchor", AtomicString::ConstructFromLiteral));
- DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, scrollKeyword, ("scroll", AtomicString::ConstructFromLiteral));
-
- if (setting == idKeyword)
- return Id;
- if (setting == heightKeyword)
- return Height;
- if (setting == widthKeyword)
- return Width;
- if (setting == viewportAnchorKeyword)
- return ViewportAnchor;
- if (setting == regionAnchorKeyword)
- return RegionAnchor;
- if (setting == scrollKeyword)
- return Scroll;
-
- return None;
-}
-
-void TextTrackRegion::parseSettingValue(RegionSetting setting, const String& value)
-{
- DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, scrollUpValueKeyword, ("up", AtomicString::ConstructFromLiteral));
-
- switch (setting) {
- case Id:
- if (value.find("-->") == notFound)
- m_id = value;
- break;
- case Width: {
- float floatWidth;
- if (WebVTTParser::parseFloatPercentageValue(value, floatWidth))
- m_width = floatWidth;
- else
- LOG(Media, "TextTrackRegion::parseSettingValue, invalid Width");
- break;
- }
- case Height: {
- unsigned position = 0;
- int number;
- if (WebVTTParser::collectDigitsToInt(value, &position, number) && position == value.length())
- m_heightInLines = number;
- else
- LOG(Media, "TextTrackRegion::parseSettingValue, invalid Height");
- break;
- }
- case RegionAnchor:
- if (!WebVTTParser::parseFloatPercentageValuePair(value, ',', m_regionAnchor))
- LOG(Media, "TextTrackRegion::parseSettingValue, invalid RegionAnchor");
- break;
- case ViewportAnchor:
- if (!WebVTTParser::parseFloatPercentageValuePair(value, ',', m_viewportAnchor))
- LOG(Media, "TextTrackRegion::parseSettingValue, invalid ViewportAnchor");
- break;
- case Scroll:
- if (value == scrollUpValueKeyword)
- m_scroll = true;
- else
- LOG(Media, "TextTrackRegion::parseSettingValue, invalid Scroll");
- break;
- case None:
- break;
- }
-}
-
-void TextTrackRegion::parseSetting(const String& input, unsigned* position)
-{
- String setting = WebVTTParser::collectWord(input, position);
-
- size_t equalOffset = setting.find('=', 1);
- if (equalOffset == notFound || !equalOffset || equalOffset == setting.length() - 1)
- return;
-
- RegionSetting name = getSettingFromString(setting.substring(0, equalOffset));
- String value = setting.substring(equalOffset + 1, setting.length() - 1);
-
- parseSettingValue(name, value);
-}
-
-const AtomicString& TextTrackRegion::textTrackCueContainerScrollingClass()
-{
- DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, trackRegionCueContainerScrollingClass, ("scrolling", AtomicString::ConstructFromLiteral));
-
- return trackRegionCueContainerScrollingClass;
-}
-
-const AtomicString& TextTrackRegion::textTrackCueContainerShadowPseudoId()
-{
- DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, trackRegionCueContainerPseudoId,
- ("-webkit-media-text-track-region-container", AtomicString::ConstructFromLiteral));
-
- return trackRegionCueContainerPseudoId;
-}
-
-const AtomicString& TextTrackRegion::textTrackRegionShadowPseudoId()
-{
- DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, trackRegionShadowPseudoId,
- ("-webkit-media-text-track-region", AtomicString::ConstructFromLiteral));
-
- return trackRegionShadowPseudoId;
-}
-
-void TextTrackRegion::appendTextTrackCueBox(PassRefPtr<VTTCueBox> displayBox)
-{
- ASSERT(m_cueContainer);
-
- if (m_cueContainer->contains(displayBox.get()))
- return;
-
- m_cueContainer->appendChild(displayBox, ASSERT_NO_EXCEPTION);
- displayLastTextTrackCueBox();
-}
-
-void TextTrackRegion::displayLastTextTrackCueBox()
-{
- ASSERT(m_cueContainer);
-
- // The container needs to be rendered, if it is not empty and the region is not currently scrolling.
- if (!m_cueContainer->renderer() || !m_cueContainer->childNodeCount() || m_scrollTimer.isActive())
- return;
-
- // If it's a scrolling region, add the scrolling class.
- if (isScrollingRegion())
- m_cueContainer->classList()->add(textTrackCueContainerScrollingClass(), IGNORE_EXCEPTION);
-
- float regionBottom = m_regionDisplayTree->getBoundingClientRect()->bottom();
-
- // Find first cue that is not entirely displayed and scroll it upwards.
- for (size_t i = 0; i < m_cueContainer->childNodeCount() && !m_scrollTimer.isActive(); ++i) {
- float childTop = static_cast<HTMLDivElement*>(m_cueContainer->childNode(i))->getBoundingClientRect()->top();
- float childBottom = static_cast<HTMLDivElement*>(m_cueContainer->childNode(i))->getBoundingClientRect()->bottom();
-
- if (regionBottom >= childBottom)
- continue;
-
- float height = childBottom - childTop;
-
- m_currentTop -= std::min(height, childBottom - regionBottom);
- m_cueContainer->setInlineStyleProperty(CSSPropertyTop, m_currentTop, CSSPrimitiveValue::CSS_PX);
-
- startTimer();
- }
-}
-
-void TextTrackRegion::willRemoveTextTrackCueBox(VTTCueBox* box)
-{
- LOG(Media, "TextTrackRegion::willRemoveTextTrackCueBox");
- ASSERT(m_cueContainer->contains(box));
-
- double boxHeight = box->getBoundingClientRect()->bottom() - box->getBoundingClientRect()->top();
-
- m_cueContainer->classList()->remove(textTrackCueContainerScrollingClass(), IGNORE_EXCEPTION);
-
- m_currentTop += boxHeight;
- m_cueContainer->setInlineStyleProperty(CSSPropertyTop, m_currentTop, CSSPrimitiveValue::CSS_PX);
-}
-
-PassRefPtr<HTMLDivElement> TextTrackRegion::getDisplayTree()
-{
- if (!m_regionDisplayTree) {
- m_regionDisplayTree = HTMLDivElement::create(*ownerDocument());
- prepareRegionDisplayTree();
- }
-
- return m_regionDisplayTree;
-}
-
-void TextTrackRegion::prepareRegionDisplayTree()
-{
- ASSERT(m_regionDisplayTree);
-
- // 7.2 Prepare region CSS boxes
-
- // FIXME: Change the code below to use viewport units when
- // http://crbug/244618 is fixed.
-
- // Let regionWidth be the text track region width.
- // Let width be 'regionWidth vw' ('vw' is a CSS unit)
- m_regionDisplayTree->setInlineStyleProperty(CSSPropertyWidth, m_width, CSSPrimitiveValue::CSS_PERCENTAGE);
-
- // Let lineHeight be '0.0533vh' ('vh' is a CSS unit) and regionHeight be
- // the text track region height. Let height be 'lineHeight' multiplied
- // by regionHeight.
- double height = lineHeight * m_heightInLines;
- m_regionDisplayTree->setInlineStyleProperty(CSSPropertyHeight, height, CSSPrimitiveValue::CSS_VH);
-
- // Let viewportAnchorX be the x dimension of the text track region viewport
- // anchor and regionAnchorX be the x dimension of the text track region
- // anchor. Let leftOffset be regionAnchorX multiplied by width divided by
- // 100.0. Let left be leftOffset subtracted from 'viewportAnchorX vw'.
- double leftOffset = m_regionAnchor.x() * m_width / 100;
- m_regionDisplayTree->setInlineStyleProperty(CSSPropertyLeft, m_viewportAnchor.x() - leftOffset, CSSPrimitiveValue::CSS_PERCENTAGE);
-
- // Let viewportAnchorY be the y dimension of the text track region viewport
- // anchor and regionAnchorY be the y dimension of the text track region
- // anchor. Let topOffset be regionAnchorY multiplied by height divided by
- // 100.0. Let top be topOffset subtracted from 'viewportAnchorY vh'.
- double topOffset = m_regionAnchor.y() * height / 100;
- m_regionDisplayTree->setInlineStyleProperty(CSSPropertyTop, m_viewportAnchor.y() - topOffset, CSSPrimitiveValue::CSS_PERCENTAGE);
-
- // The cue container is used to wrap the cues and it is the object which is
- // gradually scrolled out as multiple cues are appended to the region.
- m_cueContainer = HTMLDivElement::create(*ownerDocument());
- m_cueContainer->setInlineStyleProperty(CSSPropertyTop, 0.0f, CSSPrimitiveValue::CSS_PX);
-
- m_cueContainer->setPseudo(textTrackCueContainerShadowPseudoId());
- m_regionDisplayTree->appendChild(m_cueContainer);
-
- // 7.5 Every WebVTT region object is initialised with the following CSS
- m_regionDisplayTree->setPseudo(textTrackRegionShadowPseudoId());
-}
-
-void TextTrackRegion::startTimer()
-{
- LOG(Media, "TextTrackRegion::startTimer");
-
- if (m_scrollTimer.isActive())
- return;
-
- double duration = isScrollingRegion() ? scrollTime : 0;
- m_scrollTimer.startOneShot(duration);
-}
-
-void TextTrackRegion::stopTimer()
-{
- LOG(Media, "TextTrackRegion::stopTimer");
-
- if (m_scrollTimer.isActive())
- m_scrollTimer.stop();
-}
-
-void TextTrackRegion::scrollTimerFired(Timer<TextTrackRegion>*)
-{
- LOG(Media, "TextTrackRegion::scrollTimerFired");
-
- stopTimer();
- displayLastTextTrackCueBox();
-}
-
-} // namespace WebCore
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackRegionh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/html/track/TextTrackRegion.h (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrackRegion.h        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/Source/WebCore/html/track/TextTrackRegion.h        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -1,164 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- * Copyright (C) 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef TextTrackRegion_h
-#define TextTrackRegion_h
-
-#if ENABLE(VIDEO_TRACK) && ENABLE(WEBVTT_REGIONS)
-
-#include "ContextDestructionObserver.h"
-#include "Document.h"
-#include "FloatPoint.h"
-#include "TextTrack.h"
-#include <wtf/RefCounted.h>
-
-namespace WebCore {
-
-class HTMLDivElement;
-class VTTCueBox;
-
-class TextTrackRegion : public RefCounted<TextTrackRegion>, public ContextDestructionObserver {
-public:
- static PassRefPtr<TextTrackRegion> create(ScriptExecutionContext& context)
- {
- return adoptRef(new TextTrackRegion(context));
- }
-
- virtual ~TextTrackRegion();
-
- TextTrack* track() const { return m_track; }
- void setTrack(TextTrack*);
-
- const String& id() const { return m_id; }
- void setId(const String&);
-
- double width() const { return m_width; }
- void setWidth(double, ExceptionCode&);
-
- long height() const { return m_heightInLines; }
- void setHeight(long, ExceptionCode&);
-
- double regionAnchorX() const { return m_regionAnchor.x(); }
- void setRegionAnchorX(double, ExceptionCode&);
-
- double regionAnchorY() const { return m_regionAnchor.y(); }
- void setRegionAnchorY(double, ExceptionCode&);
-
- double viewportAnchorX() const { return m_viewportAnchor.x(); }
- void setViewportAnchorX(double, ExceptionCode&);
-
- double viewportAnchorY() const { return m_viewportAnchor.y(); }
- void setViewportAnchorY(double, ExceptionCode&);
-
- const AtomicString scroll() const;
- void setScroll(const AtomicString&, ExceptionCode&);
-
- void updateParametersFromRegion(TextTrackRegion*);
-
- const String& regionSettings() const { return m_settings; }
- void setRegionSettings(const String&);
-
- bool isScrollingRegion() { return m_scroll; }
-
- PassRefPtr<HTMLDivElement> getDisplayTree();
-
- void appendTextTrackCueBox(PassRefPtr<VTTCueBox>);
- void displayLastTextTrackCueBox();
- void willRemoveTextTrackCueBox(VTTCueBox*);
-
-private:
- TextTrackRegion(ScriptExecutionContext&);
-
- Document* ownerDocument() { return toDocument(m_scriptExecutionContext); }
-
- void prepareRegionDisplayTree();
-
- // The timer is needed to continue processing when cue scrolling ended.
- void startTimer();
- void stopTimer();
- void scrollTimerFired(Timer<TextTrackRegion>*);
-
- enum RegionSetting {
- None,
- Id,
- Width,
- Height,
- RegionAnchor,
- ViewportAnchor,
- Scroll
- };
-
- RegionSetting getSettingFromString(const String&);
-
- void parseSettingValue(RegionSetting, const String&);
- void parseSetting(const String&, unsigned*);
-
- static const AtomicString& textTrackCueContainerShadowPseudoId();
- static const AtomicString& textTrackCueContainerScrollingClass();
- static const AtomicString& textTrackRegionShadowPseudoId();
-
- String m_id;
- String m_settings;
-
- double m_width;
- unsigned m_heightInLines;
-
- FloatPoint m_regionAnchor;
- FloatPoint m_viewportAnchor;
-
- bool m_scroll;
-
- // 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
- // is cleared in the TextTrack destructor and it is generally
- // set/reset within the addRegion and removeRegion methods.
- TextTrack* m_track;
-
- // Keep track of the current numeric value of the css "top" property.
- double m_currentTop;
-
- // The timer is used to display the next cue line after the current one has
- // been displayed. It's main use is for scrolling regions and it triggers as
- // soon as the animation for rolling out one line has finished, but
- // currently it is used also for non-scrolling regions to use a single
- // code path.
- Timer<TextTrackRegion> m_scrollTimer;
-};
-
-} // namespace WebCore
-
-#endif
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackRegionidl"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/html/track/TextTrackRegion.idl (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrackRegion.idl        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/Source/WebCore/html/track/TextTrackRegion.idl        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -1,44 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- * Copyright (C) 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
- Conditional=VIDEO_TRACK & WEBVTT_REGIONS,
- JSGenerateToNativeObject,
- Constructor(),
- ConstructorCallWith=ScriptExecutionContext
-] interface TextTrackRegion {
- readonly attribute TextTrack track;
-
- attribute DOMString id;
- [SetterRaisesException] attribute double width;
- [SetterRaisesException] attribute long height;
- [SetterRaisesException] attribute double regionAnchorX;
- [SetterRaisesException] attribute double regionAnchorY;
- [SetterRaisesException] attribute double viewportAnchorX;
- [SetterRaisesException] attribute double viewportAnchorY;
- [SetterRaisesException] attribute DOMString scroll;
-};
-
</del></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackRegionListcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/html/track/TextTrackRegionList.cpp (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrackRegionList.cpp        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/Source/WebCore/html/track/TextTrackRegionList.cpp        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -1,87 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- * Copyright (C) 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if ENABLE(VIDEO_TRACK) && ENABLE(WEBVTT_REGIONS)
-
-#include "TextTrackRegionList.h"
-
-namespace WebCore {
-
-TextTrackRegionList::TextTrackRegionList()
-{
-}
-
-unsigned long TextTrackRegionList::length() const
-{
- return m_list.size();
-}
-
-TextTrackRegion* TextTrackRegionList::item(unsigned index) const
-{
- if (index < m_list.size())
- return m_list[index].get();
-
- return 0;
-}
-
-TextTrackRegion* TextTrackRegionList::getRegionById(const String& id) const
-{
- if (id.isEmpty())
- return 0;
-
- for (const auto& region : m_list) {
- if (region->id() == id)
- return region.get();
- }
-
- return 0;
-}
-
-void TextTrackRegionList::add(PassRefPtr<TextTrackRegion> region)
-{
- m_list.append(region);
-}
-
-bool TextTrackRegionList::remove(TextTrackRegion* region)
-{
- size_t index = m_list.find(region);
- if (index == notFound)
- return false;
-
- m_list.remove(index);
- return true;
-}
-
-void TextTrackRegionList::clear()
-{
- m_list.clear();
-}
-
-} // namespace WebCore
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackRegionListh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/html/track/TextTrackRegionList.h (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrackRegionList.h        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/Source/WebCore/html/track/TextTrackRegionList.h        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -1,65 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef TextTrackRegionList_h
-#define TextTrackRegionList_h
-
-#if ENABLE(VIDEO_TRACK) && ENABLE(WEBVTT_REGIONS)
-
-#include "TextTrackRegion.h"
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
-#include <wtf/Vector.h>
-
-namespace WebCore {
-
-class TextTrackRegionList : public RefCounted<TextTrackRegionList> {
-public:
- static PassRefPtr<TextTrackRegionList> create()
- {
- return adoptRef(new TextTrackRegionList());
- }
-
- ~TextTrackRegionList() { }
-
- unsigned long length() const;
-
- TextTrackRegion* item(unsigned index) const;
- TextTrackRegion* getRegionById(const String&) const;
-
- void add(PassRefPtr<TextTrackRegion>);
- bool remove(TextTrackRegion*);
-
-private:
- TextTrackRegionList();
- void clear();
-
- Vector<RefPtr<TextTrackRegion> > m_list;
-};
-
-} // namespace WebCore
-
-#endif
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackRegionListidl"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/html/track/TextTrackRegionList.idl (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrackRegionList.idl        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/Source/WebCore/html/track/TextTrackRegionList.idl        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -1,35 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
- NoInterfaceObject,
- Conditional=VIDEO_TRACK & WEBVTT_REGIONS,
- ImplementationLacksVTable,
-] interface TextTrackRegionList {
- readonly attribute unsigned long length;
- getter TextTrackRegion item(unsigned long index);
- TextTrackRegion getRegionById(DOMString id);
-};
-
</del></span></pre></div>
<a id="trunkSourceWebCorehtmltrackVTTCuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/VTTCue.cpp (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/VTTCue.cpp        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/Source/WebCore/html/track/VTTCue.cpp        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx"> #include <wtf/text/StringBuilder.h>
</span><span class="cx">
</span><span class="cx"> #if ENABLE(WEBVTT_REGIONS)
</span><del>-#include "TextTrackRegionList.h"
</del><ins>+#include "VTTRegionList.h"
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -782,8 +782,8 @@
</span><span class="cx"> #if ENABLE(WEBVTT_REGIONS)
</span><span class="cx"> // The region needs to be informed about the cue removal.
</span><span class="cx"> if (m_notifyRegion && track()) {
</span><del>- if (TextTrackRegionList* regions = track()->regions()) {
- if (TextTrackRegion* region = regions->getRegionById(m_regionId))
</del><ins>+ if (VTTRegionList* regions = track()->regions()) {
+ if (VTTRegion* region = regions->getRegionById(m_regionId))
</ins><span class="cx"> region->willRemoveTextTrackCueBox(m_displayTree.get());
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackVTTRegioncppfromrev165997trunkSourceWebCorehtmltrackTextTrackRegioncpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/html/track/VTTRegion.cpp (from rev 165997, trunk/Source/WebCore/html/track/TextTrackRegion.cpp) (0 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/VTTRegion.cpp         (rev 0)
+++ trunk/Source/WebCore/html/track/VTTRegion.cpp        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -0,0 +1,481 @@
</span><ins>+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "VTTRegion.h"
+
+#if ENABLE(VIDEO_TRACK) && ENABLE(WEBVTT_REGIONS)
+
+#include "ClientRect.h"
+#include "DOMTokenList.h"
+#include "ExceptionCodePlaceholder.h"
+#include "HTMLDivElement.h"
+#include "Logging.h"
+#include "RenderElement.h"
+#include "VTTCue.h"
+#include "WebVTTParser.h"
+#include <wtf/MathExtras.h>
+
+namespace WebCore {
+
+// The following values default values are defined within the WebVTT Regions Spec.
+// https://dvcs.w3.org/hg/text-tracks/raw-file/default/608toVTT/region.html
+
+// The region occupies by default 100% of the width of the video viewport.
+static const float defaultWidth = 100;
+
+// The region has, by default, 3 lines of text.
+static const long defaultHeightInLines = 3;
+
+// The region and viewport are anchored in the bottom left corner.
+static const float defaultAnchorPointX = 0;
+static const float defaultAnchorPointY = 100;
+
+// The region doesn't have scrolling text, by default.
+static const bool defaultScroll = false;
+
+// Default region line-height (vh units)
+static const float lineHeight = 5.33;
+
+// Default scrolling animation time period (s).
+static const float scrollTime = 0.433;
+
+VTTRegion::VTTRegion(ScriptExecutionContext& context)
+ : ContextDestructionObserver(&context)
+ , m_id(emptyString())
+ , m_width(defaultWidth)
+ , m_heightInLines(defaultHeightInLines)
+ , m_regionAnchor(FloatPoint(defaultAnchorPointX, defaultAnchorPointY))
+ , m_viewportAnchor(FloatPoint(defaultAnchorPointX, defaultAnchorPointY))
+ , m_scroll(defaultScroll)
+ , m_cueContainer(nullptr)
+ , m_regionDisplayTree(nullptr)
+ , m_track(nullptr)
+ , m_currentTop(0)
+ , m_scrollTimer(this, &VTTRegion::scrollTimerFired)
+{
+}
+
+VTTRegion::~VTTRegion()
+{
+}
+
+void VTTRegion::setTrack(TextTrack* track)
+{
+ m_track = track;
+}
+
+void VTTRegion::setId(const String& id)
+{
+ m_id = id;
+}
+
+void VTTRegion::setWidth(double value, ExceptionCode& ec)
+{
+ if (std::isinf(value) || std::isnan(value)) {
+ ec = TypeError;
+ return;
+ }
+
+ if (value < 0 || value > 100) {
+ ec = INDEX_SIZE_ERR;
+ return;
+ }
+
+ m_width = value;
+}
+
+void VTTRegion::setHeight(long value, ExceptionCode& ec)
+{
+ if (value < 0) {
+ ec = INDEX_SIZE_ERR;
+ return;
+ }
+
+ m_heightInLines = value;
+}
+
+void VTTRegion::setRegionAnchorX(double value, ExceptionCode& ec)
+{
+ if (std::isinf(value) || std::isnan(value)) {
+ ec = TypeError;
+ return;
+ }
+
+ if (value < 0 || value > 100) {
+ ec = INDEX_SIZE_ERR;
+ return;
+ }
+
+ m_regionAnchor.setX(value);
+}
+
+void VTTRegion::setRegionAnchorY(double value, ExceptionCode& ec)
+{
+ if (std::isinf(value) || std::isnan(value)) {
+ ec = TypeError;
+ return;
+ }
+
+ if (value < 0 || value > 100) {
+ ec = INDEX_SIZE_ERR;
+ return;
+ }
+
+ m_regionAnchor.setY(value);
+}
+
+void VTTRegion::setViewportAnchorX(double value, ExceptionCode& ec)
+{
+ if (std::isinf(value) || std::isnan(value)) {
+ ec = TypeError;
+ return;
+ }
+
+ if (value < 0 || value > 100) {
+ ec = INDEX_SIZE_ERR;
+ return;
+ }
+
+ m_viewportAnchor.setX(value);
+}
+
+void VTTRegion::setViewportAnchorY(double value, ExceptionCode& ec)
+{
+ if (std::isinf(value) || std::isnan(value)) {
+ ec = TypeError;
+ return;
+ }
+
+ if (value < 0 || value > 100) {
+ ec = INDEX_SIZE_ERR;
+ return;
+ }
+
+ m_viewportAnchor.setY(value);
+}
+
+const AtomicString VTTRegion::scroll() const
+{
+ DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, upScrollValueKeyword, ("up", AtomicString::ConstructFromLiteral));
+
+ if (m_scroll)
+ return upScrollValueKeyword;
+
+ return "";
+}
+
+void VTTRegion::setScroll(const AtomicString& value, ExceptionCode& ec)
+{
+ DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, upScrollValueKeyword, ("up", AtomicString::ConstructFromLiteral));
+
+ if (value != emptyString() && value != upScrollValueKeyword) {
+ ec = SYNTAX_ERR;
+ return;
+ }
+
+ m_scroll = value == upScrollValueKeyword;
+}
+
+void VTTRegion::updateParametersFromRegion(VTTRegion* region)
+{
+ m_heightInLines = region->height();
+ m_width = region->width();
+
+ m_regionAnchor = FloatPoint(region->regionAnchorX(), region->regionAnchorY());
+ m_viewportAnchor = FloatPoint(region->viewportAnchorX(), region->viewportAnchorY());
+
+ setScroll(region->scroll(), ASSERT_NO_EXCEPTION);
+}
+
+void VTTRegion::setRegionSettings(const String& input)
+{
+ m_settings = input;
+ unsigned position = 0;
+
+ while (position < input.length()) {
+ while (position < input.length() && WebVTTParser::isValidSettingDelimiter(input[position]))
+ position++;
+
+ if (position >= input.length())
+ break;
+
+ parseSetting(input, &position);
+ }
+}
+
+VTTRegion::RegionSetting VTTRegion::getSettingFromString(const String& setting)
+{
+ DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, idKeyword, ("id", AtomicString::ConstructFromLiteral));
+ DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, heightKeyword, ("height", AtomicString::ConstructFromLiteral));
+ DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, widthKeyword, ("width", AtomicString::ConstructFromLiteral));
+ DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, regionAnchorKeyword, ("regionanchor", AtomicString::ConstructFromLiteral));
+ DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, viewportAnchorKeyword, ("viewportanchor", AtomicString::ConstructFromLiteral));
+ DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, scrollKeyword, ("scroll", AtomicString::ConstructFromLiteral));
+
+ if (setting == idKeyword)
+ return Id;
+ if (setting == heightKeyword)
+ return Height;
+ if (setting == widthKeyword)
+ return Width;
+ if (setting == viewportAnchorKeyword)
+ return ViewportAnchor;
+ if (setting == regionAnchorKeyword)
+ return RegionAnchor;
+ if (setting == scrollKeyword)
+ return Scroll;
+
+ return None;
+}
+
+void VTTRegion::parseSettingValue(RegionSetting setting, const String& value)
+{
+ DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, scrollUpValueKeyword, ("up", AtomicString::ConstructFromLiteral));
+
+ switch (setting) {
+ case Id:
+ if (value.find("-->") == notFound)
+ m_id = value;
+ break;
+ case Width: {
+ float floatWidth;
+ if (WebVTTParser::parseFloatPercentageValue(value, floatWidth))
+ m_width = floatWidth;
+ else
+ LOG(Media, "VTTRegion::parseSettingValue, invalid Width");
+ break;
+ }
+ case Height: {
+ unsigned position = 0;
+ int number;
+ if (WebVTTParser::collectDigitsToInt(value, position, number) && position == value.length())
+ m_heightInLines = number;
+ else
+ LOG(Media, "VTTRegion::parseSettingValue, invalid Height");
+ break;
+ }
+ case RegionAnchor:
+ if (!WebVTTParser::parseFloatPercentageValuePair(value, ',', m_regionAnchor))
+ LOG(Media, "VTTRegion::parseSettingValue, invalid RegionAnchor");
+ break;
+ case ViewportAnchor:
+ if (!WebVTTParser::parseFloatPercentageValuePair(value, ',', m_viewportAnchor))
+ LOG(Media, "VTTRegion::parseSettingValue, invalid ViewportAnchor");
+ break;
+ case Scroll:
+ if (value == scrollUpValueKeyword)
+ m_scroll = true;
+ else
+ LOG(Media, "VTTRegion::parseSettingValue, invalid Scroll");
+ break;
+ case None:
+ break;
+ }
+}
+
+void VTTRegion::parseSetting(const String& input, unsigned* position)
+{
+ String setting = WebVTTParser::collectWord(input, position);
+
+ size_t equalOffset = setting.find('=', 1);
+ if (equalOffset == notFound || !equalOffset || equalOffset == setting.length() - 1)
+ return;
+
+ RegionSetting name = getSettingFromString(setting.substring(0, equalOffset));
+ String value = setting.substring(equalOffset + 1, setting.length() - 1);
+
+ parseSettingValue(name, value);
+}
+
+const AtomicString& VTTRegion::textTrackCueContainerScrollingClass()
+{
+ DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, trackRegionCueContainerScrollingClass, ("scrolling", AtomicString::ConstructFromLiteral));
+
+ return trackRegionCueContainerScrollingClass;
+}
+
+const AtomicString& VTTRegion::textTrackCueContainerShadowPseudoId()
+{
+ DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, trackRegionCueContainerPseudoId,
+ ("-webkit-media-text-track-region-container", AtomicString::ConstructFromLiteral));
+
+ return trackRegionCueContainerPseudoId;
+}
+
+const AtomicString& VTTRegion::textTrackRegionShadowPseudoId()
+{
+ DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, trackRegionShadowPseudoId,
+ ("-webkit-media-text-track-region", AtomicString::ConstructFromLiteral));
+
+ return trackRegionShadowPseudoId;
+}
+
+void VTTRegion::appendTextTrackCueBox(PassRefPtr<VTTCueBox> displayBox)
+{
+ ASSERT(m_cueContainer);
+
+ if (m_cueContainer->contains(displayBox.get()))
+ return;
+
+ m_cueContainer->appendChild(displayBox, ASSERT_NO_EXCEPTION);
+ displayLastTextTrackCueBox();
+}
+
+void VTTRegion::displayLastTextTrackCueBox()
+{
+ ASSERT(m_cueContainer);
+
+ // The container needs to be rendered, if it is not empty and the region is not currently scrolling.
+ if (!m_cueContainer->renderer() || !m_cueContainer->childNodeCount() || m_scrollTimer.isActive())
+ return;
+
+ // If it's a scrolling region, add the scrolling class.
+ if (isScrollingRegion())
+ m_cueContainer->classList()->add(textTrackCueContainerScrollingClass(), IGNORE_EXCEPTION);
+
+ float regionBottom = m_regionDisplayTree->getBoundingClientRect()->bottom();
+
+ // Find first cue that is not entirely displayed and scroll it upwards.
+ for (size_t i = 0; i < m_cueContainer->childNodeCount() && !m_scrollTimer.isActive(); ++i) {
+ float childTop = static_cast<HTMLDivElement*>(m_cueContainer->childNode(i))->getBoundingClientRect()->top();
+ float childBottom = static_cast<HTMLDivElement*>(m_cueContainer->childNode(i))->getBoundingClientRect()->bottom();
+
+ if (regionBottom >= childBottom)
+ continue;
+
+ float height = childBottom - childTop;
+
+ m_currentTop -= std::min(height, childBottom - regionBottom);
+ m_cueContainer->setInlineStyleProperty(CSSPropertyTop, m_currentTop, CSSPrimitiveValue::CSS_PX);
+
+ startTimer();
+ }
+}
+
+void VTTRegion::willRemoveTextTrackCueBox(VTTCueBox* box)
+{
+ LOG(Media, "VTTRegion::willRemoveTextTrackCueBox");
+ ASSERT(m_cueContainer->contains(box));
+
+ double boxHeight = box->getBoundingClientRect()->bottom() - box->getBoundingClientRect()->top();
+
+ m_cueContainer->classList()->remove(textTrackCueContainerScrollingClass(), IGNORE_EXCEPTION);
+
+ m_currentTop += boxHeight;
+ m_cueContainer->setInlineStyleProperty(CSSPropertyTop, m_currentTop, CSSPrimitiveValue::CSS_PX);
+}
+
+PassRefPtr<HTMLDivElement> VTTRegion::getDisplayTree()
+{
+ if (!m_regionDisplayTree) {
+ m_regionDisplayTree = HTMLDivElement::create(*ownerDocument());
+ prepareRegionDisplayTree();
+ }
+
+ return m_regionDisplayTree;
+}
+
+void VTTRegion::prepareRegionDisplayTree()
+{
+ ASSERT(m_regionDisplayTree);
+
+ // 7.2 Prepare region CSS boxes
+
+ // FIXME: Change the code below to use viewport units when
+ // http://crbug/244618 is fixed.
+
+ // Let regionWidth be the text track region width.
+ // Let width be 'regionWidth vw' ('vw' is a CSS unit)
+ m_regionDisplayTree->setInlineStyleProperty(CSSPropertyWidth, m_width, CSSPrimitiveValue::CSS_PERCENTAGE);
+
+ // Let lineHeight be '0.0533vh' ('vh' is a CSS unit) and regionHeight be
+ // the text track region height. Let height be 'lineHeight' multiplied
+ // by regionHeight.
+ double height = lineHeight * m_heightInLines;
+ m_regionDisplayTree->setInlineStyleProperty(CSSPropertyHeight, height, CSSPrimitiveValue::CSS_VH);
+
+ // Let viewportAnchorX be the x dimension of the text track region viewport
+ // anchor and regionAnchorX be the x dimension of the text track region
+ // anchor. Let leftOffset be regionAnchorX multiplied by width divided by
+ // 100.0. Let left be leftOffset subtracted from 'viewportAnchorX vw'.
+ double leftOffset = m_regionAnchor.x() * m_width / 100;
+ m_regionDisplayTree->setInlineStyleProperty(CSSPropertyLeft, m_viewportAnchor.x() - leftOffset, CSSPrimitiveValue::CSS_PERCENTAGE);
+
+ // Let viewportAnchorY be the y dimension of the text track region viewport
+ // anchor and regionAnchorY be the y dimension of the text track region
+ // anchor. Let topOffset be regionAnchorY multiplied by height divided by
+ // 100.0. Let top be topOffset subtracted from 'viewportAnchorY vh'.
+ double topOffset = m_regionAnchor.y() * height / 100;
+ m_regionDisplayTree->setInlineStyleProperty(CSSPropertyTop, m_viewportAnchor.y() - topOffset, CSSPrimitiveValue::CSS_PERCENTAGE);
+
+ // The cue container is used to wrap the cues and it is the object which is
+ // gradually scrolled out as multiple cues are appended to the region.
+ m_cueContainer = HTMLDivElement::create(*ownerDocument());
+ m_cueContainer->setInlineStyleProperty(CSSPropertyTop, 0.0f, CSSPrimitiveValue::CSS_PX);
+
+ m_cueContainer->setPseudo(textTrackCueContainerShadowPseudoId());
+ m_regionDisplayTree->appendChild(m_cueContainer);
+
+ // 7.5 Every WebVTT region object is initialised with the following CSS
+ m_regionDisplayTree->setPseudo(textTrackRegionShadowPseudoId());
+}
+
+void VTTRegion::startTimer()
+{
+ LOG(Media, "VTTRegion::startTimer");
+
+ if (m_scrollTimer.isActive())
+ return;
+
+ double duration = isScrollingRegion() ? scrollTime : 0;
+ m_scrollTimer.startOneShot(duration);
+}
+
+void VTTRegion::stopTimer()
+{
+ LOG(Media, "VTTRegion::stopTimer");
+
+ if (m_scrollTimer.isActive())
+ m_scrollTimer.stop();
+}
+
+void VTTRegion::scrollTimerFired(Timer<VTTRegion>*)
+{
+ LOG(Media, "VTTRegion::scrollTimerFired");
+
+ stopTimer();
+ displayLastTextTrackCueBox();
+}
+
+} // namespace WebCore
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCorehtmltrackVTTRegionhfromrev165996trunkSourceWebCorehtmltrackTextTrackRegionh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/html/track/VTTRegion.h (from rev 165996, trunk/Source/WebCore/html/track/TextTrackRegion.h) (0 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/VTTRegion.h         (rev 0)
+++ trunk/Source/WebCore/html/track/VTTRegion.h        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -0,0 +1,164 @@
</span><ins>+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef VTTRegion_h
+#define VTTRegion_h
+
+#if ENABLE(VIDEO_TRACK) && ENABLE(WEBVTT_REGIONS)
+
+#include "ContextDestructionObserver.h"
+#include "Document.h"
+#include "FloatPoint.h"
+#include "TextTrack.h"
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class HTMLDivElement;
+class VTTCueBox;
+
+class VTTRegion : public RefCounted<VTTRegion>, public ContextDestructionObserver {
+public:
+ static PassRefPtr<VTTRegion> create(ScriptExecutionContext& context)
+ {
+ return adoptRef(new VTTRegion(context));
+ }
+
+ virtual ~VTTRegion();
+
+ TextTrack* track() const { return m_track; }
+ void setTrack(TextTrack*);
+
+ const String& id() const { return m_id; }
+ void setId(const String&);
+
+ double width() const { return m_width; }
+ void setWidth(double, ExceptionCode&);
+
+ long height() const { return m_heightInLines; }
+ void setHeight(long, ExceptionCode&);
+
+ double regionAnchorX() const { return m_regionAnchor.x(); }
+ void setRegionAnchorX(double, ExceptionCode&);
+
+ double regionAnchorY() const { return m_regionAnchor.y(); }
+ void setRegionAnchorY(double, ExceptionCode&);
+
+ double viewportAnchorX() const { return m_viewportAnchor.x(); }
+ void setViewportAnchorX(double, ExceptionCode&);
+
+ double viewportAnchorY() const { return m_viewportAnchor.y(); }
+ void setViewportAnchorY(double, ExceptionCode&);
+
+ const AtomicString scroll() const;
+ void setScroll(const AtomicString&, ExceptionCode&);
+
+ void updateParametersFromRegion(VTTRegion*);
+
+ const String& regionSettings() const { return m_settings; }
+ void setRegionSettings(const String&);
+
+ bool isScrollingRegion() { return m_scroll; }
+
+ PassRefPtr<HTMLDivElement> getDisplayTree();
+
+ void appendTextTrackCueBox(PassRefPtr<VTTCueBox>);
+ void displayLastTextTrackCueBox();
+ void willRemoveTextTrackCueBox(VTTCueBox*);
+
+private:
+ VTTRegion(ScriptExecutionContext&);
+
+ Document* ownerDocument() { return toDocument(m_scriptExecutionContext); }
+
+ void prepareRegionDisplayTree();
+
+ // The timer is needed to continue processing when cue scrolling ended.
+ void startTimer();
+ void stopTimer();
+ void scrollTimerFired(Timer<VTTRegion>*);
+
+ enum RegionSetting {
+ None,
+ Id,
+ Width,
+ Height,
+ RegionAnchor,
+ ViewportAnchor,
+ Scroll
+ };
+
+ RegionSetting getSettingFromString(const String&);
+
+ void parseSettingValue(RegionSetting, const String&);
+ void parseSetting(const String&, unsigned*);
+
+ static const AtomicString& textTrackCueContainerShadowPseudoId();
+ static const AtomicString& textTrackCueContainerScrollingClass();
+ static const AtomicString& textTrackRegionShadowPseudoId();
+
+ String m_id;
+ String m_settings;
+
+ double m_width;
+ unsigned m_heightInLines;
+
+ FloatPoint m_regionAnchor;
+ FloatPoint m_viewportAnchor;
+
+ bool m_scroll;
+
+ // 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
+ // is cleared in the TextTrack destructor and it is generally
+ // set/reset within the addRegion and removeRegion methods.
+ TextTrack* m_track;
+
+ // Keep track of the current numeric value of the css "top" property.
+ double m_currentTop;
+
+ // The timer is used to display the next cue line after the current one has
+ // been displayed. It's main use is for scrolling regions and it triggers as
+ // soon as the animation for rolling out one line has finished, but
+ // currently it is used also for non-scrolling regions to use a single
+ // code path.
+ Timer<VTTRegion> m_scrollTimer;
+};
+
+} // namespace WebCore
+
+#endif
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCorehtmltrackVTTRegionidlfromrev165996trunkSourceWebCorehtmltrackTextTrackRegionidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/html/track/VTTRegion.idl (from rev 165996, trunk/Source/WebCore/html/track/TextTrackRegion.idl) (0 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/VTTRegion.idl         (rev 0)
+++ trunk/Source/WebCore/html/track/VTTRegion.idl        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+ Conditional=VIDEO_TRACK & WEBVTT_REGIONS,
+ JSGenerateToNativeObject,
+ Constructor(),
+ ConstructorCallWith=ScriptExecutionContext
+] interface VTTRegion {
+ readonly attribute TextTrack track;
+
+ attribute DOMString id;
+ [SetterRaisesException] attribute double width;
+ [SetterRaisesException] attribute long height;
+ [SetterRaisesException] attribute double regionAnchorX;
+ [SetterRaisesException] attribute double regionAnchorY;
+ [SetterRaisesException] attribute double viewportAnchorX;
+ [SetterRaisesException] attribute double viewportAnchorY;
+ [SetterRaisesException] attribute DOMString scroll;
+};
+
</ins></span></pre></div>
<a id="trunkSourceWebCorehtmltrackVTTRegionListcppfromrev165996trunkSourceWebCorehtmltrackTextTrackRegionListcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/html/track/VTTRegionList.cpp (from rev 165996, trunk/Source/WebCore/html/track/TextTrackRegionList.cpp) (0 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/VTTRegionList.cpp         (rev 0)
+++ trunk/Source/WebCore/html/track/VTTRegionList.cpp        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -0,0 +1,87 @@
</span><ins>+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "VTTRegionList.h"
+
+#if ENABLE(VIDEO_TRACK) && ENABLE(WEBVTT_REGIONS)
+
+
+namespace WebCore {
+
+VTTRegionList::VTTRegionList()
+{
+}
+
+unsigned long VTTRegionList::length() const
+{
+ return m_list.size();
+}
+
+VTTRegion* VTTRegionList::item(unsigned index) const
+{
+ if (index < m_list.size())
+ return m_list[index].get();
+
+ return 0;
+}
+
+VTTRegion* VTTRegionList::getRegionById(const String& id) const
+{
+ if (id.isEmpty())
+ return 0;
+
+ for (const auto& region : m_list) {
+ if (region->id() == id)
+ return region.get();
+ }
+
+ return 0;
+}
+
+void VTTRegionList::add(PassRefPtr<VTTRegion> region)
+{
+ m_list.append(region);
+}
+
+bool VTTRegionList::remove(VTTRegion* region)
+{
+ size_t index = m_list.find(region);
+ if (index == notFound)
+ return false;
+
+ m_list.remove(index);
+ return true;
+}
+
+void VTTRegionList::clear()
+{
+ m_list.clear();
+}
+
+} // namespace WebCore
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCorehtmltrackVTTRegionListhfromrev165996trunkSourceWebCorehtmltrackTextTrackRegionListh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/html/track/VTTRegionList.h (from rev 165996, trunk/Source/WebCore/html/track/TextTrackRegionList.h) (0 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/VTTRegionList.h         (rev 0)
+++ trunk/Source/WebCore/html/track/VTTRegionList.h        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -0,0 +1,66 @@
</span><ins>+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef VTTRegionList_h
+#define VTTRegionList_h
+
+#if ENABLE(VIDEO_TRACK) && ENABLE(WEBVTT_REGIONS)
+
+#include "VTTRegion.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class VTTRegionList : public RefCounted<VTTRegionList> {
+public:
+ static PassRefPtr<VTTRegionList> create()
+ {
+ return adoptRef(new VTTRegionList());
+ }
+
+ ~VTTRegionList() { }
+
+ unsigned long length() const;
+
+ VTTRegion* item(unsigned index) const;
+ VTTRegion* getRegionById(const String&) const;
+
+ void add(PassRefPtr<VTTRegion>);
+ bool remove(VTTRegion*);
+
+private:
+ VTTRegionList();
+ void clear();
+
+ Vector<RefPtr<VTTRegion> > m_list;
+};
+
+} // namespace WebCore
+
+#endif
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCorehtmltrackVTTRegionListidlfromrev165996trunkSourceWebCorehtmltrackTextTrackRegionListidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/html/track/VTTRegionList.idl (from rev 165996, trunk/Source/WebCore/html/track/TextTrackRegionList.idl) (0 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/VTTRegionList.idl         (rev 0)
+++ trunk/Source/WebCore/html/track/VTTRegionList.idl        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+ NoInterfaceObject,
+ Conditional=VIDEO_TRACK & WEBVTT_REGIONS,
+ ImplementationLacksVTable,
+] interface VTTRegionList {
+ readonly attribute unsigned long length;
+ getter VTTRegion item(unsigned long index);
+ VTTRegion getRegionById(DOMString id);
+};
+
</ins></span></pre></div>
<a id="trunkSourceWebCorehtmltrackWebVTTParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/WebVTTParser.cpp (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/WebVTTParser.cpp        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/Source/WebCore/html/track/WebVTTParser.cpp        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -96,12 +96,12 @@
</span><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> unsigned position = 0;
</span><del>- unsigned digitsBeforeDot = scanDigits(value, &position);
</del><ins>+ unsigned digitsBeforeDot = scanDigits(value, position);
</ins><span class="cx"> unsigned digitsAfterDot = 0;
</span><span class="cx"> if (value[position] == '.') {
</span><span class="cx"> position++;
</span><span class="cx">
</span><del>- digitsAfterDot = scanDigits(value, &position);
</del><ins>+ digitsAfterDot = scanDigits(value, position);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // At least one digit is required
</span><span class="lines">@@ -155,7 +155,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(WEBVTT_REGIONS)
</span><del>-void WebVTTParser::getNewRegions(Vector<RefPtr<TextTrackRegion>>& outputRegions)
</del><ins>+void WebVTTParser::getNewRegions(Vector<RefPtr<VTTRegion>>& outputRegions)
</ins><span class="cx"> {
</span><span class="cx"> outputRegions = m_regionList;
</span><span class="cx"> m_regionList.clear();
</span><span class="lines">@@ -451,7 +451,7 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> // Steps 12.5.1 - 12.5.9 - Construct and initialize a WebVTT Region object.
</span><del>- RefPtr<TextTrackRegion> region = TextTrackRegion::create(*m_scriptExecutionContext);
</del><ins>+ RefPtr<VTTRegion> region = VTTRegion::create(*m_scriptExecutionContext);
</ins><span class="cx"> region->setRegionSettings(headerValue);
</span><span class="cx">
</span><span class="cx"> // Step 12.5.10 If the text track list of regions regions contains a region
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackWebVTTParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/WebVTTParser.h (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/WebVTTParser.h        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/Source/WebCore/html/track/WebVTTParser.h        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -39,7 +39,7 @@
</span><span class="cx"> #include "DocumentFragment.h"
</span><span class="cx"> #include "HTMLNames.h"
</span><span class="cx"> #include "TextResourceDecoder.h"
</span><del>-#include "TextTrackRegion.h"
</del><ins>+#include "VTTRegion.h"
</ins><span class="cx"> #include "WebVTTTokenizer.h"
</span><span class="cx"> #include <memory>
</span><span class="cx"> #include <wtf/text/StringBuilder.h>
</span><span class="lines">@@ -148,7 +148,7 @@
</span><span class="cx"> // Transfers ownership of last parsed cues to caller.
</span><span class="cx"> void getNewCues(Vector<RefPtr<WebVTTCueData>>&);
</span><span class="cx"> #if ENABLE(WEBVTT_REGIONS)
</span><del>- void getNewRegions(Vector<RefPtr<TextTrackRegion>>&);
</del><ins>+ void getNewRegions(Vector<RefPtr<VTTRegion>>&);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> // Create the DocumentFragment representation of the WebVTT cue text.
</span><span class="lines">@@ -190,7 +190,7 @@
</span><span class="cx"> Vector<RefPtr<WebVTTCueData>> m_cuelist;
</span><span class="cx">
</span><span class="cx"> #if ENABLE(WEBVTT_REGIONS)
</span><del>- Vector<RefPtr<TextTrackRegion>> m_regionList;
</del><ins>+ Vector<RefPtr<VTTRegion>> m_regionList;
</ins><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderTextTrackLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/TextTrackLoader.cpp (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/TextTrackLoader.cpp        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/Source/WebCore/loader/TextTrackLoader.cpp        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx"> * Copyright (C) 2011 Google Inc. All rights reserved.
</span><ins>+ * Copyright (C) 2014 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -225,7 +226,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(WEBVTT_REGIONS)
</span><del>-void TextTrackLoader::getNewRegions(Vector<RefPtr<TextTrackRegion>>& outputRegions)
</del><ins>+void TextTrackLoader::getNewRegions(Vector<RefPtr<VTTRegion>>& outputRegions)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(m_cueParser);
</span><span class="cx"> if (m_cueParser)
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderTextTrackLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/TextTrackLoader.h (166021 => 166022)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/TextTrackLoader.h        2014-03-20 23:43:33 UTC (rev 166021)
+++ trunk/Source/WebCore/loader/TextTrackLoader.h        2014-03-20 23:47:16 UTC (rev 166022)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2011 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2011, 2014 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx"> void cancelLoad();
</span><span class="cx"> void getNewCues(Vector<RefPtr<TextTrackCue>>& outputCues);
</span><span class="cx"> #if ENABLE(WEBVTT_REGIONS)
</span><del>- void getNewRegions(Vector<RefPtr<TextTrackRegion>>& outputRegions);
</del><ins>+ void getNewRegions(Vector<RefPtr<VTTRegion>>& outputRegions);
</ins><span class="cx"> #endif
</span><span class="cx"> private:
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>