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 * (C) 2001 Peter Kelly (pmk@post.com) | 4 * (C) 2001 Peter Kelly (pmk@post.com) |
5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
6 * (C) 2007 David Smith (catfish.man@gmail.com) | 6 * (C) 2007 David Smith (catfish.man@gmail.com) |
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. | 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. |
8 * (C) 2007 Eric Seidel (eric@webkit.org) | 8 * (C) 2007 Eric Seidel (eric@webkit.org) |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1094 ContainerNode::insertedInto(insertionPoint); | 1094 ContainerNode::insertedInto(insertionPoint); |
1095 | 1095 |
1096 #if ENABLE(FULLSCREEN_API) | 1096 #if ENABLE(FULLSCREEN_API) |
1097 if (containsFullScreenElement() && parentElement() && !parentElement()->cont
ainsFullScreenElement()) | 1097 if (containsFullScreenElement() && parentElement() && !parentElement()->cont
ainsFullScreenElement()) |
1098 setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(true); | 1098 setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(true); |
1099 #endif | 1099 #endif |
1100 | 1100 |
1101 if (!insertionPoint->isInTreeScope()) | 1101 if (!insertionPoint->isInTreeScope()) |
1102 return InsertionDone; | 1102 return InsertionDone; |
1103 | 1103 |
| 1104 TreeScope* scope = insertionPoint->treeScope(); |
| 1105 if (scope != treeScope()) |
| 1106 return InsertionDone; |
| 1107 |
1104 const AtomicString& idValue = getIdAttribute(); | 1108 const AtomicString& idValue = getIdAttribute(); |
1105 if (!idValue.isNull()) | 1109 if (!idValue.isNull()) |
1106 updateId(nullAtom, idValue); | 1110 updateId(scope, nullAtom, idValue); |
1107 | 1111 |
1108 const AtomicString& nameValue = getNameAttribute(); | 1112 const AtomicString& nameValue = getNameAttribute(); |
1109 if (!nameValue.isNull()) | 1113 if (!nameValue.isNull()) |
1110 updateName(nullAtom, nameValue); | 1114 updateName(nullAtom, nameValue); |
1111 | 1115 |
1112 if (hasTagName(labelTag)) { | 1116 if (hasTagName(labelTag)) { |
1113 TreeScope* scope = treeScope(); | |
1114 if (scope->shouldCacheLabelsByForAttribute()) | 1117 if (scope->shouldCacheLabelsByForAttribute()) |
1115 updateLabel(scope, nullAtom, fastGetAttribute(forAttr)); | 1118 updateLabel(scope, nullAtom, fastGetAttribute(forAttr)); |
1116 } | 1119 } |
1117 | 1120 |
1118 return InsertionDone; | 1121 return InsertionDone; |
1119 } | 1122 } |
1120 | 1123 |
1121 void Element::removedFrom(ContainerNode* insertionPoint) | 1124 void Element::removedFrom(ContainerNode* insertionPoint) |
1122 { | 1125 { |
1123 #if ENABLE(DIALOG_ELEMENT) | 1126 #if ENABLE(DIALOG_ELEMENT) |
1124 setIsInTopLayer(false); | 1127 setIsInTopLayer(false); |
1125 #endif | 1128 #endif |
1126 #if ENABLE(FULLSCREEN_API) | 1129 #if ENABLE(FULLSCREEN_API) |
1127 if (containsFullScreenElement()) | 1130 if (containsFullScreenElement()) |
1128 setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(false); | 1131 setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(false); |
1129 #endif | 1132 #endif |
1130 #if ENABLE(POINTER_LOCK) | 1133 #if ENABLE(POINTER_LOCK) |
1131 if (document()->page()) | 1134 if (document()->page()) |
1132 document()->page()->pointerLockController()->elementRemoved(this); | 1135 document()->page()->pointerLockController()->elementRemoved(this); |
1133 #endif | 1136 #endif |
1134 | 1137 |
1135 setSavedLayerScrollOffset(IntSize()); | 1138 setSavedLayerScrollOffset(IntSize()); |
1136 | 1139 |
1137 if (insertionPoint->inDocument()) { | 1140 if (insertionPoint->isInTreeScope() && treeScope() == document()) { |
1138 const AtomicString& idValue = getIdAttribute(); | 1141 const AtomicString& idValue = getIdAttribute(); |
1139 if (!idValue.isNull() && inDocument()) | 1142 if (!idValue.isNull()) |
1140 updateId(insertionPoint->treeScope(), idValue, nullAtom); | 1143 updateId(insertionPoint->treeScope(), idValue, nullAtom); |
1141 | 1144 |
1142 const AtomicString& nameValue = getNameAttribute(); | 1145 const AtomicString& nameValue = getNameAttribute(); |
1143 if (!nameValue.isNull()) | 1146 if (!nameValue.isNull()) |
1144 updateName(nameValue, nullAtom); | 1147 updateName(nameValue, nullAtom); |
1145 | 1148 |
1146 if (hasTagName(labelTag)) { | 1149 if (hasTagName(labelTag)) { |
1147 TreeScope* treeScope = insertionPoint->treeScope(); | 1150 TreeScope* treeScope = insertionPoint->treeScope(); |
1148 if (treeScope->shouldCacheLabelsByForAttribute()) | 1151 if (treeScope->shouldCacheLabelsByForAttribute()) |
1149 updateLabel(treeScope, fastGetAttribute(forAttr), nullAtom); | 1152 updateLabel(treeScope, fastGetAttribute(forAttr), nullAtom); |
(...skipping 1540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2690 | 2693 |
2691 void Element::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const | 2694 void Element::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const |
2692 { | 2695 { |
2693 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); | 2696 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); |
2694 ContainerNode::reportMemoryUsage(memoryObjectInfo); | 2697 ContainerNode::reportMemoryUsage(memoryObjectInfo); |
2695 info.addMember(m_tagName); | 2698 info.addMember(m_tagName); |
2696 info.addMember(m_attributeData); | 2699 info.addMember(m_attributeData); |
2697 } | 2700 } |
2698 | 2701 |
2699 } // namespace WebCore | 2702 } // namespace WebCore |
OLD | NEW |