w3c / fxtf-drafts

Mirror of https://hg.fxtf.org/drafts

Home Page:https://drafts.fxtf.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[css-masking-1] `<image>` and `<mask-source>` overlap

cdoublev opened this issue · comments

<mask-reference> = none | <image> | <mask-source>
<mask-source> = <url>

https://drafts.fxtf.org/css-masking-1/#typedef-mask-reference

<image> = <url> | <image()> | <image-set()> | <cross-fade()> | <element()> | <gradient>

https://drafts.csswg.org/css-images-4/#typedef-image

I may be missing something because I think <url> was already produced by <image> at the time <mask-source> was defined.

Both use similar syntax but point to resources of different types, and these are mentioned in the spec.
<mask-source> is a reference to a mask svg element, which is not necessarily a valid image source, and vice versa.

I cannot find the issue/PR but I think this was already explained to me, sorry.

But you cannot know at parse time which of <mask-source> or <image> the resource is matching, isn't it?

I understand the usefulness of <mask-source> to differentiate them in other sections of the specification. But from the perspective of parsing, there is none and it is a bit problematic for a grammar-driven implementation: one of the two types will never get a match.

Would it be acceptable to define the two appropriate terms without using the syntax?