<!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>[201223] 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/201223">201223</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-05-20 13:43:39 -0700 (Fri, 20 May 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Fix null dereferencing in CSSAnimationTriggerScrollValue::equals
https://bugs.webkit.org/show_bug.cgi?id=157930

Patch by Alex Christensen &lt;achristensen@webkit.org&gt; on 2016-05-20
Reviewed by Dean Jackson.

Source/WebCore:

Test: fast/css/compare-animation-trigger.html

* css/CSSAnimationTriggerScrollValue.cpp:
(WebCore::CSSAnimationTriggerScrollValue::equals):
* css/CSSAnimationTriggerScrollValue.h:
(WebCore::CSSAnimationTriggerScrollValue::create):
(WebCore::CSSAnimationTriggerScrollValue::startValue):
(WebCore::CSSAnimationTriggerScrollValue::endValue):
(WebCore::CSSAnimationTriggerScrollValue::hasEndValue):
(WebCore::CSSAnimationTriggerScrollValue::operator==):
(WebCore::CSSAnimationTriggerScrollValue::CSSAnimationTriggerScrollValue):
* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapAnimationTrigger):
* css/CSSValue.h:
(WebCore::CSSValue::operator==):

LayoutTests:

* fast/css/compare-animation-trigger-expected.txt: Added.
* fast/css/compare-animation-trigger.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="#trunkSourceWebCorecssCSSAnimationTriggerScrollValuecpp">trunk/Source/WebCore/css/CSSAnimationTriggerScrollValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSAnimationTriggerScrollValueh">trunk/Source/WebCore/css/CSSAnimationTriggerScrollValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSToStyleMapcpp">trunk/Source/WebCore/css/CSSToStyleMap.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSValueh">trunk/Source/WebCore/css/CSSValue.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcsscompareanimationtriggerexpectedtxt">trunk/LayoutTests/fast/css/compare-animation-trigger-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcsscompareanimationtriggerhtml">trunk/LayoutTests/fast/css/compare-animation-trigger.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (201222 => 201223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-05-20 19:36:01 UTC (rev 201222)
+++ trunk/LayoutTests/ChangeLog        2016-05-20 20:43:39 UTC (rev 201223)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-05-20  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
+        Fix null dereferencing in CSSAnimationTriggerScrollValue::equals
+        https://bugs.webkit.org/show_bug.cgi?id=157930
+
+        Reviewed by Dean Jackson.
+
+        * fast/css/compare-animation-trigger-expected.txt: Added.
+        * fast/css/compare-animation-trigger.html: Added.
+
</ins><span class="cx"> 2016-05-20  Dave Hyatt  &lt;hyatt@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Scrolling broken in iTunes connect pages
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsscompareanimationtriggerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/compare-animation-trigger-expected.txt (0 => 201223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/compare-animation-trigger-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/css/compare-animation-trigger-expected.txt        2016-05-20 20:43:39 UTC (rev 201223)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+This test verifies that comparing two CSSAnimationTriggerScrollValues without end values does not crash.
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsscompareanimationtriggerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/compare-animation-trigger.html (0 => 201223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/compare-animation-trigger.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/compare-animation-trigger.html        2016-05-20 20:43:39 UTC (rev 201223)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+    div { -webkit-animation-trigger : container-scroll(20px); }
+&lt;/style&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+function run() {
+    document.getElementById(&quot;test&quot;).focus();
+    document.execCommand('insertHTML', false, '&lt;div id=&quot;insertedDiv&quot; style=&quot;-webkit-animation-trigger : container-scroll(20px); &quot;&gt;&lt;/div&gt;');
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;run()&quot;&gt;
+&lt;p&gt;This test verifies that comparing two CSSAnimationTriggerScrollValues without end values does not crash.&lt;/p&gt;
+&lt;div id=&quot;test&quot; contenteditable&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (201222 => 201223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-05-20 19:36:01 UTC (rev 201222)
+++ trunk/Source/WebCore/ChangeLog        2016-05-20 20:43:39 UTC (rev 201223)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2016-05-20  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
+        Fix null dereferencing in CSSAnimationTriggerScrollValue::equals
+        https://bugs.webkit.org/show_bug.cgi?id=157930
+
+        Reviewed by Dean Jackson.
+
+        Test: fast/css/compare-animation-trigger.html
+
+        * css/CSSAnimationTriggerScrollValue.cpp:
+        (WebCore::CSSAnimationTriggerScrollValue::equals):
+        * css/CSSAnimationTriggerScrollValue.h:
+        (WebCore::CSSAnimationTriggerScrollValue::create):
+        (WebCore::CSSAnimationTriggerScrollValue::startValue):
+        (WebCore::CSSAnimationTriggerScrollValue::endValue):
+        (WebCore::CSSAnimationTriggerScrollValue::hasEndValue):
+        (WebCore::CSSAnimationTriggerScrollValue::operator==):
+        (WebCore::CSSAnimationTriggerScrollValue::CSSAnimationTriggerScrollValue):
+        * css/CSSToStyleMap.cpp:
+        (WebCore::CSSToStyleMap::mapAnimationTrigger):
+        * css/CSSValue.h:
+        (WebCore::CSSValue::operator==):
+
</ins><span class="cx"> 2016-05-20  Dave Hyatt  &lt;hyatt@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Scrolling broken in iTunes connect pages
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSAnimationTriggerScrollValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSAnimationTriggerScrollValue.cpp (201222 => 201223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSAnimationTriggerScrollValue.cpp        2016-05-20 19:36:01 UTC (rev 201222)
+++ trunk/Source/WebCore/css/CSSAnimationTriggerScrollValue.cpp        2016-05-20 20:43:39 UTC (rev 201223)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;CSSAnimationTriggerScrollValue.h&quot;
</span><ins>+#include &lt;wtf/PointerComparison.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(CSS_ANIMATIONS_LEVEL_2)
</span><span class="cx"> 
</span><span class="lines">@@ -47,7 +48,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool CSSAnimationTriggerScrollValue::equals(const CSSAnimationTriggerScrollValue&amp; other) const
</span><span class="cx"> {
</span><del>-    return m_startValue-&gt;equals(*other.m_startValue.get()) &amp;&amp; m_endValue-&gt;equals(*other.m_endValue.get());
</del><ins>+    return m_startValue-&gt;equals(other.m_startValue.get()) &amp;&amp; arePointingToEqualData(m_endValue.get(), other.m_endValue.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSAnimationTriggerScrollValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSAnimationTriggerScrollValue.h (201222 => 201223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSAnimationTriggerScrollValue.h        2016-05-20 19:36:01 UTC (rev 201222)
+++ trunk/Source/WebCore/css/CSSAnimationTriggerScrollValue.h        2016-05-20 20:43:39 UTC (rev 201223)
</span><span class="lines">@@ -38,13 +38,14 @@
</span><span class="cx">         return adoptRef(*new CSSAnimationTriggerScrollValue(WTFMove(startValue), WTFMove(endValue)));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    const CSSValue* startValue() const { return m_startValue.get(); }
</del><ins>+    const CSSValue&amp; startValue() const { return m_startValue.get(); }
</ins><span class="cx">     const CSSValue* endValue() const { return m_endValue.get(); }
</span><span class="cx">     bool hasEndValue() const { return m_endValue; }
</span><span class="cx"> 
</span><span class="cx">     String customCSSText() const;
</span><span class="cx"> 
</span><span class="cx">     bool equals(const CSSAnimationTriggerScrollValue&amp;) const;
</span><ins>+    bool operator==(const CSSAnimationTriggerScrollValue&amp; other) const { return equals(other); }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     CSSAnimationTriggerScrollValue(Ref&lt;CSSValue&gt;&amp;&amp; startValue, RefPtr&lt;CSSValue&gt;&amp;&amp; endValue)
</span><span class="lines">@@ -54,7 +55,7 @@
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RefPtr&lt;CSSValue&gt; m_startValue;
</del><ins>+    Ref&lt;CSSValue&gt; m_startValue;
</ins><span class="cx">     RefPtr&lt;CSSValue&gt; m_endValue;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSToStyleMapcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSToStyleMap.cpp (201222 => 201223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSToStyleMap.cpp        2016-05-20 19:36:01 UTC (rev 201222)
+++ trunk/Source/WebCore/css/CSSToStyleMap.cpp        2016-05-20 20:43:39 UTC (rev 201223)
</span><span class="lines">@@ -531,8 +531,8 @@
</span><span class="cx">     if (value.isAnimationTriggerScrollValue()) {
</span><span class="cx">         auto&amp; scrollTrigger = downcast&lt;CSSAnimationTriggerScrollValue&gt;(value);
</span><span class="cx"> 
</span><del>-        const CSSPrimitiveValue* startValue = downcast&lt;CSSPrimitiveValue&gt;(scrollTrigger.startValue());
-        Length startLength = startValue-&gt;computeLength&lt;Length&gt;(m_resolver-&gt;state().cssToLengthConversionData());
</del><ins>+        const CSSPrimitiveValue&amp; startValue = downcast&lt;CSSPrimitiveValue&gt;(scrollTrigger.startValue());
+        Length startLength = startValue.computeLength&lt;Length&gt;(m_resolver-&gt;state().cssToLengthConversionData());
</ins><span class="cx"> 
</span><span class="cx">         Length endLength;
</span><span class="cx">         if (scrollTrigger.hasEndValue()) {
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSValue.h (201222 => 201223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSValue.h        2016-05-20 19:36:01 UTC (rev 201222)
+++ trunk/Source/WebCore/css/CSSValue.h        2016-05-20 20:43:39 UTC (rev 201223)
</span><span class="lines">@@ -138,6 +138,7 @@
</span><span class="cx">     bool traverseSubresources(const std::function&lt;bool (const CachedResource&amp;)&gt;&amp; handler) const;
</span><span class="cx"> 
</span><span class="cx">     bool equals(const CSSValue&amp;) const;
</span><ins>+    bool operator==(const CSSValue&amp; other) const { return equals(other); }
</ins><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>