New issue
Advanced search Search tips

Issue 846357 link

Starred by 7 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug



Sign in to add a comment

Use tookit-views controls in the renderer on Mac

Project Member Reported by rsesek@chromium.org, May 24 2018

Issue description

Chrome Version: 68.0.3439.0
OS: 10.13.4

Currently Mac renderers draw web <input> and other form controls using Cocoa:

https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/layout/layout_theme_mac.mm?rcl=65e34cf8c79ecc7e3a6a2eef19a7683d63baaa70
https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/paint/theme_painter_mac.mm?rcl=65e34cf8c79ecc7e3a6a2eef19a7683d63baaa70

In the world of MacViewsBrowser, using Cocoa controls in the renderer may look out-of-place. We should consider switching these elements to be drawn using Views, in whatever style is used on other platforms.

Removing this use of Cocoa from the renderer would also make some aspects of sandboxing the renderer easier and less prone to breakage in future macOS versions.

Note the historical  bug 13890 .
 
Labels: Group-Architecture
Who can make a decision of this issue?
Cocoa widget rendering is harmful to browser interoperability and site compatibility.  I would be very happy if we stop using it.

Status: Available (was: Untriaged)
Summary: Use tookit-views controls in the renderer on Mac (was: Use tookit-views controls in the renderer on Mac ?)
We should do this. There is no scheduled time for it right now but I will consider taking it as a Q1 OKR.
(For the record, ellyjones@ is the decider, so we can go ahead with this.)
Cool!
The size of the task would be a few lines C++ code change and rebaseline of hundreds of LayoutTests.  We need to apply Blink intent process because the change will affect default layout of form controls.

Should we change the popup window style for <select>?  It also can be done by a few line change.

#5: I would also be fine with that, but I believe that Windows and Linux have different popup menus than Mac does right now, even in Views.
One small concern I have is that fallback form control style (e.g. if you zoom to ~150%, see screen shots) doesn't look quite native on Mac. I wonder if we could customize these to use the correct form control color (e.g. Aqua, Graphite, or on Mojave the actual theme tint) when they are not styled? Also maybe round the buttons a little.

> Should we change the popup window style for <select>?  It also can be done by a few line change.

What does that mean/entail?
cocoa-nozoom.png
117 KB View Download
fallback-zoomed.png
144 KB View Download
Cc: ccameron@chromium.org chrishtr@chromium.org vmi...@chromium.org
 Issue 777965  has been merged into this issue.
> I wonder if we could customize these to use the correct form control color

I thought we'll use the fallback theme as is, which is identical with theme in non-Mac.  I think it's possible to develop a variant of the theme.

> > Should we change the popup window style for <select>?  It also can be done by a few line change.
> What does that mean/entail?

It means <select> uses simple rectangle popup window like Windows and Linux instead of the native rounded-corner popup window.  It is not related to the Cocoa-in-renderer issue.  It's better to keep the native one for native OS consistency, and it would be better to change it for consistency with Windows and Linux.
Anyway, this can be done separately.


I think it's important to keep the controls feeling Mac-like, even if they aren't drawn identically to the system-produced ones. So I do think we should customize the controls a little to look like Aqua, and we should keep the existing popup window style for <select>.
If this has not been claimed by the time PWAs are done, I will happily take it (it has been on my mental list of things to clean up for a long time).

Sign in to add a comment