Chromium Code Reviews| 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 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
| 6 * rights reserved. | 6 * rights reserved. |
| 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. |
| 9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
| 10 * | 10 * |
| (...skipping 1790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1801 } | 1801 } |
| 1802 | 1802 |
| 1803 const AtomicString& Node::interfaceName() const { | 1803 const AtomicString& Node::interfaceName() const { |
| 1804 return EventTargetNames::Node; | 1804 return EventTargetNames::Node; |
| 1805 } | 1805 } |
| 1806 | 1806 |
| 1807 ExecutionContext* Node::getExecutionContext() const { | 1807 ExecutionContext* Node::getExecutionContext() const { |
| 1808 return document().contextDocument(); | 1808 return document().contextDocument(); |
| 1809 } | 1809 } |
| 1810 | 1810 |
| 1811 void Node::willMoveToNewDocument() { | |
| 1812 if (document().frameHost()) | |
|
bokan
2017/01/12 16:54:48
Could we pass in the newDocument and only do this
wjmaclean
2017/01/13 17:40:30
Done.
| |
| 1813 document().frameHost()->eventHandlerRegistry().didMoveOutOfFrameHost(*this); | |
| 1814 } | |
| 1815 | |
| 1811 void Node::didMoveToNewDocument(Document& oldDocument) { | 1816 void Node::didMoveToNewDocument(Document& oldDocument) { |
| 1812 TreeScopeAdopter::ensureDidMoveToNewDocumentWasCalled(oldDocument); | 1817 TreeScopeAdopter::ensureDidMoveToNewDocumentWasCalled(oldDocument); |
| 1813 | 1818 |
| 1814 if (const EventTargetData* eventTargetData = this->eventTargetData()) { | 1819 if (const EventTargetData* eventTargetData = this->eventTargetData()) { |
| 1815 const EventListenerMap& listenerMap = eventTargetData->eventListenerMap; | 1820 const EventListenerMap& listenerMap = eventTargetData->eventListenerMap; |
| 1816 if (!listenerMap.isEmpty()) { | 1821 if (!listenerMap.isEmpty()) { |
| 1817 for (const auto& type : listenerMap.eventTypes()) | 1822 for (const auto& type : listenerMap.eventTypes()) |
| 1818 document().addListenerTypeIfNeeded(type); | 1823 document().addListenerTypeIfNeeded(type); |
| 1819 } | 1824 } |
| 1820 } | 1825 } |
| 1821 | 1826 |
| 1822 oldDocument.markers().removeMarkers(this); | 1827 oldDocument.markers().removeMarkers(this); |
| 1823 if (oldDocument.frameHost() && !document().frameHost()) | 1828 if (document().frameHost()) |
|
bokan
2017/01/12 16:54:48
And to match the above, add a check that we're mov
wjmaclean
2017/01/13 17:40:30
Done.
Let me know if a DCHECK is what you had int
| |
| 1824 oldDocument.frameHost()->eventHandlerRegistry().didMoveOutOfFrameHost( | |
| 1825 *this); | |
| 1826 else if (document().frameHost() && !oldDocument.frameHost()) | |
| 1827 document().frameHost()->eventHandlerRegistry().didMoveIntoFrameHost(*this); | 1829 document().frameHost()->eventHandlerRegistry().didMoveIntoFrameHost(*this); |
| 1828 else if (oldDocument.frameHost() != document().frameHost()) | |
| 1829 EventHandlerRegistry::didMoveBetweenFrameHosts( | |
| 1830 *this, oldDocument.frameHost(), document().frameHost()); | |
| 1831 | 1830 |
| 1832 if (const HeapVector<TraceWrapperMember<MutationObserverRegistration>>* | 1831 if (const HeapVector<TraceWrapperMember<MutationObserverRegistration>>* |
| 1833 registry = mutationObserverRegistry()) { | 1832 registry = mutationObserverRegistry()) { |
| 1834 for (const auto& registration : *registry) { | 1833 for (const auto& registration : *registry) { |
| 1835 document().addMutationObserverTypes(registration->mutationTypes()); | 1834 document().addMutationObserverTypes(registration->mutationTypes()); |
| 1836 } | 1835 } |
| 1837 } | 1836 } |
| 1838 | 1837 |
| 1839 if (transientMutationObserverRegistry()) { | 1838 if (transientMutationObserverRegistry()) { |
| 1840 for (MutationObserverRegistration* registration : | 1839 for (MutationObserverRegistration* registration : |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2542 if (node) { | 2541 if (node) { |
| 2543 std::stringstream stream; | 2542 std::stringstream stream; |
| 2544 node->printNodePathTo(stream); | 2543 node->printNodePathTo(stream); |
| 2545 LOG(INFO) << stream.str(); | 2544 LOG(INFO) << stream.str(); |
| 2546 } else { | 2545 } else { |
| 2547 LOG(INFO) << "Cannot showNodePath for <null>"; | 2546 LOG(INFO) << "Cannot showNodePath for <null>"; |
| 2548 } | 2547 } |
| 2549 } | 2548 } |
| 2550 | 2549 |
| 2551 #endif | 2550 #endif |
| OLD | NEW |