prefers-reduced-transparency triggers by contrast settings
Categories
(Core :: Widget: Gtk, defect, P3)
Tracking
()
People
(Reporter: lwarlow, Unassigned)
References
(Blocks 1 open bug)
Details
Steps to reproduce:
Load https://goose.icu/prefers-reduced-transparency
Actual results:
prefers-reduced-transparency (when the flag is enabled) is triggered by high contrast on GTK.
Expected results:
I would expect it to just not be triggered on OS's that don't have a relavant reduced transparency setting. There's a separate existing media query for high contrast, web developers should use that to respond.
As far as I'm aware the use case for less transparency isn't directly the same as more contrast (hence why it's a separate option in at least 3 OS's) so I'd like to query if this should be kept?
Comment 1•3 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•3 years ago
|
||
| Reporter | ||
Comment 3•3 years ago
|
||
Yes I've seen that document I corrected it yesterday to not refer to reduce motion preferences. The last point about other signals was added specifically to document this existing behaviour. I'm just querying if this actually makes sense.
Comment 4•3 years ago
|
||
The source code says:
// If high contrast is enabled, enable prefers-reduced-transparency media
// query as well as there is no dedicated option.
Comment 5•3 years ago
|
||
:canadahonk, do you have any additional thoughts about this? (Do you know what Chromium is doing in this regard?)
Comment 6•3 years ago
•
|
||
This was intentional and suggested by emilio iirc, not sure if we want to keep this or not. Spec doesn't say much on this specifically. Chromium don't do this afaik.
| Reporter | ||
Comment 7•3 years ago
|
||
As the person implementing this in chrome I can confirm it doesn't have this behaviour and there's no plans to add it. Chromium uses the platform settings where they exist (macOS, windows and in future iOS) and on the other platforms it just always returns no-preference.
Comment 8•3 years ago
|
||
OK, thanks. My feeling is that if this interaction is desirable, it should be included in the spec, or else we probably shouldn't do it. But I'd be interested to hear what the Accessibility team has to say.... Morgan, any thoughts on this?
| Reporter | ||
Comment 9•3 years ago
|
||
Fwiw my thoughts on it are there's already a prefers-contrast media query which is matched on Linux. So matching prefers-reduced-transparency doesn't really add anything except potential confusion. This preference while being related to contrast is more about background transparency/patterns.
Comment 10•3 years ago
|
||
Background transparency affects (generally reduces) contrast tho, right? Anyways happy to defer to Morgan here, I don't particularly mind just removing that but...
| Reporter | ||
Comment 11•3 years ago
|
||
Fwiw I noticed today that macOS automatically sets PRT when increase contrast is set. So perhaps this is fine? Just wanted to double check either way. If you decide to leave it in I'll make Chrome match. (Once I've fixed prefers-contrast on gtk theme).
Comment 12•3 years ago
•
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #10)
Background transparency affects (generally reduces) contrast tho, right? Anyways happy to defer to Morgan here, I don't particularly mind just removing that but...
(In reply to Jonathan Kew [:jfkthame] from comment #8)
OK, thanks. My feeling is that if this interaction is desirable, it should be included in the spec, or else we probably shouldn't do it. But I'd be interested to hear what the Accessibility team has to say.... Morgan, any thoughts on this?
Sorry for the slow reply, I was on PTO :)
I'll bring this back to the team, but my 2 cents:
Using prefers contrast as a proxy for reducing transparency is something both Windows and macOS do at the platform level. If you enable High Contrast Mode on windows, Transparency Effects are turned off and disabled (the user cannot enable this option while HCM is on). On macOS, if you enable Increase Contrast, Reduce Transparency is turned on and disabled (the user cannot disable this option while Increase Contrast is on).
It makes sense to me that, barring an explicit platform option on GTK, we use prefers-contrast as a proxy for reducing transparency. As emilio said, background transparency generally reduces contrast (a similar instance of this: our backplating algorithm traverses the ancestor chain of the frame tree in effort to compose an opaque background color, we don't use the first partially-transparent background we come across).
| Reporter | ||
Comment 13•3 years ago
|
||
That makes sense. I didn't realise both Windows and macOS did that. Pretty good sign that should be the behaviour in that case. I'll go ahead and close this issue now. I'll add a task for me to update this in Chromium once their high contrast on linux is fixed.
Description
•