Bug 6001 - CSS2: WebKit does not handle fallback custom cursors
Summary: CSS2: WebKit does not handle fallback custom cursors
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P4 Normal
Assignee: Nobody
URL: http://www.w3.org/TR/REC-CSS2/ui.html...
Keywords:
Depends on: 9013
Blocks: 6002
  Show dependency treegraph
 
Reported: 2005-12-08 01:48 PST by Eric Seidel (no email)
Modified: 2006-09-26 05:39 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2005-12-08 01:48:13 PST
WebKit does not handle fallback custom cursors

I should have caught the fallback cursor issue when reviewing darin's orginal patch:
http://bugzilla.opendarwin.org/show_bug.cgi?id=5689
Comment 1 Eric Seidel (no email) 2005-12-08 01:50:19 PST
From the spec:
http://www.w3.org/TR/REC-CSS2/ui.html#cursor-props
"If the user agent cannot handle the first cursor of a list of cursors, it should attempt to handle the 
second, etc. If the user agent cannot handle any user-defined cursor, it must use the generic cursor at the 
end of the list."
Comment 2 Eric Seidel (no email) 2005-12-08 01:58:37 PST
http://www.w3.org/Graphics/SVG/Test/20030813/svggen/interact-cursor-01-f.svg
Demonstrates cursor fallback behavior.

http://www.w3.org/TR/css3-ui/
also has some example code.
Comment 3 Darin Adler 2005-12-10 10:16:53 PST
Even though I did the original custom cursor work, I suggest that someone else do the "list of cursors" and 
fallback machinery work.
Comment 4 Alexey Proskuryakov 2006-05-19 14:36:04 PDT
Unless I'm missing something, this means that WebKit cannot handle any custom cursor specified in accordance with the spec, and also any custom cursor that WebKit handles is specified incorrectly.
Comment 5 Eric Seidel (no email) 2006-09-06 00:57:05 PDT
I spoke with hyatt and darin this evening.  We've come up with a pretty simple fix for this.

1. We will need a new class, perhaps called CursorDescription. (like FontDescription).  This will contain CurorType enum (just like RenderStyle::cursor() does today), as well as a CachedImage* (just like cursorImage() does today), as well as a CursorDescription next pointer (CursorDescription* m_next; CursorDescription* next() const;)
2. RenderStyle::cursor() will stay (to optimize for the common single-specified cursor case).  RenderStyle::cursorImage() will change to CursorDescription* RenderStyle::cursorList().
3. Either cursor() will return a special CURSOR_LIST enum value, or simply cursorList() returning non-null will trigger the cursor list fallback behavior instead of the normal single-cursor case.

That's pretty much it.  This should be a pretty small patch and shouldn't take more than a couple hours to code up.
Comment 6 Alexey Proskuryakov 2006-09-06 02:13:52 PDT
There's a lot work already done in an unfinished patch for bug 6002.
Comment 7 Eric Seidel (no email) 2006-09-06 03:27:03 PDT
One other thing I forgot.  The CursorDescription class can't just point to a CacheImage, as the cursor might not just be an image.  It will need to point to either an SVGCursorElement (bug 6002) or a CachedImage, FloatPoint (hotspot -- as part of CSS3) pair.  Perhaps we'll want an abstract class to codify this CursorProvider interface.  Not sure.
Comment 8 Eric Seidel (no email) 2006-09-26 05:39:51 PDT
Fixed as part of bug 6002