Commit b9505433 authored by Eric Lawrence's avatar Eric Lawrence Committed by Commit Bot

Replace tab character with spaces for Aura tooltips

When EnableAuraTooltipsOnWindows was enabled, HTML title attributes and
other content that display tooltips started rendering a box instead of
whitespace for a tab character.

This change replaces tab characters with six spaces, approximating the
rendering of pre-EnableAuraTooltipsOnWindows display and that of other
browsers.

Bug: 993100
Change-Id: Ib0a39850bfd13b73a960828cd465cc965e6a713d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1834889Reviewed-by: default avatarMichael Wasserman <msw@chromium.org>
Reviewed-by: default avatarCliff Smolinsky <cliffsmo@microsoft.com>
Commit-Queue: Eric Lawrence [MSFT] <ericlaw@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#703321}
parent 2d6c2c8c
...@@ -121,7 +121,13 @@ class TooltipAura::TooltipView : public views::View { ...@@ -121,7 +121,13 @@ class TooltipAura::TooltipView : public views::View {
void SetText(const base::string16& text) { void SetText(const base::string16& text) {
render_text_->SetHorizontalAlignment(gfx::ALIGN_TO_HEAD); render_text_->SetHorizontalAlignment(gfx::ALIGN_TO_HEAD);
render_text_->SetText(text);
// Replace tabs with whitespace to avoid placeholder character rendering
// where previously it did not. crbug.com/993100
base::string16 newText(text);
base::ReplaceChars(newText, base::ASCIIToUTF16("\t"),
base::ASCIIToUTF16(" "), &newText);
render_text_->SetText(newText);
SchedulePaint(); SchedulePaint();
} }
......
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