| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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
are parsed. | 83 // Either the id or name will be used depending on the order the attributes
are parsed. |
| 84 | 84 |
| 85 if (name == idAttr || name == nameAttr) { | 85 if (name == idAttr || name == nameAttr) { |
| 86 if (name == idAttr) { | 86 if (name == idAttr) { |
| 87 // Call base class so that hasID bit gets set. | 87 // Call base class so that hasID bit gets set. |
| 88 HTMLElement::parseAttribute(name, oldValue, value); | 88 HTMLElement::parseAttribute(name, oldValue, value); |
| 89 if (document().isHTMLDocument()) | 89 if (document().isHTMLDocument()) |
| 90 return; | 90 return; |
| 91 } | 91 } |
| 92 if (inShadowIncludingDocument()) | 92 if (isConnected()) |
| 93 treeScope().removeImageMap(this); | 93 treeScope().removeImageMap(this); |
| 94 String mapName = value; | 94 String mapName = value; |
| 95 if (mapName[0] == '#') | 95 if (mapName[0] == '#') |
| 96 mapName = mapName.substring(1); | 96 mapName = mapName.substring(1); |
| 97 m_name = AtomicString(document().isHTMLDocument() ? mapName.lower() : ma
pName); | 97 m_name = AtomicString(document().isHTMLDocument() ? mapName.lower() : ma
pName); |
| 98 if (inShadowIncludingDocument()) | 98 if (isConnected()) |
| 99 treeScope().addImageMap(this); | 99 treeScope().addImageMap(this); |
| 100 | 100 |
| 101 return; | 101 return; |
| 102 } | 102 } |
| 103 | 103 |
| 104 HTMLElement::parseAttribute(name, oldValue, value); | 104 HTMLElement::parseAttribute(name, oldValue, value); |
| 105 } | 105 } |
| 106 | 106 |
| 107 HTMLCollection* HTMLMapElement::areas() | 107 HTMLCollection* HTMLMapElement::areas() |
| 108 { | 108 { |
| 109 return ensureCachedCollection<HTMLCollection>(MapAreas); | 109 return ensureCachedCollection<HTMLCollection>(MapAreas); |
| 110 } | 110 } |
| 111 | 111 |
| 112 Node::InsertionNotificationRequest HTMLMapElement::insertedInto(ContainerNode* i
nsertionPoint) | 112 Node::InsertionNotificationRequest HTMLMapElement::insertedInto(ContainerNode* i
nsertionPoint) |
| 113 { | 113 { |
| 114 if (insertionPoint->inShadowIncludingDocument()) | 114 if (insertionPoint->isConnected()) |
| 115 treeScope().addImageMap(this); | 115 treeScope().addImageMap(this); |
| 116 return HTMLElement::insertedInto(insertionPoint); | 116 return HTMLElement::insertedInto(insertionPoint); |
| 117 } | 117 } |
| 118 | 118 |
| 119 void HTMLMapElement::removedFrom(ContainerNode* insertionPoint) | 119 void HTMLMapElement::removedFrom(ContainerNode* insertionPoint) |
| 120 { | 120 { |
| 121 if (insertionPoint->inShadowIncludingDocument()) | 121 if (insertionPoint->isConnected()) |
| 122 treeScope().removeImageMap(this); | 122 treeScope().removeImageMap(this); |
| 123 HTMLElement::removedFrom(insertionPoint); | 123 HTMLElement::removedFrom(insertionPoint); |
| 124 } | 124 } |
| 125 | 125 |
| 126 } // namespace blink | 126 } // namespace blink |
| OLD | NEW |