Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Unified Diff: Source/core/layout/HitTestResult.cpp

Issue 1119813002: Use the correct node when hit testing on an image map (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/replaced/image-map-alt-content-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/HitTestResult.cpp
diff --git a/Source/core/layout/HitTestResult.cpp b/Source/core/layout/HitTestResult.cpp
index 639f24b89dc8c85cb0d1bb650769b9b794a44212..7d747bdf0b0b0115d373f756787872e33b6c6783 100644
--- a/Source/core/layout/HitTestResult.cpp
+++ b/Source/core/layout/HitTestResult.cpp
@@ -166,14 +166,14 @@ HTMLAreaElement* HitTestResult::imageAreaForImage() const
}
}
- if (!imageElement)
+ if (!imageElement || !imageElement->layoutObject())
return nullptr;
HTMLMapElement* map = imageElement->treeScope().getImageMap(imageElement->fastGetAttribute(usemapAttr));
if (!map)
return nullptr;
- LayoutBox* box = toLayoutBox(layoutObject());
+ LayoutBox* box = toLayoutBox(imageElement->layoutObject());
LayoutRect contentBox = box->contentBoxRect();
float scaleFactor = 1 / box->style()->effectiveZoom();
LayoutPoint location = localPoint();
« no previous file with comments | « LayoutTests/fast/replaced/image-map-alt-content-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698