Summary: | [test case] Image maps do not work if corners of clickable areas are not given in the standard way | ||
---|---|---|---|
Product: | [Applications] konqueror | Reporter: | Tal Levy <latyvel> |
Component: | khtml | Assignee: | Konqueror Developers <konq-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | frank78ac, giovanni, justin, maksim |
Priority: | NOR | ||
Version: | 3.5 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
First part of a test case
Test case (using the previously attached image) |
Description
Tal Levy
2006-12-10 00:31:23 UTC
Well, it does work with konqueror 3.5.6 so this can be closed. Oops I'm sorry - no, doesn't work. I get the same. The links that doesn't work are an image map. Could you try to produce a minimal testcase from that page showing the problem? Maybe you want to play around with this small page that only contains an imagemap with one link (that works): http://spacepenguin.de/unsorted/imagemap_konq/test.html - maybe you can see a difference in the way the imagemaps are created, I didn't so far (it doesn't matter if the map is in the page head or not and it also doesn't matter if the image is mentioned first or after the map). Another funny thing on that site: the mouseover buttons in the menu.menu from the link above are not shown on mouseover, they appear broken (also konq only, ok in firefox and opera). The mouseover problem is covered in bug #138605. Created attachment 25317 [details]
First part of a test case
Created attachment 25318 [details] Test case (using the previously attached image) Confirmed on 3.5.9 and SVN trunk rev. 820315, attached a simple test case. The problem is that the coordinates of the clickable rectangular areas are not given in the standard way. Usually, one would do it like this: <area shape="rect" alt="KDE" coords="x1,y1,x2,y2" href="http://www.kde.org/"> where (x1,y1) is the top left corner and (x2,y2) the bottom right corner of the area. Firefox accepts any other combination of opposite corners (like here: first bottom left, then top right), but Konqueror doesn't. Thanks for the reduction. Looks easy enough to fix. Hi Maksim, the patch below fixes the problem for me. Cheers, Frank Index: khtml/html/html_imageimpl.cpp =================================================================== --- khtml/html/html_imageimpl.cpp (revision 820315) +++ khtml/html/html_imageimpl.cpp (working copy) @@ -581,7 +581,9 @@ int y0 = m_coords[1].minWidth(height_); int x1 = m_coords[2].minWidth(width_); int y1 = m_coords[3].minWidth(height_); - region = QRegion(x0,y0,x1-x0,y1-y0); + // use qMin () and qAbs () to make sure that this works for any pair + // of opposite corners (x0,y0) and (x1,y1) + region = QRegion(qMin(x0,x1),qMin(y0,y1),qAbs(x1-x0),qAbs(y1-y0)); } else if (shape==Default) region = QRegion(0,0,width_,height_); Applied in http://lists.kde.org/?l=kde-commits&m=121442597331064&w=2 Thanks again for the analysis and the patch. *** Bug 163433 has been marked as a duplicate of this bug. *** *** Bug 92663 has been marked as a duplicate of this bug. *** |