Commit 854c86ea authored by yutak@chromium.org's avatar yutak@chromium.org
Browse files

2011-05-12 Yuta Kitamura <yutak@chromium.org>

        Reviewed by Kent Tamura.

        WebSocket add new event: CloseEvent
        https://bugs.webkit.org/show_bug.cgi?id=35573

        Original patch was written by Fumitoshi Ukai <ukai@chromium.org>.
        I modified the test close-event.html slightly so that it passes on Chromium.
        I also updated a few test results that are affected by this change.

        * fast/dom/Window/window-properties-expected.txt:
        * fast/dom/Window/window-property-descriptors-expected.txt:
        * fast/dom/prototype-inheritance-expected.txt:
        * fast/js/global-constructors-expected.txt:
        * http/tests/websocket/tests/close-event-expected.txt: Added.
        * http/tests/websocket/tests/close-event.html: Added.
        * platform/chromium/fast/dom/prototype-inheritance-expected.txt:
2011-05-12  Yuta Kitamura  <yutak@chromium.org>

        Reviewed by Kent Tamura.

        WebSocket add new event: CloseEvent
        https://bugs.webkit.org/show_bug.cgi?id=35573

        Original patch was written by Fumitoshi Ukai <ukai@chromium.org>.
        I added CloseEvent constructor to DOMWindow, so it can be referred
        in the new test (close-event.html).

        Test: http/tests/websocket/tests/close-event.html

        * CMakeLists.txt:
        * CodeGenerators.pri:
        * DerivedSources.cpp:
        * DerivedSources.make:
        * GNUmakefile.list.am:
        * WebCore.gypi:
        * WebCore.pro:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSEventCustom.cpp:
        (WebCore::toJS):
        * bindings/v8/custom/V8EventCustom.cpp:
        (WebCore::toV8):
        * dom/Event.cpp:
        (WebCore::Event::isCloseEvent):
        * dom/Event.h:
        * page/DOMWindow.idl: Add CloseEvent constructor.
        * websockets/CloseEvent.h: Added.
        (WebCore::CloseEvent::isCloseEvent):
        (WebCore::CloseEvent::create):
        (WebCore::CloseEvent::initCloseEvent):
        (WebCore::CloseEvent::wasClean):
        (WebCore::CloseEvent::CloseEvent):
        * websockets/CloseEvent.idl: Added.
        * websockets/WebSocket.cpp:
        (WebCore::WebSocket::didClose):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@86315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 550a18c6
2011-05-12 Yuta Kitamura <yutak@chromium.org>
Reviewed by Kent Tamura.
WebSocket add new event: CloseEvent
https://bugs.webkit.org/show_bug.cgi?id=35573
Original patch was written by Fumitoshi Ukai <ukai@chromium.org>.
I modified the test close-event.html slightly so that it passes on Chromium.
I also updated a few test results that are affected by this change.
* fast/dom/Window/window-properties-expected.txt:
* fast/dom/Window/window-property-descriptors-expected.txt:
* fast/dom/prototype-inheritance-expected.txt:
* fast/js/global-constructors-expected.txt:
* http/tests/websocket/tests/close-event-expected.txt: Added.
* http/tests/websocket/tests/close-event.html: Added.
* platform/chromium/fast/dom/prototype-inheritance-expected.txt:
2011-05-12 Ben Wells <benwells@chromium.org>
 
Reviewed by Simon Fraser.
......@@ -479,6 +479,32 @@ window.Clipboard.prototype.clearData [function]
window.Clipboard.prototype.getData [function]
window.Clipboard.prototype.setData [function]
window.Clipboard.prototype.setDragImage [function]
window.CloseEvent [object CloseEventConstructor]
window.CloseEvent.prototype [object CloseEventPrototype]
window.CloseEvent.prototype.AT_TARGET [number]
window.CloseEvent.prototype.BLUR [number]
window.CloseEvent.prototype.BUBBLING_PHASE [number]
window.CloseEvent.prototype.CAPTURING_PHASE [number]
window.CloseEvent.prototype.CHANGE [number]
window.CloseEvent.prototype.CLICK [number]
window.CloseEvent.prototype.DBLCLICK [number]
window.CloseEvent.prototype.DRAGDROP [number]
window.CloseEvent.prototype.FOCUS [number]
window.CloseEvent.prototype.KEYDOWN [number]
window.CloseEvent.prototype.KEYPRESS [number]
window.CloseEvent.prototype.KEYUP [number]
window.CloseEvent.prototype.MOUSEDOWN [number]
window.CloseEvent.prototype.MOUSEDRAG [number]
window.CloseEvent.prototype.MOUSEMOVE [number]
window.CloseEvent.prototype.MOUSEOUT [number]
window.CloseEvent.prototype.MOUSEOVER [number]
window.CloseEvent.prototype.MOUSEUP [number]
window.CloseEvent.prototype.SELECT [number]
window.CloseEvent.prototype.initCloseEvent [function]
window.CloseEvent.prototype.initEvent [function]
window.CloseEvent.prototype.preventDefault [function]
window.CloseEvent.prototype.stopImmediatePropagation [function]
window.CloseEvent.prototype.stopPropagation [function]
window.Comment [object CommentConstructor]
window.Comment.prototype [printed above as window.CharacterData.prototype]
window.Counter [object CounterConstructor]
......
......@@ -30,6 +30,7 @@ PASS typeof Object.getOwnPropertyDescriptor(window, 'CharacterData') is 'object'
PASS typeof Object.getOwnPropertyDescriptor(window, 'ClientRect') is 'object'
PASS typeof Object.getOwnPropertyDescriptor(window, 'ClientRectList') is 'object'
PASS typeof Object.getOwnPropertyDescriptor(window, 'Clipboard') is 'object'
PASS typeof Object.getOwnPropertyDescriptor(window, 'CloseEvent') is 'object'
PASS typeof Object.getOwnPropertyDescriptor(window, 'Comment') is 'object'
PASS typeof Object.getOwnPropertyDescriptor(window, 'Counter') is 'object'
PASS typeof Object.getOwnPropertyDescriptor(window, 'DOMException') is 'object'
......
......@@ -57,6 +57,8 @@ PASS inner.ClientRectList.isInner is true
PASS inner.ClientRectList.constructor.isInner is true
PASS inner.Clipboard.isInner is true
PASS inner.Clipboard.constructor.isInner is true
PASS inner.CloseEvent.isInner is true
PASS inner.CloseEvent.constructor.isInner is true
PASS inner.Comment.isInner is true
PASS inner.Comment.constructor.isInner is true
PASS inner.Counter.isInner is true
......
......@@ -28,6 +28,7 @@ PASS CharacterData.toString() is '[object CharacterDataConstructor]'
PASS ClientRect.toString() is '[object ClientRectConstructor]'
PASS ClientRectList.toString() is '[object ClientRectListConstructor]'
PASS Clipboard.toString() is '[object ClipboardConstructor]'
PASS CloseEvent.toString() is '[object CloseEventConstructor]'
PASS Comment.toString() is '[object CommentConstructor]'
PASS Counter.toString() is '[object CounterConstructor]'
PASS DOMException.toString() is '[object DOMExceptionConstructor]'
......
Make sure WebSocket fires CloseEvent when closed.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
WebSocket is open
Received: 'Hello from Simple WSH.'
Closed
PASS closeEventType is "close"
PASS 'wasClean' in closeEvent is true
PASS Object.getPrototypeOf(closeEvent) === CloseEvent.prototype is true
PASS Object.getPrototypeOf(closeEvent) !== Event.prototype is true
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<link rel="stylesheet" href="../../../js-test-resources/js-test-style.css">
<script src="../../../js-test-resources/js-test-pre.js"></script>
</head>
<body>
<div id="description"></div>
<div id="console"></div>
<script type="text/javascript">
description("Make sure WebSocket fires CloseEvent when closed.");
window.jsTestIsAsync = true;
var ws = new WebSocket("ws://127.0.0.1:8880/websocket/tests/simple");
ws.onopen = function()
{
debug("WebSocket is open");
};
ws.onmessage = function(messageEvent)
{
debug("Received: '" + messageEvent.data + "'");
};
var closeEvent;
var closeEventType;
ws.onclose = function(event)
{
debug("Closed");
closeEvent = event;
closeEventType = closeEvent.type;
shouldBe("closeEventType", '"close"')
shouldBeTrue("'wasClean' in closeEvent");
shouldBeTrue("Object.getPrototypeOf(closeEvent) === CloseEvent.prototype");
shouldBeTrue("Object.getPrototypeOf(closeEvent) !== Event.prototype");
finishJSTest();
};
var successfullyParsed = true;
</script>
<script src="../../../js-test-resources/js-test-post.js"></script>
</body>
</html>
......@@ -57,6 +57,8 @@ PASS inner.ClientRectList.isInner is true
PASS inner.ClientRectList.constructor.isInner is true
PASS inner.Clipboard.isInner is true
PASS inner.Clipboard.constructor.isInner is true
PASS inner.CloseEvent.isInner is true
PASS inner.CloseEvent.constructor.isInner is true
PASS inner.Comment.isInner is true
PASS inner.Comment.constructor.isInner is true
PASS inner.Counter.isInner is true
......
......@@ -399,6 +399,7 @@ SET(WebCore_IDL_FILES
webaudio/LowPass2FilterNode.idl
webaudio/RealtimeAnalyserNode.idl
websockets/CloseEvent.idl
websockets/WebSocket.idl
workers/AbstractWorker.idl
......
2011-05-12 Yuta Kitamura <yutak@chromium.org>
Reviewed by Kent Tamura.
WebSocket add new event: CloseEvent
https://bugs.webkit.org/show_bug.cgi?id=35573
Original patch was written by Fumitoshi Ukai <ukai@chromium.org>.
I added CloseEvent constructor to DOMWindow, so it can be referred
in the new test (close-event.html).
Test: http/tests/websocket/tests/close-event.html
* CMakeLists.txt:
* CodeGenerators.pri:
* DerivedSources.cpp:
* DerivedSources.make:
* GNUmakefile.list.am:
* WebCore.gypi:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSEventCustom.cpp:
(WebCore::toJS):
* bindings/v8/custom/V8EventCustom.cpp:
(WebCore::toV8):
* dom/Event.cpp:
(WebCore::Event::isCloseEvent):
* dom/Event.h:
* page/DOMWindow.idl: Add CloseEvent constructor.
* websockets/CloseEvent.h: Added.
(WebCore::CloseEvent::isCloseEvent):
(WebCore::CloseEvent::create):
(WebCore::CloseEvent::initCloseEvent):
(WebCore::CloseEvent::wasClean):
(WebCore::CloseEvent::CloseEvent):
* websockets/CloseEvent.idl: Added.
* websockets/WebSocket.cpp:
(WebCore::WebSocket::didClose):
2011-05-12 Ben Wells <benwells@chromium.org>
 
Reviewed by Simon Fraser.
......@@ -529,6 +529,7 @@ IDL_BINDINGS += \
webaudio/JavaScriptAudioNode.idl \
webaudio/LowPass2FilterNode.idl \
webaudio/RealtimeAnalyserNode.idl \
websockets/CloseEvent.idl \
websockets/WebSocket.idl \
workers/AbstractWorker.idl \
workers/DedicatedWorkerContext.idl \
......
......@@ -46,6 +46,7 @@
#include "JSClientRect.cpp"
#include "JSClientRectList.cpp"
#include "JSClipboard.cpp"
#include "JSCloseEvent.cpp"
#include "JSComment.cpp"
#include "JSCompositionEvent.cpp"
#include "JSConsole.cpp"
......
......@@ -122,6 +122,7 @@ DOM_CLASSES = \
ClientRect \
ClientRectList \
Clipboard \
CloseEvent \
Comment \
CompositionEvent \
Console \
......
......@@ -3553,6 +3553,7 @@ webcore_sources += \
Source/WebCore/svg/SVGZoomEvent.cpp \
Source/WebCore/svg/SVGZoomEvent.h \
Source/WebCore/WebCorePrefix.h \
Source/WebCore/websockets/CloseEvent.h \
Source/WebCore/websockets/ThreadableWebSocketChannelClientWrapper.h \
Source/WebCore/websockets/ThreadableWebSocketChannel.cpp \
Source/WebCore/websockets/ThreadableWebSocketChannel.h \
......@@ -4456,6 +4457,8 @@ endif
# ----
if ENABLE_WEB_SOCKETS
webcore_built_sources += \
DerivedSources/WebCore/JSCloseEvent.cpp \
DerivedSources/WebCore/JSCloseEvent.h \
DerivedSources/WebCore/JSWebSocket.cpp \
DerivedSources/WebCore/JSWebSocket.h
endif # END ENABLE_WEB_SOCKETS
......
......@@ -1410,6 +1410,7 @@
'webaudio/LowPass2FilterNode.idl',
'webaudio/OfflineAudioCompletionEvent.idl',
'webaudio/RealtimeAnalyserNode.idl',
'websockets/CloseEvent.idl',
'websockets/WebSocket.idl',
'workers/AbstractWorker.idl',
'workers/DedicatedWorkerContext.idl',
......@@ -5956,6 +5957,7 @@
'webaudio/RealtimeAnalyser.h',
'webaudio/RealtimeAnalyserNode.cpp',
'webaudio/RealtimeAnalyserNode.h',
'websockets/CloseEvent.h',
'websockets/ThreadableWebSocketChannel.cpp',
'websockets/ThreadableWebSocketChannel.h',
'websockets/ThreadableWebSocketChannelClientWrapper.h',
......
......@@ -3374,6 +3374,7 @@ SOURCES += \
contains(DEFINES, ENABLE_WEB_SOCKETS=1) {
HEADERS += \
websockets/CloseEvent.h \
websockets/ThreadableWebSocketChannel.h \
websockets/ThreadableWebSocketChannelClientWrapper.h \
websockets/WebSocket.h \
......
......@@ -67121,6 +67121,10 @@
<Filter
Name="websockets"
>
<File
RelativePath="..\websockets\CloseEvent.h"
>
</File>
<File
RelativePath="..\websockets\ThreadableWebSocketChannel.cpp"
>
......@@ -1361,6 +1361,7 @@
521D46F611AEC98100514613 /* KillRingMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 521D46F511AEC98100514613 /* KillRingMac.mm */; };
521D46F811AEC9B100514613 /* KillRing.h in Headers */ = {isa = PBXBuildFile; fileRef = 521D46F711AEC9B100514613 /* KillRing.h */; };
54C50F7B0E801DF3009832A0 /* XMLDocumentParserLibxml2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 54C50F7A0E801DF3009832A0 /* XMLDocumentParserLibxml2.cpp */; };
51FB54F5113E364200821176 /* CloseEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 51FB54F4113E364200821176 /* CloseEvent.h */; };
550A0BC9085F6039007353D6 /* QualifiedName.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 550A0BC7085F6039007353D6 /* QualifiedName.cpp */; };
550A0BCA085F6039007353D6 /* QualifiedName.h in Headers */ = {isa = PBXBuildFile; fileRef = 550A0BC8085F6039007353D6 /* QualifiedName.h */; settings = {ATTRIBUTES = (Private, ); }; };
5905ADBF1302F3CE00F116DF /* XMLTreeViewer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5905ADBD1302F3CE00F116DF /* XMLTreeViewer.cpp */; };
......@@ -1415,6 +1416,8 @@
5D88EE9211407FF400BC3ABC /* DOMSVGFEMorphologyElementInternal.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 8422418B107E786F00766A87 /* DOMSVGFEMorphologyElementInternal.h */; };
5D925B670F64D4DD00B847F0 /* ScrollBehavior.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D925B650F64D4DD00B847F0 /* ScrollBehavior.cpp */; };
5D925B680F64D4DD00B847F0 /* ScrollBehavior.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D925B660F64D4DD00B847F0 /* ScrollBehavior.h */; settings = {ATTRIBUTES = (Private, ); }; };
51FB5505113E3E9100821176 /* JSCloseEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51FB5503113E3E9100821176 /* JSCloseEvent.cpp */; };
51FB5504113E3E9100821176 /* JSCloseEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 51FB5502113E3E9100821176 /* JSCloseEvent.h */; };
5DA5E0FC102B953800088CF9 /* JSWebSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5DA5E0FA102B953800088CF9 /* JSWebSocket.cpp */; };
5DA5E0FD102B953800088CF9 /* JSWebSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DA5E0FB102B953800088CF9 /* JSWebSocket.h */; };
5DB1BC6A10715A6400EFAA49 /* TransformSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DB1BC6810715A6400EFAA49 /* TransformSource.h */; };
......@@ -7882,6 +7885,8 @@
521D46F511AEC98100514613 /* KillRingMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KillRingMac.mm; sourceTree = "<group>"; };
521D46F711AEC9B100514613 /* KillRing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KillRing.h; sourceTree = "<group>"; };
54C50F7A0E801DF3009832A0 /* XMLDocumentParserLibxml2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XMLDocumentParserLibxml2.cpp; sourceTree = "<group>"; };
51FB54F4113E364200821176 /* CloseEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CloseEvent.h; sourceTree = "<group>"; };
51FB54F6113E365900821176 /* CloseEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CloseEvent.idl; sourceTree = "<group>"; };
550A0BC7085F6039007353D6 /* QualifiedName.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = QualifiedName.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
550A0BC8085F6039007353D6 /* QualifiedName.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = QualifiedName.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
5905ADBD1302F3CE00F116DF /* XMLTreeViewer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XMLTreeViewer.cpp; sourceTree = "<group>"; };
......@@ -7937,6 +7942,8 @@
5D87BB8211E3ED8600702B6F /* ExportFileGenerator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ExportFileGenerator.cpp; path = DerivedSources/WebCore/ExportFileGenerator.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
5D925B650F64D4DD00B847F0 /* ScrollBehavior.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollBehavior.cpp; sourceTree = "<group>"; };
5D925B660F64D4DD00B847F0 /* ScrollBehavior.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollBehavior.h; sourceTree = "<group>"; };
51FB5503113E3E9100821176 /* JSCloseEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSCloseEvent.cpp; path = JSCloseEvent.cpp; sourceTree = "<group>"; };
51FB5502113E3E9100821176 /* JSCloseEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSCloseEvent.h; path = JSCloseEvent.h; sourceTree = "<group>"; };
5DA5E0FA102B953800088CF9 /* JSWebSocket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebSocket.cpp; sourceTree = "<group>"; };
5DA5E0FB102B953800088CF9 /* JSWebSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebSocket.h; sourceTree = "<group>"; };
5DB1BC6810715A6400EFAA49 /* TransformSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TransformSource.h; sourceTree = "<group>"; };
......@@ -13772,6 +13779,8 @@
518A34BD1026C831001B6896 /* websockets */ = {
isa = PBXGroup;
children = (
51FB54F4113E364200821176 /* CloseEvent.h */,
51FB54F6113E365900821176 /* CloseEvent.idl */,
5112247110CFB8C6008099D7 /* ThreadableWebSocketChannel.cpp */,
5112247310CFB8D8008099D7 /* ThreadableWebSocketChannel.h */,
5112247510CFB8E8008099D7 /* ThreadableWebSocketChannelClientWrapper.h */,
......@@ -13838,6 +13847,8 @@
5DA5E0F9102B950400088CF9 /* WebSockets */ = {
isa = PBXGroup;
children = (
51FB5503113E3E9100821176 /* JSCloseEvent.cpp */,
51FB5502113E3E9100821176 /* JSCloseEvent.h */,
5DA5E0FA102B953800088CF9 /* JSWebSocket.cpp */,
5DA5E0FB102B953800088CF9 /* JSWebSocket.h */,
);
......@@ -19857,6 +19868,7 @@
4B8AF4AA0B1CE02B00687690 /* ClipboardAccessPolicy.h in Headers */,
85031B400A44EFC700F992E0 /* ClipboardEvent.h in Headers */,
93F199E708245E59001E9ABC /* ClipboardMac.h in Headers */,
51FB54F5113E364200821176 /* CloseEvent.h in Headers */,
C0C054CB1118C8E400CE2636 /* CodeGenerator.pm in Headers */,
BC5EB5DF0E81B9AB00B25965 /* CollapsedBorderValue.h in Headers */,
93C441F00F813A1A00C1A634 /* CollectionCache.h in Headers */,
......@@ -21270,6 +21282,7 @@
BCC065880F3CE2A700CD2D87 /* JSClientRect.h in Headers */,
BCC0658A0F3CE2A700CD2D87 /* JSClientRectList.h in Headers */,
BCA83E500D7CE1E9003421A8 /* JSClipboard.h in Headers */,
51FB5504113E3E9100821176 /* JSCloseEvent.h in Headers */,
93F9B6E10BA0FB7200854064 /* JSComment.h in Headers */,
79AC9219109945C80021266E /* JSCompositionEvent.h in Headers */,
BC98543E0CD3D98C00069BC1 /* JSConsole.h in Headers */,
......@@ -24063,6 +24076,7 @@
BCC065890F3CE2A700CD2D87 /* JSClientRectList.cpp in Sources */,
BCA83E4F0D7CE1E9003421A8 /* JSClipboard.cpp in Sources */,
BCA83E520D7CE205003421A8 /* JSClipboardCustom.cpp in Sources */,
51FB5505113E3E9100821176 /* JSCloseEvent.cpp in Sources */,
93F9B6E00BA0FB7200854064 /* JSComment.cpp in Sources */,
79AC9218109945C80021266E /* JSCompositionEvent.cpp in Sources */,
BC98543D0CD3D98B00069BC1 /* JSConsole.cpp in Sources */,
......@@ -105,6 +105,11 @@
#include "OfflineAudioCompletionEvent.h"
#endif
#if ENABLE(WEB_SOCKETS)
#include "CloseEvent.h"
#include "JSCloseEvent.h"
#endif
using namespace JSC;
namespace WebCore {
......@@ -198,6 +203,10 @@ JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, Event* event)
#if ENABLE(INPUT_SPEECH)
else if (event->isSpeechInputEvent())
wrapper = CREATE_DOM_WRAPPER(exec, globalObject, SpeechInputEvent, event);
#endif
#if ENABLE(WEB_SOCKETS)
else if (event->isCloseEvent())
wrapper = CREATE_DOM_WRAPPER(exec, globalObject, CloseEvent, event);
#endif
else
wrapper = CREATE_DOM_WRAPPER(exec, globalObject, Event, event);
......
......@@ -38,6 +38,7 @@
#include "V8BeforeLoadEvent.h"
#include "V8Binding.h"
#include "V8Clipboard.h"
#include "V8CloseEvent.h"
#include "V8CompositionEvent.h"
#include "V8CustomEvent.h"
#include "V8DeviceMotionEvent.h"
......@@ -179,6 +180,10 @@ v8::Handle<v8::Value> toV8(Event* impl)
#endif
if (impl->isCustomEvent())
return toV8(static_cast<CustomEvent*>(impl));
#if ENABLE(WEB_SOCKETS)
if (impl->isCloseEvent())
return toV8(static_cast<CloseEvent*>(impl));
#endif
return V8Event::wrap(impl);
}
} // namespace WebCore
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment