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

Unified Diff: Source/core/html/HTMLAnchorElement.cpp

Issue 198553002: Use new is*Element() helper functions even more in HTML code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | « Source/core/html/FormAssociatedElement.cpp ('k') | Source/core/html/HTMLAreaElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLAnchorElement.cpp
diff --git a/Source/core/html/HTMLAnchorElement.cpp b/Source/core/html/HTMLAnchorElement.cpp
index 0d2ee69ba29b1b4890d48cb9e7ac5129bd9999ab..33e6a318c7b93d13044a36ad4a3bce30857debed 100644
--- a/Source/core/html/HTMLAnchorElement.cpp
+++ b/Source/core/html/HTMLAnchorElement.cpp
@@ -171,16 +171,16 @@ static void appendServerMapMousePosition(StringBuilder& url, Event* event)
ASSERT(event->target());
Node* target = event->target()->toNode();
ASSERT(target);
- if (!target->hasTagName(imgTag))
+ if (!isHTMLImageElement(*target))
return;
- HTMLImageElement* imageElement = toHTMLImageElement(event->target()->toNode());
- if (!imageElement || !imageElement->isServerMap())
+ HTMLImageElement& imageElement = toHTMLImageElement(*target);
+ if (!imageElement.isServerMap())
return;
- if (!imageElement->renderer() || !imageElement->renderer()->isRenderImage())
+ if (!imageElement.renderer() || !imageElement.renderer()->isRenderImage())
return;
- RenderImage* renderer = toRenderImage(imageElement->renderer());
+ RenderImage* renderer = toRenderImage(imageElement.renderer());
// FIXME: This should probably pass true for useTransforms.
FloatPoint absolutePosition = renderer->absoluteToLocal(FloatPoint(toMouseEvent(event)->pageX(), toMouseEvent(event)->pageY()));
« no previous file with comments | « Source/core/html/FormAssociatedElement.cpp ('k') | Source/core/html/HTMLAreaElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698