| 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 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r
ights reserved. |
| 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
| 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
| 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. |
| (...skipping 2211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2222 m_lifecycle.advanceTo(DocumentLifecycle::Stopped); | 2222 m_lifecycle.advanceTo(DocumentLifecycle::Stopped); |
| 2223 | 2223 |
| 2224 // FIXME: Currently we call notifyContextDestroyed() only in | 2224 // FIXME: Currently we call notifyContextDestroyed() only in |
| 2225 // Document::detach(), which means that we don't call | 2225 // Document::detach(), which means that we don't call |
| 2226 // notifyContextDestroyed() for a document that doesn't get detached. | 2226 // notifyContextDestroyed() for a document that doesn't get detached. |
| 2227 // If such a document has any observer, the observer won't get | 2227 // If such a document has any observer, the observer won't get |
| 2228 // a contextDestroyed() notification. This can happen for a document | 2228 // a contextDestroyed() notification. This can happen for a document |
| 2229 // created by DOMImplementation::createDocument(). | 2229 // created by DOMImplementation::createDocument(). |
| 2230 DocumentLifecycleNotifier::notifyContextDestroyed(); | 2230 DocumentLifecycleNotifier::notifyContextDestroyed(); |
| 2231 ExecutionContext::notifyContextDestroyed(); | 2231 ExecutionContext::notifyContextDestroyed(); |
| 2232 |
| 2233 m_fetcher.clear(); |
| 2232 } | 2234 } |
| 2233 | 2235 |
| 2234 void Document::removeAllEventListeners() | 2236 void Document::removeAllEventListeners() |
| 2235 { | 2237 { |
| 2236 ContainerNode::removeAllEventListeners(); | 2238 ContainerNode::removeAllEventListeners(); |
| 2237 | 2239 |
| 2238 if (LocalDOMWindow* domWindow = this->domWindow()) | 2240 if (LocalDOMWindow* domWindow = this->domWindow()) |
| 2239 domWindow->removeAllEventListeners(); | 2241 domWindow->removeAllEventListeners(); |
| 2240 } | 2242 } |
| 2241 | 2243 |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2647 if (m_loadEventProgress < PageHideInProgress) { | 2649 if (m_loadEventProgress < PageHideInProgress) { |
| 2648 m_loadEventProgress = PageHideInProgress; | 2650 m_loadEventProgress = PageHideInProgress; |
| 2649 if (LocalDOMWindow* window = domWindow()) | 2651 if (LocalDOMWindow* window = domWindow()) |
| 2650 window->dispatchEvent(PageTransitionEvent::create(EventTypeNames
::pagehide, false), this); | 2652 window->dispatchEvent(PageTransitionEvent::create(EventTypeNames
::pagehide, false), this); |
| 2651 if (!m_frame) | 2653 if (!m_frame) |
| 2652 return; | 2654 return; |
| 2653 | 2655 |
| 2654 // The DocumentLoader (and thus its DocumentLoadTiming) might get de
stroyed | 2656 // The DocumentLoader (and thus its DocumentLoadTiming) might get de
stroyed |
| 2655 // while dispatching the event, so protect it to prevent writing the
end | 2657 // while dispatching the event, so protect it to prevent writing the
end |
| 2656 // time into freed memory. | 2658 // time into freed memory. |
| 2657 RefPtr<DocumentLoader> documentLoader = m_frame->loader().provision
alDocumentLoader(); | 2659 RefPtrWillBeRawPtr<DocumentLoader> documentLoader = m_frame->loader(
).provisionalDocumentLoader(); |
| 2658 m_loadEventProgress = UnloadEventInProgress; | 2660 m_loadEventProgress = UnloadEventInProgress; |
| 2659 RefPtrWillBeRawPtr<Event> unloadEvent(Event::create(EventTypeNames::
unload)); | 2661 RefPtrWillBeRawPtr<Event> unloadEvent(Event::create(EventTypeNames::
unload)); |
| 2660 if (documentLoader && !documentLoader->timing().unloadEventStart() &
& !documentLoader->timing().unloadEventEnd()) { | 2662 if (documentLoader && !documentLoader->timing().unloadEventStart() &
& !documentLoader->timing().unloadEventEnd()) { |
| 2661 DocumentLoadTiming& timing = documentLoader->timing(); | 2663 DocumentLoadTiming& timing = documentLoader->timing(); |
| 2662 ASSERT(timing.navigationStart()); | 2664 ASSERT(timing.navigationStart()); |
| 2663 timing.markUnloadEventStart(); | 2665 timing.markUnloadEventStart(); |
| 2664 m_frame->localDOMWindow()->dispatchEvent(unloadEvent, this); | 2666 m_frame->localDOMWindow()->dispatchEvent(unloadEvent, this); |
| 2665 timing.markUnloadEventEnd(); | 2667 timing.markUnloadEventEnd(); |
| 2666 } else { | 2668 } else { |
| 2667 m_frame->localDOMWindow()->dispatchEvent(unloadEvent, m_frame->d
ocument()); | 2669 m_frame->localDOMWindow()->dispatchEvent(unloadEvent, m_frame->d
ocument()); |
| (...skipping 2586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5254 return loader; | 5256 return loader; |
| 5255 } | 5257 } |
| 5256 | 5258 |
| 5257 Node* eventTargetNodeForDocument(Document* doc) | 5259 Node* eventTargetNodeForDocument(Document* doc) |
| 5258 { | 5260 { |
| 5259 if (!doc) | 5261 if (!doc) |
| 5260 return 0; | 5262 return 0; |
| 5261 Node* node = doc->focusedElement(); | 5263 Node* node = doc->focusedElement(); |
| 5262 if (!node && doc->isPluginDocument()) { | 5264 if (!node && doc->isPluginDocument()) { |
| 5263 PluginDocument* pluginDocument = toPluginDocument(doc); | 5265 PluginDocument* pluginDocument = toPluginDocument(doc); |
| 5264 node = pluginDocument->pluginNode(); | 5266 node = pluginDocument->pluginNode(); |
| 5265 } | 5267 } |
| 5266 if (!node && doc->isHTMLDocument()) | 5268 if (!node && doc->isHTMLDocument()) |
| 5267 node = doc->body(); | 5269 node = doc->body(); |
| 5268 if (!node) | 5270 if (!node) |
| 5269 node = doc->documentElement(); | 5271 node = doc->documentElement(); |
| 5270 return node; | 5272 return node; |
| 5271 } | 5273 } |
| 5272 | 5274 |
| 5273 void Document::adjustFloatQuadsForScrollAndAbsoluteZoom(Vector<FloatQuad>& quads
, LayoutObject& layoutObject) | 5275 void Document::adjustFloatQuadsForScrollAndAbsoluteZoom(Vector<FloatQuad>& quads
, LayoutObject& layoutObject) |
| 5274 { | 5276 { |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5770 #ifndef NDEBUG | 5772 #ifndef NDEBUG |
| 5771 using namespace blink; | 5773 using namespace blink; |
| 5772 void showLiveDocumentInstances() | 5774 void showLiveDocumentInstances() |
| 5773 { | 5775 { |
| 5774 WeakDocumentSet& set = liveDocumentSet(); | 5776 WeakDocumentSet& set = liveDocumentSet(); |
| 5775 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 5777 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 5776 for (Document* document : set) | 5778 for (Document* document : set) |
| 5777 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); | 5779 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); |
| 5778 } | 5780 } |
| 5779 #endif | 5781 #endif |
| OLD | NEW |