Re: [fxtf-drafts] [css-masking-1] Clarification on mask-type presentation attribute (#480)

...snip...
> This leads me to believe that all presentation attributes should be available as an attribute on applicable DOM elements- meaning the following is valid:
> 
> ```
> <mask id="mask" mask-type="alpha">
>   <path d="..." />
> </mask>
> ```

Correct.

> Looking at this [codepen example](https://codepen.io/sandgraham/pen/BaVwwza?editors=1100), it seems Chrome, Firefox, and Safari accept the attribute.
> 
> However, the examples shown in the draft masking spec seem to make a point of using inline style attributes:
> 
> ```
> <mask id="mask" style="mask-type: alpha;">
>   <path d="..." />
> </mask>
> ```
> 
> And indeed, MDN [does the same](https://developer.mozilla.org/en-US/docs/Web/CSS/mask-type).

What mechanism examples use does not really carry any relevance. I.e they are not normative.

> I also noticed that `mask-type` is not listed under the [presentation attributes](https://drafts.fxtf.org/css-masking/#the-mask-type) for the `mask` element (which _seems_ contradictory),

This looks like an oversight/bug.

> nor is it included in the [`SVGMaskElement` interface](https://drafts.fxtf.org/css-masking/#InterfaceSVGMaskElement).

It's not uncommon for a presentation attribute to not have a corresponding IDL attribute (most on SVG elements don't).

> This leads me to believe that `mask-type` might not be intended as a DOM attribute. I'd appreciate any guidance available on this topic.

The term "DOM attribute" may be a bit ambiguous, so I'd suggest using the terminology from [1]. Using that terminology I'd say that there is a _content attribute_ `mask-type`, but it has no corresponding _IDL attribute_ (which would likely have been named `maskType` or `masktype` if it existed). Does that make sense?

[1] https://html.spec.whatwg.org/multipage/infrastructure.html#terminology

-- 
GitHub Notification of comment by fsoder
Please view or discuss this issue at https://github.com/w3c/fxtf-drafts/issues/480#issuecomment-1319069903 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 17 November 2022 18:59:11 UTC