| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 } | 57 } |
| 58 | 58 |
| 59 return defaultArea; | 59 return defaultArea; |
| 60 } | 60 } |
| 61 | 61 |
| 62 HTMLImageElement* HTMLMapElement::imageElement() { | 62 HTMLImageElement* HTMLMapElement::imageElement() { |
| 63 HTMLCollection* images = document().images(); | 63 HTMLCollection* images = document().images(); |
| 64 for (unsigned i = 0; Element* curr = images->item(i); ++i) { | 64 for (unsigned i = 0; Element* curr = images->item(i); ++i) { |
| 65 DCHECK(isHTMLImageElement(curr)); | 65 DCHECK(isHTMLImageElement(curr)); |
| 66 | 66 |
| 67 // The HTMLImageElement's useMap() value includes the '#' symbol at the begi
nning, | 67 // The HTMLImageElement's useMap() value includes the '#' symbol at the |
| 68 // which has to be stripped off. | 68 // beginning, which has to be stripped off. |
| 69 HTMLImageElement& imageElement = toHTMLImageElement(*curr); | 69 HTMLImageElement& imageElement = toHTMLImageElement(*curr); |
| 70 String useMapName = | 70 String useMapName = |
| 71 imageElement.getAttribute(usemapAttr).getString().substring(1); | 71 imageElement.getAttribute(usemapAttr).getString().substring(1); |
| 72 if (equalIgnoringCase(useMapName, m_name)) | 72 if (equalIgnoringCase(useMapName, m_name)) |
| 73 return &imageElement; | 73 return &imageElement; |
| 74 } | 74 } |
| 75 | 75 |
| 76 return nullptr; | 76 return nullptr; |
| 77 } | 77 } |
| 78 | 78 |
| 79 void HTMLMapElement::parseAttribute(const QualifiedName& name, | 79 void HTMLMapElement::parseAttribute(const QualifiedName& name, |
| 80 const AtomicString& oldValue, | 80 const AtomicString& oldValue, |
| 81 const AtomicString& value) { | 81 const AtomicString& value) { |
| 82 // FIXME: This logic seems wrong for XML documents. | 82 // FIXME: This logic seems wrong for XML documents. |
| 83 // Either the id or name will be used depending on the order the attributes ar
e parsed. | 83 // Either the id or name will be used depending on the order the attributes |
| 84 // are parsed. |
| 84 | 85 |
| 85 if (name == idAttr || name == nameAttr) { | 86 if (name == idAttr || name == nameAttr) { |
| 86 if (name == idAttr) { | 87 if (name == idAttr) { |
| 87 // Call base class so that hasID bit gets set. | 88 // Call base class so that hasID bit gets set. |
| 88 HTMLElement::parseAttribute(name, oldValue, value); | 89 HTMLElement::parseAttribute(name, oldValue, value); |
| 89 if (document().isHTMLDocument()) | 90 if (document().isHTMLDocument()) |
| 90 return; | 91 return; |
| 91 } | 92 } |
| 92 if (isConnected()) | 93 if (isConnected()) |
| 93 treeScope().removeImageMap(this); | 94 treeScope().removeImageMap(this); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 116 return HTMLElement::insertedInto(insertionPoint); | 117 return HTMLElement::insertedInto(insertionPoint); |
| 117 } | 118 } |
| 118 | 119 |
| 119 void HTMLMapElement::removedFrom(ContainerNode* insertionPoint) { | 120 void HTMLMapElement::removedFrom(ContainerNode* insertionPoint) { |
| 120 if (insertionPoint->isConnected()) | 121 if (insertionPoint->isConnected()) |
| 121 treeScope().removeImageMap(this); | 122 treeScope().removeImageMap(this); |
| 122 HTMLElement::removedFrom(insertionPoint); | 123 HTMLElement::removedFrom(insertionPoint); |
| 123 } | 124 } |
| 124 | 125 |
| 125 } // namespace blink | 126 } // namespace blink |
| OLD | NEW |