summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebCore/html/HTMLMapElement.cpp
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@nokia.com>2010-04-06 10:36:47 (GMT)
committerJocelyn Turcotte <jocelyn.turcotte@nokia.com>2010-04-06 10:36:47 (GMT)
commitbb35b65bbfba82e0dd0ac306d3dab54436cdaff6 (patch)
tree8174cb262a960ff7b2e4aa8f1aaf154db71d2636 /src/3rdparty/webkit/WebCore/html/HTMLMapElement.cpp
parent4b27d0d887269583a0f76e922948f8c25e96ab88 (diff)
downloadQt-bb35b65bbfba82e0dd0ac306d3dab54436cdaff6.zip
Qt-bb35b65bbfba82e0dd0ac306d3dab54436cdaff6.tar.gz
Qt-bb35b65bbfba82e0dd0ac306d3dab54436cdaff6.tar.bz2
Update src/3rdparty/webkit from trunk.
Imported from 839d8709327f925aacb3b6362c06152594def97e in branch qtwebkit-2.0 of repository git://gitorious.org/+qtwebkit-developers/webkit/qtwebkit.git Rubber-stamped-by: Simon Hausmann
Diffstat (limited to 'src/3rdparty/webkit/WebCore/html/HTMLMapElement.cpp')
-rw-r--r--src/3rdparty/webkit/WebCore/html/HTMLMapElement.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/3rdparty/webkit/WebCore/html/HTMLMapElement.cpp b/src/3rdparty/webkit/WebCore/html/HTMLMapElement.cpp
index 90204e0..10a05d6 100644
--- a/src/3rdparty/webkit/WebCore/html/HTMLMapElement.cpp
+++ b/src/3rdparty/webkit/WebCore/html/HTMLMapElement.cpp
@@ -25,10 +25,12 @@
#include "Document.h"
#include "HTMLAreaElement.h"
#include "HTMLCollection.h"
+#include "HTMLImageElement.h"
#include "HTMLNames.h"
#include "HitTestResult.h"
#include "IntSize.h"
#include "MappedAttribute.h"
+#include "RenderObject.h"
using namespace std;
@@ -75,12 +77,30 @@ bool HTMLMapElement::mapMouseEvent(int x, int y, const IntSize& size, HitTestRes
return defaultArea;
}
+HTMLImageElement* HTMLMapElement::imageElement() const
+{
+ RefPtr<HTMLCollection> coll = document()->images();
+ for (Node* curr = coll->firstItem(); curr; curr = coll->nextItem()) {
+ if (!curr->hasTagName(imgTag))
+ continue;
+
+ // The HTMLImageElement's useMap() value includes the '#' symbol at the beginning,
+ // which has to be stripped off.
+ HTMLImageElement* imageElement = static_cast<HTMLImageElement*>(curr);
+ String useMapName = imageElement->getAttribute(usemapAttr).string().substring(1);
+ if (equalIgnoringCase(useMapName, m_name))
+ return imageElement;
+ }
+
+ return 0;
+}
+
void HTMLMapElement::parseMappedAttribute(MappedAttribute* attr)
{
const QualifiedName& attrName = attr->name();
- if (attrName == idAttr || attrName == nameAttr) {
+ if (attrName == idAttributeName() || attrName == nameAttr) {
Document* doc = document();
- if (attrName == idAttr) {
+ if (attrName == idAttributeName()) {
// Call base class so that hasID bit gets set.
HTMLElement::parseMappedAttribute(attr);
if (doc->isHTMLDocument())