Avoid RenderText fuzzer to try unsupported ELIDE_LONG_WORDS
Remove an unsupported eliding multiline mode: ELIDE_LONG_WORDS The eliding mode is still supported by ElideRectangleText(...) and still used in Canvas. This CL only prevent an incorrect use in RenderText and remove it from the fuzzer. R=msw@chromium.org Bug: 1150235 Change-Id: I53aee3ddc2ba9fd8e7b69995e25aa697644b6894 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2561438 Reviewed-by: Robert Liao <robliao@chromium.org> Reviewed-by: Keren Zhu <kerenzhu@chromium.org> Commit-Queue: Etienne Bergeron <etienneb@chromium.org> Cr-Commit-Position: refs/heads/master@{#833826}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
26fd4832f0
commit
b68def240c
@ -583,6 +583,9 @@ size_t RenderText::GetTextIndexOfLine(size_t line) {
|
||||
}
|
||||
|
||||
void RenderText::SetWordWrapBehavior(WordWrapBehavior behavior) {
|
||||
// TODO(1150235): ELIDE_LONG_WORDS is not supported.
|
||||
DCHECK_NE(behavior, ELIDE_LONG_WORDS);
|
||||
|
||||
if (word_wrap_behavior_ != behavior) {
|
||||
word_wrap_behavior_ = behavior;
|
||||
if (multiline_) {
|
||||
|
@ -148,14 +148,13 @@ gfx::TextStyle ConsumeStyle(FuzzedDataProvider* fdp) {
|
||||
}
|
||||
|
||||
gfx::WordWrapBehavior ConsumeWordWrap(FuzzedDataProvider* fdp) {
|
||||
switch (fdp->ConsumeIntegralInRange(0, 4)) {
|
||||
// TODO(1150235): ELIDE_LONG_WORDS is not supported.
|
||||
switch (fdp->ConsumeIntegralInRange(0, 3)) {
|
||||
case 0:
|
||||
return gfx::IGNORE_LONG_WORDS;
|
||||
case 1:
|
||||
return gfx::TRUNCATE_LONG_WORDS;
|
||||
case 2:
|
||||
return gfx::ELIDE_LONG_WORDS;
|
||||
case 3:
|
||||
return gfx::WRAP_LONG_WORDS;
|
||||
default:
|
||||
return gfx::IGNORE_LONG_WORDS;
|
||||
|
Reference in New Issue
Block a user