Page MenuHomePhabricator

Improve line breaking behavior in Firefox and Chrome under complex conditions
ClosedPublic

Authored by epriestley on Wed, May 13, 6:52 PM.

Details

Summary

See https://github.com/phacility/phabricator/pull/854. In some situations, line-break: anywhere produces better behavior than word-break: break-all. It never appears to produce worse behavior.

Test Plan
  • Break behavior changes if a line contains "<span />" elements caused by syntax highlighting. This CSS adjustment only appears to apply to text with internal "<span />" elements.
  • This specifically impacts certain internal breakpoints adjacent to punctuation, so the test case is highly specific. Generic test cases with latin word characters do not evidence any behavioral changes.
  • This change appears to have no impact on Safari, which uses the better behavior in all cases.
  • Before Patch: In Firefox and Chrome, this specific change breaks awkwardly. There is more room for text to fit on the broken line:

Firefox

Chrome

  • After Patch: Firefox and Chrome break the line better. Here's Firefox:

  • Additional context:

Safari Behavior (Unchanged)

Chrome with no highlighting (desirable behavior). Firefox does the same thing.

Also tested other cases, which seem never-worse in any browser.

Diff Detail

Repository
rP Phabricator
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

epriestley created this revision.Wed, May 13, 6:52 PM
This revision was not accepted when it landed; it landed in state Needs Review.Wed, May 13, 6:54 PM
epriestley requested review of this revision.
This revision was automatically updated to reflect the committed changes.