playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[Feature]: Add support for hyphens: auto;

Open EMaderbacher opened this issue 1 year ago • 2 comments

🚀 Feature Request

Currently the CSS hypens: auto; is only supported by Chromium headless. According to #34067 the support will be removed with v1.50. Would be nice to have this feature back in a future release

Example

No response

Motivation

Supporting hyphens: auto; will result in same output as in standard browsers

EMaderbacher avatar Jan 17 '25 12:01 EMaderbacher

We use playwright to create visual snapshots of pages. Recently an explicit change was made to hyphenation, and this prevents automatic regression tests through visual confirmation. It would be nice to have the browser behave like a standard browser if hyphens is explicitly defined.

ConcernedHobbit avatar Mar 13 '25 08:03 ConcernedHobbit

Investigation:

  • Google Chrome by default does download the hyphen-data via component updater. We as Playwright disable it via a CLI flag.
  • macOS uses system hyphen APIs, Linux and Windows requires hyphen-data
  • For Headless Shell this gets supplied via a hyphen-data directory.
  • For normal Chromium this directory gets ignored by default - we'd have to massage this condition or use CfT instead.
  • As a hacky workaround for now users can use Chrome for Testing and pass it via the executablePath or use Google Chrome which might work. CfT has working hyphen-data.

We'll collect more feedback until we continue to invest more time on it.

mxschmitt avatar Apr 07 '25 09:04 mxschmitt

This also is an issue here... We were used to check for visual regression and hyphenation was part of it. Right now all test cases fail because hyphenation suddenly stops working after we updated. :-(

Is this going to be introduced in the near future? Or do we have to find a longterm alternative?

r-oldenburg avatar Jul 29 '25 13:07 r-oldenburg