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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/html/FormAssociatedElement.cpp ('k') | Source/core/html/HTMLAreaElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 Simon Hausmann <hausmann@kde.org> 4 * (C) 2000 Simon Hausmann <hausmann@kde.org>
5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
6 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 6 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 } 164 }
165 165
166 static void appendServerMapMousePosition(StringBuilder& url, Event* event) 166 static void appendServerMapMousePosition(StringBuilder& url, Event* event)
167 { 167 {
168 if (!event->isMouseEvent()) 168 if (!event->isMouseEvent())
169 return; 169 return;
170 170
171 ASSERT(event->target()); 171 ASSERT(event->target());
172 Node* target = event->target()->toNode(); 172 Node* target = event->target()->toNode();
173 ASSERT(target); 173 ASSERT(target);
174 if (!target->hasTagName(imgTag)) 174 if (!isHTMLImageElement(*target))
175 return; 175 return;
176 176
177 HTMLImageElement* imageElement = toHTMLImageElement(event->target()->toNode( )); 177 HTMLImageElement& imageElement = toHTMLImageElement(*target);
178 if (!imageElement || !imageElement->isServerMap()) 178 if (!imageElement.isServerMap())
179 return; 179 return;
180 180
181 if (!imageElement->renderer() || !imageElement->renderer()->isRenderImage()) 181 if (!imageElement.renderer() || !imageElement.renderer()->isRenderImage())
182 return; 182 return;
183 RenderImage* renderer = toRenderImage(imageElement->renderer()); 183 RenderImage* renderer = toRenderImage(imageElement.renderer());
184 184
185 // FIXME: This should probably pass true for useTransforms. 185 // FIXME: This should probably pass true for useTransforms.
186 FloatPoint absolutePosition = renderer->absoluteToLocal(FloatPoint(toMouseEv ent(event)->pageX(), toMouseEvent(event)->pageY())); 186 FloatPoint absolutePosition = renderer->absoluteToLocal(FloatPoint(toMouseEv ent(event)->pageX(), toMouseEvent(event)->pageY()));
187 int x = absolutePosition.x(); 187 int x = absolutePosition.x();
188 int y = absolutePosition.y(); 188 int y = absolutePosition.y();
189 url.append('?'); 189 url.append('?');
190 url.appendNumber(x); 190 url.appendNumber(x);
191 url.append(','); 191 url.append(',');
192 url.appendNumber(y); 192 url.appendNumber(y);
193 } 193 }
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 preconnectToURL(url, motivation); 693 preconnectToURL(url, motivation);
694 m_hasIssuedPreconnect = true; 694 m_hasIssuedPreconnect = true;
695 } 695 }
696 696
697 bool HTMLAnchorElement::isInteractiveContent() const 697 bool HTMLAnchorElement::isInteractiveContent() const
698 { 698 {
699 return isLink(); 699 return isLink();
700 } 700 }
701 701
702 } 702 }
OLDNEW
« 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