<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - dir=auto causes spaces to not get collapsed"
   href="https://bugs.webkit.org/show_bug.cgi?id=124146#c16">Comment # 16</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - dir=auto causes spaces to not get collapsed"
   href="https://bugs.webkit.org/show_bug.cgi?id=124146">bug 124146</a>
              from <span class="vcard"><a class="email" href="mailto:mmaxfield&#64;apple.com" title="Myles C. Maxfield &lt;mmaxfield&#64;apple.com&gt;"> <span class="fn">Myles C. Maxfield</span></a>
</span></b>
        <pre>Wow, yeah, our midpoint handling is completely busted with regard to isolate.

In particular, RenderBlockFlow::appendRunsForObject() assumes that we are iterating in the order of midpoints (aka in logical order, because the midpoints are inserted by our line breaking logic, which is (correctly) insensitive to bidi).

However, constructBidiRunsForSegment() in RenderBlockLineLayout.cpp doesn't iterate in logical order, which is acceptable because of the definition of &quot;isolate&quot; (namely, that isolated elements can be processed out-of-band because they don't require any context)

Overall: our line breaking logic builds up a data structure of midpoints in logical order, and when we process a run of text inside constructBidiRunsForSegment(), we keep a cursor into that data structure and expect it to progress at the same rate that our bidi text processing progresses. However, our bidi text processing doesn't operate in logical order, so when the processing consults the data structure, it's looking in the wrong place inside it.

Fixing this is no simple matter.</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>