| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2006 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2006 Allan Sandfeld Jensen (kde@carewolf.com) |
| 6 * (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 6 * (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
| 8 * Copyright (C) 2010 Google Inc. All rights reserved. | 8 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 9 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. | 9 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. |
| 10 * | 10 * |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 { | 289 { |
| 290 HTMLImageElement* i = isHTMLImageElement(node()) ? toHTMLImageElement(node()
) : 0; | 290 HTMLImageElement* i = isHTMLImageElement(node()) ? toHTMLImageElement(node()
) : 0; |
| 291 return i ? i->treeScope().getImageMap(i->fastGetAttribute(usemapAttr)) : 0; | 291 return i ? i->treeScope().getImageMap(i->fastGetAttribute(usemapAttr)) : 0; |
| 292 } | 292 } |
| 293 | 293 |
| 294 bool LayoutImage::nodeAtPoint(HitTestResult& result, const HitTestLocation& loca
tionInContainer, const LayoutPoint& accumulatedOffset, HitTestAction hitTestActi
on) | 294 bool LayoutImage::nodeAtPoint(HitTestResult& result, const HitTestLocation& loca
tionInContainer, const LayoutPoint& accumulatedOffset, HitTestAction hitTestActi
on) |
| 295 { | 295 { |
| 296 HitTestResult tempResult(result.hitTestRequest(), result.hitTestLocation()); | 296 HitTestResult tempResult(result.hitTestRequest(), result.hitTestLocation()); |
| 297 bool inside = LayoutReplaced::nodeAtPoint(tempResult, locationInContainer, a
ccumulatedOffset, hitTestAction); | 297 bool inside = LayoutReplaced::nodeAtPoint(tempResult, locationInContainer, a
ccumulatedOffset, hitTestAction); |
| 298 | 298 |
| 299 if (tempResult.innerNode() && node()) { | |
| 300 if (HTMLMapElement* map = imageMap()) { | |
| 301 LayoutRect contentBox = contentBoxRect(); | |
| 302 float scaleFactor = 1 / style()->effectiveZoom(); | |
| 303 LayoutPoint location = locationInContainer.point() - toLayoutSize(ac
cumulatedOffset) - locationOffset() - toLayoutSize(contentBox.location()); | |
| 304 location.scale(scaleFactor, scaleFactor); | |
| 305 | |
| 306 if (HTMLAreaElement* area = map->areaForPoint(location, contentBox.s
ize())) { | |
| 307 tempResult.setInnerNode(area); | |
| 308 tempResult.setURLElement(area); | |
| 309 } | |
| 310 } | |
| 311 } | |
| 312 | |
| 313 if (!inside && result.hitTestRequest().listBased()) | 299 if (!inside && result.hitTestRequest().listBased()) |
| 314 result.append(tempResult); | 300 result.append(tempResult); |
| 315 if (inside) | 301 if (inside) |
| 316 result = tempResult; | 302 result = tempResult; |
| 317 return inside; | 303 return inside; |
| 318 } | 304 } |
| 319 | 305 |
| 320 void LayoutImage::layout() | 306 void LayoutImage::layout() |
| 321 { | 307 { |
| 322 LayoutReplaced::layout(); | 308 LayoutReplaced::layout(); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 return 0; | 373 return 0; |
| 388 | 374 |
| 389 ImageResource* cachedImage = m_imageResource->cachedImage(); | 375 ImageResource* cachedImage = m_imageResource->cachedImage(); |
| 390 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage(
)) | 376 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage(
)) |
| 391 return toSVGImage(cachedImage->image())->embeddedContentBox(); | 377 return toSVGImage(cachedImage->image())->embeddedContentBox(); |
| 392 | 378 |
| 393 return 0; | 379 return 0; |
| 394 } | 380 } |
| 395 | 381 |
| 396 } // namespace blink | 382 } // namespace blink |
| OLD | NEW |