Open Bug 492237 Opened 15 years ago Updated 2 years ago

animated images in CSS 'cursor: url()' should animate rather than showing first frame

Categories

(Core :: Widget, defect, P3)

defect

Tracking

()

People

(Reporter: sephr, Unassigned)

References

(Blocks 3 open bugs)

Details

(Keywords: dev-doc-needed, Whiteboard: tpi:+)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.10) Gecko/2009042523 Ubuntu/9.04 (jaunty) Firefox/3.0.10 GTB5
Build Identifier: 

I see no reason other than being annoying (that can be solved by stopping the animation when the user pushes the escape key) why animated cursors shouldn't be allowed.
There are legitimate reasons that you might want to use an animated cursor such as specifying a custom "loading" cursor that pertains to the web application a user is using.

Reproducible: Always

Steps to Reproduce:
1. Set cursor: url(some-animated-cursor) directly in CSS or through style.cursor in a script.

Actual Results:  
Only first frame of the animated cursor is shown.

Expected Results:  
Cursor goes through animation until user presses the escape key.
Layout/style code passes an imgIContainer to nsIWidget::SetCursor, so I think this is entirely a widget (+ imagelib ?) issue.

That said, I'm not sure what format different platforms expect animated cursors to be in; the conversion might be a bit complicated.
Status: UNCONFIRMED → NEW
Component: Style System (CSS) → Widget
Ever confirmed: true
Priority: -- → P5
QA Contact: style-system → general
Summary: Allow animated cursors → animated images in CSS 'cursor: url()' should animate rather than showing first frame
Blocks: 495609
Using Firefox 3.6.3 I see an interesting effect.  The cursor is static,
but it animates every time I move it, until I stop moving it.

Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.3) Gecko/20100423 Ubuntu/10.04 (lucid) Firefox/3.6.3
Summary: animated images in CSS 'cursor: url()' should animate rather than showing first frame → animated images in CSS 'cursor: url()' should animate rather than showing first frame (and animating only when the mouse moves)
"cursor:url(http:\/\/ ... .gif),wait;"
should get a third argument (behind URL and type): animate, with values
- never, just showing the first frame
- move, animating while the cursor is moved
- nomove, animating while the cursor is not moved
- always, animating regardless whether the cursor is moved or not
(default: never, because that was the old behaviour)
and a fourth argument: number of times the animation is shown (when it is shown),
with zero, some natural number, or infty (for infinitely) as possible values (and either 0 or 1 or infty as default value).
For example, "cursor:url(http:\/\/ ...  .gif),wait,move,7;" would show the animation 7 times while the cursor is moved and then stop the animation (and start again when the cursor is moved again). The animation should stop at the last frame of the animation. If the first frame is whished for, the last frame just needs to be a copy of the first frame (and with minimal duration set).
And, of course, this should first be made official CSS by W3C, and then implemented by Mozilla. So, is anybody able to forward this to the right person at W3C?

Furthermore, .cur, .ani, gif, .png should all be supported (and maybe other formats I just forgot about, too).
(Internet Explorer at least supports .cur and .ani, while Firefox does not!)
Version: unspecified → Trunk
The "animating when the mouse moves" part no longer happens -- now we just show the first frame, period.  --> updating summary
Summary: animated images in CSS 'cursor: url()' should animate rather than showing first frame (and animating only when the mouse moves) → animated images in CSS 'cursor: url()' should animate rather than showing first frame
Hello,

Is this really a CSS 2.1 bug? There is no indication anywhere in CSS 2.1 (even in CSS3 User Interface [1]) that requires user agents to support animated cursors (or any particular formats like .ani, .cur, .gif, .png, .apng, etc).

There is only 1 test at CSS 2.1 test suite on animated cursor and it has the "may" flag:
http://test.csswg.org/suites/css2.1/nightly-unstable/html4/cursor-024.htm

> (Internet Explorer at least supports .cur and .ani, while Firefox does not!)

IE8 supports .cur and .ani (see count-up, count-down, count-up-down at
http://www.gtalbot.org/DHTMLSection/Cursors.html#Proprietary )
but does not support animated .gif as cursor. It would be nice to know the support in IE10 and IE11 for .png, .apng and animated gif. 

Firefox 28.0a1 supports .cur, .png (as non-animated cursors) and does not support .ani cursor.

[1]: CSS3 UI, WD 17 Jan 2012; Section 9.1.1. 'cursor' property 
http://www.w3.org/TR/css3-ui/#cursor
> It would be nice to know the support in IE10 and IE11 for .png, .apng and animated gif.

"Cursors of type .CUR and .ANI are the only supported cursor types."
http://msdn.microsoft.com/en-us/library/aa358795.aspx

but MSDN files are often outdated, incorrect, unreliable...
> that requires user agents to support

Maybe this is not required, but shouldn't Firefox be a browser that "out-performs"? Like "Firefox is the first browser that supports..."? I thought we wanted FF to be *better* than just standard, don't we?
> Maybe this is not required

That was my main point. It's not required by CSS 2.1 and the sole test on animated cursor in CSS2.1 test suite uses a "may" flag.
And, right now, it is still not required by CSS3 User Interface: by judging from the examples and explanations of examples (especially Example 10), it seems directed to flexible, open latitude toward image cursor formats.

> , but shouldn't Firefox be a browser that
> "out-performs"? Like "Firefox is the first browser that supports..."? I
> thought we wanted FF to be *better* than just standard, don't we?

Yes, yes and yes to your 3 questions. :)

Cheers, Gérard
Too many duplicates for this bug, its time to fix it, isn't it?
Priority: P5 → P3
Whiteboard: tpi:+
Still not fixed in Firefox 57.0.2 (Quantum). :-(
(In reply to Cameron McCormack (:heycam) from bug 700926 comment #65)
> The remainder of this work got done in other bugs as part of stylo. 
> Although cursors now do use nsStyleImageRequest, that's not going to make
> animated cursors work, which would need changes to all of the
> nsWindow::SetCursor implementations I guess.
Blocks: css-ui-3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: