<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:zalan&#64;apple.com" title="zalan &lt;zalan&#64;apple.com&gt;"> <span class="fn">zalan</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Soft hyphen is not shown when it is placed at the end of an inline element"
   href="https://bugs.webkit.org/show_bug.cgi?id=153980">bug 153980</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;">Assignee</td>
           <td>zalan&#64;apple.com
           </td>
           <td>webkit-unassigned&#64;lists.webkit.org
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Soft hyphen is not shown when it is placed at the end of an inline element"
   href="https://bugs.webkit.org/show_bug.cgi?id=153980#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Soft hyphen is not shown when it is placed at the end of an inline element"
   href="https://bugs.webkit.org/show_bug.cgi?id=153980">bug 153980</a>
              from <span class="vcard"><a class="email" href="mailto:zalan&#64;apple.com" title="zalan &lt;zalan&#64;apple.com&gt;"> <span class="fn">zalan</span></a>
</span></b>
        <pre>We missed the case when the character at the breaking position does not fit the line and soft-hyphen is followed by this overflowing character. (foo&amp;shy;bar where b overflows the line). In such cases we don't yet have an item in the breaking history.      
This should fix it -&gt;
diff --git a/Source/WebCore/rendering/line/BreakingContext.h b/Source/WebCore/rendering/line/BreakingContext.h
index b44c5a2..46b1c68 100644
--- a/Source/WebCore/rendering/line/BreakingContext.h
+++ b/Source/WebCore/rendering/line/BreakingContext.h
&#64;&#64; -903,8 +903,28 &#64;&#64; inline bool BreakingContext::handleText(WordMeasurements&amp; wordMeasurements, bool
                         m_lineInfo.setPreviousLineBrokeCleanly(true);
                         wordMeasurement.endOffset = m_lineBreakHistory.offset();
                     }
-                    if (m_lineBreakHistory.offset() &amp;&amp; downcast&lt;RenderText&gt;(m_lineBreakHistory.renderer()) &amp;&amp; downcast&lt;RenderText&gt;(*m_lineBreakHistory.renderer()).textLength() &amp;&amp; downcast&lt;RenderText&gt;(*m_lineBreakHistory.renderer()).characterAt(m_lineBreakHistory.offset() - 1) == softHyphen &amp;&amp; style.hyphens() != HyphensNone)
-                        hyphenated = true;
+                    // Check if the last breaking position is a soft-hyphen.
+                    if (!hyphenated) {
+                        const RenderText* textRenderer = nullptr;
+                        Optional&lt;int&gt; breakingPositon;
+                        if (m_lineBreakHistory.historyLength() &amp;&amp; is&lt;RenderText&gt;(m_lineBreakHistory.renderer())) {
+                            textRenderer = downcast&lt;RenderText&gt;(m_lineBreakHistory.renderer());
+                            breakingPositon = m_lineBreakHistory.offset();
+                        } else if (nextBreakablePosition &gt; -1 &amp;&amp; is&lt;RenderText&gt;(m_current.renderer())) {
+                            textRenderer = downcast&lt;RenderText&gt;(m_current.renderer());
+                            breakingPositon = nextBreakablePosition;
+                        }
+                        if (textRenderer &amp;&amp; breakingPositon) {
+                            if (breakingPositon.value() == 0) {
+                                // We need to check the previous renderer for the soft-hyphen character instead.
+                                textRenderer = is&lt;RenderText&gt;(m_lastObject) ? downcast&lt;RenderText&gt;(m_lastObject) : nullptr;
+                                if (textRenderer)
+                                    breakingPositon = textRenderer-&gt;textLength();
+                            }
+                            UChar characterBeforeBreakingPosition = textRenderer-&gt;characterAt(breakingPositon.value() - 1);
+                            hyphenated = characterBeforeBreakingPosition == softHyphen &amp;&amp; style.hyphens() != HyphensNone;
+                        }
+                    }
                     if (m_lineBreakHistory.offset() &amp;&amp; m_lineBreakHistory.offset() != (unsigned)wordMeasurement.endOffset &amp;&amp; !wordMeasurement.width) {
                         if (charWidth) {
                             wordMeasurement.endOffset = m_lineBreakHistory.offset();
Patch is coming up soon. (need to see first if checking prev is sufficient enough)</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>