Repository navigation
Commit 3b21127
committed
[web_paragraph] Map code units without a cluster to a cluster
Chrome gives some invisible characters, such as a soft hyphen (U+00AD)
or a zero width space (U+200B), no text cluster. Their code units were
left mapped to cluster 0, so a text range that included one could map
to a cluster range that went backwards. Laying out a paragraph that
ends with one of these characters failed the assertion in
_TextClusterMapping.toTextRange.
Map each of those code units to the cluster before it, or to the first
cluster at the start of the text. A cluster range that starts at such a
code unit then starts at the next cluster, so a span that starts with
one covers only its own clusters.1 parent 950bf4e commit 3b21127
2 files changed
Lines changed: 56 additions & 1 deletion
File tree
- engine/src/flutter/lib/web_ui
- lib/src/engine/web_paragraph
- test/webparagraph
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
104 | 109 | | |
105 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
106 | 114 | | |
107 | 115 | | |
108 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
109 | 121 | | |
110 | 122 | | |
111 | 123 | | |
| |||
1077 | 1089 | | |
1078 | 1090 | | |
1079 | 1091 | | |
1080 | | - | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
1081 | 1099 | | |
1082 | 1100 | | |
1083 | 1101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
833 | 833 | | |
834 | 834 | | |
835 | 835 | | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
836 | 873 | | |
0 commit comments