| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 if (defaultArea) { | 66 if (defaultArea) { |
| 67 result.setInnerNode(defaultArea); | 67 result.setInnerNode(defaultArea); |
| 68 result.setURLElement(defaultArea); | 68 result.setURLElement(defaultArea); |
| 69 } | 69 } |
| 70 return defaultArea; | 70 return defaultArea; |
| 71 } | 71 } |
| 72 | 72 |
| 73 HTMLImageElement* HTMLMapElement::imageElement() | 73 HTMLImageElement* HTMLMapElement::imageElement() |
| 74 { | 74 { |
| 75 RefPtr<HTMLCollection> images = document().images(); | 75 RefPtrWillBeRawPtr<HTMLCollection> images = document().images(); |
| 76 for (unsigned i = 0; Element* curr = images->item(i); i++) { | 76 for (unsigned i = 0; Element* curr = images->item(i); i++) { |
| 77 ASSERT(isHTMLImageElement(curr)); | 77 ASSERT(isHTMLImageElement(curr)); |
| 78 | 78 |
| 79 // The HTMLImageElement's useMap() value includes the '#' symbol at the
beginning, | 79 // The HTMLImageElement's useMap() value includes the '#' symbol at the
beginning, |
| 80 // which has to be stripped off. | 80 // which has to be stripped off. |
| 81 HTMLImageElement& imageElement = toHTMLImageElement(*curr); | 81 HTMLImageElement& imageElement = toHTMLImageElement(*curr); |
| 82 String useMapName = imageElement.getAttribute(usemapAttr).string().subst
ring(1); | 82 String useMapName = imageElement.getAttribute(usemapAttr).string().subst
ring(1); |
| 83 if (equalIgnoringCase(useMapName, m_name)) | 83 if (equalIgnoringCase(useMapName, m_name)) |
| 84 return &imageElement; | 84 return &imageElement; |
| 85 } | 85 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 107 m_name = AtomicString(document().isHTMLDocument() ? mapName.lower() : ma
pName); | 107 m_name = AtomicString(document().isHTMLDocument() ? mapName.lower() : ma
pName); |
| 108 if (inDocument()) | 108 if (inDocument()) |
| 109 treeScope().addImageMap(this); | 109 treeScope().addImageMap(this); |
| 110 | 110 |
| 111 return; | 111 return; |
| 112 } | 112 } |
| 113 | 113 |
| 114 HTMLElement::parseAttribute(name, value); | 114 HTMLElement::parseAttribute(name, value); |
| 115 } | 115 } |
| 116 | 116 |
| 117 PassRefPtr<HTMLCollection> HTMLMapElement::areas() | 117 PassRefPtrWillBeRawPtr<HTMLCollection> HTMLMapElement::areas() |
| 118 { | 118 { |
| 119 return ensureCachedHTMLCollection(MapAreas); | 119 return ensureCachedHTMLCollection(MapAreas); |
| 120 } | 120 } |
| 121 | 121 |
| 122 Node::InsertionNotificationRequest HTMLMapElement::insertedInto(ContainerNode* i
nsertionPoint) | 122 Node::InsertionNotificationRequest HTMLMapElement::insertedInto(ContainerNode* i
nsertionPoint) |
| 123 { | 123 { |
| 124 if (insertionPoint->inDocument()) | 124 if (insertionPoint->inDocument()) |
| 125 treeScope().addImageMap(this); | 125 treeScope().addImageMap(this); |
| 126 return HTMLElement::insertedInto(insertionPoint); | 126 return HTMLElement::insertedInto(insertionPoint); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void HTMLMapElement::removedFrom(ContainerNode* insertionPoint) | 129 void HTMLMapElement::removedFrom(ContainerNode* insertionPoint) |
| 130 { | 130 { |
| 131 if (insertionPoint->inDocument()) | 131 if (insertionPoint->inDocument()) |
| 132 treeScope().removeImageMap(this); | 132 treeScope().removeImageMap(this); |
| 133 HTMLElement::removedFrom(insertionPoint); | 133 HTMLElement::removedFrom(insertionPoint); |
| 134 } | 134 } |
| 135 | 135 |
| 136 } | 136 } |
| OLD | NEW |