Skip to content

[css-ui] Should the cursor property support image-set()? #5831

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

Closed
emilio opened this issue Jan 4, 2021 · 10 comments
Closed

[css-ui] Should the cursor property support image-set()? #5831

emilio opened this issue Jan 4, 2021 · 10 comments

Comments

@emilio
Copy link
Collaborator

emilio commented Jan 4, 2021

WebKit's implementation of image-set allows you to use cursor: -webkit-image-set().

There's a few tests in WPT (http://wpt.live/css/css-ui/cursor-image-014.html, http://wpt.live/css/css-ui/cursor-image-015.html), that seem to claim it should work (and it should support full <image> syntax). However the spec syntax only has <url>: https://drafts.csswg.org/css-ui-4/#cursor

cc @frivoal

@emilio emilio added the css-ui-4 Current Work label Jan 4, 2021
@emilio
Copy link
Collaborator Author

emilio commented Jan 4, 2021

Note that WebKit / Blink only allows -webkit-image-set(<url>), not image-set(<image>)

@SebastianZ
Copy link
Contributor

SebastianZ commented Jan 4, 2021

See also the discussions in #2480 and #3432.

The prose currently has this note:

User Agents may, instead of <url>, support <image> which is a superset.

I agree that at least image-set() should be supported in order to cover the use case of #2480.

Though I can also imagine use cases for the other values of <image> like e.g. a radial gradient as it's used as cursor in the device emulation mode of the Chrome DevTools, or using image fragments as cursors as supported by the image() function.
So I think we should go "all in" and require support for the whole <image> syntax.

Sebastian

@frivoal
Copy link
Collaborator

frivoal commented Jan 5, 2021

However the spec syntax only has <url>

and

The prose currently has this note:

User Agents may, instead of <url>, support <image> which is a superset.

Right. As far as I remember, we wanted to allow and even encourage <image>, but only left it as a "may", without changing the base syntax due to the fact that implementations were lacking, and at least for level 3, we didn't want to claim things that weren't real. We could strengthen the encouragement in level 4.

@SebastianZ
Copy link
Contributor

I've added a PR to change it to <image> and remove the note. So when there's WG consensus on this, it can be merged.

Sebastian

@emilio
Copy link
Collaborator Author

emilio commented Jan 5, 2021

I have a few questions about supporting <image> entirely. Gradients and so on don't have sizes. What should be the size of the cursor when defined via linear-gradient() for example?

@SebastianZ
Copy link
Contributor

How missing natural sizes of images are handled is already defined by this sentence:

The default object size for cursor images is a UA-defined size that should be based on the size of a typical cursor on the UA’s operating system.

Sebastian

@SebastianZ
Copy link
Contributor

Because the PR for this is lying around for quite some time now and I believe that's something the group can decide on in a call, I marked this as Agenda+.

Note, Gecko implemented partial support for the use of image-set() in cursor in https://bugzil.la/1695402. Other engines also only support url() in their -webkit prefixed versions.

The question now is, should the full <image> syntax be supported within the cursor property? If not, should at least image-set() with its syntax limited to url() values be supported?

Sebastian

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed [css-ui] Should the cursor property support image-set()?, and agreed to the following:

  • RESOLVED: Add a URL parameter-specific version of image-set function to the cursor property
The full IRC log of that discussion <dael> Topic: [css-ui] Should the cursor property support image-set()?
<dael> github: https://github.com//issues/5831
<dael> florian: Has always supported url production to point to image
<dael> florian: Since css ui 3 spec says it's allowed to support image production to do image sets, gradients, etc
<dael> florian: It's as a may b/c as of time for css ui 3 no one did it
<dael> florian: Since then we have 1 shipping and 1 experimental of more than urls but supporting image-set function as long as image-set only contains links to urls.
<dael> florian: one poss is we keep spec as is. Other is we explicitly call out now that there's 2 impl is you can do url and this version and may the rest. 3rd is switch entire spec to using image production and encourage browsers to fill in what's missing
<dael> astearns: Opinions?
<dael> florian: I'm inclined to spec what is impl. We were refaining b/c no one had done it. Still not all impl but since we have more spec that would be nice. Can't just use imace-set production b/c no one does gradients.
<dael> florian: Since we have multiple implementations we should spec it
<dael> astearns: I think fine to spec what's impl. I assume there's no tests in wpt
<dael> florian: I haven't checked. As a spec writer Id idn't create
<dael> iank_: This just coveres image-set. Also the image function. Was that impl?
<dael> florian: Don't think so. Only seen image-set with URLs. spec allows more but I don't think anyone has impl
<dael> astearns: Prop: Add a URL param-specific version of image-set function to the cursor property
<dael> astearns: Obj?
<dael> RESOLVED: Add a URL parameter-specific version of image-set function to the cursor property
<dael> astearns: Please do add tests
<dael> florian: Sure

@frivoal
Copy link
Collaborator

frivoal commented Apr 7, 2022

Addressed by 78fb03b

@frivoal
Copy link
Collaborator

frivoal commented Apr 7, 2022

There was a pre-existing test for image-set() cursors in WPT, until now marked as optional. It is now no longer marked as optional and I have updated the parsing tests as well, so we do have coverage for this feature. However it is minimal coverage, and we could do with more.

@frivoal frivoal added the Tested Memory aid - issue has WPT tests label Apr 7, 2022
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Apr 11, 2022
…rsors, a=testonly

Automatic update from web-platform-tests
image-set() is no longer optional for cursors

See w3c/csswg-drafts#5831

--
Update the parsing test for cursor to reflect the requirement to support image-set()

See w3c/csswg-drafts#5831

--

wpt-commits: 45df1db8adb9f0fdd41110886797533b266e3707, 0d792625664243da144f345130ced901c1e95c37
wpt-pr: 33542
jamienicol pushed a commit to jamienicol/gecko that referenced this issue Apr 14, 2022
…rsors, a=testonly

Automatic update from web-platform-tests
image-set() is no longer optional for cursors

See w3c/csswg-drafts#5831

--
Update the parsing test for cursor to reflect the requirement to support image-set()

See w3c/csswg-drafts#5831

--

wpt-commits: 45df1db8adb9f0fdd41110886797533b266e3707, 0d792625664243da144f345130ced901c1e95c37
wpt-pr: 33542
DanielRyanSmith pushed a commit to DanielRyanSmith/wpt that referenced this issue Apr 27, 2022
DanielRyanSmith pushed a commit to DanielRyanSmith/wpt that referenced this issue Apr 27, 2022
yisibl added a commit to cssdream/css3test that referenced this issue Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants