Skip to content

fix(Paragraph): Remove Firefox "inline-block" hack for <*-text-line>, use local DOMRect-cache.#199

Merged
mettta merged 5 commits intomainfrom
textLine_FF_hack_removing
Feb 20, 2026
Merged

fix(Paragraph): Remove Firefox "inline-block" hack for <*-text-line>, use local DOMRect-cache.#199
mettta merged 5 commits intomainfrom
textLine_FF_hack_removing

Conversation

@mettta
Copy link
Copy Markdown
Owner

@mettta mettta commented Feb 20, 2026

Removed a legacy inline-block workaround for service text-line elements and kept a single inline display path.

Why the workaround was added:

  • It was introduced to reduce Firefox issues with inline offsetTop measurements and baseline gap noise during line-splitting.

Why we remove it now:

  • Firefox no longer shows the issue this workaround targeted.
  • The workaround caused a mismatch between measurement-time layout and final render layout.
  • In edge cases, text looked like it fit during calculation, but wrapped after grouping.
  • This was more visible with custom fonts and mixed inline content.

Also, to stabilize measurements:

  • Wrap every split line (not only compound, but also single text lines) in textGroup: each line gets a block-level wrapper, while inline flow is preserved inside the group, keeping the original visual appearance.
  • Replace offsetTop/offsetHeight-based line-start detection with cached DOMRect geometry in _findNewLineStarts, preserving the original heuristic while fixing Firefox inline offset inconsistencies.

Removed a legacy `inline-block` workaround for service text-line elements and kept a single `inline` display path.

Why the workaround was added:
- It was introduced to reduce Firefox issues with inline `offsetTop` measurements and baseline gap noise during line-splitting.

Why we remove it now:
- Firefox no longer shows the issue this workaround targeted.
- The workaround caused a mismatch between measurement-time layout and final render layout.
- In edge cases, text looked like it fit during calculation, but wrapped after grouping.
- This was more visible with custom fonts and mixed inline content.
…ent line measurement

Wrap every split line in `textGroup` to stabilize measurements: each line gets a block-level wrapper, while inline flow is preserved inside the group, keeping the original visual appearance.
@mettta mettta changed the title Remove Firefox "inline-block" hack for <*-text-line> fix(Paragraph): Remove Firefox "inline-block" hack for <*-text-line>, use local DOMRect-cache. Feb 20, 2026
@mettta mettta merged commit 38cd41c into main Feb 20, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant