<!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  &lt;bfulgham@apple.com&gt;
+
+        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  &lt;hmuller@adobe.com&gt;
</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>-&lt;!DOCTYPE html&gt;
-&lt;html&gt;
-    &lt;head&gt;
-        &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
-
-        &lt;script src=../../media-file.js&gt;&lt;/script&gt;
-        &lt;script src=../../video-test.js&gt;&lt;/script&gt;
-        &lt;script&gt;
-            var region;
-            var invalidPercentageValues;
-
-            function startTest()
-            {
-                if (!window.TextTrackRegion) {
-                    failTest();
-                    return;
-                }
-
-                region = new TextTrackRegion();
-
-                consoleWrite(&quot;** Test the default indexs of a region. **&quot;);
-                testExpected(&quot;region.track&quot;, null);
-                testExpected(&quot;region.scroll&quot;, &quot;&quot;);
-                testExpected(&quot;region.viewportAnchorX&quot;, 0);
-                testExpected(&quot;region.viewportAnchorY&quot;, 100);
-                testExpected(&quot;region.regionAnchorX&quot;, 0);
-                testExpected(&quot;region.regionAnchorY&quot;, 100);
-                testExpected(&quot;region.height&quot;, 3);
-                testExpected(&quot;region.width&quot;, 100);
-
-                consoleWrite(&quot;&lt;br&gt;** Test that incorrect mutation keeps previous valid values. **&quot;);
-                run(&quot;region.scroll = 'invalid-scroll-value'&quot;);
-                testExpected(&quot;region.scroll&quot;, &quot;&quot;);
-
-                invalidPercentageValues = [-1, 101, -Infinity, Infinity, NaN];
-                for (index in invalidPercentageValues) {
-                  consoleWrite(&quot;&lt;br&gt;Invalid percentage value: &quot; + invalidPercentageValues[index]);
-                  run(&quot;region.viewportAnchorX = invalidPercentageValues[index]&quot;);
-                  testExpected(&quot;region.viewportAnchorX&quot;, 0);
-                  run(&quot;region.viewportAnchorY = invalidPercentageValues[index]&quot;);
-                  testExpected(&quot;region.viewportAnchorY&quot;, 100);
-                  run(&quot;region.regionAnchorX = invalidPercentageValues[index]&quot;);
-                  testExpected(&quot;region.regionAnchorX&quot;, 0);
-                  run(&quot;region.regionAnchorY = invalidPercentageValues[index]&quot;);
-                  testExpected(&quot;region.regionAnchorY&quot;, 100);
-                  run(&quot;region.width = invalidPercentageValues[index]&quot;);
-                  testExpected(&quot;region.width&quot;, 100);
-                }
-
-                run(&quot;region.height = -1&quot;);
-                testExpected(&quot;region.height&quot;, 3);
-
-                consoleWrite(&quot;&lt;br&gt;** Test that proper mutation keeps assigned value. **&quot;);
-                run(&quot;region.height = 130&quot;);
-                testExpected(&quot;region.height&quot;, 130);
-
-                run(&quot;region.viewportAnchorX = 64&quot;);
-                testExpected(&quot;region.viewportAnchorX&quot;, 64);
-                run(&quot;region.viewportAnchorY = 32&quot;);
-                testExpected(&quot;region.viewportAnchorY&quot;, 32);
-                run(&quot;region.regionAnchorX = 16&quot;);
-                testExpected(&quot;region.regionAnchorX&quot;, 16);
-                run(&quot;region.regionAnchorY = 8&quot;);
-                testExpected(&quot;region.regionAnchorY&quot;, 8);
-
-                run(&quot;region.width = 42&quot;);
-                testExpected(&quot;region.width&quot;, 42);
-
-                endTest();
-            }
-
-        &lt;/script&gt;
-    &lt;/head&gt;
-    &lt;body onload=&quot;startTest()&quot;&gt;
-        &lt;p&gt;Tests the constructor and mutation of TextTrackRegion.&lt;/p&gt;
-    &lt;/body&gt;
-&lt;/html&gt;
</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 &lt;= 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 &lt;= 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 &lt;= 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 &lt;= 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 &lt;= 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>-&lt;!DOCTYPE html&gt;
-&lt;html&gt;
-    &lt;head&gt;
-        &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
-
-        &lt;script src=../../media-controls.js&gt;&lt;/script&gt;
-        &lt;script src=../../media-file.js&gt;&lt;/script&gt;
-        &lt;script src=../../video-test.js&gt;&lt;/script&gt;
-        &lt;script&gt;
-        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 &lt; linesCount; ++i) {
-              var lineTop = cueRect.top + i * lineHeight;
-              var lineBottom = cueRect.top + (i+1) * lineHeight;
-
-              if (lineTop &gt;= regionRect.top &amp;&amp; lineBottom &lt;= regionRect.bottom)
-                visibleLines++;
-            }
-
-            return visibleLines;
-        }
-
-        function testRegionsDisplay()
-        {
-            testTrack = video.textTracks[0];
-
-            consoleWrite(&quot;** The text track has only one region **&quot;);
-            testExpected(&quot;testTrack.regions.length&quot;, 1);
-
-            try {
-              region = textTrackDisplayElement(video, 'region');
-              container = textTrackDisplayElement(video, 'region-container');
-            } catch(e) {
-              consoleWrite(e);
-            }
-
-            consoleWrite(&quot;&lt;br&gt;** Inspecting cues displayed within region**&quot;);
-
-            waitForEvent(&quot;seeked&quot;, inspectRegionTree);
-            seekVideo();
-        }
-
-        function seekVideo()
-        {
-            consoleWrite(&quot;&quot;);
-            run(&quot;video.currentTime = &quot; + seekTimes[crtSeekTime++]);
-        }
-
-        function inspectRegionTree()
-        {
-            consoleWrite(&quot;Total cues in region: &quot; + container.children.length);
-            totalVisibleLines = 0;
-
-            for (var i = 0; i &lt; container.children.length; ++i) {
-                var cue = container.children[i];
-                var cueVisibleLines = countVisibleLines(cue);
-                consoleWrite(&quot;Cue content is: &quot; + cue.textContent);
-                consoleWrite(&quot;Cue lines visible from this cue: &quot; + cueVisibleLines);
-
-                totalVisibleLines += cueVisibleLines;
-            }
-
-            testExpected(&quot;totalVisibleLines &lt;= testTrack.regions[0].height&quot;, 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);
-        }
-
-        &lt;/script&gt;
-    &lt;/head&gt;
-    &lt;body&gt;
-        &lt;p&gt;Tests default rendering for TextTrackCues that belong to a TextTrackRegion.&lt;/p&gt;
-        &lt;video controls&gt;
-            &lt;track src=&quot;../captions-webvtt/captions-regions.vtt&quot; kind=&quot;captions&quot; default onload=&quot;startTest()&quot;&gt;
-        &lt;/video&gt;
-    &lt;/body&gt;
-&lt;/html&gt;
</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>-&lt;!DOCTYPE html&gt;
-&lt;html&gt;
-    &lt;head&gt;
-        &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
-
-        &lt;script src=../../media-controls.js&gt;&lt;/script&gt;
-        &lt;script src=../../media-file.js&gt;&lt;/script&gt;
-        &lt;script src=../../video-test.js&gt;&lt;/script&gt;
-        &lt;script&gt;
-        var testTrack;
-        var region;
-        var container;
-
-        function testRegionsDisplay()
-        {
-            testTrack = video.textTracks[0];
-
-            consoleWrite(&quot;** The text track has only one region **&quot;);
-            testExpected(&quot;testTrack.regions.length&quot;, 1);
-
-            try {
-              region = textTrackDisplayElement(video, 'region');
-              container = textTrackDisplayElement(video, 'region-container');
-            } catch(e) {
-              consoleWrite(e);
-            }
-
-            consoleWrite(&quot;&lt;br&gt;** Inspecting the default DOM layout used for regions display **&quot;);
-
-            consoleWrite(&quot;&lt;br&gt;** Only one region should be displayed **&quot;);
-            testExpected(&quot;region.children.length&quot;, 1);
-
-            consoleWrite(&quot;&lt;br&gt;** The child of the region should be the container **&quot;);
-            testExpected(&quot;region.children[0] == container&quot;, true);
-
-            consoleWrite(&quot;&lt;br&gt;** Default pseudo IDs should be set properly&quot;);
-            testExpected(&quot;region.getAttribute('pseudo')&quot;, &quot;-webkit-media-text-track-region&quot;);
-            testExpected(&quot;container.getAttribute('pseudo')&quot;, &quot;-webkit-media-text-track-region-container&quot;);
-
-            endTest();
-        }
-
-        function startTest()
-        {
-            if (!window.TextTrackRegion) {
-                failTest();
-                return;
-            }
-
-            findMediaElement();
-
-            video.src = findMediaFile('video', '../../content/test');
-            waitForEvent('canplaythrough', testRegionsDisplay);
-        }
-
-        &lt;/script&gt;
-    &lt;/head&gt;
-    &lt;body&gt;
-        &lt;p&gt;Tests default DOM layout structure for a TextTrackRegion.&lt;/p&gt;
-        &lt;video controls&gt;
-            &lt;track src=&quot;../captions-webvtt/captions-regions.vtt&quot; kind=&quot;captions&quot; default onload=&quot;startTest()&quot;&gt;
-        &lt;/video&gt;
-    &lt;/body&gt;
-&lt;/html&gt;
</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>-&lt;!DOCTYPE html&gt;
-&lt;html&gt;
-    &lt;head&gt;
-        &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
-
-        &lt;script src=../../media-file.js&gt;&lt;/script&gt;
-        &lt;script src=../../video-test.js&gt;&lt;/script&gt;
-        &lt;script&gt;
-        var testTrack;
-        var region;
-        var regions;
-        var updatedRegion;
-
-        function startTest()
-        {
-            testTrack = document.getElementsByTagName('track')[0];
-
-            consoleWrite(&quot;&lt;br&gt;** Implicit mode disabled and the regions attribute is null **&quot;);
-            testExpected(&quot;testTrack.track.mode&quot;, &quot;disabled&quot;);
-            testExpected(&quot;testTrack.track.regions&quot;, null);
-
-            testTrack.track.mode = &quot;hidden&quot;;
-            regions = testTrack.track.regions;
-
-            consoleWrite(&quot;&lt;br&gt;** The regions attribute should be an empty TextTrackRegionList **&quot;);
-            testExpected(&quot;regions != null&quot;, true);
-            testExpected(&quot;regions.length&quot;, 0);
-
-            region = new TextTrackRegion();
-            region.id = &quot;TestId&quot;;
-
-            consoleWrite(&quot;&lt;br&gt;** The default value of the track attribute of the region is null**&quot;);
-            testExpected(&quot;region.track&quot;, null);
-
-            testTrack.track.addRegion(region);
-
-            consoleWrite(&quot;&lt;br&gt;** The addRegion() method properly updates the TextTrackRegionList object **&quot;);
-            testExpected(&quot;regions.length&quot;, 1);
-            testExpected(&quot;regions[0] == region&quot;, true);
-            testExpected(&quot;regions[0].track == testTrack.track&quot;, true);
-
-            consoleWrite(&quot;&lt;br&gt;** The track attribute should correctly reflect the track to which the region was added to**&quot;);
-            testExpected(&quot;region.track == testTrack.track&quot;, 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 = &quot;up&quot;;
-
-            consoleWrite(&quot;&lt;br&gt;** Adding a region with an existing id should update the existing region **&quot;);
-            testTrack.track.addRegion(updatedRegion);
-            testExpected(&quot;regions[0].viewportAnchorX&quot;, updatedRegion.viewportAnchorX);
-            testExpected(&quot;regions[0].viewportAnchorY&quot;, updatedRegion.viewportAnchorY);
-            testExpected(&quot;regions[0].regionAnchorX&quot;, updatedRegion.regionAnchorX);
-            testExpected(&quot;regions[0].regionAnchorY&quot;, updatedRegion.regionAnchorY);
-            testExpected(&quot;regions[0].height&quot;, updatedRegion.height);
-            testExpected(&quot;regions[0].width&quot;, updatedRegion.width);
-            testExpected(&quot;regions[0].scroll&quot;, updatedRegion.scroll);
-
-            testExpected(&quot;regions[0] != updatedRegion&quot;, true);
-
-            consoleWrite(&quot;&lt;br&gt;** Add the region back and check if removeRegion() removes it properly **&quot;);
-            testTrack.track.addRegion(region);
-            testExpected(&quot;regions.length&quot;, 1);
-            testTrack.track.removeRegion(region);
-            testExpected(&quot;regions.length&quot;, 0);
-
-            consoleWrite(&quot;&lt;br&gt;** In case the region is not found, NotFoundError should be thrown **&quot;);
-            try {
-              testTrack.track.removeRegion(region);
-            } catch(e) {
-              consoleWrite(e);
-            }
-
-            // FIXME(109818): Update test for multiple initial regions (after parsing is supported).
-
-            consoleWrite(&quot;&quot;);
-            endTest();
-        }
-
-        function startTestWithDelay()
-        {
-            setTimeout(startTest, 100);
-        }
-        &lt;/script&gt;
-    &lt;/head&gt;
-    &lt;body onload=&quot;startTestWithDelay()&quot;&gt;
-        &lt;p&gt;Tests TextTrackRegionList functionality: length, operator[], and getRegionById()&lt;/p&gt;
-        &lt;video&gt;
-            &lt;track id=&quot;testTrack&quot; src=&quot;captions-webvtt/captions-fast.vtt&quot;&gt;
-        &lt;/video&gt;
-    &lt;/body&gt;
-&lt;/html&gt;
</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>-&lt;!DOCTYPE html&gt;
-&lt;html&gt;
-    &lt;head&gt;
-        &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
-
-        &lt;script src=../../media-file.js&gt;&lt;/script&gt;
-        &lt;script src=../../video-test.js&gt;&lt;/script&gt;
-        &lt;script&gt;
-        var region;
-
-        function startTest()
-        {
-            if (!window.TextTrackRegion) {
-                failTest();
-                return;
-            }
-
-            findMediaElement();
-            testExpected(&quot;video.textTracks[0].regions.length&quot;, 5);
-
-            consoleWrite(&quot;&quot;);
-            region = video.textTracks[0].regions[0];
-            testExpected(&quot;region.id&quot;, &quot;region_without_settings&quot;);
-
-            consoleWrite(&quot;&quot;);
-            region = video.textTracks[0].regions[1];
-            testExpected(&quot;region.id&quot;, &quot;region_with_all_settings&quot;);
-            testExpected(&quot;region.width&quot;, 32);
-            testExpected(&quot;region.height&quot;, 5);
-            testExpected(&quot;region.regionAnchorX&quot;, 41);
-            testExpected(&quot;region.regionAnchorY&quot;, 20);
-            testExpected(&quot;region.viewportAnchorX&quot;, 31);
-            testExpected(&quot;region.viewportAnchorY&quot;, 84);
-            testExpected(&quot;region.scroll&quot;, &quot;up&quot;);
-
-            consoleWrite(&quot;&quot;);
-            region = video.textTracks[0].regions[2];
-            testExpected(&quot;region.id&quot;, &quot;region_floating_point_anchor&quot;);
-            testExpected(&quot;Math.round(region.regionAnchorX * 1000)&quot;, 41133);
-            testExpected(&quot;Math.round(region.regionAnchorY * 1000)&quot;, 20420);
-            testExpected(&quot;Math.round(region.viewportAnchorX * 1000)&quot;, 32330);
-            testExpected(&quot;Math.round(region.viewportAnchorY * 1000)&quot;, 32440);
-
-            consoleWrite(&quot;&quot;);
-            region = video.textTracks[0].regions[3];
-            testExpected(&quot;region.id&quot;, &quot;not_unique_id&quot;);
-            testExpected(&quot;region.width&quot;, 67);
-
-            consoleWrite(&quot;&quot;);
-            region = video.textTracks[0].regions[4];
-            testExpected(&quot;region.id&quot;, &quot;&quot;);
-
-            consoleWrite(&quot;&quot;);
-            endTest();
-        }
-
-        setCaptionDisplayMode('Automatic');
-        &lt;/script&gt;
-    &lt;/head&gt;
-    &lt;body&gt;
-        &lt;p&gt;Tests proper parsing of various regions present in WebVTT header area.&lt;/p&gt;
-        &lt;video controls&gt;
-            &lt;track src=&quot;../captions-webvtt/header-regions.vtt&quot; kind=&quot;captions&quot; default onload=&quot;startTest()&quot;&gt;
-        &lt;/video&gt;
-
-    &lt;/body&gt;
-&lt;/html&gt;
</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>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+    &lt;head&gt;
+        &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
+
+        &lt;script src=../../media-file.js&gt;&lt;/script&gt;
+        &lt;script src=../../video-test.js&gt;&lt;/script&gt;
+        &lt;script&gt;
+            var region;
+            var invalidPercentageValues;
+
+            function startTest()
+            {
+                if (!window.VTTRegion) {
+                    failTest();
+                    return;
+                }
+
+                region = new VTTRegion();
+                consoleWrite(&quot;** Test instanceof VTTRegion. **&quot;);
+                testExpected(&quot;region instanceof VTTRegion&quot;, true);
+
+                consoleWrite(&quot;** Test the default indexs of a region. **&quot;);
+                testExpected(&quot;region.track&quot;, null);
+                testExpected(&quot;region.scroll&quot;, &quot;&quot;);
+                testExpected(&quot;region.viewportAnchorX&quot;, 0);
+                testExpected(&quot;region.viewportAnchorY&quot;, 100);
+                testExpected(&quot;region.regionAnchorX&quot;, 0);
+                testExpected(&quot;region.regionAnchorY&quot;, 100);
+                testExpected(&quot;region.height&quot;, 3);
+                testExpected(&quot;region.width&quot;, 100);
+
+                consoleWrite(&quot;&lt;br&gt;** Test that incorrect mutation keeps previous valid values. **&quot;);
+                run(&quot;region.scroll = 'invalid-scroll-value'&quot;);
+                testExpected(&quot;region.scroll&quot;, &quot;&quot;);
+
+                invalidPercentageValues = [-1, 101, -Infinity, Infinity, NaN];
+                for (index in invalidPercentageValues) {
+                  consoleWrite(&quot;&lt;br&gt;Invalid percentage value: &quot; + invalidPercentageValues[index]);
+                  run(&quot;region.viewportAnchorX = invalidPercentageValues[index]&quot;);
+                  testExpected(&quot;region.viewportAnchorX&quot;, 0);
+                  run(&quot;region.viewportAnchorY = invalidPercentageValues[index]&quot;);
+                  testExpected(&quot;region.viewportAnchorY&quot;, 100);
+                  run(&quot;region.regionAnchorX = invalidPercentageValues[index]&quot;);
+                  testExpected(&quot;region.regionAnchorX&quot;, 0);
+                  run(&quot;region.regionAnchorY = invalidPercentageValues[index]&quot;);
+                  testExpected(&quot;region.regionAnchorY&quot;, 100);
+                  run(&quot;region.width = invalidPercentageValues[index]&quot;);
+                  testExpected(&quot;region.width&quot;, 100);
+                }
+
+                run(&quot;region.height = -1&quot;);
+                testExpected(&quot;region.height&quot;, 3);
+
+                consoleWrite(&quot;&lt;br&gt;** Test that proper mutation keeps assigned value. **&quot;);
+                run(&quot;region.height = 130&quot;);
+                testExpected(&quot;region.height&quot;, 130);
+
+                run(&quot;region.viewportAnchorX = 64&quot;);
+                testExpected(&quot;region.viewportAnchorX&quot;, 64);
+                run(&quot;region.viewportAnchorY = 32&quot;);
+                testExpected(&quot;region.viewportAnchorY&quot;, 32);
+                run(&quot;region.regionAnchorX = 16&quot;);
+                testExpected(&quot;region.regionAnchorX&quot;, 16);
+                run(&quot;region.regionAnchorY = 8&quot;);
+                testExpected(&quot;region.regionAnchorY&quot;, 8);
+
+                run(&quot;region.width = 42&quot;);
+                testExpected(&quot;region.width&quot;, 42);
+
+                endTest();
+            }
+
+        &lt;/script&gt;
+    &lt;/head&gt;
+    &lt;body onload=&quot;startTest()&quot;&gt;
+        &lt;p&gt;Tests the constructor and mutation of VTTRegion.&lt;/p&gt;
+    &lt;/body&gt;
+&lt;/html&gt;
</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 &lt;= 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 &lt;= 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 &lt;= 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 &lt;= 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 &lt;= 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>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+    &lt;head&gt;
+        &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
+
+        &lt;script src=../../media-controls.js&gt;&lt;/script&gt;
+        &lt;script src=../../media-file.js&gt;&lt;/script&gt;
+        &lt;script src=../../video-test.js&gt;&lt;/script&gt;
+        &lt;script&gt;
+        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 &lt; linesCount; ++i) {
+              var lineTop = cueRect.top + i * lineHeight;
+              var lineBottom = cueRect.top + (i+1) * lineHeight;
+
+              if (lineTop &gt;= regionRect.top &amp;&amp; lineBottom &lt;= regionRect.bottom)
+                visibleLines++;
+            }
+
+            return visibleLines;
+        }
+
+        function testRegionsDisplay()
+        {
+            testTrack = video.textTracks[0];
+
+            consoleWrite(&quot;** The text track has only one region **&quot;);
+            testExpected(&quot;testTrack.regions.length&quot;, 1);
+
+            try {
+              region = textTrackDisplayElement(video, 'region');
+              container = textTrackDisplayElement(video, 'region-container');
+            } catch(e) {
+              consoleWrite(e);
+            }
+
+            consoleWrite(&quot;&lt;br&gt;** Inspecting cues displayed within region**&quot;);
+
+            waitForEvent(&quot;seeked&quot;, inspectRegionTree);
+            seekVideo();
+        }
+
+        function seekVideo()
+        {
+            consoleWrite(&quot;&quot;);
+            run(&quot;video.currentTime = &quot; + seekTimes[crtSeekTime++]);
+        }
+
+        function inspectRegionTree()
+        {
+            consoleWrite(&quot;Total cues in region: &quot; + container.children.length);
+            totalVisibleLines = 0;
+
+            for (var i = 0; i &lt; container.children.length; ++i) {
+                var cue = container.children[i];
+                var cueVisibleLines = countVisibleLines(cue);
+                consoleWrite(&quot;Cue content is: &quot; + cue.textContent);
+                consoleWrite(&quot;Cue lines visible from this cue: &quot; + cueVisibleLines);
+
+                totalVisibleLines += cueVisibleLines;
+            }
+
+            testExpected(&quot;totalVisibleLines &lt;= testTrack.regions[0].height&quot;, 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);
+        }
+
+        &lt;/script&gt;
+    &lt;/head&gt;
+    &lt;body&gt;
+        &lt;p&gt;Tests default rendering for TextTrackCues that belong to a VTTRegion.&lt;/p&gt;
+        &lt;video controls&gt;
+            &lt;track src=&quot;../captions-webvtt/captions-regions.vtt&quot; kind=&quot;captions&quot; default onload=&quot;startTest()&quot;&gt;
+        &lt;/video&gt;
+    &lt;/body&gt;
+&lt;/html&gt;
</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>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+    &lt;head&gt;
+        &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
+
+        &lt;script src=../../media-controls.js&gt;&lt;/script&gt;
+        &lt;script src=../../media-file.js&gt;&lt;/script&gt;
+        &lt;script src=../../video-test.js&gt;&lt;/script&gt;
+        &lt;script&gt;
+        var testTrack;
+        var region;
+        var container;
+
+        function testRegionsDisplay()
+        {
+            testTrack = video.textTracks[0];
+
+            consoleWrite(&quot;** The text track has only one region **&quot;);
+            testExpected(&quot;testTrack.regions.length&quot;, 1);
+
+            try {
+              region = textTrackDisplayElement(video, 'region');
+              container = textTrackDisplayElement(video, 'region-container');
+            } catch(e) {
+              consoleWrite(e);
+            }
+
+            consoleWrite(&quot;&lt;br&gt;** Inspecting the default DOM layout used for regions display **&quot;);
+
+            consoleWrite(&quot;&lt;br&gt;** Only one region should be displayed **&quot;);
+            testExpected(&quot;region.children.length&quot;, 1);
+
+            consoleWrite(&quot;&lt;br&gt;** The child of the region should be the container **&quot;);
+            testExpected(&quot;region.children[0] == container&quot;, true);
+
+            consoleWrite(&quot;&lt;br&gt;** Default pseudo IDs should be set properly&quot;);
+            testExpected(&quot;region.getAttribute('pseudo')&quot;, &quot;-webkit-media-text-track-region&quot;);
+            testExpected(&quot;container.getAttribute('pseudo')&quot;, &quot;-webkit-media-text-track-region-container&quot;);
+
+            endTest();
+        }
+
+        function startTest()
+        {
+            if (!window.VTTRegion) {
+                failTest();
+                return;
+            }
+
+            findMediaElement();
+
+            video.src = findMediaFile('video', '../../content/test');
+            waitForEvent('canplaythrough', testRegionsDisplay);
+        }
+
+        &lt;/script&gt;
+    &lt;/head&gt;
+    &lt;body&gt;
+        &lt;p&gt;Tests default DOM layout structure for a VTTRegion.&lt;/p&gt;
+        &lt;video controls&gt;
+            &lt;track src=&quot;../captions-webvtt/captions-regions.vtt&quot; kind=&quot;captions&quot; default onload=&quot;startTest()&quot;&gt;
+        &lt;/video&gt;
+    &lt;/body&gt;
+&lt;/html&gt;
</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>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+    &lt;head&gt;
+        &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
+
+        &lt;script src=../../media-file.js&gt;&lt;/script&gt;
+        &lt;script src=../../video-test.js&gt;&lt;/script&gt;
+        &lt;script&gt;
+        var testTrack;
+        var region;
+        var regions;
+        var updatedRegion;
+
+        function startTest()
+        {
+            testTrack = document.getElementsByTagName('track')[0];
+
+            consoleWrite(&quot;&lt;br&gt;** Implicit mode disabled and the regions attribute is null **&quot;);
+            testExpected(&quot;testTrack.track.mode&quot;, &quot;disabled&quot;);
+            testExpected(&quot;testTrack.track.regions&quot;, null);
+
+            testTrack.track.mode = &quot;hidden&quot;;
+            regions = testTrack.track.regions;
+
+            consoleWrite(&quot;&lt;br&gt;** The regions attribute should be an empty VTTRegionList **&quot;);
+            testExpected(&quot;regions != null&quot;, true);
+            testExpected(&quot;regions.length&quot;, 0);
+
+            region = new VTTRegion();
+            region.id = &quot;TestId&quot;;
+
+            consoleWrite(&quot;&lt;br&gt;** The default value of the track attribute of the region is null**&quot;);
+            testExpected(&quot;region.track&quot;, null);
+
+            testTrack.track.addRegion(region);
+
+            consoleWrite(&quot;&lt;br&gt;** The addRegion() method properly updates the VTTRegionList object **&quot;);
+            testExpected(&quot;regions.length&quot;, 1);
+            testExpected(&quot;regions[0] == region&quot;, true);
+            testExpected(&quot;regions[0].track == testTrack.track&quot;, true);
+
+            consoleWrite(&quot;&lt;br&gt;** The track attribute should correctly reflect the track to which the region was added to**&quot;);
+            testExpected(&quot;region.track == testTrack.track&quot;, 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 = &quot;up&quot;;
+
+            consoleWrite(&quot;&lt;br&gt;** Adding a region with an existing id should update the existing region **&quot;);
+            testTrack.track.addRegion(updatedRegion);
+            testExpected(&quot;regions[0].viewportAnchorX&quot;, updatedRegion.viewportAnchorX);
+            testExpected(&quot;regions[0].viewportAnchorY&quot;, updatedRegion.viewportAnchorY);
+            testExpected(&quot;regions[0].regionAnchorX&quot;, updatedRegion.regionAnchorX);
+            testExpected(&quot;regions[0].regionAnchorY&quot;, updatedRegion.regionAnchorY);
+            testExpected(&quot;regions[0].height&quot;, updatedRegion.height);
+            testExpected(&quot;regions[0].width&quot;, updatedRegion.width);
+            testExpected(&quot;regions[0].scroll&quot;, updatedRegion.scroll);
+
+            testExpected(&quot;regions[0] != updatedRegion&quot;, true);
+
+            consoleWrite(&quot;&lt;br&gt;** Add the region back and check if removeRegion() removes it properly **&quot;);
+            testTrack.track.addRegion(region);
+            testExpected(&quot;regions.length&quot;, 1);
+            testTrack.track.removeRegion(region);
+            testExpected(&quot;regions.length&quot;, 0);
+
+            consoleWrite(&quot;&lt;br&gt;** In case the region is not found, NotFoundError should be thrown **&quot;);
+            try {
+              testTrack.track.removeRegion(region);
+            } catch(e) {
+              consoleWrite(e);
+            }
+
+            // FIXME(109818): Update test for multiple initial regions (after parsing is supported).
+
+            consoleWrite(&quot;&quot;);
+            endTest();
+        }
+
+        function startTestWithDelay()
+        {
+            setTimeout(startTest, 100);
+        }
+        &lt;/script&gt;
+    &lt;/head&gt;
+    &lt;body onload=&quot;startTestWithDelay()&quot;&gt;
+        &lt;p&gt;Tests VTTRegionList functionality: length, operator[], and getRegionById()&lt;/p&gt;
+        &lt;video&gt;
+            &lt;track id=&quot;testTrack&quot; src=&quot;../captions-webvtt/captions-fast.vtt&quot;&gt;
+        &lt;/video&gt;
+    &lt;/body&gt;
+&lt;/html&gt;
</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>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+    &lt;head&gt;
+        &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
+
+        &lt;script src=../../media-file.js&gt;&lt;/script&gt;
+        &lt;script src=../../video-test.js&gt;&lt;/script&gt;
+        &lt;script&gt;
+        var region;
+
+        function startTest()
+        {
+            if (!window.VTTRegion) {
+                failTest();
+                return;
+            }
+
+            findMediaElement();
+            testExpected(&quot;video.textTracks[0].regions.length&quot;, 5);
+
+            consoleWrite(&quot;&quot;);
+            region = video.textTracks[0].regions[0];
+            testExpected(&quot;region.id&quot;, &quot;region_without_settings&quot;);
+
+            consoleWrite(&quot;&quot;);
+            region = video.textTracks[0].regions[1];
+            testExpected(&quot;region.id&quot;, &quot;region_with_all_settings&quot;);
+            testExpected(&quot;region.width&quot;, 32);
+            testExpected(&quot;region.height&quot;, 5);
+            testExpected(&quot;region.regionAnchorX&quot;, 41);
+            testExpected(&quot;region.regionAnchorY&quot;, 20);
+            testExpected(&quot;region.viewportAnchorX&quot;, 31);
+            testExpected(&quot;region.viewportAnchorY&quot;, 84);
+            testExpected(&quot;region.scroll&quot;, &quot;up&quot;);
+
+            consoleWrite(&quot;&quot;);
+            region = video.textTracks[0].regions[2];
+            testExpected(&quot;region.id&quot;, &quot;region_floating_point_anchor&quot;);
+            testExpected(&quot;Math.round(region.regionAnchorX * 1000)&quot;, 41133);
+            testExpected(&quot;Math.round(region.regionAnchorY * 1000)&quot;, 20420);
+            testExpected(&quot;Math.round(region.viewportAnchorX * 1000)&quot;, 32330);
+            testExpected(&quot;Math.round(region.viewportAnchorY * 1000)&quot;, 32440);
+
+            consoleWrite(&quot;&quot;);
+            region = video.textTracks[0].regions[3];
+            testExpected(&quot;region.id&quot;, &quot;not_unique_id&quot;);
+            testExpected(&quot;region.width&quot;, 67);
+
+            consoleWrite(&quot;&quot;);
+            region = video.textTracks[0].regions[4];
+            testExpected(&quot;region.id&quot;, &quot;&quot;);
+
+            consoleWrite(&quot;&quot;);
+            endTest();
+        }
+
+        setCaptionDisplayMode('Automatic');
+        &lt;/script&gt;
+    &lt;/head&gt;
+    &lt;body&gt;
+        &lt;p&gt;Tests proper parsing of various regions present in WebVTT header area.&lt;/p&gt;
+        &lt;video controls&gt;
+            &lt;track src=&quot;../captions-webvtt/header-regions.vtt&quot; kind=&quot;captions&quot; default onload=&quot;startTest()&quot;&gt;
+        &lt;/video&gt;
+
+    &lt;/body&gt;
+&lt;/html&gt;
</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  &lt;bfulgham@apple.com&gt;
+
+        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  &lt;simon.fraser@apple.com&gt;
</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 = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7ACD88D214C08BD60084EDD2 /* InspectorIndexedDBAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorIndexedDBAgent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7ADE722510CBBB9B006B3B3A /* ContextMenuProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContextMenuProvider.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                7AF9B1FC18CFB2DF00C64BEF /* TextTrackRegion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextTrackRegion.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                7AF9B1FD18CFB2DF00C64BEF /* TextTrackRegion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextTrackRegion.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                7AF9B1FE18CFB2DF00C64BEF /* TextTrackRegion.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TextTrackRegion.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
-                7AF9B1FF18CFB2DF00C64BEF /* TextTrackRegionList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextTrackRegionList.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                7AF9B20018CFB2DF00C64BEF /* TextTrackRegionList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextTrackRegionList.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                7AF9B20118CFB2DF00C64BEF /* TextTrackRegionList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TextTrackRegionList.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
-                7AF9B20818CFB5F200C64BEF /* JSTextTrackRegion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTextTrackRegion.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                7AF9B20918CFB5F200C64BEF /* JSTextTrackRegion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTextTrackRegion.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                7AF9B20A18CFB5F300C64BEF /* JSTextTrackRegionList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTextTrackRegionList.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                7AF9B20B18CFB5F300C64BEF /* JSTextTrackRegionList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTextTrackRegionList.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                7AF9B1FC18CFB2DF00C64BEF /* VTTRegion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VTTRegion.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7AF9B1FD18CFB2DF00C64BEF /* VTTRegion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VTTRegion.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7AF9B1FE18CFB2DF00C64BEF /* VTTRegion.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VTTRegion.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7AF9B1FF18CFB2DF00C64BEF /* VTTRegionList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VTTRegionList.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7AF9B20018CFB2DF00C64BEF /* VTTRegionList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VTTRegionList.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7AF9B20118CFB2DF00C64BEF /* VTTRegionList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VTTRegionList.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7AF9B20818CFB5F200C64BEF /* JSVTTRegion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVTTRegion.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7AF9B20918CFB5F200C64BEF /* JSVTTRegion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVTTRegion.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7AF9B20A18CFB5F300C64BEF /* JSVTTRegionList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVTTRegionList.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7AF9B20B18CFB5F300C64BEF /* JSVTTRegionList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVTTRegionList.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 7C2BDD3B17C7F98B0038FF15 /* JSDOMGlobalObjectTask.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMGlobalObjectTask.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C2BDD3C17C7F98B0038FF15 /* JSDOMGlobalObjectTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMGlobalObjectTask.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C522D4915B477E8009B7C95 /* InspectorOverlay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorOverlay.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</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 &quot;TextTrackRegionList.h&quot;
</del><ins>+#include &quot;VTTRegionList.h&quot;
</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-&gt;track()-&gt;mode() == TextTrack::disabledKeyword())
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        TextTrackRegion* region = cue-&gt;track()-&gt;regions()-&gt;getRegionById(cue-&gt;regionId());
</del><ins>+        VTTRegion* region = cue-&gt;track()-&gt;regions()-&gt;getRegionById(cue-&gt;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 &quot;TextTrackCueList.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBVTT_REGIONS)
</span><del>-#include &quot;TextTrackRegionList.h&quot;
</del><ins>+#include &quot;VTTRegionList.h&quot;
</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&lt;RefPtr&lt;TextTrackRegion&gt;&gt; newRegions;
</del><ins>+    Vector&lt;RefPtr&lt;VTTRegion&gt;&gt; newRegions;
</ins><span class="cx">     m_loader-&gt;getNewRegions(newRegions);
</span><span class="cx"> 
</span><span class="cx">     for (size_t i = 0; i &lt; 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 &quot;SourceBuffer.h&quot;
</span><span class="cx"> #include &quot;TextTrackCueList.h&quot;
</span><span class="cx"> #include &quot;TextTrackList.h&quot;
</span><del>-#include &quot;TextTrackRegionList.h&quot;
</del><ins>+#include &quot;VTTRegion.h&quot;
+#include &quot;VTTRegionList.h&quot;
</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) &amp;&amp; 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&lt;TextTrackRegion&gt; prpRegion)
</del><ins>+void TextTrack::addRegion(PassRefPtr&lt;VTTRegion&gt; prpRegion)
</ins><span class="cx"> {
</span><span class="cx">     if (!prpRegion)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    RefPtr&lt;TextTrackRegion&gt; region = prpRegion;
-    TextTrackRegionList* regionList = ensureTextTrackRegionList();
</del><ins>+    RefPtr&lt;VTTRegion&gt; 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-&gt;getRegionById(region-&gt;id());
</del><ins>+    VTTRegion* existingRegion = regionList-&gt;getRegionById(region-&gt;id());
</ins><span class="cx">     if (existingRegion) {
</span><span class="cx">         existingRegion-&gt;updateParametersFromRegion(region.get());
</span><span class="cx">         return;
</span><span class="lines">@@ -395,7 +396,7 @@
</span><span class="cx">     regionList-&gt;add(region);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TextTrack::removeRegion(TextTrackRegion* region, ExceptionCode &amp;ec)
</del><ins>+void TextTrack::removeRegion(VTTRegion* region, ExceptionCode &amp;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) &amp;&amp; ENABLE(WEBVTT_REGIONS)
</span><del>-    TextTrackRegionList* regions();
-    void addRegion(PassRefPtr&lt;TextTrackRegion&gt;);
-    void removeRegion(TextTrackRegion*, ExceptionCode&amp;);
</del><ins>+    VTTRegionList* regions();
+    void addRegion(PassRefPtr&lt;VTTRegion&gt;);
+    void removeRegion(VTTRegion*, ExceptionCode&amp;);
</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) &amp;&amp; ENABLE(WEBVTT_REGIONS)
</span><del>-    TextTrackRegionList* ensureTextTrackRegionList();
-    RefPtr&lt;TextTrackRegionList&gt; m_regions;
</del><ins>+    VTTRegionList* ensureVTTRegionList();
+    RefPtr&lt;VTTRegionList&gt; 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) &amp;&amp; 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 &lt;wtf/text/StringBuilder.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBVTT_REGIONS)
</span><del>-#include &quot;TextTrackRegionList.h&quot;
</del><ins>+#include &quot;VTTRegionList.h&quot;
</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
- * &quot;AS IS&quot; 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 &quot;config.h&quot;
-
-#if ENABLE(VIDEO_TRACK) &amp;&amp; ENABLE(WEBVTT_REGIONS)
-
-#include &quot;TextTrackRegion.h&quot;
-
-#include &quot;ClientRect.h&quot;
-#include &quot;DOMTokenList.h&quot;
-#include &quot;ExceptionCodePlaceholder.h&quot;
-#include &quot;HTMLDivElement.h&quot;
-#include &quot;Logging.h&quot;
-#include &quot;RenderElement.h&quot;
-#include &quot;VTTCue.h&quot;
-#include &quot;WebVTTParser.h&quot;
-#include &lt;wtf/MathExtras.h&gt;
-
-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&amp; context)
-    : ContextDestructionObserver(&amp;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, &amp;TextTrackRegion::scrollTimerFired)
-{
-}
-
-TextTrackRegion::~TextTrackRegion()
-{
-}
-
-void TextTrackRegion::setTrack(TextTrack* track)
-{
-    m_track = track;
-}
-
-void TextTrackRegion::setId(const String&amp; id)
-{
-    m_id = id;
-}
-
-void TextTrackRegion::setWidth(double value, ExceptionCode&amp; ec)
-{
-    if (std::isinf(value) || std::isnan(value)) {
-        ec = TypeError;
-        return;
-    }
-
-    if (value &lt; 0 || value &gt; 100) {
-        ec = INDEX_SIZE_ERR;
-        return;
-    }
-
-    m_width = value;
-}
-
-void TextTrackRegion::setHeight(long value, ExceptionCode&amp; ec)
-{
-    if (value &lt; 0) {
-        ec = INDEX_SIZE_ERR;
-        return;
-    }
-
-    m_heightInLines = value;
-}
-
-void TextTrackRegion::setRegionAnchorX(double value, ExceptionCode&amp; ec)
-{
-    if (std::isinf(value) || std::isnan(value)) {
-        ec = TypeError;
-        return;
-    }
-
-    if (value &lt; 0 || value &gt; 100) {
-        ec = INDEX_SIZE_ERR;
-        return;
-    }
-
-    m_regionAnchor.setX(value);
-}
-
-void TextTrackRegion::setRegionAnchorY(double value, ExceptionCode&amp; ec)
-{
-    if (std::isinf(value) || std::isnan(value)) {
-        ec = TypeError;
-        return;
-    }
-
-    if (value &lt; 0 || value &gt; 100) {
-        ec = INDEX_SIZE_ERR;
-        return;
-    }
-
-    m_regionAnchor.setY(value);
-}
-
-void TextTrackRegion::setViewportAnchorX(double value, ExceptionCode&amp; ec)
-{
-    if (std::isinf(value) || std::isnan(value)) {
-        ec = TypeError;
-        return;
-    }
-
-    if (value &lt; 0 || value &gt; 100) {
-        ec = INDEX_SIZE_ERR;
-        return;
-    }
-
-    m_viewportAnchor.setX(value);
-}
-
-void TextTrackRegion::setViewportAnchorY(double value, ExceptionCode&amp; ec)
-{
-    if (std::isinf(value) || std::isnan(value)) {
-        ec = TypeError;
-        return;
-    }
-
-    if (value &lt; 0 || value &gt; 100) {
-        ec = INDEX_SIZE_ERR;
-        return;
-    }
-
-    m_viewportAnchor.setY(value);
-}
-
-const AtomicString TextTrackRegion::scroll() const
-{
-    DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, upScrollValueKeyword, (&quot;up&quot;, AtomicString::ConstructFromLiteral));
-
-    if (m_scroll)
-        return upScrollValueKeyword;
-
-    return &quot;&quot;;
-}
-
-void TextTrackRegion::setScroll(const AtomicString&amp; value, ExceptionCode&amp; ec)
-{
-    DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, upScrollValueKeyword, (&quot;up&quot;, AtomicString::ConstructFromLiteral));
-
-    if (value != emptyString() &amp;&amp; value != upScrollValueKeyword) {
-        ec = SYNTAX_ERR;
-        return;
-    }
-
-    m_scroll = value == upScrollValueKeyword;
-}
-
-void TextTrackRegion::updateParametersFromRegion(TextTrackRegion* region)
-{
-    m_heightInLines = region-&gt;height();
-    m_width = region-&gt;width();
-
-    m_regionAnchor = FloatPoint(region-&gt;regionAnchorX(), region-&gt;regionAnchorY());
-    m_viewportAnchor = FloatPoint(region-&gt;viewportAnchorX(), region-&gt;viewportAnchorY());
-
-    setScroll(region-&gt;scroll(), ASSERT_NO_EXCEPTION);
-}
-
-void TextTrackRegion::setRegionSettings(const String&amp; input)
-{
-    m_settings = input;
-    unsigned position = 0;
-
-    while (position &lt; input.length()) {
-        while (position &lt; input.length() &amp;&amp; WebVTTParser::isValidSettingDelimiter(input[position]))
-            position++;
-
-        if (position &gt;= input.length())
-            break;
-
-        parseSetting(input, &amp;position);
-    }
-}
-
-TextTrackRegion::RegionSetting TextTrackRegion::getSettingFromString(const String&amp; setting)
-{
-    DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, idKeyword, (&quot;id&quot;, AtomicString::ConstructFromLiteral));
-    DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, heightKeyword, (&quot;height&quot;, AtomicString::ConstructFromLiteral));
-    DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, widthKeyword, (&quot;width&quot;, AtomicString::ConstructFromLiteral));
-    DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, regionAnchorKeyword, (&quot;regionanchor&quot;, AtomicString::ConstructFromLiteral));
-    DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, viewportAnchorKeyword, (&quot;viewportanchor&quot;, AtomicString::ConstructFromLiteral));
-    DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, scrollKeyword, (&quot;scroll&quot;, 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&amp; value)
-{
-    DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, scrollUpValueKeyword, (&quot;up&quot;, AtomicString::ConstructFromLiteral));
-
-    switch (setting) {
-    case Id:
-        if (value.find(&quot;--&gt;&quot;) == notFound)
-            m_id = value;
-        break;
-    case Width: {
-        float floatWidth;
-        if (WebVTTParser::parseFloatPercentageValue(value, floatWidth))
-            m_width = floatWidth;
-        else
-            LOG(Media, &quot;TextTrackRegion::parseSettingValue, invalid Width&quot;);
-        break;
-    }
-    case Height: {
-        unsigned position = 0;
-        int number;
-        if (WebVTTParser::collectDigitsToInt(value, &amp;position, number) &amp;&amp; position == value.length())
-            m_heightInLines = number;
-        else
-            LOG(Media, &quot;TextTrackRegion::parseSettingValue, invalid Height&quot;);
-        break;
-    }
-    case RegionAnchor:
-        if (!WebVTTParser::parseFloatPercentageValuePair(value, ',', m_regionAnchor))
-            LOG(Media, &quot;TextTrackRegion::parseSettingValue, invalid RegionAnchor&quot;);
-        break;
-    case ViewportAnchor:
-        if (!WebVTTParser::parseFloatPercentageValuePair(value, ',', m_viewportAnchor))
-            LOG(Media, &quot;TextTrackRegion::parseSettingValue, invalid ViewportAnchor&quot;);
-        break;
-    case Scroll:
-        if (value == scrollUpValueKeyword)
-            m_scroll = true;
-        else
-            LOG(Media, &quot;TextTrackRegion::parseSettingValue, invalid Scroll&quot;);
-        break;
-    case None:
-        break;
-    }
-}
-
-void TextTrackRegion::parseSetting(const String&amp; 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&amp; TextTrackRegion::textTrackCueContainerScrollingClass()
-{
-    DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, trackRegionCueContainerScrollingClass, (&quot;scrolling&quot;, AtomicString::ConstructFromLiteral));
-
-    return trackRegionCueContainerScrollingClass;
-}
-
-const AtomicString&amp; TextTrackRegion::textTrackCueContainerShadowPseudoId()
-{
-    DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, trackRegionCueContainerPseudoId,
-        (&quot;-webkit-media-text-track-region-container&quot;, AtomicString::ConstructFromLiteral));
-
-    return trackRegionCueContainerPseudoId;
-}
-
-const AtomicString&amp; TextTrackRegion::textTrackRegionShadowPseudoId()
-{
-    DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, trackRegionShadowPseudoId,
-        (&quot;-webkit-media-text-track-region&quot;, AtomicString::ConstructFromLiteral));
-
-    return trackRegionShadowPseudoId;
-}
-
-void TextTrackRegion::appendTextTrackCueBox(PassRefPtr&lt;VTTCueBox&gt; displayBox)
-{
-    ASSERT(m_cueContainer);
-
-    if (m_cueContainer-&gt;contains(displayBox.get()))
-        return;
-
-    m_cueContainer-&gt;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-&gt;renderer() || !m_cueContainer-&gt;childNodeCount() || m_scrollTimer.isActive())
-        return;
-
-    // If it's a scrolling region, add the scrolling class.
-    if (isScrollingRegion())
-        m_cueContainer-&gt;classList()-&gt;add(textTrackCueContainerScrollingClass(), IGNORE_EXCEPTION);
-
-    float regionBottom = m_regionDisplayTree-&gt;getBoundingClientRect()-&gt;bottom();
-
-    // Find first cue that is not entirely displayed and scroll it upwards.
-    for (size_t i = 0; i &lt; m_cueContainer-&gt;childNodeCount() &amp;&amp; !m_scrollTimer.isActive(); ++i) {
-        float childTop = static_cast&lt;HTMLDivElement*&gt;(m_cueContainer-&gt;childNode(i))-&gt;getBoundingClientRect()-&gt;top();
-        float childBottom = static_cast&lt;HTMLDivElement*&gt;(m_cueContainer-&gt;childNode(i))-&gt;getBoundingClientRect()-&gt;bottom();
-
-        if (regionBottom &gt;= childBottom)
-            continue;
-
-        float height = childBottom - childTop;
-
-        m_currentTop -= std::min(height, childBottom - regionBottom);
-        m_cueContainer-&gt;setInlineStyleProperty(CSSPropertyTop, m_currentTop, CSSPrimitiveValue::CSS_PX);
-
-        startTimer();
-    }
-}
-
-void TextTrackRegion::willRemoveTextTrackCueBox(VTTCueBox* box)
-{
-    LOG(Media, &quot;TextTrackRegion::willRemoveTextTrackCueBox&quot;);
-    ASSERT(m_cueContainer-&gt;contains(box));
-
-    double boxHeight = box-&gt;getBoundingClientRect()-&gt;bottom() - box-&gt;getBoundingClientRect()-&gt;top();
-
-    m_cueContainer-&gt;classList()-&gt;remove(textTrackCueContainerScrollingClass(), IGNORE_EXCEPTION);
-
-    m_currentTop += boxHeight;
-    m_cueContainer-&gt;setInlineStyleProperty(CSSPropertyTop, m_currentTop, CSSPrimitiveValue::CSS_PX);
-}
-
-PassRefPtr&lt;HTMLDivElement&gt; 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-&gt;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-&gt;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-&gt;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-&gt;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-&gt;setInlineStyleProperty(CSSPropertyTop, 0.0f, CSSPrimitiveValue::CSS_PX);
-
-    m_cueContainer-&gt;setPseudo(textTrackCueContainerShadowPseudoId());
-    m_regionDisplayTree-&gt;appendChild(m_cueContainer);
-
-    // 7.5 Every WebVTT region object is initialised with the following CSS
-    m_regionDisplayTree-&gt;setPseudo(textTrackRegionShadowPseudoId());
-}
-
-void TextTrackRegion::startTimer()
-{
-    LOG(Media, &quot;TextTrackRegion::startTimer&quot;);
-
-    if (m_scrollTimer.isActive())
-        return;
-
-    double duration = isScrollingRegion() ? scrollTime : 0;
-    m_scrollTimer.startOneShot(duration);
-}
-
-void TextTrackRegion::stopTimer()
-{
-    LOG(Media, &quot;TextTrackRegion::stopTimer&quot;);
-
-    if (m_scrollTimer.isActive())
-        m_scrollTimer.stop();
-}
-
-void TextTrackRegion::scrollTimerFired(Timer&lt;TextTrackRegion&gt;*)
-{
-    LOG(Media, &quot;TextTrackRegion::scrollTimerFired&quot;);
-
-    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
- * &quot;AS IS&quot; 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) &amp;&amp; ENABLE(WEBVTT_REGIONS)
-
-#include &quot;ContextDestructionObserver.h&quot;
-#include &quot;Document.h&quot;
-#include &quot;FloatPoint.h&quot;
-#include &quot;TextTrack.h&quot;
-#include &lt;wtf/RefCounted.h&gt;
-
-namespace WebCore {
-
-class HTMLDivElement;
-class VTTCueBox;
-
-class TextTrackRegion : public RefCounted&lt;TextTrackRegion&gt;, public ContextDestructionObserver {
-public:
-    static PassRefPtr&lt;TextTrackRegion&gt; create(ScriptExecutionContext&amp; context)
-    {
-        return adoptRef(new TextTrackRegion(context));
-    }
-
-    virtual ~TextTrackRegion();
-
-    TextTrack* track() const { return m_track; }
-    void setTrack(TextTrack*);
-
-    const String&amp; id() const { return m_id; }
-    void setId(const String&amp;);
-
-    double width() const { return m_width; }
-    void setWidth(double, ExceptionCode&amp;);
-
-    long height() const { return m_heightInLines; }
-    void setHeight(long, ExceptionCode&amp;);
-
-    double regionAnchorX() const { return m_regionAnchor.x(); }
-    void setRegionAnchorX(double, ExceptionCode&amp;);
-
-    double regionAnchorY() const { return m_regionAnchor.y(); }
-    void setRegionAnchorY(double, ExceptionCode&amp;);
-
-    double viewportAnchorX() const { return m_viewportAnchor.x(); }
-    void setViewportAnchorX(double, ExceptionCode&amp;);
-
-    double viewportAnchorY() const { return m_viewportAnchor.y(); }
-    void setViewportAnchorY(double, ExceptionCode&amp;);
-
-    const AtomicString scroll() const;
-    void setScroll(const AtomicString&amp;, ExceptionCode&amp;);
-
-    void updateParametersFromRegion(TextTrackRegion*);
-
-    const String&amp; regionSettings() const { return m_settings; }
-    void setRegionSettings(const String&amp;);
-
-    bool isScrollingRegion() { return m_scroll; }
-
-    PassRefPtr&lt;HTMLDivElement&gt; getDisplayTree();
-    
-    void appendTextTrackCueBox(PassRefPtr&lt;VTTCueBox&gt;);
-    void displayLastTextTrackCueBox();
-    void willRemoveTextTrackCueBox(VTTCueBox*);
-
-private:
-    TextTrackRegion(ScriptExecutionContext&amp;);
-
-    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&lt;TextTrackRegion&gt;*);
-
-    enum RegionSetting {
-        None,
-        Id,
-        Width,
-        Height,
-        RegionAnchor,
-        ViewportAnchor,
-        Scroll
-    };
-
-    RegionSetting getSettingFromString(const String&amp;);
-
-    void parseSettingValue(RegionSetting, const String&amp;);
-    void parseSetting(const String&amp;, unsigned*);
-
-    static const AtomicString&amp; textTrackCueContainerShadowPseudoId();
-    static const AtomicString&amp; textTrackCueContainerScrollingClass();
-    static const AtomicString&amp; 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&lt;HTMLDivElement&gt; m_cueContainer;
-    RefPtr&lt;HTMLDivElement&gt; 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 &quot;top&quot; 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&lt;TextTrackRegion&gt; 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 &amp; 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 &quot;config.h&quot;
-
-#if ENABLE(VIDEO_TRACK) &amp;&amp; ENABLE(WEBVTT_REGIONS)
-
-#include &quot;TextTrackRegionList.h&quot;
-
-namespace WebCore {
-
-TextTrackRegionList::TextTrackRegionList()
-{
-}
-
-unsigned long TextTrackRegionList::length() const
-{
-    return m_list.size();
-}
-
-TextTrackRegion* TextTrackRegionList::item(unsigned index) const
-{
-    if (index &lt; m_list.size())
-        return m_list[index].get();
-
-    return 0;
-}
-
-TextTrackRegion* TextTrackRegionList::getRegionById(const String&amp; id) const
-{
-    if (id.isEmpty())
-        return 0;
-
-    for (const auto&amp; region : m_list) {
-        if (region-&gt;id() == id)
-            return region.get();
-    }
-
-    return 0;
-}
-
-void TextTrackRegionList::add(PassRefPtr&lt;TextTrackRegion&gt; 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) &amp;&amp; ENABLE(WEBVTT_REGIONS)
-
-#include &quot;TextTrackRegion.h&quot;
-#include &lt;wtf/PassRefPtr.h&gt;
-#include &lt;wtf/RefCounted.h&gt;
-#include &lt;wtf/Vector.h&gt;
-
-namespace WebCore {
-
-class TextTrackRegionList : public RefCounted&lt;TextTrackRegionList&gt; {
-public:
-    static PassRefPtr&lt;TextTrackRegionList&gt; create()
-    {
-        return adoptRef(new TextTrackRegionList());
-    }
-
-    ~TextTrackRegionList() { }
-
-    unsigned long length() const;
-
-    TextTrackRegion* item(unsigned index) const;
-    TextTrackRegion* getRegionById(const String&amp;) const;
-
-    void add(PassRefPtr&lt;TextTrackRegion&gt;);
-    bool remove(TextTrackRegion*);
-
-private:
-    TextTrackRegionList();
-    void clear();
-
-    Vector&lt;RefPtr&lt;TextTrackRegion&gt; &gt; 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 &amp; 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 &lt;wtf/text/StringBuilder.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBVTT_REGIONS)
</span><del>-#include &quot;TextTrackRegionList.h&quot;
</del><ins>+#include &quot;VTTRegionList.h&quot;
</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 &amp;&amp; track()) {
</span><del>-        if (TextTrackRegionList* regions = track()-&gt;regions()) {
-            if (TextTrackRegion* region = regions-&gt;getRegionById(m_regionId))
</del><ins>+        if (VTTRegionList* regions = track()-&gt;regions()) {
+            if (VTTRegion* region = regions-&gt;getRegionById(m_regionId))
</ins><span class="cx">                 region-&gt;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
+ * &quot;AS IS&quot; 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 &quot;config.h&quot;
+#include &quot;VTTRegion.h&quot;
+
+#if ENABLE(VIDEO_TRACK) &amp;&amp; ENABLE(WEBVTT_REGIONS)
+
+#include &quot;ClientRect.h&quot;
+#include &quot;DOMTokenList.h&quot;
+#include &quot;ExceptionCodePlaceholder.h&quot;
+#include &quot;HTMLDivElement.h&quot;
+#include &quot;Logging.h&quot;
+#include &quot;RenderElement.h&quot;
+#include &quot;VTTCue.h&quot;
+#include &quot;WebVTTParser.h&quot;
+#include &lt;wtf/MathExtras.h&gt;
+
+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&amp; context)
+    : ContextDestructionObserver(&amp;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, &amp;VTTRegion::scrollTimerFired)
+{
+}
+
+VTTRegion::~VTTRegion()
+{
+}
+
+void VTTRegion::setTrack(TextTrack* track)
+{
+    m_track = track;
+}
+
+void VTTRegion::setId(const String&amp; id)
+{
+    m_id = id;
+}
+
+void VTTRegion::setWidth(double value, ExceptionCode&amp; ec)
+{
+    if (std::isinf(value) || std::isnan(value)) {
+        ec = TypeError;
+        return;
+    }
+
+    if (value &lt; 0 || value &gt; 100) {
+        ec = INDEX_SIZE_ERR;
+        return;
+    }
+
+    m_width = value;
+}
+
+void VTTRegion::setHeight(long value, ExceptionCode&amp; ec)
+{
+    if (value &lt; 0) {
+        ec = INDEX_SIZE_ERR;
+        return;
+    }
+
+    m_heightInLines = value;
+}
+
+void VTTRegion::setRegionAnchorX(double value, ExceptionCode&amp; ec)
+{
+    if (std::isinf(value) || std::isnan(value)) {
+        ec = TypeError;
+        return;
+    }
+
+    if (value &lt; 0 || value &gt; 100) {
+        ec = INDEX_SIZE_ERR;
+        return;
+    }
+
+    m_regionAnchor.setX(value);
+}
+
+void VTTRegion::setRegionAnchorY(double value, ExceptionCode&amp; ec)
+{
+    if (std::isinf(value) || std::isnan(value)) {
+        ec = TypeError;
+        return;
+    }
+
+    if (value &lt; 0 || value &gt; 100) {
+        ec = INDEX_SIZE_ERR;
+        return;
+    }
+
+    m_regionAnchor.setY(value);
+}
+
+void VTTRegion::setViewportAnchorX(double value, ExceptionCode&amp; ec)
+{
+    if (std::isinf(value) || std::isnan(value)) {
+        ec = TypeError;
+        return;
+    }
+
+    if (value &lt; 0 || value &gt; 100) {
+        ec = INDEX_SIZE_ERR;
+        return;
+    }
+
+    m_viewportAnchor.setX(value);
+}
+
+void VTTRegion::setViewportAnchorY(double value, ExceptionCode&amp; ec)
+{
+    if (std::isinf(value) || std::isnan(value)) {
+        ec = TypeError;
+        return;
+    }
+
+    if (value &lt; 0 || value &gt; 100) {
+        ec = INDEX_SIZE_ERR;
+        return;
+    }
+
+    m_viewportAnchor.setY(value);
+}
+
+const AtomicString VTTRegion::scroll() const
+{
+    DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, upScrollValueKeyword, (&quot;up&quot;, AtomicString::ConstructFromLiteral));
+
+    if (m_scroll)
+        return upScrollValueKeyword;
+
+    return &quot;&quot;;
+}
+
+void VTTRegion::setScroll(const AtomicString&amp; value, ExceptionCode&amp; ec)
+{
+    DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, upScrollValueKeyword, (&quot;up&quot;, AtomicString::ConstructFromLiteral));
+
+    if (value != emptyString() &amp;&amp; value != upScrollValueKeyword) {
+        ec = SYNTAX_ERR;
+        return;
+    }
+
+    m_scroll = value == upScrollValueKeyword;
+}
+
+void VTTRegion::updateParametersFromRegion(VTTRegion* region)
+{
+    m_heightInLines = region-&gt;height();
+    m_width = region-&gt;width();
+
+    m_regionAnchor = FloatPoint(region-&gt;regionAnchorX(), region-&gt;regionAnchorY());
+    m_viewportAnchor = FloatPoint(region-&gt;viewportAnchorX(), region-&gt;viewportAnchorY());
+
+    setScroll(region-&gt;scroll(), ASSERT_NO_EXCEPTION);
+}
+
+void VTTRegion::setRegionSettings(const String&amp; input)
+{
+    m_settings = input;
+    unsigned position = 0;
+
+    while (position &lt; input.length()) {
+        while (position &lt; input.length() &amp;&amp; WebVTTParser::isValidSettingDelimiter(input[position]))
+            position++;
+
+        if (position &gt;= input.length())
+            break;
+
+        parseSetting(input, &amp;position);
+    }
+}
+
+VTTRegion::RegionSetting VTTRegion::getSettingFromString(const String&amp; setting)
+{
+    DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, idKeyword, (&quot;id&quot;, AtomicString::ConstructFromLiteral));
+    DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, heightKeyword, (&quot;height&quot;, AtomicString::ConstructFromLiteral));
+    DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, widthKeyword, (&quot;width&quot;, AtomicString::ConstructFromLiteral));
+    DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, regionAnchorKeyword, (&quot;regionanchor&quot;, AtomicString::ConstructFromLiteral));
+    DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, viewportAnchorKeyword, (&quot;viewportanchor&quot;, AtomicString::ConstructFromLiteral));
+    DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, scrollKeyword, (&quot;scroll&quot;, 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&amp; value)
+{
+    DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, scrollUpValueKeyword, (&quot;up&quot;, AtomicString::ConstructFromLiteral));
+
+    switch (setting) {
+    case Id:
+        if (value.find(&quot;--&gt;&quot;) == notFound)
+            m_id = value;
+        break;
+    case Width: {
+        float floatWidth;
+        if (WebVTTParser::parseFloatPercentageValue(value, floatWidth))
+            m_width = floatWidth;
+        else
+            LOG(Media, &quot;VTTRegion::parseSettingValue, invalid Width&quot;);
+        break;
+    }
+    case Height: {
+        unsigned position = 0;
+        int number;
+        if (WebVTTParser::collectDigitsToInt(value, position, number) &amp;&amp; position == value.length())
+            m_heightInLines = number;
+        else
+            LOG(Media, &quot;VTTRegion::parseSettingValue, invalid Height&quot;);
+        break;
+    }
+    case RegionAnchor:
+        if (!WebVTTParser::parseFloatPercentageValuePair(value, ',', m_regionAnchor))
+            LOG(Media, &quot;VTTRegion::parseSettingValue, invalid RegionAnchor&quot;);
+        break;
+    case ViewportAnchor:
+        if (!WebVTTParser::parseFloatPercentageValuePair(value, ',', m_viewportAnchor))
+            LOG(Media, &quot;VTTRegion::parseSettingValue, invalid ViewportAnchor&quot;);
+        break;
+    case Scroll:
+        if (value == scrollUpValueKeyword)
+            m_scroll = true;
+        else
+            LOG(Media, &quot;VTTRegion::parseSettingValue, invalid Scroll&quot;);
+        break;
+    case None:
+        break;
+    }
+}
+
+void VTTRegion::parseSetting(const String&amp; 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&amp; VTTRegion::textTrackCueContainerScrollingClass()
+{
+    DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, trackRegionCueContainerScrollingClass, (&quot;scrolling&quot;, AtomicString::ConstructFromLiteral));
+
+    return trackRegionCueContainerScrollingClass;
+}
+
+const AtomicString&amp; VTTRegion::textTrackCueContainerShadowPseudoId()
+{
+    DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, trackRegionCueContainerPseudoId,
+        (&quot;-webkit-media-text-track-region-container&quot;, AtomicString::ConstructFromLiteral));
+
+    return trackRegionCueContainerPseudoId;
+}
+
+const AtomicString&amp; VTTRegion::textTrackRegionShadowPseudoId()
+{
+    DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, trackRegionShadowPseudoId,
+        (&quot;-webkit-media-text-track-region&quot;, AtomicString::ConstructFromLiteral));
+
+    return trackRegionShadowPseudoId;
+}
+
+void VTTRegion::appendTextTrackCueBox(PassRefPtr&lt;VTTCueBox&gt; displayBox)
+{
+    ASSERT(m_cueContainer);
+
+    if (m_cueContainer-&gt;contains(displayBox.get()))
+        return;
+
+    m_cueContainer-&gt;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-&gt;renderer() || !m_cueContainer-&gt;childNodeCount() || m_scrollTimer.isActive())
+        return;
+
+    // If it's a scrolling region, add the scrolling class.
+    if (isScrollingRegion())
+        m_cueContainer-&gt;classList()-&gt;add(textTrackCueContainerScrollingClass(), IGNORE_EXCEPTION);
+
+    float regionBottom = m_regionDisplayTree-&gt;getBoundingClientRect()-&gt;bottom();
+
+    // Find first cue that is not entirely displayed and scroll it upwards.
+    for (size_t i = 0; i &lt; m_cueContainer-&gt;childNodeCount() &amp;&amp; !m_scrollTimer.isActive(); ++i) {
+        float childTop = static_cast&lt;HTMLDivElement*&gt;(m_cueContainer-&gt;childNode(i))-&gt;getBoundingClientRect()-&gt;top();
+        float childBottom = static_cast&lt;HTMLDivElement*&gt;(m_cueContainer-&gt;childNode(i))-&gt;getBoundingClientRect()-&gt;bottom();
+
+        if (regionBottom &gt;= childBottom)
+            continue;
+
+        float height = childBottom - childTop;
+
+        m_currentTop -= std::min(height, childBottom - regionBottom);
+        m_cueContainer-&gt;setInlineStyleProperty(CSSPropertyTop, m_currentTop, CSSPrimitiveValue::CSS_PX);
+
+        startTimer();
+    }
+}
+
+void VTTRegion::willRemoveTextTrackCueBox(VTTCueBox* box)
+{
+    LOG(Media, &quot;VTTRegion::willRemoveTextTrackCueBox&quot;);
+    ASSERT(m_cueContainer-&gt;contains(box));
+
+    double boxHeight = box-&gt;getBoundingClientRect()-&gt;bottom() - box-&gt;getBoundingClientRect()-&gt;top();
+
+    m_cueContainer-&gt;classList()-&gt;remove(textTrackCueContainerScrollingClass(), IGNORE_EXCEPTION);
+
+    m_currentTop += boxHeight;
+    m_cueContainer-&gt;setInlineStyleProperty(CSSPropertyTop, m_currentTop, CSSPrimitiveValue::CSS_PX);
+}
+
+PassRefPtr&lt;HTMLDivElement&gt; 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-&gt;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-&gt;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-&gt;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-&gt;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-&gt;setInlineStyleProperty(CSSPropertyTop, 0.0f, CSSPrimitiveValue::CSS_PX);
+
+    m_cueContainer-&gt;setPseudo(textTrackCueContainerShadowPseudoId());
+    m_regionDisplayTree-&gt;appendChild(m_cueContainer);
+
+    // 7.5 Every WebVTT region object is initialised with the following CSS
+    m_regionDisplayTree-&gt;setPseudo(textTrackRegionShadowPseudoId());
+}
+
+void VTTRegion::startTimer()
+{
+    LOG(Media, &quot;VTTRegion::startTimer&quot;);
+
+    if (m_scrollTimer.isActive())
+        return;
+
+    double duration = isScrollingRegion() ? scrollTime : 0;
+    m_scrollTimer.startOneShot(duration);
+}
+
+void VTTRegion::stopTimer()
+{
+    LOG(Media, &quot;VTTRegion::stopTimer&quot;);
+
+    if (m_scrollTimer.isActive())
+        m_scrollTimer.stop();
+}
+
+void VTTRegion::scrollTimerFired(Timer&lt;VTTRegion&gt;*)
+{
+    LOG(Media, &quot;VTTRegion::scrollTimerFired&quot;);
+
+    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
+ * &quot;AS IS&quot; 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) &amp;&amp; ENABLE(WEBVTT_REGIONS)
+
+#include &quot;ContextDestructionObserver.h&quot;
+#include &quot;Document.h&quot;
+#include &quot;FloatPoint.h&quot;
+#include &quot;TextTrack.h&quot;
+#include &lt;wtf/RefCounted.h&gt;
+
+namespace WebCore {
+
+class HTMLDivElement;
+class VTTCueBox;
+
+class VTTRegion : public RefCounted&lt;VTTRegion&gt;, public ContextDestructionObserver {
+public:
+    static PassRefPtr&lt;VTTRegion&gt; create(ScriptExecutionContext&amp; context)
+    {
+        return adoptRef(new VTTRegion(context));
+    }
+
+    virtual ~VTTRegion();
+
+    TextTrack* track() const { return m_track; }
+    void setTrack(TextTrack*);
+
+    const String&amp; id() const { return m_id; }
+    void setId(const String&amp;);
+
+    double width() const { return m_width; }
+    void setWidth(double, ExceptionCode&amp;);
+
+    long height() const { return m_heightInLines; }
+    void setHeight(long, ExceptionCode&amp;);
+
+    double regionAnchorX() const { return m_regionAnchor.x(); }
+    void setRegionAnchorX(double, ExceptionCode&amp;);
+
+    double regionAnchorY() const { return m_regionAnchor.y(); }
+    void setRegionAnchorY(double, ExceptionCode&amp;);
+
+    double viewportAnchorX() const { return m_viewportAnchor.x(); }
+    void setViewportAnchorX(double, ExceptionCode&amp;);
+
+    double viewportAnchorY() const { return m_viewportAnchor.y(); }
+    void setViewportAnchorY(double, ExceptionCode&amp;);
+
+    const AtomicString scroll() const;
+    void setScroll(const AtomicString&amp;, ExceptionCode&amp;);
+
+    void updateParametersFromRegion(VTTRegion*);
+
+    const String&amp; regionSettings() const { return m_settings; }
+    void setRegionSettings(const String&amp;);
+
+    bool isScrollingRegion() { return m_scroll; }
+
+    PassRefPtr&lt;HTMLDivElement&gt; getDisplayTree();
+    
+    void appendTextTrackCueBox(PassRefPtr&lt;VTTCueBox&gt;);
+    void displayLastTextTrackCueBox();
+    void willRemoveTextTrackCueBox(VTTCueBox*);
+
+private:
+    VTTRegion(ScriptExecutionContext&amp;);
+
+    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&lt;VTTRegion&gt;*);
+
+    enum RegionSetting {
+        None,
+        Id,
+        Width,
+        Height,
+        RegionAnchor,
+        ViewportAnchor,
+        Scroll
+    };
+
+    RegionSetting getSettingFromString(const String&amp;);
+
+    void parseSettingValue(RegionSetting, const String&amp;);
+    void parseSetting(const String&amp;, unsigned*);
+
+    static const AtomicString&amp; textTrackCueContainerShadowPseudoId();
+    static const AtomicString&amp; textTrackCueContainerScrollingClass();
+    static const AtomicString&amp; 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&lt;HTMLDivElement&gt; m_cueContainer;
+    RefPtr&lt;HTMLDivElement&gt; 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 &quot;top&quot; 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&lt;VTTRegion&gt; 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 &amp; 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 &quot;config.h&quot;
+#include &quot;VTTRegionList.h&quot;
+
+#if ENABLE(VIDEO_TRACK) &amp;&amp; ENABLE(WEBVTT_REGIONS)
+
+
+namespace WebCore {
+
+VTTRegionList::VTTRegionList()
+{
+}
+
+unsigned long VTTRegionList::length() const
+{
+    return m_list.size();
+}
+
+VTTRegion* VTTRegionList::item(unsigned index) const
+{
+    if (index &lt; m_list.size())
+        return m_list[index].get();
+
+    return 0;
+}
+
+VTTRegion* VTTRegionList::getRegionById(const String&amp; id) const
+{
+    if (id.isEmpty())
+        return 0;
+
+    for (const auto&amp; region : m_list) {
+        if (region-&gt;id() == id)
+            return region.get();
+    }
+
+    return 0;
+}
+
+void VTTRegionList::add(PassRefPtr&lt;VTTRegion&gt; 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) &amp;&amp; ENABLE(WEBVTT_REGIONS)
+
+#include &quot;VTTRegion.h&quot;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/RefCounted.h&gt;
+#include &lt;wtf/Vector.h&gt;
+
+namespace WebCore {
+
+class VTTRegionList : public RefCounted&lt;VTTRegionList&gt; {
+public:
+    static PassRefPtr&lt;VTTRegionList&gt; create()
+    {
+        return adoptRef(new VTTRegionList());
+    }
+
+    ~VTTRegionList() { }
+
+    unsigned long length() const;
+
+    VTTRegion* item(unsigned index) const;
+    VTTRegion* getRegionById(const String&amp;) const;
+
+    void add(PassRefPtr&lt;VTTRegion&gt;);
+    bool remove(VTTRegion*);
+
+private:
+    VTTRegionList();
+    void clear();
+
+    Vector&lt;RefPtr&lt;VTTRegion&gt; &gt; 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 &amp; 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, &amp;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, &amp;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&lt;RefPtr&lt;TextTrackRegion&gt;&gt;&amp; outputRegions)
</del><ins>+void WebVTTParser::getNewRegions(Vector&lt;RefPtr&lt;VTTRegion&gt;&gt;&amp; 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&lt;TextTrackRegion&gt; region = TextTrackRegion::create(*m_scriptExecutionContext);
</del><ins>+    RefPtr&lt;VTTRegion&gt; region = VTTRegion::create(*m_scriptExecutionContext);
</ins><span class="cx">     region-&gt;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 &quot;DocumentFragment.h&quot;
</span><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="cx"> #include &quot;TextResourceDecoder.h&quot;
</span><del>-#include &quot;TextTrackRegion.h&quot;
</del><ins>+#include &quot;VTTRegion.h&quot;
</ins><span class="cx"> #include &quot;WebVTTTokenizer.h&quot;
</span><span class="cx"> #include &lt;memory&gt;
</span><span class="cx"> #include &lt;wtf/text/StringBuilder.h&gt;
</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&lt;RefPtr&lt;WebVTTCueData&gt;&gt;&amp;);
</span><span class="cx"> #if ENABLE(WEBVTT_REGIONS)
</span><del>-    void getNewRegions(Vector&lt;RefPtr&lt;TextTrackRegion&gt;&gt;&amp;);
</del><ins>+    void getNewRegions(Vector&lt;RefPtr&lt;VTTRegion&gt;&gt;&amp;);
</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&lt;RefPtr&lt;WebVTTCueData&gt;&gt; m_cuelist;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBVTT_REGIONS)
</span><del>-    Vector&lt;RefPtr&lt;TextTrackRegion&gt;&gt; m_regionList;
</del><ins>+    Vector&lt;RefPtr&lt;VTTRegion&gt;&gt; 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&lt;RefPtr&lt;TextTrackRegion&gt;&gt;&amp; outputRegions)
</del><ins>+void TextTrackLoader::getNewRegions(Vector&lt;RefPtr&lt;VTTRegion&gt;&gt;&amp; 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&lt;RefPtr&lt;TextTrackCue&gt;&gt;&amp; outputCues);
</span><span class="cx"> #if ENABLE(WEBVTT_REGIONS)
</span><del>-    void getNewRegions(Vector&lt;RefPtr&lt;TextTrackRegion&gt;&gt;&amp; outputRegions);
</del><ins>+    void getNewRegions(Vector&lt;RefPtr&lt;VTTRegion&gt;&gt;&amp; outputRegions);
</ins><span class="cx"> #endif
</span><span class="cx"> private:
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>