[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?