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 2638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2649 if (m_loadEventProgress < PageHideInProgress) { | 2649 if (m_loadEventProgress < PageHideInProgress) { |
2650 m_loadEventProgress = PageHideInProgress; | 2650 m_loadEventProgress = PageHideInProgress; |
2651 if (LocalDOMWindow* window = domWindow()) | 2651 if (LocalDOMWindow* window = domWindow()) |
2652 window->dispatchEvent(PageTransitionEvent::create(EventTypeNames
::pagehide, false), this); | 2652 window->dispatchEvent(PageTransitionEvent::create(EventTypeNames
::pagehide, false), this); |
2653 if (!m_frame) | 2653 if (!m_frame) |
2654 return; | 2654 return; |
2655 | 2655 |
2656 // The DocumentLoader (and thus its DocumentLoadTiming) might get de
stroyed | 2656 // The DocumentLoader (and thus its DocumentLoadTiming) might get de
stroyed |
2657 // 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 |
2658 // time into freed memory. | 2658 // time into freed memory. |
2659 RefPtr<DocumentLoader> documentLoader = m_frame->loader().provision
alDocumentLoader(); | 2659 RefPtrWillBeRawPtr<DocumentLoader> documentLoader = m_frame->loader(
).provisionalDocumentLoader(); |
2660 m_loadEventProgress = UnloadEventInProgress; | 2660 m_loadEventProgress = UnloadEventInProgress; |
2661 RefPtrWillBeRawPtr<Event> unloadEvent(Event::create(EventTypeNames::
unload)); | 2661 RefPtrWillBeRawPtr<Event> unloadEvent(Event::create(EventTypeNames::
unload)); |
2662 if (documentLoader && !documentLoader->timing().unloadEventStart() &
& !documentLoader->timing().unloadEventEnd()) { | 2662 if (documentLoader && !documentLoader->timing().unloadEventStart() &
& !documentLoader->timing().unloadEventEnd()) { |
2663 DocumentLoadTiming& timing = documentLoader->timing(); | 2663 DocumentLoadTiming& timing = documentLoader->timing(); |
2664 ASSERT(timing.navigationStart()); | 2664 ASSERT(timing.navigationStart()); |
2665 timing.markUnloadEventStart(); | 2665 timing.markUnloadEventStart(); |
2666 m_frame->localDOMWindow()->dispatchEvent(unloadEvent, this); | 2666 m_frame->localDOMWindow()->dispatchEvent(unloadEvent, this); |
2667 timing.markUnloadEventEnd(); | 2667 timing.markUnloadEventEnd(); |
2668 } else { | 2668 } else { |
2669 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... |
5256 return loader; | 5256 return loader; |
5257 } | 5257 } |
5258 | 5258 |
5259 Node* eventTargetNodeForDocument(Document* doc) | 5259 Node* eventTargetNodeForDocument(Document* doc) |
5260 { | 5260 { |
5261 if (!doc) | 5261 if (!doc) |
5262 return 0; | 5262 return 0; |
5263 Node* node = doc->focusedElement(); | 5263 Node* node = doc->focusedElement(); |
5264 if (!node && doc->isPluginDocument()) { | 5264 if (!node && doc->isPluginDocument()) { |
5265 PluginDocument* pluginDocument = toPluginDocument(doc); | 5265 PluginDocument* pluginDocument = toPluginDocument(doc); |
5266 node = pluginDocument->pluginNode(); | 5266 node = pluginDocument->pluginNode(); |
5267 } | 5267 } |
5268 if (!node && doc->isHTMLDocument()) | 5268 if (!node && doc->isHTMLDocument()) |
5269 node = doc->body(); | 5269 node = doc->body(); |
5270 if (!node) | 5270 if (!node) |
5271 node = doc->documentElement(); | 5271 node = doc->documentElement(); |
5272 return node; | 5272 return node; |
5273 } | 5273 } |
5274 | 5274 |
5275 void Document::adjustFloatQuadsForScrollAndAbsoluteZoom(Vector<FloatQuad>& quads
, LayoutObject& layoutObject) | 5275 void Document::adjustFloatQuadsForScrollAndAbsoluteZoom(Vector<FloatQuad>& quads
, LayoutObject& layoutObject) |
5276 { | 5276 { |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5766 #ifndef NDEBUG | 5766 #ifndef NDEBUG |
5767 using namespace blink; | 5767 using namespace blink; |
5768 void showLiveDocumentInstances() | 5768 void showLiveDocumentInstances() |
5769 { | 5769 { |
5770 WeakDocumentSet& set = liveDocumentSet(); | 5770 WeakDocumentSet& set = liveDocumentSet(); |
5771 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 5771 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
5772 for (Document* document : set) | 5772 for (Document* document : set) |
5773 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); | 5773 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); |
5774 } | 5774 } |
5775 #endif | 5775 #endif |
OLD | NEW |