diff options
author | msw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-29 13:02:47 +0000 |
---|---|---|
committer | msw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-29 13:02:47 +0000 |
commit | fecf9f77fccd08c22e9655843a534c79ed0ba567 (patch) | |
tree | b5b547490e03d455fedcb73a45cfdf5fe8ad81f9 /cc/output/copy_output_result.h | |
parent | 9a8a76dea83aec91deac43479dd6c6f497510c47 (diff) | |
download | chromium_src-fecf9f77fccd08c22e9655843a534c79ed0ba567.zip chromium_src-fecf9f77fccd08c22e9655843a534c79ed0ba567.tar.gz chromium_src-fecf9f77fccd08c22e9655843a534c79ed0ba567.tar.bz2 |
Clamp RenderTextWin layout length to 10,000 code points.
Add RenderText::truncate_length_ and setter to clamp layout text length.
Avoid system limitations and performance degradation on Win/Uniscribe.
This does not impact underlying text data, only what's shown on screen.
Truncate text_ to layout_text_ in UpdateLayoutText() and append ellipsis.
Only reveal obscured characters within the layout text range.
Ensure the run and glyph limits are actually tried in their loops.
Add unit tests for reasonable truncation behavior.
Bail if layout fails, this will leave text un-rendered instead of crashing.
Clamp run length to avoid exceeding the glyph limit later on.
Clamp layout indices in conversion, fix run index bounds checks.
TODO(followup): Truncate text on Linux/Pango as needed.
TODO(followup): Increase supported text length and run counts.
TODO(followup): UMA text lengths, run counts, failures, and truncations.
BUG=235854,236406,248960,131660
TEST=Paste more than 10k characters on Win to see ellipsis and no crashes. (note that omnibox specific codepaths will cause additional performance degradation in that field). No crash on Windows with Search by Image extension use (tried various sizes 16x16 -> 96x96 -> 1900x1200 -> 3840x2160). Normal text behavior with <10k code points, and no behavior change on ChromeOS/Linux_Aura.
R=asvitkine@chromium.org,oshima@chromium.org,sky@chromium.org
Review URL: https://chromiumcodereview.appspot.com/17745005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209286 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/output/copy_output_result.h')
0 files changed, 0 insertions, 0 deletions