diff options
Diffstat (limited to 'WebCore/rendering/RenderImage.cpp')
| -rw-r--r-- | WebCore/rendering/RenderImage.cpp | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/WebCore/rendering/RenderImage.cpp b/WebCore/rendering/RenderImage.cpp index f48a219..5c11e41 100644 --- a/WebCore/rendering/RenderImage.cpp +++ b/WebCore/rendering/RenderImage.cpp @@ -26,9 +26,6 @@ #include "config.h" #include "RenderImage.h" -#include "BitmapImage.h" -#include "Document.h" -#include "FrameView.h" #include "GraphicsContext.h" #include "HTMLImageElement.h" #include "HTMLInputElement.h" @@ -93,8 +90,7 @@ private: Timer<RenderImage> m_highQualityRepaintTimer; }; -class RenderImageScaleObserver -{ +class RenderImageScaleObserver { public: static bool shouldImagePaintAtLowQuality(RenderImage*, const IntSize&); @@ -447,20 +443,19 @@ HTMLMapElement* RenderImage::imageMap() return i ? i->document()->getImageMap(i->useMap()) : 0; } -bool RenderImage::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction) +bool RenderImage::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, HitTestAction hitTestAction) { HitTestResult tempResult(result.point()); - bool inside = RenderReplaced::nodeAtPoint(request, tempResult, _x, _y, _tx, _ty, hitTestAction); + bool inside = RenderReplaced::nodeAtPoint(request, tempResult, x, y, tx, ty, hitTestAction); if (inside && node()) { - int tx = _tx + x(); - int ty = _ty + y(); - - HTMLMapElement* map = imageMap(); - if (map) { - // we're a client side image map - inside = map->mapMouseEvent(_x - tx, _y - ty, IntSize(contentWidth(), contentHeight()), tempResult); - tempResult.setInnerNonSharedNode(node()); + if (HTMLMapElement* map = imageMap()) { + IntRect contentBox = contentBoxRect(); + float zoom = style()->effectiveZoom(); + int mapX = lroundf((x - tx - this->x() - contentBox.x()) / zoom); + int mapY = lroundf((y - ty - this->y() - contentBox.y()) / zoom); + if (map->mapMouseEvent(mapX, mapY, contentBox.size(), tempResult)) + tempResult.setInnerNonSharedNode(node()); } } |
