<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 - tryHyphenating's maxPrefixWidth computation is odd."
   href="https://bugs.webkit.org/show_bug.cgi?id=169613">169613</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>tryHyphenating's maxPrefixWidth computation is odd.
          </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>Layout and Rendering
          </td>
        </tr>

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

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

        <tr>
          <th>CC</th>
          <td>bfulgham&#64;webkit.org, simon.fraser&#64;apple.com, zalan&#64;apple.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I wonder why
1. the xPos in-param value is not set to the position of the hyphenated string but instead it is set to one character before.
Most of the time it's a space (whitespace) but it can also be a sequence of non-collapsed whitespace like tabs.
case 1: non-collapsed whitespace -&gt; &quot;tabtabstring&quot;, xPos -&gt; &quot;tab|tabstring&quot; 
case 2: collapsed whitespace &quot;spacestring&quot;, xPos -&gt; &quot;|spacestring&quot;
3. then we do &quot;availableWidth - xPos - hyphenWidth&quot; where the &quot;availableWidth - xPos&quot; is supposed to indicate the width we have for hyphenating, but since this value is inflated by the trailing whitespace, we try to compensate for that by subtracting hyphenWidth. (that's just a guess, but I can't figure out a better explanation, not even through blame)
I just don't see how these values add up and why can't we pass in the actual width left for the string and see if the hyphen fits.</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>