Css cursor style ignored by image map.

RESOLVED FIXED in mozilla1.8.1alpha2



Layout: Images
17 years ago
11 years ago


(Reporter: Tim Howgego, Assigned: dbaron)


({css2, testcase})

css2, testcase
Bug Flags:
in-testsuite ?

Firefox Tracking Flags

(Not tracked)


(Whiteboard: [HTML4-13.6.1])


(2 attachments)



17 years ago
Css cursor style (for example cursor: crosshair;) is replaced by the system
defaults when the mouse passes over an image map.

This seems to apply regardless of whether the style is assigned to a div holding
the image map, or is inherited from the main html document. It seems to apply to
all cursor types. It applies to the whole map, not just specific areas. It also
occurred in NS 6.0. Cursors work correctly in other parts of the same document.
As a point of reference IE 5.5 does not have this problem.

No url - if you can not recreate this by simply aadding the style to an existing
bit of code, please email me for a sample.

Comment 1

17 years ago
please specify a specification to explain why our implementation is wrong.

what happens when you put a style into the img or imagemap?
I have no code lying around that uses imagemaps.  Please attach a testcase to
this bug using http://bugzilla.mozilla.org/createattachment.cgi?id=68502

That would expedite the handling of this bug significantly.

Comment 3

17 years ago
Created attachment 25026 [details]
Demonstration of bug 68502
OK, I can reproduce this on linux build 2001-02-11-06.  We have the following:

<div> <img> <map><area></map></div> and the div has cursor:crosshair set.  The
image is not inheriting the cursor -- it has an arrow over the non-link part and
a hand over the link part.

setting "img { cursor: crosshair }" (with or without !important) makes the
cursor be a crosshair over the link part of the image but an arrow over the
non-link part.

If there is no imagemap attached to the image, the image correctly inherits the
cursor from the div it's in.

setting status to new, os to all, over to style system, adding keywords.

This is probably related to bug 63792, but is not a duplicate, since there the
correct cursor _is_ displayed eventually.
Assignee: asa → pierre
Component: Browser-General → Style System
Ever confirmed: true
Keywords: css2, testcase
OS: Windows 98 → All
QA Contact: doronr → ian
Hardware: PC → All

Comment 5

17 years ago
Reassigned to Layout, this bug will be better off on Marc's list.

First thing first... nsImageFrame::GetCursor() should not reinitialize the cursor 
(ie. we shouldn't have "aCursor = NS_STYLE_CURSOR_AUTO"). The default cursors for 
"img" and "img[usemap]" are defined in

In the current code the problem is that when an image has a map, both selectors 
apply.  When the cursor is inside the image map, GetStyleData() is called in 
nsImageFrame::GetCursor().  When it is not inside the image map, GetStyleData() 
is called in nsFrame::GetCursor().  Both calls return the same style.

Instead, the "img[usemap]" selector should only apply when the mouse is inside 
the image map, otherwise it should be the "img" selector.
Assignee: pierre → attinasi
Component: Style System → Layout


16 years ago
Target Milestone: --- → mozilla1.1
Whiteboard: [HTML4-13.6.1]
So.. perhaps we should put a cursor style on the <area> elements instead of on
the <img>?  See the XXX comments on nsImageFrame::GetCursor:

//XXX This will need to be rewritten once we have content for areas
//XXXbz We have content for areas now.... 

So we could get the nsIContent corresponding to the <area> the user is hovering,
resolve style on it, and get the cursor from there.

Assignee: attinasi → jdunn
Component: Layout → Image: Layout
QA Contact: ian → tpreston
Target Milestone: mozilla1.1alpha → ---

Comment 7

14 years ago
Created attachment 146666 [details]
Simple HTML file displaying the problem.

This example shows clearly that the bug is directly caused by having a usemap
attribute on an img. Simply removing the usemap attribute will cause the
desired behaviour to occur.

I tested this file in build 1.8a

Comment 8

14 years ago
Comment on attachment 146666 [details]
Simple HTML file displaying the problem.

      <STYLE type="text/css">
	    cursor: crosshair;

	    cursor: crosshair;
      <MAP name="imageMap"/>
      Simple image with "usemap" attribute:<br>
      <IMG usemap="#imageMap" src="http://mozilla.org/images/mlogo.gif"/><br>
      Exact same image without "usemap" attribute:<br>
      <IMG src="http://mozilla.org/images/mlogo.gif"/><br>

Comment 9

13 years ago
*** Bug 259368 has been marked as a duplicate of this bug. ***


13 years ago
QA Contact: tpreston → core.layout.images
*** Bug 296826 has been marked as a duplicate of this bug. ***


11 years ago
Assignee: jdunn → nobody

Comment 11

11 years ago
looks like this is a pretty old bug...

fix pls... 



11 years ago
Assignee: nobody → dbaron

Comment 12

11 years ago
Fixed on trunk for Gecko 1.9alpha1, 2006-04-20, by checkin of bug 302536.

Fixed on MOZILLA_1_8_BRANCH for Mozilla 1.8.1 alpha2 (?), 2006-04-20, by checkin of bug 302536.
Last Resolved: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.8.1alpha2
Flags: in-testsuite?
You need to log in before you can comment on or make changes to this bug.