Commit 37c3a135 authored by ckocagil's avatar ckocagil Committed by Commit bot

RTHB: Limit text to 10k code units

BUG=244679
R=msw

Review URL: https://codereview.chromium.org/594683002

Cr-Commit-Position: refs/heads/master@{#296088}
parent 4ca5434d
...@@ -28,6 +28,9 @@ namespace gfx { ...@@ -28,6 +28,9 @@ namespace gfx {
namespace { namespace {
// Text length limit. Longer strings are slow and not fully tested.
const size_t kMaxTextLength = 10000;
// The maximum number of scripts a Unicode character can belong to. This value // The maximum number of scripts a Unicode character can belong to. This value
// is arbitrarily chosen to be a good limit because it is unlikely for a single // is arbitrarily chosen to be a good limit because it is unlikely for a single
// character to belong to more scripts. // character to belong to more scripts.
...@@ -572,7 +575,9 @@ Range TextRunHarfBuzz::GetGraphemeBounds( ...@@ -572,7 +575,9 @@ Range TextRunHarfBuzz::GetGraphemeBounds(
RenderTextHarfBuzz::RenderTextHarfBuzz() RenderTextHarfBuzz::RenderTextHarfBuzz()
: RenderText(), : RenderText(),
needs_layout_(false) {} needs_layout_(false) {
set_truncate_length(kMaxTextLength);
}
RenderTextHarfBuzz::~RenderTextHarfBuzz() {} RenderTextHarfBuzz::~RenderTextHarfBuzz() {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment