Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cdoublev opened this issue Sep 19, 2023 · 2 comments
Open

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

cdoublev opened this issue Sep 19, 2023 · 2 comments

Comments

@cdoublev
Copy link
Contributor

<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
Copy link

ydaniv commented Sep 19, 2023

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
Copy link
Contributor Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants