summaryrefslogtreecommitdiff
path: root/Source/WebCore/html/HTMLMapElement.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2013-09-13 12:51:20 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-19 20:50:05 +0200
commitd441d6f39bb846989d95bcf5caf387b42414718d (patch)
treee367e64a75991c554930278175d403c072de6bb8 /Source/WebCore/html/HTMLMapElement.cpp
parent0060b2994c07842f4c59de64b5e3e430525c4b90 (diff)
downloadqtwebkit-d441d6f39bb846989d95bcf5caf387b42414718d.tar.gz
Import Qt5x2 branch of QtWebkit for Qt 5.2
Importing a new snapshot of webkit. Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Source/WebCore/html/HTMLMapElement.cpp')
-rw-r--r--Source/WebCore/html/HTMLMapElement.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/Source/WebCore/html/HTMLMapElement.cpp b/Source/WebCore/html/HTMLMapElement.cpp
index d01eae67e..66fd73e80 100644
--- a/Source/WebCore/html/HTMLMapElement.cpp
+++ b/Source/WebCore/html/HTMLMapElement.cpp
@@ -30,6 +30,7 @@
#include "HTMLNames.h"
#include "HitTestResult.h"
#include "IntSize.h"
+#include "NodeTraversal.h"
#include "RenderObject.h"
using namespace std;
@@ -61,10 +62,10 @@ HTMLMapElement::~HTMLMapElement()
bool HTMLMapElement::mapMouseEvent(LayoutPoint location, const LayoutSize& size, HitTestResult& result)
{
HTMLAreaElement* defaultArea = 0;
- Node *node = this;
- while ((node = node->traverseNextNode(this))) {
- if (node->hasTagName(areaTag)) {
- HTMLAreaElement* areaElt = static_cast<HTMLAreaElement*>(node);
+ Element* element = this;
+ while ((element = ElementTraversal::next(element, this))) {
+ if (isHTMLAreaElement(element)) {
+ HTMLAreaElement* areaElt = toHTMLAreaElement(element);
if (areaElt->isDefault()) {
if (!defaultArea)
defaultArea = areaElt;
@@ -84,12 +85,12 @@ HTMLImageElement* HTMLMapElement::imageElement()
{
RefPtr<HTMLCollection> images = document()->images();
for (unsigned i = 0; Node* curr = images->item(i); i++) {
- if (!curr->hasTagName(imgTag))
+ if (!isHTMLImageElement(curr))
continue;
// The HTMLImageElement's useMap() value includes the '#' symbol at the beginning,
// which has to be stripped off.
- HTMLImageElement* imageElement = static_cast<HTMLImageElement*>(curr);
+ HTMLImageElement* imageElement = toHTMLImageElement(curr);
String useMapName = imageElement->getAttribute(usemapAttr).string().substring(1);
if (equalIgnoringCase(useMapName, m_name))
return imageElement;