alphagov / reported-bugs

Tracking bugs in browsers, assistive technologies and operating systems that have been reported by GDS
5 stars 2 forks source link

Text wraps unnecessarily within intrinsically-sized elements when using certain fonts and the inner HTML of the element contains a new line that is not preceded by a space (Safari Technology Preview) #66

Closed 36degrees closed 2 years ago

36degrees commented 2 years ago

Upstream bug: https://bugs.webkit.org/show_bug.cgi?id=232939 Date: 2021-11-10 Reported by: Oliver Byford Related to: https://github.com/alphagov/govuk-frontend/issues/2429


We're seeing an issue with text being aggressively wrapped when it doesn't need to be in Safari Technology Preview r132 and above – we've also tested with r131 and the problem does not occur there, so are fairly confident this is a regression that was introduced in r132.

Safari Tech Preview r134

This seems to be a compatibility issue with our particular font, as the problem does not occur if remove the font from our font stack and fall back to Arial.

Steps to reproduce

  1. Open https://design-system.service.gov.uk in both Safari Technology Preview (r132 or later) and a current stable version of Safari (I've checked in both v15.0 (16612.1.29.41.4) and v15.1 (17612.2.91.20) and they display correctly)
  2. Compare the layout in the two browsers, paying attention to how text is being wrapped

Expected results

The layout and wrapping of text should be consistent between the current stable version of Safari and Safari Technology Preview.

Actual results

Text is aggressively wrapped when it doesn't need to be in Safari Technology Preview.

So far we've observed the problem affecting:

I've marked this issue as major severity as we're not seeing this happening in other browsers and, if this regression hit a stable release of Safari it would affect the display of elements across GOV.UK – the website for the UK government.

36degrees commented 2 years ago

From further testing, this appears to be an issue when:

See https://codepen.io/36degrees/pen/abyjzNr for a minimum viable example of the issue.