Changeset 148072 in webkit
- Timestamp:
- Apr 9, 2013 6:11:50 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r148070 r148072 1 2013-04-09 Adam Klein <adamk@chromium.org> 2 3 Update Document's event listener type bitfield when adopting a Node 4 https://bugs.webkit.org/show_bug.cgi?id=114322 5 6 Reviewed by Darin Adler. 7 8 * fast/events/event-listener-moving-documents-expected.txt: Added. 9 * fast/events/event-listener-moving-documents.html: Added. 10 1 11 2013-04-09 Dongwoo Joshua Im <dw.im@samsung.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r148071 r148072 1 2013-04-09 Adam Klein <adamk@chromium.org> 2 3 Update Document's event listener type bitfield when adopting a Node 4 https://bugs.webkit.org/show_bug.cgi?id=114322 5 6 Reviewed by Darin Adler. 7 8 Without this, moving a Node between documents can silently deactivate 9 an event listener, if it's one of the types that whose creation is 10 optimized away by Document::hasListenerType. 11 12 An alternate approach would be to simply copy the old document's 13 bitfield over. It's a tradeoff between making adoption fast and making 14 the operation of any operation depending on these event types fast. 15 The latter seems like the right optimization given that adoption 16 doesn't happen very often. 17 18 Test: fast/events/event-listener-moving-documents.html 19 20 * dom/Node.cpp: 21 (WebCore::Node::didMoveToNewDocument): For each event listener type on the adopted node, update the new document's list of listener types. 22 1 23 2013-04-09 Dean Jackson <dino@apple.com> 2 24 -
trunk/Source/WebCore/dom/Node.cpp
r148026 r148072 2153 2153 TreeScopeAdopter::ensureDidMoveToNewDocumentWasCalled(oldDocument); 2154 2154 2155 if (const EventTargetData* eventTargetData = this->eventTargetData()) { 2156 const EventListenerMap& listenerMap = eventTargetData->eventListenerMap; 2157 if (!listenerMap.isEmpty()) { 2158 Vector<AtomicString> types = listenerMap.eventTypes(); 2159 for (unsigned i = 0; i < types.size(); ++i) 2160 document()->addListenerTypeIfNeeded(types[i]); 2161 } 2162 } 2163 2155 2164 if (AXObjectCache::accessibilityEnabled() && oldDocument) 2156 2165 if (AXObjectCache* cache = oldDocument->existingAXObjectCache()) 2157 2166 cache->remove(this); 2158 2159 // FIXME: Event listener types for this node should be set on the new owner document here.2160 2167 2161 2168 const EventListenerVector& wheelListeners = getEventListeners(eventNames().mousewheelEvent);
Note: See TracChangeset
for help on using the changeset viewer.