<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Latching algorithm in findEnclosingOverflowScroll is broken"
   href="https://bugs.webkit.org/show_bug.cgi?id=145642">145642</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Latching algorithm in findEnclosingOverflowScroll is broken
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>528+ (Nightly build)
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Layout and Rendering
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>bfulgham&#64;webkit.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I discovered this problem while debugging <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - REGRESSION (r181879): Scrolling order on pages with focused iframe is broken."
   href="show_bug.cgi?id=145637">Bug 145637</a>.

The logic in findEnclosingOverflowScroll uses the RenderBox &quot;canBeScrolledAndHasScrollableArea&quot; to identify the nearest enclosing element that can be scrolled. However, this method considers horizontal and vertical scrolling as equally relevant. This is a problem when we want to perform a vertical scroll, but the element underneath the mouse pointer can only be scrolled in a horizontal direction.

When we have this scenario, the latching logic chooses the horizontally scrollable region and attempts to latch to it. When it discovers that it cannot be scrolled in the user's gesture direction, it gives up and passes control to the next enclosing latching context. When we are working on a single page, this means the document body, and things generally work as the user expects. But when we have nested iframes, this causes us to pop up to the enclosing iframe, which looks wrong to the user.

The test case I added in <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - REGRESSION (r181879): Scrolling order on pages with focused iframe is broken."
   href="show_bug.cgi?id=145637">Bug 145637</a> highlights this problem if you modify the &lt;img&gt; style to remove the &quot;max-width:100%&quot; in 'inner_content.html'.

I think the right fix here is to modify 'findEnclosingOverflowScroll' so that it takes the gesture's dominant direction into account.</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>