Bug 12895 - REGRESSION: imagemap: pointer cursor is shown everywhere
Summary: REGRESSION: imagemap: pointer cursor is shown everywhere
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac (PowerPC) OS X 10.4
: P1 Normal
Assignee: Nobody
URL: http://michi.stuenzi.net/
Keywords: InRadar, Regression
Depends on:
Blocks:
 
Reported: 2007-02-26 05:03 PST by Thomas Steinacher
Modified: 2007-03-02 00:36 PST (History)
4 users (show)

See Also:


Attachments
imagemap image should never itself be the URLElement in hit test results (1.45 KB, patch)
2007-03-01 11:58 PST, Antti Koivisto
mjs: review+
Details | Formatted Diff | Diff
First attempt (1.78 KB, patch)
2007-03-01 13:28 PST, Rob Buis
mjs: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Steinacher 2007-02-26 05:03:59 PST
Using revision 19850, the pointer cursor on the image map on http://michi.stuenzi.net/ is shown everywhere, not just on the links. This doesn't occur in shipping Safari.
Comment 1 mitz 2007-02-26 10:04:53 PST
Probably caused by <http://trac.webkit.org/projects/webkit/changeset/19400>.
Comment 2 Darin Adler 2007-02-27 06:31:55 PST
I can't get to the URL mentioned here. I'll look for other image maps.
Comment 3 Darin Adler 2007-02-27 06:34:45 PST
Testing with the image map at <http://www.december.com/html/demo/imagemap.html>, everything's working fine. So I can't diagnose this without access to the broken test case.
Comment 4 mitz 2007-02-27 06:44:27 PST
Another test case:
data:text/html,<img src="http://webkit.org/images/icon-gold.png" usemap="#map">

Some other places that check isLink() specifically exclude elements whose renderer is an image. Perhaps that's just what Document::prepareMouseEvent() should do.
Comment 5 Thomas Steinacher 2007-02-27 08:29:12 PST
The page is working again. I changed the DNS servers and forgot to set them up correctly. So please try again.
Comment 6 Maciej Stachowiak 2007-02-27 19:36:21 PST
<rdar://problem/5028163>
Comment 7 Antti Koivisto 2007-03-01 11:58:52 PST
Created attachment 13439 [details]
imagemap image should never itself be the URLElement in hit test results

This does not replicate Firefox behavior where if usemap attribute is empty or wrong the hand cursor is shown over entire image area. That seems more like a bug than a feature.
Comment 8 Rob Buis 2007-03-01 13:28:16 PST
Created attachment 13440 [details]
First  attempt

Hi,

I am not sure HTMLImageElement should ever return true for isLink, so I am attaching the patch since it is an easy fix. Let me know if I got isLink all wrong though.
Cheers,

Rob.
Comment 9 Antti Koivisto 2007-03-01 15:01:24 PST
I wasn't sure either but not setting isLink for imagemaps seemed like a risky change considering that it is used from quite many places not related to this particular problem.
Comment 10 Maciej Stachowiak 2007-03-01 18:24:42 PST
I think it is safer to take Antti's narrow fix for now, and later investigate whether any of the paces calling isLink also want to include imagemaps. It's hard to tell from a quick scan of the code.
Comment 11 Maciej Stachowiak 2007-03-01 18:33:25 PST
Comment on attachment 13439 [details]
imagemap image should never itself be the URLElement in hit test results

r=me
Comment 12 Maciej Stachowiak 2007-03-01 18:34:17 PST
Comment on attachment 13440 [details]
First  attempt

I don't think we should land this fix for now, but in the future we should figure out what parts of the code expect an imagemap to be treated as a link, and which don't.
Comment 13 Maciej Stachowiak 2007-03-01 23:23:11 PST
Comment on attachment 13440 [details]
First  attempt

(r-, but I think we should investigate this approach later, when we have time to review the affected code).
Comment 14 Antti Koivisto 2007-03-02 00:36:01 PST
r19941