Open Bug 1911534 Opened 1 month ago Updated 25 days ago

Unstyled spans are not layout-neutral in justified text / justification algorithm is span-dependent

Categories

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

Desktop
Windows 10
defect

Tracking

()

Tracking Status
firefox-esr115 --- wontfix
firefox-esr128 --- wontfix
firefox129 --- wontfix
firefox130 --- wontfix

People

(Reporter: rbucata, Unassigned, NeedInfo)

References

(Regression, )

Details

(Keywords: regression, Whiteboard: [webcompat-source:web-bugs])

Attachments

(1 file)

Environment:
Operating system: Windows 10
Firefox version: Firefox 128.0

Steps to reproduce:

  1. Navigate to: https://jsfiddle.net/vwLso5b8/8/
  2. Observe the console output

The glitch can be hard to reproduce because text justification is only inconsistent at certain widths. In this example, in my local browser, setting the container to 410px did it. However, if the problem is not apparent, just remove the fixed width and drag to resize the window for a bit and it'll eventually pop up.

It's also hard to pinpoint what's wrong because changing CSS (font-size, white-space, word-break, font-kerning etc.) will seemingly fix it. However, you'll soon realize that it's not really fixed, it's just that the text has repositioned and will now break at a different width. Nothing that I tried solved it definitively, although sometimes it took longer for the problem to manifest.

I suspect it's something in the text justification algorithm.

Expected Behavior:
The text is rendered correctly

Actual Behavior:
The text is rendered broken

Notes:

  • Reproduces regardless of the status of ETP
  • Reproduces in Firefox Nightly, and Firefox Release
  • Does not reproduce in Chrome

Created from https://github.com/webcompat/web-bugs/issues/139946

Component: Site Reports → Layout: Text and Fonts
Product: Web Compatibility → Core

The regressor attribution to bug 1071816 doesn't make sense, unless the code for bug 1071816 is somehow very, very broken:

Bug 1071816 is about character encoding and only for file: URLs. The bug description here suggests a layout-level glitch on a Web site (not file:). I took a look at the code that landed for bug 1071816, and it looks very, very unlikely that it could have caused the kind of brokenness described here.

No longer regressed by: 1071816

:xidorn, since you are the author of the regressor, bug 1063857, could you take a look?

For more information, please visit BugBot documentation.

Flags: needinfo?(xidorn+moz)

Added some resizing so the bug is seen clearly.

This is clearly a bug, but it's hard to justify making it more than S3 given how long-standing it is. The justification algorithm is described here and was introduced in bug 1063857 (not surprising).

If Xidorn had time to take a look it'd be amazing, of course. cc'ing Jonathan who might be familiar with that code as well, and fixing up the title :)

Severity: -- → S3
Priority: -- → P3
Summary: jsfiddle.net - Span tags are not layout-neutral causing graphic glitches → Unstyled spans are not layout-neutral in justified text / justification algorithm is span-dependent
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: