Skip to content

Commit 1da5483

Browse files
author
epriestley
committedMay 13, 2020
Improve line breaking behavior in Firefox and Chrome under complex conditions
Summary: See <phacility#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 {F7480567} Chrome {F7480568} - After Patch: Firefox and Chrome break the line better. Here's Firefox: {F7480569} - Additional context: Safari Behavior (Unchanged) {F7480570} Chrome with no highlighting (desirable behavior). Firefox does the same thing. {F7480571} Also tested other cases, which seem never-worse in any browser. {F7480574} Differential Revision: https://secure.phabricator.com/D21247
1 parent 3dea920 commit 1da5483

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed
 

‎resources/celerity/map.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
'names' => array(
1010
'conpherence.pkg.css' => '0e3cf785',
1111
'conpherence.pkg.js' => '020aebcf',
12-
'core.pkg.css' => '1b80c45d',
12+
'core.pkg.css' => 'a560707d',
1313
'core.pkg.js' => '1e667bcb',
1414
'dark-console.pkg.js' => '187792c2',
1515
'differential.pkg.css' => 'd71d4531',
@@ -115,7 +115,7 @@
115115
'rsrc/css/application/uiexample/example.css' => 'b4795059',
116116
'rsrc/css/core/core.css' => '1b29ed61',
117117
'rsrc/css/core/remarkup.css' => 'c286eaef',
118-
'rsrc/css/core/syntax.css' => '220b85f9',
118+
'rsrc/css/core/syntax.css' => '548567f6',
119119
'rsrc/css/core/z-index.css' => '612e9522',
120120
'rsrc/css/diviner/diviner-shared.css' => '4bd263b0',
121121
'rsrc/css/font/font-awesome.css' => '3883938a',
@@ -172,7 +172,7 @@
172172
'rsrc/css/phui/phui-pager.css' => 'd022c7ad',
173173
'rsrc/css/phui/phui-pinboard-view.css' => '1f08f5d8',
174174
'rsrc/css/phui/phui-policy-section-view.css' => '139fdc64',
175-
'rsrc/css/phui/phui-property-list-view.css' => '9c477af1',
175+
'rsrc/css/phui/phui-property-list-view.css' => '5adf7078',
176176
'rsrc/css/phui/phui-remarkup-preview.css' => '91767007',
177177
'rsrc/css/phui/phui-segment-bar-view.css' => '5166b370',
178178
'rsrc/css/phui/phui-spacing.css' => 'b05cadc3',
@@ -869,7 +869,7 @@
869869
'phui-pager-css' => 'd022c7ad',
870870
'phui-pinboard-view-css' => '1f08f5d8',
871871
'phui-policy-section-view-css' => '139fdc64',
872-
'phui-property-list-view-css' => '9c477af1',
872+
'phui-property-list-view-css' => '5adf7078',
873873
'phui-remarkup-preview-css' => '91767007',
874874
'phui-segment-bar-view-css' => '5166b370',
875875
'phui-spacing-css' => 'b05cadc3',
@@ -907,7 +907,7 @@
907907
'sprite-login-css' => '18b368a6',
908908
'sprite-tokens-css' => 'f1896dc5',
909909
'syntax-default-css' => '055fc231',
910-
'syntax-highlighting-css' => '220b85f9',
910+
'syntax-highlighting-css' => '548567f6',
911911
'tokens-css' => 'ce5a50bd',
912912
'trigger-rule' => '41b7b4f6',
913913
'trigger-rule-control' => '5faf27b9',
@@ -1095,9 +1095,6 @@
10951095
'phabricator-diff-path-view',
10961096
'phuix-button-view',
10971097
),
1098-
'220b85f9' => array(
1099-
'syntax-default-css',
1100-
),
11011098
'225bbb98' => array(
11021099
'javelin-install',
11031100
'javelin-reactor',
@@ -1409,6 +1406,9 @@
14091406
'phuix-autocomplete',
14101407
'javelin-mask',
14111408
),
1409+
'548567f6' => array(
1410+
'syntax-default-css',
1411+
),
14121412
'55a24e84' => array(
14131413
'javelin-install',
14141414
'javelin-dom',

‎webroot/rsrc/css/core/syntax.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
.remarkup-code td > span {
1414
display: inline;
15-
word-break: break-all;
15+
line-break: anywhere;
1616
}
1717

1818
.remarkup-code .rbw_r { color: red; }

‎webroot/rsrc/css/phui/phui-property-list-view.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ td.old .jupyter-cell-code-line {
364364
margin: 4px 0;
365365
padding: 8px;
366366
white-space: pre-wrap;
367-
word-break: break-all;
367+
line-break: anywhere;
368368
}
369369

370370
.jupyter-output-stderr {

0 commit comments

Comments
 (0)
Failed to load comments.