Closed Bug 1928202 Opened 4 months ago Closed 4 months ago

Soft Wrap Opportunity Before Replaced Element

Categories

(Core :: Layout: Text and Fonts, defect)

Firefox 131
defect

Tracking

()

RESOLVED DUPLICATE of bug 1927524

People

(Reporter: klausgy, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0

Steps to reproduce:

Having Some text<a><svg></svg></a> and having white-space: nowrap; on the <a> doesn't introduce a soft wrap opportunity between text and the SVG, see here: https://jsfiddle.net/xwceur0g/5/

Actual results:

Chrome and Safari behave differently here. Originally, I thought FFs behavior was more intuitive and logical, so I filed a bug for Chromium. But the devs convinced me that Chromium adheres to the spec:

Thank you for an interesting case. I can confirm Firefox doesn't break before the SVG, while Chromium and Safari does.

The spec is

CSS Text 5.1 Line Breaking Details:
For soft wrap opportunities defined by the boundary between two characters or atomic inlines, the white-space property on the nearest common ancestor of the two characters controls breaking

The nearest common ancestor of the text node and <svg> is <body>, so there should be a soft wrap opportunity between "d" of "World" and the SVG.

Expected results:

Soft wrap opportunity should be introduced.

Component: Untriaged → Layout: Text and Fonts
Product: Firefox → Core

This looks like the same as bug 1927524 (the testcase there uses <canvas> rather than <svg>, but it's the same issue).

Status: UNCONFIRMED → RESOLVED
Closed: 4 months ago
Duplicate of bug: 1927524
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.