<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:simon.fraser@apple.com" title="Simon Fraser (smfr) <simon.fraser@apple.com>"> <span class="fn">Simon Fraser (smfr)</span></a>
</span> changed
<a class="bz_bug_link
bz_status_NEW "
title="NEW - Extend event stream to include interpolated events and add a force press test that uses that interpolation"
href="https://bugs.webkit.org/show_bug.cgi?id=163161">bug 163161</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Attachment #291127 Flags</td>
<td>review?
</td>
<td>review-
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Extend event stream to include interpolated events and add a force press test that uses that interpolation"
href="https://bugs.webkit.org/show_bug.cgi?id=163161#c6">Comment # 6</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Extend event stream to include interpolated events and add a force press test that uses that interpolation"
href="https://bugs.webkit.org/show_bug.cgi?id=163161">bug 163161</a>
from <span class="vcard"><a class="email" href="mailto:simon.fraser@apple.com" title="Simon Fraser (smfr) <simon.fraser@apple.com>"> <span class="fn">Simon Fraser (smfr)</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=291127&action=diff" name="attach_291127" title="Patch">attachment 291127</a> <a href="attachment.cgi?id=291127&action=edit" title="Patch">[details]</a></span>
Patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=291127&action=review">https://bugs.webkit.org/attachment.cgi?id=291127&action=review</a>
<span class="quote">> Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:307
> + if (phase != UITouchPhaseCancelled && phase != UITouchPhaseBegan && phase != UITouchPhaseEnded
> + && phase != UITouchPhaseStationary)</span >
No need to wrap this.
<span class="quote">> Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:977
> +
> + </span >
Remove one of the blank lines.
<span class="quote">> Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:988
> + NSMutableDictionary *newEvent = [endEvent mutableCopy];</span >
We're not using ARC, so this is leaked.
<span class="quote">> Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:997
> + while ((startTouch = [startEnumerator nextObject]) && (endTouch = [endEnumerator nextObject])) {</span >
This assumes that the touches are listed in "id" order. Maybe you should just bail if the start and end events have touches with non-matching ids? At the very least, you need to find matching touches by id.
<span class="quote">> Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:999
> + NSMutableDictionary *newTouch = [[endTouch mutableCopy] autorelease];</span >
Perferable to just explicitly -release after the [newTouches addObject:newTouch] below.
<span class="quote">> Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:1002
> + newTouch[HIDEventXKey] = [NSNumber numberWithDouble:interpolations[interpolationType]([startTouch[HIDEventXKey] doubleValue], [endTouch[HIDEventXKey] doubleValue], t)];</span >
I think you can use @() here.
<span class="quote">> Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:1005
> + newTouch[HIDEventYKey] = [NSNumber numberWithDouble:interpolations[interpolationType]([startTouch[HIDEventYKey] doubleValue], [endTouch[HIDEventYKey] doubleValue], t)];</span >
Ditto.
<span class="quote">> Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:1008
> + newTouch[HIDEventPressureKey] = [NSNumber numberWithDouble:interpolations[interpolationType]([startTouch[HIDEventPressureKey] doubleValue], [endTouch[HIDEventPressureKey] doubleValue], t)];</span >
Ditto.
<span class="quote">> Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:1029
> + if (interpolate) {
> + NSArray *newEvents = [self interpolatedEvents:eventInfo];
> + [self processEventsArray:newEvents withStartTime:startTime];
> + } else {</span >
I don't like here how you generate the interpolated events in the middle of dispatching. I think you should do a first pass over -events and make a new events array with the interpolated events, and then dispatch.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>