The setter of binaryType attribute in WebSocket should raise the exception.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Mar 2016 05:28:21 +0000 (05:28 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Mar 2016 05:28:21 +0000 (05:28 +0000)
commit2659c2b94774c9085109cb59e1b40974eadafa57
treedf0de22f56b892280afa8e5c77a3d36747e9b78d
parentf6a7eadd23da1ec20bad050ff8e2af5a1a19b8da
The setter of binaryType attribute in WebSocket should raise the exception.
https://bugs.webkit.org/show_bug.cgi?id=135874

Patch by Jinwoo Jeong <jw00.jeong@samsung.com> on 2016-03-20
Reviewed by Antonio Gomes.

Source/WebCore:

According to W3C WebSocket Specification, <https://www.w3.org/TR/2012/CR-websockets-20120920/>
when an invalid value is set on binaryType of WebSocket, a SyntaxError should be raised.

* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::setBinaryType): Add a parameter to set an exception.
* Modules/websockets/WebSocket.h: Ditto.
* Modules/websockets/WebSocket.idl: Update that setter of binaryType could raise an exception.

LayoutTests:

According to W3C WebSocket Specification, <https://www.w3.org/TR/2012/CR-websockets-20120920/>,
when an invalid value is set on binaryType of WebSocket, a SyntaxError should be raised.

* http/tests/websocket/tests/hybi/binary-type.html: Catch a syntax exception when binary type is set with invalid values.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198482 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/websocket/tests/hybi/binary-type-expected.txt
LayoutTests/http/tests/websocket/tests/hybi/binary-type.html
Source/WebCore/ChangeLog
Source/WebCore/Modules/websockets/WebSocket.cpp
Source/WebCore/Modules/websockets/WebSocket.h
Source/WebCore/Modules/websockets/WebSocket.idl