MacViews: Enable RenderTextHarfBuzz to get Textfields to work.

Textfields require RenderTextHarfBuzz to work properly on the Mac because
RenderTextMac's implementation is not complete.
But RenderTextMac is used by the Cocoa UI to perform string sizing and elliding,
HarfBuzz will not give the same answers.
So for now we turn on HarfBuzz conditionally on OS_MACOSX and TOOLKIT_VIEWS.
TextFieldModel and StyledLabel unit tests now pass without failures.

BUG=378134

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276341 0039d316-1c4b-4281-b951-d872f2087c98
parent e34fb320
...@@ -412,11 +412,16 @@ RenderText::~RenderText() { ...@@ -412,11 +412,16 @@ RenderText::~RenderText() {
} }
RenderText* RenderText::CreateInstance() { RenderText* RenderText::CreateInstance() {
#if defined(OS_MACOSX) && defined(TOOLKIT_VIEWS)
// Use the more complete HarfBuzz implementation for Views controls on Mac.
return new RenderTextHarfBuzz;
#else
if (CommandLine::ForCurrentProcess()->HasSwitch( if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableHarfBuzzRenderText)) { switches::kEnableHarfBuzzRenderText)) {
return new RenderTextHarfBuzz; return new RenderTextHarfBuzz;
} }
return CreateNativeInstance(); return CreateNativeInstance();
#endif
} }
void RenderText::SetText(const base::string16& text) { void RenderText::SetText(const base::string16& text) {
......
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