diff options
Diffstat (limited to 'src/3rdparty/webkit/WebCore/dom/ContainerNode.cpp')
-rw-r--r-- | src/3rdparty/webkit/WebCore/dom/ContainerNode.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/3rdparty/webkit/WebCore/dom/ContainerNode.cpp b/src/3rdparty/webkit/WebCore/dom/ContainerNode.cpp index 7274b5dc3c..5cd07819d9 100644 --- a/src/3rdparty/webkit/WebCore/dom/ContainerNode.cpp +++ b/src/3rdparty/webkit/WebCore/dom/ContainerNode.cpp @@ -23,6 +23,7 @@ #include "config.h" #include "ContainerNode.h" +#include "BeforeLoadEvent.h" #include "Cache.h" #include "ContainerNodeAlgorithms.h" #include "DeleteButtonController.h" @@ -909,4 +910,15 @@ static void dispatchChildRemovalEvents(Node* child) } } +bool ContainerNode::dispatchBeforeLoadEvent(const String& sourceURL) +{ + if (!document()->hasListenerType(Document::BEFORELOAD_LISTENER)) + return true; + + RefPtr<ContainerNode> protector(this); + RefPtr<BeforeLoadEvent> beforeLoadEvent = BeforeLoadEvent::create(sourceURL); + dispatchEvent(beforeLoadEvent.get()); + return !beforeLoadEvent->defaultPrevented(); +} + } // namespace WebCore |