<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 - ComplexTextController never worked if runs are non monotonic"
   href="https://bugs.webkit.org/show_bug.cgi?id=167597">167597</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>ComplexTextController never worked if runs are non monotonic
          </td>
        </tr>

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

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

        <tr>
          <th>Version</th>
          <td>WebKit Nightly Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </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>Text
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>mmaxfield&#64;apple.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>mmaxfield&#64;apple.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>In ComplexTextController::advance(), we iterate through runs in string order. When we encounter a run, we append its paint advances into the GlyphBuffer and we increase the runWidthSoFar by its layout advance.

FontCascadeCocoa assumes that runs are adjacent. If the runs aren't adjacent or monotonic, our runWidthSoFar is meaningless because of this assumption.

Similarly, when we paint glyphs, we just paint them in the order they appear in the GlyphBuffer. If the runs aren't monotonic, then this order is completely busted and the results will be garbage.

Instead, since it never worked, we should just remove the logic about iterating to an arbitrary run in the middle of the ComplexTextController (inside advance()) and force monotonic iteration.</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>