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 2637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2648 cache->handleLoadComplete(this); | 2648 cache->handleLoadComplete(this); |
2649 else | 2649 else |
2650 cache->handleLayoutComplete(this); | 2650 cache->handleLayoutComplete(this); |
2651 } | 2651 } |
2652 } | 2652 } |
2653 | 2653 |
2654 if (svgExtensions()) | 2654 if (svgExtensions()) |
2655 accessSVGExtensions().startAnimations(); | 2655 accessSVGExtensions().startAnimations(); |
2656 } | 2656 } |
2657 | 2657 |
2658 bool Document::dispatchBeforeUnloadEvent(ChromeClient& chromeClient, bool isRelo
ad, bool& didAllowNavigation) | 2658 bool Document::dispatchBeforeUnloadEvent(ChromeClient& chromeClient, bool isRelo
ad, bool& didAllowNavigation, bool& eventListenerCalled) |
2659 { | 2659 { |
2660 if (!m_domWindow) | 2660 if (!m_domWindow) |
2661 return true; | 2661 return true; |
2662 | 2662 |
2663 if (!body()) | 2663 if (!body()) |
2664 return true; | 2664 return true; |
2665 | 2665 |
2666 if (processingBeforeUnload()) | 2666 if (processingBeforeUnload()) |
2667 return false; | 2667 return false; |
2668 | 2668 |
| 2669 if (m_domWindow->hasEventListeners(EventTypeNames::beforeunload)) |
| 2670 eventListenerCalled = true; |
2669 BeforeUnloadEvent* beforeUnloadEvent = BeforeUnloadEvent::create(); | 2671 BeforeUnloadEvent* beforeUnloadEvent = BeforeUnloadEvent::create(); |
2670 m_loadEventProgress = BeforeUnloadEventInProgress; | 2672 m_loadEventProgress = BeforeUnloadEventInProgress; |
2671 m_domWindow->dispatchEvent(beforeUnloadEvent, this); | 2673 m_domWindow->dispatchEvent(beforeUnloadEvent, this); |
2672 m_loadEventProgress = BeforeUnloadEventCompleted; | 2674 m_loadEventProgress = BeforeUnloadEventCompleted; |
2673 if (!beforeUnloadEvent->defaultPrevented()) | 2675 if (!beforeUnloadEvent->defaultPrevented()) |
2674 defaultEventHandler(beforeUnloadEvent); | 2676 defaultEventHandler(beforeUnloadEvent); |
2675 if (!frame() || beforeUnloadEvent->returnValue().isNull()) | 2677 if (!frame() || beforeUnloadEvent->returnValue().isNull()) |
2676 return true; | 2678 return true; |
2677 | 2679 |
2678 if (didAllowNavigation) { | 2680 if (didAllowNavigation) { |
(...skipping 3343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6022 } | 6024 } |
6023 | 6025 |
6024 void showLiveDocumentInstances() | 6026 void showLiveDocumentInstances() |
6025 { | 6027 { |
6026 WeakDocumentSet& set = liveDocumentSet(); | 6028 WeakDocumentSet& set = liveDocumentSet(); |
6027 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6029 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
6028 for (Document* document : set) | 6030 for (Document* document : set) |
6029 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get
String().utf8().data()); | 6031 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get
String().utf8().data()); |
6030 } | 6032 } |
6031 #endif | 6033 #endif |
OLD | NEW |