Bug 12895

Summary: REGRESSION: imagemap: pointer cursor is shown everywhere
Product: WebKit Reporter: Thomas Steinacher <tom>
Component: ImagesAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, eric, koivisto, mitz
Priority: P1 Keywords: InRadar, Regression
Version: 523.x (Safari 3)   
Hardware: Mac (PowerPC)   
OS: OS X 10.4   
URL: http://michi.stuenzi.net/
Attachments:
Description Flags
imagemap image should never itself be the URLElement in hit test results
mjs: review+
First attempt mjs: review-

Thomas Steinacher
Reported 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.
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+
First attempt (1.78 KB, patch)
2007-03-01 13:28 PST, Rob Buis
mjs: review-
mitz
Comment 1 2007-02-26 10:04:53 PST
Darin Adler
Comment 2 2007-02-27 06:31:55 PST
I can't get to the URL mentioned here. I'll look for other image maps.
Darin Adler
Comment 3 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.
mitz
Comment 4 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.
Thomas Steinacher
Comment 5 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.
Maciej Stachowiak
Comment 6 2007-02-27 19:36:21 PST
Antti Koivisto
Comment 7 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.
Rob Buis
Comment 8 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.
Antti Koivisto
Comment 9 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.
Maciej Stachowiak
Comment 10 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.
Maciej Stachowiak
Comment 11 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
Maciej Stachowiak
Comment 12 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.
Maciej Stachowiak
Comment 13 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).
Antti Koivisto
Comment 14 2007-03-02 00:36:01 PST
Note You need to log in before you can comment on or make changes to this bug.