Skip to content

Inconsistent Soft Wrap Opportunities Between Browsers #11109

@fweth

Description

@fweth

I recently filed a bug report for Chromium about inconsistent line break behavior between Firefox and other browsers. In my opinion, Firefox's handling is more reasonable. The issue is demonstrated here: https://jsfiddle.net/xwceur0g/5/.

I would like the SVG element to break to a new line along with the last word preceding it, as there are no soft wrap opportunities (SWO) between the text and the SVG, according to my logic. Firefox already handles this as desired, but other browsers do not. However, you can make it work in Chrome and Safari by adding some text content in the <a> element before the <svg>, for example, <a>&nbsp;<svg>...</svg></a>.

This approach seems unintuitive to me, as it implies that adding text content removes an SWO, whereas, in my view, text content should (at most) add SWOs. For instance, $nbsp; should simply mean "place a space here but don't change any SWOs." However, the way Chrome and Safari interpret it, $nbsp; can also mean "place a space here and remove the SWO that existed before."

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions