| OLD | NEW |
| 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 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 55 |
| 56 HTMLMapElement::~HTMLMapElement() | 56 HTMLMapElement::~HTMLMapElement() |
| 57 { | 57 { |
| 58 } | 58 } |
| 59 | 59 |
| 60 bool HTMLMapElement::mapMouseEvent(LayoutPoint location, const LayoutSize& size,
HitTestResult& result) | 60 bool HTMLMapElement::mapMouseEvent(LayoutPoint location, const LayoutSize& size,
HitTestResult& result) |
| 61 { | 61 { |
| 62 HTMLAreaElement* defaultArea = 0; | 62 HTMLAreaElement* defaultArea = 0; |
| 63 Element* element = this; | 63 Element* element = this; |
| 64 while ((element = ElementTraversal::next(element, this))) { | 64 while ((element = ElementTraversal::next(element, this))) { |
| 65 if (element->hasTagName(areaTag)) { | 65 if (isHTMLAreaElement(element)) { |
| 66 HTMLAreaElement* areaElt = static_cast<HTMLAreaElement*>(element); | 66 HTMLAreaElement* areaElt = toHTMLAreaElement(element); |
| 67 if (areaElt->isDefault()) { | 67 if (areaElt->isDefault()) { |
| 68 if (!defaultArea) | 68 if (!defaultArea) |
| 69 defaultArea = areaElt; | 69 defaultArea = areaElt; |
| 70 } else if (areaElt->mapMouseEvent(location, size, result)) | 70 } else if (areaElt->mapMouseEvent(location, size, result)) |
| 71 return true; | 71 return true; |
| 72 } | 72 } |
| 73 } | 73 } |
| 74 | 74 |
| 75 if (defaultArea) { | 75 if (defaultArea) { |
| 76 result.setInnerNode(defaultArea); | 76 result.setInnerNode(defaultArea); |
| 77 result.setURLElement(defaultArea); | 77 result.setURLElement(defaultArea); |
| 78 } | 78 } |
| 79 return defaultArea; | 79 return defaultArea; |
| 80 } | 80 } |
| 81 | 81 |
| 82 HTMLImageElement* HTMLMapElement::imageElement() | 82 HTMLImageElement* HTMLMapElement::imageElement() |
| 83 { | 83 { |
| 84 RefPtr<HTMLCollection> images = document()->images(); | 84 RefPtr<HTMLCollection> images = document()->images(); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 } | 137 } |
| 138 | 138 |
| 139 void HTMLMapElement::removedFrom(ContainerNode* insertionPoint) | 139 void HTMLMapElement::removedFrom(ContainerNode* insertionPoint) |
| 140 { | 140 { |
| 141 if (insertionPoint->inDocument()) | 141 if (insertionPoint->inDocument()) |
| 142 treeScope()->removeImageMap(this); | 142 treeScope()->removeImageMap(this); |
| 143 HTMLElement::removedFrom(insertionPoint); | 143 HTMLElement::removedFrom(insertionPoint); |
| 144 } | 144 } |
| 145 | 145 |
| 146 } | 146 } |
| OLD | NEW |