Bug 135874 - The setter of binaryType attribute in WebSocket should raise the exception.
Summary: The setter of binaryType attribute in WebSocket should raise the exception.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-12 22:15 PDT by Jinwoo Jeong
Modified: 2016-03-20 22:28 PDT (History)
7 users (show)

See Also:


Attachments
Patch (3.33 KB, patch)
2014-08-12 22:22 PDT, Jinwoo Jeong
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from webkit-ews-14 for mac-mountainlion-wk2 (474.98 KB, application/zip)
2014-08-12 23:17 PDT, Build Bot
no flags Details
Archive of layout-test-results from webkit-ews-06 for mac-mountainlion (496.20 KB, application/zip)
2014-08-12 23:42 PDT, Build Bot
no flags Details
Modify a test related with websocket. (6.20 KB, patch)
2014-08-13 00:00 PDT, Jinwoo Jeong
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from webkit-ews-06 for mac-mountainlion (494.78 KB, application/zip)
2014-08-13 01:19 PDT, Build Bot
no flags Details
Archive of layout-test-results from webkit-ews-05 for mac-mountainlion (497.81 KB, application/zip)
2014-08-13 02:20 PDT, Build Bot
no flags Details
Archive of layout-test-results from webkit-ews-14 for mac-mountainlion-wk2 (499.61 KB, application/zip)
2014-08-13 02:55 PDT, Build Bot
no flags Details
Modify typos on a test html file. (6.20 KB, patch)
2014-08-13 21:43 PDT, Jinwoo Jeong
no flags Details | Formatted Diff | Diff
Modify an expected file related with a websocket binary-type test (6.01 KB, patch)
2014-08-20 19:09 PDT, Jinwoo Jeong
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from webkit-ews-02 for mac-mountainlion (499.62 KB, application/zip)
2014-08-20 20:32 PDT, Build Bot
no flags Details
Archive of layout-test-results from webkit-ews-08 for mac-mountainlion (498.30 KB, application/zip)
2014-08-20 21:30 PDT, Build Bot
no flags Details
Modify a test file and an expected file. (6.21 KB, patch)
2014-08-21 21:02 PDT, Jinwoo Jeong
no flags Details | Formatted Diff | Diff
Patch (6.93 KB, patch)
2016-03-19 00:15 PDT, Jinwoo Jeong
no flags Details | Formatted Diff | Diff
Patch (6.93 KB, patch)
2016-03-20 21:01 PDT, Jinwoo Jeong
no flags Details | Formatted Diff | Diff
patch for landing (7.01 KB, patch)
2016-03-20 21:12 PDT, Jinwoo Jeong
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jinwoo Jeong 2014-08-12 22:15:13 PDT
According to W3C WebSocket Specification,
when any value exclusive of 'blob' or 'arraybuffer' is set on binaryType of WebSocket, a SyntaxError should be raised.
Comment 1 Jinwoo Jeong 2014-08-12 22:22:44 PDT
Created attachment 236498 [details]
Patch
Comment 2 Build Bot 2014-08-12 23:17:11 PDT
Comment on attachment 236498 [details]
Patch

Attachment 236498 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/4999644836790272

New failing tests:
http/tests/websocket/tests/hybi/binary-type.html
Comment 3 Build Bot 2014-08-12 23:17:13 PDT
Created attachment 236500 [details]
Archive of layout-test-results from webkit-ews-14 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-14  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.5
Comment 4 Build Bot 2014-08-12 23:42:01 PDT
Comment on attachment 236498 [details]
Patch

Attachment 236498 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/5983372736200704

New failing tests:
http/tests/websocket/tests/hybi/binary-type.html
Comment 5 Build Bot 2014-08-12 23:42:04 PDT
Created attachment 236501 [details]
Archive of layout-test-results from webkit-ews-06 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-06  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 6 Jinwoo Jeong 2014-08-13 00:00:04 PDT
Created attachment 236502 [details]
Modify a test related with websocket.
Comment 7 Build Bot 2014-08-13 01:19:33 PDT
Comment on attachment 236502 [details]
Modify a test related with websocket.

Attachment 236502 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/5704798808571904

New failing tests:
http/tests/websocket/tests/hybi/binary-type.html
Comment 8 Build Bot 2014-08-13 01:19:35 PDT
Created attachment 236504 [details]
Archive of layout-test-results from webkit-ews-06 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-06  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 9 Build Bot 2014-08-13 02:20:40 PDT
Comment on attachment 236502 [details]
Modify a test related with websocket.

Attachment 236502 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/5165196498698240

New failing tests:
http/tests/websocket/tests/hybi/binary-type.html
Comment 10 Build Bot 2014-08-13 02:20:43 PDT
Created attachment 236506 [details]
Archive of layout-test-results from webkit-ews-05 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-05  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 11 Build Bot 2014-08-13 02:55:03 PDT
Comment on attachment 236502 [details]
Modify a test related with websocket.

Attachment 236502 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/5273852728836096

New failing tests:
http/tests/websocket/tests/hybi/binary-type.html
Comment 12 Build Bot 2014-08-13 02:55:05 PDT
Created attachment 236508 [details]
Archive of layout-test-results from webkit-ews-14 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-14  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.5
Comment 13 Jinwoo Jeong 2014-08-13 21:43:22 PDT
Created attachment 236578 [details]
Modify typos on a test html file.
Comment 14 Darin Adler 2014-08-13 22:22:06 PDT
Comment on attachment 236578 [details]
Modify typos on a test html file.

View in context: https://bugs.webkit.org/attachment.cgi?id=236578&action=review

Code change is OK, test change is not. See comments below.

> LayoutTests/http/tests/websocket/tests/hybi/binary-type.html:12
> +var syntaxErr = "SyntaxError";

This is not needed.

> LayoutTests/http/tests/websocket/tests/hybi/binary-type.html:-21
> -debug("Set invalid values to binaryType. They should be ignored. No exception should be thrown.");

I don’t think this is needed at all. We should just delete it and not add new debug lines.

> LayoutTests/http/tests/websocket/tests/hybi/binary-type.html:-24
> -ws.binaryType = "Blob";
> -shouldBeEqualToString("ws.binaryType", "blob");

The change needed here is much smaller than what's done below. It should just be this.

    shouldThrow("ws.binaryType = 'Blob'", "SyntaxError");
    shouldBeEqualToString("ws.binaryType", "blob");

But also, binary-type-expected.txt has to be updated too since the expected results are changing.
Comment 15 Jinwoo Jeong 2014-08-20 19:09:50 PDT
Created attachment 236908 [details]
Modify an expected file related with a websocket binary-type test
Comment 16 Build Bot 2014-08-20 20:32:23 PDT
Comment on attachment 236908 [details]
Modify an expected file related with a websocket binary-type test

Attachment 236908 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/4535230291509248

New failing tests:
http/tests/websocket/tests/hybi/binary-type.html
Comment 17 Build Bot 2014-08-20 20:32:26 PDT
Created attachment 236911 [details]
Archive of layout-test-results from webkit-ews-02 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-02  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 18 Build Bot 2014-08-20 21:30:23 PDT
Comment on attachment 236908 [details]
Modify an expected file related with a websocket binary-type test

Attachment 236908 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/6689651116998656

New failing tests:
http/tests/websocket/tests/hybi/binary-type.html
Comment 19 Build Bot 2014-08-20 21:30:27 PDT
Created attachment 236912 [details]
Archive of layout-test-results from webkit-ews-08 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-08  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 20 Jinwoo Jeong 2014-08-21 21:02:57 PDT
Created attachment 236962 [details]
Modify a test file and an expected file.
Comment 21 Brent Fulgham 2016-03-14 11:38:32 PDT
Comment on attachment 236962 [details]
Modify a test file and an expected file.

View in context: https://bugs.webkit.org/attachment.cgi?id=236962&action=review

This change seems good, and passed tests. Could you please revise the patch for the current source tree and resubmit for final review?

> Source/WebCore/ChangeLog:9
> +        when invalid values is set on binaryType of WebSocket, a SyntaxError should be raised.

Could you provide a link to the specification here, or at least indicate the specification section that states this?
Comment 22 Jinwoo Jeong 2016-03-14 17:29:58 PDT
I will check this.
Comment 23 Jinwoo Jeong 2016-03-19 00:15:39 PDT
Created attachment 274511 [details]
Patch
Comment 24 Antonio Gomes 2016-03-19 07:28:29 PDT
Comment on attachment 274511 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=274511&action=review

r=me

Have you check how blink, gecko behave on the same scenario?

> Source/WebCore/ChangeLog:9
> +        when invalid values is set on binaryType of WebSocket, a SyntaxError should be raised.

*when an invalid value is set...
Comment 25 Jinwoo Jeong 2016-03-20 21:01:09 PDT
Created attachment 274570 [details]
Patch
Comment 26 Jinwoo Jeong 2016-03-20 21:12:53 PDT
Created attachment 274571 [details]
patch for landing
Comment 27 WebKit Commit Bot 2016-03-20 22:28:24 PDT
Comment on attachment 274571 [details]
patch for landing

Clearing flags on attachment: 274571

Committed r198482: <http://trac.webkit.org/changeset/198482>
Comment 28 WebKit Commit Bot 2016-03-20 22:28:30 PDT
All reviewed patches have been landed.  Closing bug.