w3c / fxtf-drafts

Mirror of https://hg.fxtf.org/drafts
https://drafts.fxtf.org/
Other
71 stars 50 forks source link

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

Open cdoublev opened 1 year ago

cdoublev commented 1 year ago

<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.

ydaniv commented 1 year ago

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.

cdoublev commented 1 year ago

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?