<!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>[245505] 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/245505">245505</a></dd>
<dt>Author</dt> <dd>graouts@webkit.org</dd>
<dt>Date</dt> <dd>2019-05-19 14:34:24 -0700 (Sun, 19 May 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Pointer Events] A pointer should be marked as primary for all of its events
https://bugs.webkit.org/show_bug.cgi?id=197909
<rdar://problem/50801608>

Reviewed by Dean Jackson.

Source/WebCore:

Add an ivar for EventHandler which we'll use in WebKitAdditions code to track the touch identifier
of the very first touch to start in a given sequence.

* page/EventHandler.h:

LayoutTests:

Update tests to match expectations that only the first touch of a sequence is the primary pointer,
which applies to all of its events, even after the even is no longer touching the digitizer.

* pointerevents/ios/over-enter-out-leave.html:
* pointerevents/ios/pointer-event-order.html:
* pointerevents/ios/pointer-events-implicit-capture.html:
* pointerevents/ios/pointer-events-is-primary-expected.txt:
* pointerevents/ios/pointer-events-is-primary.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestspointereventsiosoverenteroutleavehtml">trunk/LayoutTests/pointerevents/ios/over-enter-out-leave.html</a></li>
<li><a href="#trunkLayoutTestspointereventsiospointereventorderhtml">trunk/LayoutTests/pointerevents/ios/pointer-event-order.html</a></li>
<li><a href="#trunkLayoutTestspointereventsiospointereventsimplicitcapturehtml">trunk/LayoutTests/pointerevents/ios/pointer-events-implicit-capture.html</a></li>
<li><a href="#trunkLayoutTestspointereventsiospointereventsisprimaryexpectedtxt">trunk/LayoutTests/pointerevents/ios/pointer-events-is-primary-expected.txt</a></li>
<li><a href="#trunkLayoutTestspointereventsiospointereventsisprimaryhtml">trunk/LayoutTests/pointerevents/ios/pointer-events-is-primary.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorepageEventHandlerh">trunk/Source/WebCore/page/EventHandler.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (245504 => 245505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2019-05-19 18:17:40 UTC (rev 245504)
+++ trunk/LayoutTests/ChangeLog 2019-05-19 21:34:24 UTC (rev 245505)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2019-05-19  Antoine Quint  <graouts@apple.com>
+
+        [Pointer Events] A pointer should be marked as primary for all of its events
+        https://bugs.webkit.org/show_bug.cgi?id=197909
+        <rdar://problem/50801608>
+
+        Reviewed by Dean Jackson.
+
+        Update tests to match expectations that only the first touch of a sequence is the primary pointer,
+        which applies to all of its events, even after the even is no longer touching the digitizer.
+
+        * pointerevents/ios/over-enter-out-leave.html:
+        * pointerevents/ios/pointer-event-order.html:
+        * pointerevents/ios/pointer-events-implicit-capture.html:
+        * pointerevents/ios/pointer-events-is-primary-expected.txt:
+        * pointerevents/ios/pointer-events-is-primary.html:
+
</ins><span class="cx"> 2019-05-19  Simon Fraser  <simon.fraser@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Layers painting into shared backing need to contribute to overlap
</span></span></pre></div>
<a id="trunkLayoutTestspointereventsiosoverenteroutleavehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/pointerevents/ios/over-enter-out-leave.html (245504 => 245505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/pointerevents/ios/over-enter-out-leave.html    2019-05-19 18:17:40 UTC (rev 245504)
+++ trunk/LayoutTests/pointerevents/ios/over-enter-out-leave.html       2019-05-19 21:34:24 UTC (rev 245505)
</span><span class="lines">@@ -23,9 +23,9 @@
</span><span class="cx">             { type: "pointerover", x: 100, y: 100, isPrimary: true },
</span><span class="cx">             { type: "pointerenter", x: 100, y: 100, isPrimary: true },
</span><span class="cx">             { type: "pointerdown", x: 100, y: 100, isPrimary: true },
</span><del>-            { type: "pointerup", x: 100, y: 100, isPrimary: false },
-            { type: "pointerout", x: 100, y: 100, isPrimary: false },
-            { type: "pointerleave", x: 100, y: 100, isPrimary: false },
</del><ins>+            { type: "pointerup", x: 100, y: 100, isPrimary: true },
+            { type: "pointerout", x: 100, y: 100, isPrimary: true },
+            { type: "pointerleave", x: 100, y: 100, isPrimary: true },
</ins><span class="cx">         ]);
</span><span class="cx">         test.done();
</span><span class="cx">     });
</span></span></pre></div>
<a id="trunkLayoutTestspointereventsiospointereventorderhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/pointerevents/ios/pointer-event-order.html (245504 => 245505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/pointerevents/ios/pointer-event-order.html     2019-05-19 18:17:40 UTC (rev 245504)
+++ trunk/LayoutTests/pointerevents/ios/pointer-event-order.html        2019-05-19 21:34:24 UTC (rev 245505)
</span><span class="lines">@@ -20,9 +20,9 @@
</span><span class="cx">             { type: "pointerover", x: 100, y: 100, isPrimary: true },
</span><span class="cx">             { type: "pointerenter", x: 100, y: 100, isPrimary: true },
</span><span class="cx">             { type: "pointerdown", x: 100, y: 100, isPrimary: true },
</span><del>-            { type: "pointerup", x: 100, y: 100, isPrimary: false },
-            { type: "pointerout", x: 100, y: 100, isPrimary: false },
-            { type: "pointerleave", x: 100, y: 100, isPrimary: false },
</del><ins>+            { type: "pointerup", x: 100, y: 100, isPrimary: true },
+            { type: "pointerout", x: 100, y: 100, isPrimary: true },
+            { type: "pointerleave", x: 100, y: 100, isPrimary: true },
</ins><span class="cx">             { type: "click", x: 100, y: 100 },
</span><span class="cx">         ]);
</span><span class="cx">         test.done();
</span></span></pre></div>
<a id="trunkLayoutTestspointereventsiospointereventsimplicitcapturehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/pointerevents/ios/pointer-events-implicit-capture.html (245504 => 245505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/pointerevents/ios/pointer-events-implicit-capture.html 2019-05-19 18:17:40 UTC (rev 245504)
+++ trunk/LayoutTests/pointerevents/ios/pointer-events-implicit-capture.html    2019-05-19 21:34:24 UTC (rev 245505)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx">             { id: 1, type: "pointermove" },
</span><span class="cx">             { id: 2, type: "pointermove" },
</span><span class="cx">             { id: 1, type: "pointerup" },
</span><del>-            { id: 1, type: "lostpointercapture", isPrimary: false },
</del><ins>+            { id: 1, type: "lostpointercapture", isPrimary: true },
</ins><span class="cx">             { id: 2, type: "pointerup" },
</span><span class="cx">             { id: 2, type: "lostpointercapture", isPrimary: false }
</span><span class="cx">         ]);
</span></span></pre></div>
<a id="trunkLayoutTestspointereventsiospointereventsisprimaryexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/pointerevents/ios/pointer-events-is-primary-expected.txt (245504 => 245505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/pointerevents/ios/pointer-events-is-primary-expected.txt       2019-05-19 18:17:40 UTC (rev 245504)
+++ trunk/LayoutTests/pointerevents/ios/pointer-events-is-primary-expected.txt  2019-05-19 21:34:24 UTC (rev 245505)
</span><span class="lines">@@ -1,3 +1,3 @@
</span><span class="cx"> 
</span><del>-PASS Oldest active touch has isPrimary = true. 
</del><ins>+PASS The first touch of a touch sequence has isPrimary = true. 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestspointereventsiospointereventsisprimaryhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/pointerevents/ios/pointer-events-is-primary.html (245504 => 245505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/pointerevents/ios/pointer-events-is-primary.html       2019-05-19 18:17:40 UTC (rev 245504)
+++ trunk/LayoutTests/pointerevents/ios/pointer-events-is-primary.html  2019-05-19 21:34:24 UTC (rev 245505)
</span><span class="lines">@@ -14,10 +14,11 @@
</span><span class="cx"> 
</span><span class="cx"> target_test((target, test) => {
</span><span class="cx">     target.style.touchAction = "none";
</span><del>-    const eventTracker = new EventTracker(target, ["pointerdown", "pointermove"]);
</del><ins>+    const eventTracker = new EventTracker(target, ["pointerover", "pointerenter", "pointerdown", "pointermove", "pointerup", "pointerout", "pointerleave"]);
</ins><span class="cx"> 
</span><span class="cx">     const one = ui.finger();
</span><span class="cx">     const two = ui.finger();
</span><ins>+    const three = ui.finger();
</ins><span class="cx">     ui.sequence([
</span><span class="cx">         one.begin({ x: 10, y: 10 }),
</span><span class="cx">         two.begin({ x: 50, y: 50 }),
</span><span class="lines">@@ -25,18 +26,45 @@
</span><span class="cx">         one.move({ x: 30, y: 30 }),
</span><span class="cx">         one.end(),
</span><span class="cx">         two.move({ x: 50, y: 50 }),
</span><del>-        two.end()
</del><ins>+        two.end(),
+        three.begin({ x: 10, y: 10 }),
+        three.end(),
</ins><span class="cx">     ]).then(() => {
</span><span class="cx">         eventTracker.assertMatchesEvents([
</span><ins>+            // Yielded by one.begin({ x: 10, y: 10 }).
+            { id: 1, type: "pointerover", x: 10, y: 10, isPrimary: true },
+            { id: 1, type: "pointerenter", x: 10, y: 10, isPrimary: true },
</ins><span class="cx">             { id: 1, type: "pointerdown", x: 10, y: 10, isPrimary: true },
</span><ins>+            // Yielded by two.begin({ x: 50, y: 50 }).
+            { id: 2, type: "pointerover", x: 50, y: 50, isPrimary: false },
+            { id: 2, type: "pointerenter", x: 50, y: 50, isPrimary: false },
</ins><span class="cx">             { id: 2, type: "pointerdown", x: 50, y: 50, isPrimary: false },
</span><ins>+            // Yielded by two.move({ x: 70, y: 70 }).
</ins><span class="cx">             { id: 2, type: "pointermove", x: 70, y: 70, isPrimary: false },
</span><ins>+            // Yielded by one.move({ x: 30, y: 30 }).
</ins><span class="cx">             { id: 1, type: "pointermove", x: 30, y: 30, isPrimary: true },
</span><del>-            { id: 2, type: "pointermove", x: 50, y: 50, isPrimary: true }
</del><ins>+            // Yielded by one.end().
+            { id: 1, type: "pointerup", x: 30, y: 30, isPrimary: true },
+            { id: 1, type: "pointerout", x: 30, y: 30, isPrimary: true },
+            { id: 1, type: "pointerleave", x: 30, y: 30, isPrimary: true },
+            // Yielded by two.move({ x: 50, y: 50 }).
+            { id: 2, type: "pointermove", x: 50, y: 50, isPrimary: false },
+            // Yielded by two.end().
+            { id: 2, type: "pointerup", x: 50, y: 50, isPrimary: false },
+            { id: 2, type: "pointerout", x: 50, y: 50, isPrimary: false },
+            { id: 2, type: "pointerleave", x: 50, y: 50, isPrimary: false },
+            // Yielded by three.begin({ x: 10, y: 10 }).
+            { id: 3, type: "pointerover", x: 10, y: 10, isPrimary: true },
+            { id: 3, type: "pointerenter", x: 10, y: 10, isPrimary: true },
+            { id: 3, type: "pointerdown", x: 10, y: 10, isPrimary: true },
+            // Yielded by three.end().
+            { id: 3, type: "pointerup", x: 10, y: 10, isPrimary: true },
+            { id: 3, type: "pointerout", x: 10, y: 10, isPrimary: true },
+            { id: 3, type: "pointerleave", x: 10, y: 10, isPrimary: true },
</ins><span class="cx">         ]);
</span><span class="cx">         test.done();
</span><span class="cx">     });
</span><del>-}, "Oldest active touch has isPrimary = true.");
</del><ins>+}, "The first touch of a touch sequence has isPrimary = true.");
</ins><span class="cx"> 
</span><span class="cx"> </script>
</span><span class="cx"> </body>
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (245504 => 245505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2019-05-19 18:17:40 UTC (rev 245504)
+++ trunk/Source/WebCore/ChangeLog      2019-05-19 21:34:24 UTC (rev 245505)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2019-05-19  Antoine Quint  <graouts@apple.com>
+
+        [Pointer Events] A pointer should be marked as primary for all of its events
+        https://bugs.webkit.org/show_bug.cgi?id=197909
+        <rdar://problem/50801608>
+
+        Reviewed by Dean Jackson.
+
+        Add an ivar for EventHandler which we'll use in WebKitAdditions code to track the touch identifier
+        of the very first touch to start in a given sequence.
+
+        * page/EventHandler.h:
+
</ins><span class="cx"> 2019-05-19  Darin Adler  <darin@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Change String::number to use "shortest" instead of "fixed precision 6 digits"
</span></span></pre></div>
<a id="trunkSourceWebCorepageEventHandlerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EventHandler.h (245504 => 245505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EventHandler.h 2019-05-19 18:17:40 UTC (rev 245504)
+++ trunk/Source/WebCore/page/EventHandler.h    2019-05-19 21:34:24 UTC (rev 245505)
</span><span class="lines">@@ -614,6 +614,10 @@
</span><span class="cx">     unsigned touchIdentifierForMouseEvents { 0 };
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(POINTER_EVENTS) && ENABLE(IOS_TOUCH_EVENTS)
+    unsigned m_touchIdentifierForPrimaryTouch { 0 };
+#endif
+
</ins><span class="cx">     double m_maxMouseMovedDuration { 0 };
</span><span class="cx">     bool m_didStartDrag { false };
</span><span class="cx">     bool m_isHandlingWheelEvent { false };
</span></span></pre>
</div>
</div>

</body>
</html>