<!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>[207907] 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/207907">207907</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-10-26 12:27:20 -0700 (Wed, 26 Oct 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>First parameter to TextTrack.addCue() / removeCue() should not be nullable
https://bugs.webkit.org/show_bug.cgi?id=164020

Reviewed by Eric Carlson.

Source/WebCore:

First parameter to TextTrack.addCue() / removeCue() should not be nullable:
- https://html.spec.whatwg.org/#texttrack

Firefox and Chrome agree with the specification.

Test: media/track/texttrack-addCue-null.html

* html/track/InbandDataTextTrack.cpp:
(WebCore::InbandDataTextTrack::removeDataCue):
(WebCore::InbandDataTextTrack::removeCue):
* html/track/InbandDataTextTrack.h:
* html/track/InbandGenericTextTrack.cpp:
(WebCore::InbandGenericTextTrack::addGenericCue):
(WebCore::InbandGenericTextTrack::removeGenericCue):
(WebCore::InbandGenericTextTrack::removeCue):
* html/track/InbandGenericTextTrack.h:
* html/track/TextTrack.cpp:
(WebCore::TextTrack::addCue):
(WebCore::TextTrack::removeCue):
* html/track/TextTrack.h:
* html/track/TextTrack.idl:

LayoutTests:

Add layout test coverage.

* media/track/texttrack-addCue-null-expected.txt: Added.
* media/track/texttrack-addCue-null.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorehtmltrackInbandDataTextTrackcpp">trunk/Source/WebCore/html/track/InbandDataTextTrack.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackInbandDataTextTrackh">trunk/Source/WebCore/html/track/InbandDataTextTrack.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackInbandGenericTextTrackcpp">trunk/Source/WebCore/html/track/InbandGenericTextTrack.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackInbandGenericTextTrackh">trunk/Source/WebCore/html/track/InbandGenericTextTrack.h</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>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsmediatracktexttrackaddCuenullexpectedtxt">trunk/LayoutTests/media/track/texttrack-addCue-null-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmediatracktexttrackaddCuenullhtml">trunk/LayoutTests/media/track/texttrack-addCue-null.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (207906 => 207907)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-10-26 19:23:55 UTC (rev 207906)
+++ trunk/LayoutTests/ChangeLog        2016-10-26 19:27:20 UTC (rev 207907)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-10-26  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        First parameter to TextTrack.addCue() / removeCue() should not be nullable
+        https://bugs.webkit.org/show_bug.cgi?id=164020
+
+        Reviewed by Eric Carlson.
+
+        Add layout test coverage.
+
+        * media/track/texttrack-addCue-null-expected.txt: Added.
+        * media/track/texttrack-addCue-null.html: Added.
+
</ins><span class="cx"> 2016-10-26  Antoine Quint  &lt;graouts@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Modern Media Controls] Media Controller: elapsed and remaining time support
</span></span></pre></div>
<a id="trunkLayoutTestsmediatracktexttrackaddCuenullexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/media/track/texttrack-addCue-null-expected.txt (0 => 207907)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/texttrack-addCue-null-expected.txt                                (rev 0)
+++ trunk/LayoutTests/media/track/texttrack-addCue-null-expected.txt        2016-10-26 19:27:20 UTC (rev 207907)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+Tests that the parameter to TextTrack.addCue() / removeCue() is not nullable.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS track.addCue(null) threw exception TypeError: Argument 1 ('cue') to TextTrack.addCue must be an instance of TextTrackCue.
+PASS track.removeCue(null) threw exception TypeError: Argument 1 ('cue') to TextTrack.removeCue must be an instance of TextTrackCue.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsmediatracktexttrackaddCuenullhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/media/track/texttrack-addCue-null.html (0 => 207907)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/texttrack-addCue-null.html                                (rev 0)
+++ trunk/LayoutTests/media/track/texttrack-addCue-null.html        2016-10-26 19:27:20 UTC (rev 207907)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+description(&quot;Tests that the parameter to TextTrack.addCue() / removeCue() is not nullable.&quot;);
+var video = document.createElement('video');
+var track = video.addTextTrack('subtitles');
+
+shouldThrowErrorName(&quot;track.addCue(null)&quot;, &quot;TypeError&quot;);
+shouldThrowErrorName(&quot;track.removeCue(null)&quot;, &quot;TypeError&quot;);
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (207906 => 207907)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-26 19:23:55 UTC (rev 207906)
+++ trunk/Source/WebCore/ChangeLog        2016-10-26 19:27:20 UTC (rev 207907)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2016-10-26  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        First parameter to TextTrack.addCue() / removeCue() should not be nullable
+        https://bugs.webkit.org/show_bug.cgi?id=164020
+
+        Reviewed by Eric Carlson.
+
+        First parameter to TextTrack.addCue() / removeCue() should not be nullable:
+        - https://html.spec.whatwg.org/#texttrack
+
+        Firefox and Chrome agree with the specification.
+
+        Test: media/track/texttrack-addCue-null.html
+
+        * html/track/InbandDataTextTrack.cpp:
+        (WebCore::InbandDataTextTrack::removeDataCue):
+        (WebCore::InbandDataTextTrack::removeCue):
+        * html/track/InbandDataTextTrack.h:
+        * html/track/InbandGenericTextTrack.cpp:
+        (WebCore::InbandGenericTextTrack::addGenericCue):
+        (WebCore::InbandGenericTextTrack::removeGenericCue):
+        (WebCore::InbandGenericTextTrack::removeCue):
+        * html/track/InbandGenericTextTrack.h:
+        * html/track/TextTrack.cpp:
+        (WebCore::TextTrack::addCue):
+        (WebCore::TextTrack::removeCue):
+        * html/track/TextTrack.h:
+        * html/track/TextTrack.idl:
+
</ins><span class="cx"> 2016-10-26  Antoine Quint  &lt;graouts@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Modern Media Controls] Media Controller: elapsed and remaining time support
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackInbandDataTextTrackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/InbandDataTextTrack.cpp (207906 => 207907)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/InbandDataTextTrack.cpp        2016-10-26 19:23:55 UTC (rev 207906)
+++ trunk/Source/WebCore/html/track/InbandDataTextTrack.cpp        2016-10-26 19:27:20 UTC (rev 207907)
</span><span class="lines">@@ -114,18 +114,17 @@
</span><span class="cx">     if (iter == m_incompleteCueMap.end())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    RefPtr&lt;DataCue&gt; cue = iter-&gt;value;
-    if (cue) {
</del><ins>+    if (RefPtr&lt;DataCue&gt; cue = iter-&gt;value) {
</ins><span class="cx">         LOG(Media, &quot;InbandDataTextTrack::removeDataCue removing cue: start=%s, end=%s\n&quot;, toString(cue-&gt;startTime()).utf8().data(), toString(cue-&gt;endTime()).utf8().data());
</span><del>-        removeCue(cue.get());
</del><ins>+        removeCue(*cue);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ExceptionOr&lt;void&gt; InbandDataTextTrack::removeCue(TextTrackCue* cue)
</del><ins>+ExceptionOr&lt;void&gt; InbandDataTextTrack::removeCue(TextTrackCue&amp; cue)
</ins><span class="cx"> {
</span><del>-    ASSERT(cue-&gt;cueType() == TextTrackCue::Data);
</del><ins>+    ASSERT(cue.cueType() == TextTrackCue::Data);
</ins><span class="cx"> 
</span><del>-    m_incompleteCueMap.remove(const_cast&lt;SerializedPlatformRepresentation*&gt;(toDataCue(cue)-&gt;platformValue()));
</del><ins>+    m_incompleteCueMap.remove(const_cast&lt;SerializedPlatformRepresentation*&gt;(toDataCue(&amp;cue)-&gt;platformValue()));
</ins><span class="cx"> 
</span><span class="cx">     return InbandTextTrack::removeCue(cue);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackInbandDataTextTrackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/InbandDataTextTrack.h (207906 => 207907)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/InbandDataTextTrack.h        2016-10-26 19:23:55 UTC (rev 207906)
+++ trunk/Source/WebCore/html/track/InbandDataTextTrack.h        2016-10-26 19:27:20 UTC (rev 207907)
</span><span class="lines">@@ -50,7 +50,7 @@
</span><span class="cx">     void addDataCue(InbandTextTrackPrivate*, const MediaTime&amp; start, const MediaTime&amp; end, PassRefPtr&lt;SerializedPlatformRepresentation&gt;, const String&amp;) final;
</span><span class="cx">     void updateDataCue(InbandTextTrackPrivate*, const MediaTime&amp; start, const MediaTime&amp; end, PassRefPtr&lt;SerializedPlatformRepresentation&gt;) final;
</span><span class="cx">     void removeDataCue(InbandTextTrackPrivate*, const MediaTime&amp; start, const MediaTime&amp; end, PassRefPtr&lt;SerializedPlatformRepresentation&gt;) final;
</span><del>-    ExceptionOr&lt;void&gt; removeCue(TextTrackCue*) final;
</del><ins>+    ExceptionOr&lt;void&gt; removeCue(TextTrackCue&amp;) final;
</ins><span class="cx"> 
</span><span class="cx">     HashMap&lt;RefPtr&lt;SerializedPlatformRepresentation&gt;, RefPtr&lt;DataCue&gt;&gt; m_incompleteCueMap;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackInbandGenericTextTrackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/InbandGenericTextTrack.cpp (207906 => 207907)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/InbandGenericTextTrack.cpp        2016-10-26 19:23:55 UTC (rev 207906)
+++ trunk/Source/WebCore/html/track/InbandGenericTextTrack.cpp        2016-10-26 19:27:20 UTC (rev 207907)
</span><span class="lines">@@ -127,9 +127,9 @@
</span><span class="cx">     if (m_cueMap.find(*cueData))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    RefPtr&lt;TextTrackCueGeneric&gt; cue = TextTrackCueGeneric::create(*scriptExecutionContext(), cueData-&gt;startTime(), cueData-&gt;endTime(), cueData-&gt;content());
-    updateCueFromCueData(cue.get(), cueData.get());
-    if (hasCue(cue.get(), TextTrackCue::IgnoreDuration)) {
</del><ins>+    auto cue = TextTrackCueGeneric::create(*scriptExecutionContext(), cueData-&gt;startTime(), cueData-&gt;endTime(), cueData-&gt;content());
+    updateCueFromCueData(cue.ptr(), cueData.get());
+    if (hasCue(cue.ptr(), TextTrackCue::IgnoreDuration)) {
</ins><span class="cx">         LOG(Media, &quot;InbandGenericTextTrack::addGenericCue ignoring already added cue: start=%s, end=%s, content=\&quot;%s\&quot;\n&quot;, toString(cueData-&gt;startTime()).utf8().data(), toString(cueData-&gt;endTime()).utf8().data(), cueData-&gt;content().utf8().data());
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -137,7 +137,7 @@
</span><span class="cx">     LOG(Media, &quot;InbandGenericTextTrack::addGenericCue added cue: start=%.2f, end=%.2f, content=\&quot;%s\&quot;\n&quot;, cueData-&gt;startTime().toDouble(), cueData-&gt;endTime().toDouble(), cueData-&gt;content().utf8().data());
</span><span class="cx"> 
</span><span class="cx">     if (cueData-&gt;status() != GenericCueData::Complete)
</span><del>-        m_cueMap.add(*cueData, *cue);
</del><ins>+        m_cueMap.add(*cueData, cue);
</ins><span class="cx"> 
</span><span class="cx">     addCue(WTFMove(cue));
</span><span class="cx"> }
</span><span class="lines">@@ -159,17 +159,17 @@
</span><span class="cx">     auto* cue = m_cueMap.find(*cueData);
</span><span class="cx">     if (cue) {
</span><span class="cx">         LOG(Media, &quot;InbandGenericTextTrack::removeGenericCue removing cue: start=%s, end=%s, content=\&quot;%s\&quot;\n&quot;,  toString(cueData-&gt;startTime()).utf8().data(), toString(cueData-&gt;endTime()).utf8().data(), cueData-&gt;content().utf8().data());
</span><del>-        removeCue(cue);
</del><ins>+        removeCue(*cue);
</ins><span class="cx">     } else {
</span><span class="cx">         LOG(Media, &quot;InbandGenericTextTrack::removeGenericCue UNABLE to find cue: start=%.2f, end=%.2f, content=\&quot;%s\&quot;\n&quot;, cueData-&gt;startTime().toDouble(), cueData-&gt;endTime().toDouble(), cueData-&gt;content().utf8().data());
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ExceptionOr&lt;void&gt; InbandGenericTextTrack::removeCue(TextTrackCue* cue)
</del><ins>+ExceptionOr&lt;void&gt; InbandGenericTextTrack::removeCue(TextTrackCue&amp; cue)
</ins><span class="cx"> {
</span><span class="cx">     auto result = TextTrack::removeCue(cue);
</span><del>-    if (!result.hasException() &amp;&amp; cue)
-        m_cueMap.remove(*cue);
</del><ins>+    if (!result.hasException())
+        m_cueMap.remove(cue);
</ins><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackInbandGenericTextTrackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/InbandGenericTextTrack.h (207906 => 207907)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/InbandGenericTextTrack.h        2016-10-26 19:23:55 UTC (rev 207906)
+++ trunk/Source/WebCore/html/track/InbandGenericTextTrack.h        2016-10-26 19:27:20 UTC (rev 207907)
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx">     void addGenericCue(InbandTextTrackPrivate*, PassRefPtr&lt;GenericCueData&gt;) final;
</span><span class="cx">     void updateGenericCue(InbandTextTrackPrivate*, GenericCueData*) final;
</span><span class="cx">     void removeGenericCue(InbandTextTrackPrivate*, GenericCueData*) final;
</span><del>-    ExceptionOr&lt;void&gt; removeCue(TextTrackCue*) final;
</del><ins>+    ExceptionOr&lt;void&gt; removeCue(TextTrackCue&amp;) final;
</ins><span class="cx"> 
</span><span class="cx">     PassRefPtr&lt;TextTrackCueGeneric&gt; createCue(PassRefPtr&lt;GenericCueData&gt;);
</span><span class="cx">     void updateCueFromCueData(TextTrackCueGeneric*, GenericCueData*);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/TextTrack.cpp (207906 => 207907)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrack.cpp        2016-10-26 19:23:55 UTC (rev 207906)
+++ trunk/Source/WebCore/html/track/TextTrack.cpp        2016-10-26 19:27:20 UTC (rev 207907)
</span><span class="lines">@@ -290,11 +290,8 @@
</span><span class="cx">     return m_cues-&gt;activeCues();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ExceptionOr&lt;void&gt; TextTrack::addCue(RefPtr&lt;TextTrackCue&gt;&amp;&amp; cue)
</del><ins>+ExceptionOr&lt;void&gt; TextTrack::addCue(Ref&lt;TextTrackCue&gt;&amp;&amp; cue)
</ins><span class="cx"> {
</span><del>-    if (!cue)
-        return { };
-
</del><span class="cx">     // 4.7.10.12.6 Text tracks exposing in-band metadata
</span><span class="cx">     // The UA will use DataCue to expose only text track cue objects that belong to a text track that has a text
</span><span class="cx">     // track kind of metadata.
</span><span class="lines">@@ -320,19 +317,16 @@
</span><span class="cx"> 
</span><span class="cx">     // 2. Add cue to the method's TextTrack object's text track's text track list of cues.
</span><span class="cx">     cue-&gt;setTrack(this);
</span><del>-    ensureTextTrackCueList().add(cue);
</del><ins>+    ensureTextTrackCueList().add(cue.ptr());
</ins><span class="cx">     
</span><span class="cx">     if (m_client)
</span><del>-        m_client-&gt;textTrackAddCue(this, *cue);
</del><ins>+        m_client-&gt;textTrackAddCue(this, cue);
</ins><span class="cx"> 
</span><span class="cx">     return { };
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ExceptionOr&lt;void&gt; TextTrack::removeCue(TextTrackCue* cue)
</del><ins>+ExceptionOr&lt;void&gt; TextTrack::removeCue(TextTrackCue&amp; cue)
</ins><span class="cx"> {
</span><del>-    if (!cue)
-        return { };
-
</del><span class="cx">     // 4.8.10.12.5 Text track API
</span><span class="cx"> 
</span><span class="cx">     // The removeCue(cue) method of TextTrack objects, when invoked, must run the following steps:
</span><span class="lines">@@ -339,16 +333,16 @@
</span><span class="cx"> 
</span><span class="cx">     // 1. If the given cue is not currently listed in the method's TextTrack 
</span><span class="cx">     // object's text track's text track list of cues, then throw a NotFoundError exception.
</span><del>-    if (cue-&gt;track() != this)
</del><ins>+    if (cue.track() != this)
</ins><span class="cx">         return Exception { NOT_FOUND_ERR };
</span><span class="cx"> 
</span><span class="cx">     // 2. Remove cue from the method's TextTrack object's text track's text track list of cues.
</span><del>-    if (!m_cues || !m_cues-&gt;remove(cue))
</del><ins>+    if (!m_cues || !m_cues-&gt;remove(&amp;cue))
</ins><span class="cx">         return Exception { INVALID_STATE_ERR };
</span><span class="cx"> 
</span><del>-    cue-&gt;setTrack(nullptr);
</del><ins>+    cue.setTrack(nullptr);
</ins><span class="cx">     if (m_client)
</span><del>-        m_client-&gt;textTrackRemoveCue(this, *cue);
</del><ins>+        m_client-&gt;textTrackRemoveCue(this, cue);
</ins><span class="cx"> 
</span><span class="cx">     return { };
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/TextTrack.h (207906 => 207907)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrack.h        2016-10-26 19:23:55 UTC (rev 207906)
+++ trunk/Source/WebCore/html/track/TextTrack.h        2016-10-26 19:27:20 UTC (rev 207907)
</span><span class="lines">@@ -100,8 +100,8 @@
</span><span class="cx">     void clearClient() override { m_client = nullptr; }
</span><span class="cx">     TextTrackClient* client() { return m_client; }
</span><span class="cx"> 
</span><del>-    ExceptionOr&lt;void&gt; addCue(RefPtr&lt;TextTrackCue&gt;&amp;&amp;);
-    virtual ExceptionOr&lt;void&gt; removeCue(TextTrackCue*);
</del><ins>+    ExceptionOr&lt;void&gt; addCue(Ref&lt;TextTrackCue&gt;&amp;&amp;);
+    virtual ExceptionOr&lt;void&gt; removeCue(TextTrackCue&amp;);
</ins><span class="cx"> 
</span><span class="cx">     bool hasCue(TextTrackCue*, TextTrackCue::CueMatchRules = TextTrackCue::MatchAllFields);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/TextTrack.idl (207906 => 207907)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrack.idl        2016-10-26 19:23:55 UTC (rev 207906)
+++ trunk/Source/WebCore/html/track/TextTrack.idl        2016-10-26 19:27:20 UTC (rev 207907)
</span><span class="lines">@@ -43,9 +43,8 @@
</span><span class="cx">     readonly attribute TextTrackCueList? cues;
</span><span class="cx">     readonly attribute TextTrackCueList? activeCues;
</span><span class="cx"> 
</span><del>-    // FIXME: cue parameter should not be nullable in addCue and removeCue.
-    [MayThrowException] void addCue(TextTrackCue? cue);
-    [MayThrowException] void removeCue(TextTrackCue? cue);
</del><ins>+    [MayThrowException] void addCue(TextTrackCue cue);
+    [MayThrowException] void removeCue(TextTrackCue cue);
</ins><span class="cx"> 
</span><span class="cx">     attribute EventHandler oncuechange;
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>