<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:simon.fraser&#64;apple.com" title="Simon Fraser (smfr) &lt;simon.fraser&#64;apple.com&gt;"> <span class="fn">Simon Fraser (smfr)</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Autoscrolling from a drag selection does not work in full screen, or when the window is against the screen edge"
   href="https://bugs.webkit.org/show_bug.cgi?id=155858">bug 155858</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 #274927 Flags</td>
           <td>review?
           </td>
           <td>review-
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Autoscrolling from a drag selection does not work in full screen, or when the window is against the screen edge"
   href="https://bugs.webkit.org/show_bug.cgi?id=155858#c7">Comment # 7</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Autoscrolling from a drag selection does not work in full screen, or when the window is against the screen edge"
   href="https://bugs.webkit.org/show_bug.cgi?id=155858">bug 155858</a>
              from <span class="vcard"><a class="email" href="mailto:simon.fraser&#64;apple.com" title="Simon Fraser (smfr) &lt;simon.fraser&#64;apple.com&gt;"> <span class="fn">Simon Fraser (smfr)</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=274927&amp;action=diff" name="attach_274927" title="Patch">attachment 274927</a> <a href="attachment.cgi?id=274927&amp;action=edit" title="Patch">[details]</a></span>
Patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=274927&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=274927&amp;action=review</a>

<span class="quote">&gt; Source/WebCore/page/mac/EventHandlerMac.mm:1149
&gt; +    CGFloat screenLeftEdge = screenRect.x();
&gt; +    CGFloat insetScreenLeftEdge = screenLeftEdge + EDGE_DISTANCE_THRESHOLD;
&gt; +    CGFloat screenRightEdge = screenLeftEdge + screenRect.width();
&gt; +    CGFloat insetScreenRightEdge = screenRightEdge - EDGE_DISTANCE_THRESHOLD;
&gt; +    if (screenPoint.x() &gt;= screenLeftEdge &amp;&amp; screenPoint.x() &lt; insetScreenLeftEdge) {
&gt; +        CGFloat distanceFromEdge = screenPoint.x() - screenLeftEdge - EDGE_DISTANCE_THRESHOLD;
&gt; +        if (distanceFromEdge &lt; 0)
&gt; +            adjustmentFactor.setWidth((distanceFromEdge / EDGE_DISTANCE_THRESHOLD) * PIXELS_MULTIPLIER);
&gt; +    } else if (screenPoint.x() &gt;= insetScreenRightEdge &amp;&amp; screenPoint.x() &lt; screenRightEdge) {
&gt; +        CGFloat distanceFromEdge = EDGE_DISTANCE_THRESHOLD - (screenRightEdge - screenPoint.x());
&gt; +        if (distanceFromEdge &gt; 0)
&gt; +            adjustmentFactor.setWidth((distanceFromEdge / EDGE_DISTANCE_THRESHOLD) * PIXELS_MULTIPLIER);
&gt; +    }
&gt; +
&gt; +    CGFloat screenTopEdge = screenRect.y();
&gt; +    CGFloat insetScreenTopEdge = screenTopEdge + EDGE_DISTANCE_THRESHOLD;
&gt; +    CGFloat screenBottomEdge = screenTopEdge + screenRect.height();
&gt; +    CGFloat insetScreenBottomEdge = screenBottomEdge - EDGE_DISTANCE_THRESHOLD;
&gt; +
&gt; +    if (screenPoint.y() &gt;= screenTopEdge &amp;&amp; screenPoint.y() &lt; insetScreenTopEdge) {
&gt; +        CGFloat distanceFromEdge = screenPoint.y() - screenTopEdge - EDGE_DISTANCE_THRESHOLD;
&gt; +        if (distanceFromEdge &lt; 0)
&gt; +            adjustmentFactor.setHeight((distanceFromEdge / EDGE_DISTANCE_THRESHOLD) * PIXELS_MULTIPLIER);
&gt; +    } else if (screenPoint.y() &gt;= insetScreenBottomEdge &amp;&amp; screenPoint.y() &lt; screenBottomEdge) {
&gt; +        CGFloat distanceFromEdge = EDGE_DISTANCE_THRESHOLD - (screenBottomEdge - screenPoint.y());
&gt; +        if (distanceFromEdge &gt; 0)
&gt; +            adjustmentFactor.setHeight((distanceFromEdge / EDGE_DISTANCE_THRESHOLD) * PIXELS_MULTIPLIER);
&gt; +    }</span >

I think you should do all this with floats. No reason to use CG types here.

You can also use screenRect.maxX() etc rather than left + width.

<span class="quote">&gt; Source/WebCore/platform/ios/PlatformScreenIOS.mm:127
&gt; +    return FloatRect([[getUIScreenClass() mainScreen] _referenceBounds]);</span >

Don't we have an implicit conversions from CGRect to FloatRect?

<span class="quote">&gt; Source/WebKit2/UIProcess/WebPageProxy.cpp:2342
&gt; +    m_process-&gt;send(Messages::WebPage::WindowScreenDidChange(displayID, screenRect), m_pageID);</span >

I'm not sure why you have to pass a screenRect here. Wen can get the screen rect from the displayID in the web process.</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>