Firefox-specific rendering issue with fitText in CSS Grid contexts requires browser-specific debugging.
The issue involves Firefox incorrectly calculating text scaling within CSS Grid layouts in the Media & Text block. While the problem is isolated to Firefox and has clear reproduction steps, the solution may require understanding both the fitText algorithm and Firefox's grid implementation quirks. The previous flex container fix (#73652) suggests this might be a similar but distinct grid-related issue.
When "Fit text" is enabled (Typography > Fit text toggle) on a Paragraph or Heading block placed inside a Media & Text block, the text does not scale correctly in Firefox. It renders correctly in Chrome, Edge, Brave, and Safari.
The text either overflows the content area or renders at a size that doesn't fit the container — on both frontend and backend (editor).
This appears to be the CSS Grid counterpart of the flex container issue
fixed in #73652. That PR fixed fitText inside flex containers, but the
Media & Text block uses a CSS Grid layout (grid-template-columns: 50% 1fr),
and the same class of problem occurs here — the fitText algorithm
miscalculates the available width inside the 1fr grid column in Firefox.
I also attempted the CSS-only fix of adding min-width: 0 to
.wp-block-media-text__content (which is a standard fix for grid item
intrinsic sizing in Firefox), but this did not resolve the issue. The
problem appears to be in how the fitText JavaScript reads the container
dimensions inside a CSS Grid context in Firefox, not just in how Firefox
resolves min-width: auto.
Now open the same page in Chrome — the text scales correctly.
The text should scale to fit the available width of the
.wp-block-media-text__content area, just like it does in Chrome/Edge/Safari.
In Firefox, the text either overflows the content column or renders at an incorrect (too large) size. Problem occurs on both the frontend and within the block editor.
Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!
Mustafabharmal