[Webkit-unassigned] [Bug 224172] New: Inline tags can break soft hyphens

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Apr 4 10:25:25 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=224172

            Bug ID: 224172
           Summary: Inline tags can break soft hyphens
           Product: WebKit
           Version: Safari 14
          Hardware: Mac (Intel)
                OS: macOS 10.15
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Text
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: mrbencem at gmail.com
                CC: mmaxfield at apple.com

Created attachment 425131

  --> https://bugs.webkit.org/attachment.cgi?id=425131&action=review

Soft hyphen is missing

Hi,

Soft hyphen is not displayed if it is the last character in an inline element, although the line does break:

<p style="width: 100px;">
    <span style="color: red;">Inter­</span>dimensional
</p>

A possible workaround would be to move the soft hyphen out of the inline element:

<p style="width: 100px;">
    <span style="color: red;">Inter</span>­dimensional
</p>

Unfortunately this also removes the intended styling, the hyphen is now visible but black instead of red. Another issue with this workaround is that when using multiple inline elements to programmatically style a piece of text, the inline element beginning with a soft hyphen will have double height:

<p style="width: 100px;">
    <span style="color: red;">Inter</span>
    <span>­dimensional</span>
</p>

The hyphen is rendered onto the first line but the rest of the text is onto the second line, preventing a script from measuring actual line heights. Auto-hyphenation is poorly supported in modern browsers and soft hyphens could be a viable alternative for sophisticated web-based text editors, but this bug is a significant obstacle in this regard.

The intended behavior would be to show the glyph whenever break happens regardless of its parent.

(Soft hyphens show/style/hide as intended in Chrome 89.0.4389.114)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210404/1bb5fafe/attachment-0001.htm>


More information about the webkit-unassigned mailing list