Skip to content

iTIP-formatter: respect the color-scheme in HTML MIME parts

This renders emails, containing CSS color-scheme property, appropriate for the current desktop preference.

Related to #2275 (closed), closes #2284 (closed), closes !118 (merged).

https://www.w3.org/TR/css-color-adjust-1/#color-scheme-effect says:

«In order to preserve expected color contrasts, in the case of embedded documents typically rendered over a transparent canvas (such as provided via an HTML iframe element), if the used color scheme of the element and the used color scheme of the embedded document’s root element do not match, then the UA must use an opaque canvas of the Canvas color appropriate to the embedded document’s used color scheme instead of a transparent canvas.»

So, here the IFRAME is changed to have color-scheme: light; background-color: white. If the embedded HTML MIME part does not change the color-scheme explicitly, its background-color is transparent (⇔white). Otherwise the background is overwritten by the embedded color-scheme.

I have not tested the changes in e-mail-formatter-text-html.

I have no idea about the impact of the changed JavaScript code.

Merge request reports