<!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>[186433] releases/WebKitGTK/webkit-2.8</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/186433">186433</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2015-07-07 03:22:13 -0700 (Tue, 07 Jul 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/185955">r185955</a> - Do not send touch events to the slider's thumb when it does not have a renderer.
https://bugs.webkit.org/show_bug.cgi?id=146307
rdar://problem/21539399

Reviewed by Simon Fraser.

Bail out early if either the touch target or the renderer() is null.

Source/WebCore:

Test: fast/events/touch/input-range-with-thumb-display-none-crash.html

* html/shadow/SliderThumbElement.cpp:
(WebCore::findTouchWithIdentifier):
(WebCore::SliderThumbElement::handleTouchStart):
(WebCore::SliderThumbElement::handleTouchMove):
(WebCore::SliderThumbElement::handleTouchEndAndCancel):

LayoutTests:

* fast/events/touch/input-range-with-thumb-display-none-crash-expected.txt: Added.
* fast/events/touch/input-range-with-thumb-display-none-crash.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit28LayoutTestsChangeLog">releases/WebKitGTK/webkit-2.8/LayoutTests/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWebCoreChangeLog">releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWebCorehtmlshadowSliderThumbElementcpp">releases/WebKitGTK/webkit-2.8/Source/WebCore/html/shadow/SliderThumbElement.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit28LayoutTestsplatformiossimulatoriostouchinputrangewiththumbdisplaynonecrashexpectedtxt">releases/WebKitGTK/webkit-2.8/LayoutTests/platform/ios-simulator/ios/touch/input-range-with-thumb-display-none-crash-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit28LayoutTestsplatformiossimulatoriostouchinputrangewiththumbdisplaynonecrashhtml">releases/WebKitGTK/webkit-2.8/LayoutTests/platform/ios-simulator/ios/touch/input-range-with-thumb-display-none-crash.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit28LayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/LayoutTests/ChangeLog (186432 => 186433)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/LayoutTests/ChangeLog        2015-07-07 10:20:30 UTC (rev 186432)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/ChangeLog        2015-07-07 10:22:13 UTC (rev 186433)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2015-06-25  Zalan Bujtas  &lt;zalan@apple.com&gt;
+
+        Do not send touch events to the slider's thumb when it does not have a renderer.
+        https://bugs.webkit.org/show_bug.cgi?id=146307
+        rdar://problem/21539399
+
+        Reviewed by Simon Fraser.
+
+        Bail out early if either the touch target or the renderer() is null.
+
+        * fast/events/touch/input-range-with-thumb-display-none-crash-expected.txt: Added.
+        * fast/events/touch/input-range-with-thumb-display-none-crash.html: Added.
+
</ins><span class="cx"> 2015-06-22  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION(r169105) Dangling renderer pointer in SelectionSubtreeRoot::SelectionSubtreeData.
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28LayoutTestsplatformiossimulatoriostouchinputrangewiththumbdisplaynonecrashexpectedtxt"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.8/LayoutTests/platform/ios-simulator/ios/touch/input-range-with-thumb-display-none-crash-expected.txt (0 => 186433)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/LayoutTests/platform/ios-simulator/ios/touch/input-range-with-thumb-display-none-crash-expected.txt                                (rev 0)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/platform/ios-simulator/ios/touch/input-range-with-thumb-display-none-crash-expected.txt        2015-07-07 10:22:13 UTC (rev 186433)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+Pass if no crash.  
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit28LayoutTestsplatformiossimulatoriostouchinputrangewiththumbdisplaynonecrashhtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.8/LayoutTests/platform/ios-simulator/ios/touch/input-range-with-thumb-display-none-crash.html (0 => 186433)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/LayoutTests/platform/ios-simulator/ios/touch/input-range-with-thumb-display-none-crash.html                                (rev 0)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/platform/ios-simulator/ios/touch/input-range-with-thumb-display-none-crash.html        2015-07-07 10:22:13 UTC (rev 186433)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;title&gt;This tests that touch events are handled correctly when the range's thumb is display:none&lt;/title&gt;
+&lt;script&gt;
+    if (window.testRunner)
+            testRunner.dumpAsText();
+&lt;/script&gt;
+&lt;style&gt;
+        input[type=range] {
+                -webkit-appearance: none;
+        }
+
+        input[type=range]::-webkit-slider-runnable-track {
+                height: 5px;
+                  background: red;
+        }
+
+        input[type=&quot;range&quot;]::-webkit-slider-thumb {
+            -webkit-appearance: none;
+            display: none;
+        }
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    Pass if no crash.
+        &lt;input type=&quot;range&quot; id=&quot;range&quot; min=&quot;0&quot; max=&quot;300&quot; step=&quot;5&quot; value=&quot;0&quot;&gt;
+&lt;/body&gt;
+&lt;script&gt;
+        var event = document.createEvent('TouchEvent');
+        event.initUIEvent('touchstart', true, true);
+        event.view = window;
+        document.getElementById(&quot;range&quot;).dispatchEvent(event);
+&lt;/script&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog (186432 => 186433)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog        2015-07-07 10:20:30 UTC (rev 186432)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog        2015-07-07 10:22:13 UTC (rev 186433)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2015-06-25  Zalan Bujtas  &lt;zalan@apple.com&gt;
+
+        Do not send touch events to the slider's thumb when it does not have a renderer.
+        https://bugs.webkit.org/show_bug.cgi?id=146307
+        rdar://problem/21539399
+
+        Reviewed by Simon Fraser.
+
+        Bail out early if either the touch target or the renderer() is null.
+
+        Test: fast/events/touch/input-range-with-thumb-display-none-crash.html
+
+        * html/shadow/SliderThumbElement.cpp:
+        (WebCore::findTouchWithIdentifier):
+        (WebCore::SliderThumbElement::handleTouchStart):
+        (WebCore::SliderThumbElement::handleTouchMove):
+        (WebCore::SliderThumbElement::handleTouchEndAndCancel):
+
</ins><span class="cx"> 2015-06-25  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Empty gtk-font-name setting causes WebProcess crash rendering pages
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWebCorehtmlshadowSliderThumbElementcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/html/shadow/SliderThumbElement.cpp (186432 => 186433)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WebCore/html/shadow/SliderThumbElement.cpp        2015-07-07 10:20:30 UTC (rev 186432)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/html/shadow/SliderThumbElement.cpp        2015-07-07 10:22:13 UTC (rev 186433)
</span><span class="lines">@@ -418,11 +418,11 @@
</span><span class="cx">     m_exclusiveTouchIdentifier = NoIdentifier;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static Touch* findTouchWithIdentifier(TouchList* list, unsigned identifier)
</del><ins>+static Touch* findTouchWithIdentifier(TouchList&amp; list, unsigned identifier)
</ins><span class="cx"> {
</span><del>-    unsigned length = list-&gt;length();
</del><ins>+    unsigned length = list.length();
</ins><span class="cx">     for (unsigned i = 0; i &lt; length; ++i) {
</span><del>-        Touch* touch = list-&gt;item(i);
</del><ins>+        Touch* touch = list.item(i);
</ins><span class="cx">         if (touch-&gt;identifier() == identifier)
</span><span class="cx">             return touch;
</span><span class="cx">     }
</span><span class="lines">@@ -432,12 +432,17 @@
</span><span class="cx"> void SliderThumbElement::handleTouchStart(TouchEvent* touchEvent)
</span><span class="cx"> {
</span><span class="cx">     TouchList* targetTouches = touchEvent-&gt;targetTouches();
</span><ins>+    if (!targetTouches)
+        return;
+
</ins><span class="cx">     if (targetTouches-&gt;length() != 1)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    // Ignore the touch if it is not really inside the thumb.
</del><span class="cx">     Touch* touch = targetTouches-&gt;item(0);
</span><ins>+    if (!renderer())
+        return;
</ins><span class="cx">     IntRect boundingBox = renderer()-&gt;absoluteBoundingBoxRect();
</span><ins>+    // Ignore the touch if it is not really inside the thumb.
</ins><span class="cx">     if (!boundingBox.contains(touch-&gt;pageX(), touch-&gt;pageY()))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -453,7 +458,11 @@
</span><span class="cx">     if (identifier == NoIdentifier)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    Touch* touch = findTouchWithIdentifier(touchEvent-&gt;targetTouches(), identifier);
</del><ins>+    TouchList* targetTouches = touchEvent-&gt;targetTouches();
+    if (!targetTouches)
+        return;
+
+    Touch* touch = findTouchWithIdentifier(*targetTouches, identifier);
</ins><span class="cx">     if (!touch)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -468,9 +477,12 @@
</span><span class="cx">     if (identifier == NoIdentifier)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+    TouchList* targetTouches = touchEvent-&gt;targetTouches();
+    if (!targetTouches)
+        return;
</ins><span class="cx">     // If our exclusive touch still exists, it was not the touch
</span><span class="cx">     // that ended, so we should not stop dragging.
</span><del>-    Touch* exclusiveTouch = findTouchWithIdentifier(touchEvent-&gt;targetTouches(), identifier);
</del><ins>+    Touch* exclusiveTouch = findTouchWithIdentifier(*targetTouches, identifier);
</ins><span class="cx">     if (exclusiveTouch)
</span><span class="cx">         return;
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>