W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2015

Re: [whatwg] A mask="" advisory flag for <link rel=icon>

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 16 Jun 2015 13:42:50 -0700
Message-ID: <CAAWBYDBg1M8=6XqvU-rSzTp6hHP4MSA2j-7Gz5Pfjk8Mqq=Ggg@mail.gmail.com>
To: "Edward O'Connor" <eoconnor@apple.com>
Cc: WHATWG List <whatwg@whatwg.org>
On Mon, Jun 15, 2015 at 10:37 AM, Edward O'Connor <eoconnor@apple.com> wrote:
> Authors would provide a mask icon like so:
>
>     <link rel=icon href=mask.svg mask>
[...]
> P.S. OK, bikeshedding. What should we call the attribute? The ideal name
> says something about the icon and not about how a UA might use it. There
> are a few properties of the icon that are interesting: it's monochrome
> (and can be tinted to fit a theme), it's suitable for use as a mask,
> it's a simple/minimal/reduced representation of the site or app. We
> could go with a monochrome attribute, a mask attribute, or some other
> option. Out of these I most like an attribute named mask. It's shorter,
> for one. But I don't strongly prefer it and I'm sure someone else will
> come up with something way better.

Before we start bikeshedding, can you commit to actually changing your
implementation?  Safari has already shipped with the exact proposal
given in this thread; if you're seeking a rubberstamp rather than a
collab, say so.

In the spirit of bikeshedding, Justin Dolske seems to have the right
idea.  "mask" or "icon-mask" or something as a new rel value that
indicates a file to be used as a theme-color-filled mask works better
within the existing ecosystem.  In particular, naive processors that
understand rel=icon but not mask (aka every browser on the market
today besides latest Safari) won't do stupid things, like use the mask
as an icon directly.

> There’s no technological enforcement that the SVG only uses the color
> black. We will interpret it as a mask in the same way as the SVG ‘mask’
> element, which effectively combines the luminance with the alpha channel.
> Effectively, this means that other colors will end up partly transparent,
> so using other colors will probably do something weird, but nothing
> prevents authors from doing that afaik.
>
> The reason for treating the icon as a mask is that we want to enforce
> having a monochrome shape, specifically for our pinned tabs feature.

The svg <mask> element has a switch for choosing between luminance and
alpha masking; I think using alpha masking instead seems like a pretty
clear win.  It makes the color irrelevant, making it more likely that
the plain icon is appropriate to use for a mask as well, and there's
no difference in behavior if you're using opaque colors.  (No
difference in functionality overall, either; you just achieve
partial-transparency with alpha rather than color.)

~TJ
Received on Tuesday, 16 June 2015 20:43:37 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:33 UTC