Commit b68def24 authored by Etienne Bergeron's avatar Etienne Bergeron Committed by Chromium LUCI CQ

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/+/2561438Reviewed-by: default avatarRobert Liao <robliao@chromium.org>
Reviewed-by: default avatarKeren Zhu <kerenzhu@chromium.org>
Commit-Queue: Etienne Bergeron <etienneb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#833826}
parent 26fd4832
...@@ -583,6 +583,9 @@ size_t RenderText::GetTextIndexOfLine(size_t line) { ...@@ -583,6 +583,9 @@ size_t RenderText::GetTextIndexOfLine(size_t line) {
} }
void RenderText::SetWordWrapBehavior(WordWrapBehavior behavior) { void RenderText::SetWordWrapBehavior(WordWrapBehavior behavior) {
// TODO(1150235): ELIDE_LONG_WORDS is not supported.
DCHECK_NE(behavior, ELIDE_LONG_WORDS);
if (word_wrap_behavior_ != behavior) { if (word_wrap_behavior_ != behavior) {
word_wrap_behavior_ = behavior; word_wrap_behavior_ = behavior;
if (multiline_) { if (multiline_) {
......
...@@ -148,14 +148,13 @@ gfx::TextStyle ConsumeStyle(FuzzedDataProvider* fdp) { ...@@ -148,14 +148,13 @@ gfx::TextStyle ConsumeStyle(FuzzedDataProvider* fdp) {
} }
gfx::WordWrapBehavior ConsumeWordWrap(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: case 0:
return gfx::IGNORE_LONG_WORDS; return gfx::IGNORE_LONG_WORDS;
case 1: case 1:
return gfx::TRUNCATE_LONG_WORDS; return gfx::TRUNCATE_LONG_WORDS;
case 2: case 2:
return gfx::ELIDE_LONG_WORDS;
case 3:
return gfx::WRAP_LONG_WORDS; return gfx::WRAP_LONG_WORDS;
default: default:
return gfx::IGNORE_LONG_WORDS; return gfx::IGNORE_LONG_WORDS;
......
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