Css cursor style ignored by image map.

RESOLVED FIXED in mozilla1.8.1alpha2

Status

()

Core
Layout: Images
RESOLVED FIXED
17 years ago
11 years ago

People

(Reporter: Tim Howgego, Assigned: dbaron)

Tracking

({css2, testcase})

Trunk
mozilla1.8.1alpha2
css2, testcase
Points:
---
Bug Flags:
in-testsuite ?

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [HTML4-13.6.1])

Attachments

(2 attachments)

(Reporter)

Description

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.
(Reporter)

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
Status: UNCONFIRMED → NEW
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
http://lxr.mozilla.org/seamonkey/source/layout/html/document/src/html.css#367 

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

Updated

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.

Thoughts?
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.

<HTML>
   <HEAD>
      <STYLE type="text/css">
	 img
	 {
	    cursor: crosshair;
	 }

	 img[usemap]
	 {
	    cursor: crosshair;
	 }
      </STYLE>
   </HEAD>
   <BODY>
      <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>
   </BODY>
</HTML>

Comment 9

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

Updated

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

Updated

11 years ago
Assignee: jdunn → nobody

Comment 11

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

fix pls... 

:)
(Assignee)

Updated

11 years ago
Assignee: nobody → dbaron
(Assignee)

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.
Status: NEW → RESOLVED
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.