WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
101569
[WebSocket] send() and close() should not throw an exception for an unpaired surrogate but use the replacement character
https://bugs.webkit.org/show_bug.cgi?id=101569
Summary
[WebSocket] send() and close() should not throw an exception for an unpaired...
Kenichi Ishibashi
Reported
2012-11-08 02:46:36 PST
Chromium bug entry:
http://code.google.com/p/chromium/issues/detail?id=159568
The WebSocket API specification has changed. When a message of send() (or a reason of close()) has unpaired surrogates, they should be replaced with replacement character (U+FFFE), instead of throwing SYNTAX_ERR. Specification diff:
http://html5.org/tools/web-apps-tracker?from=7083&to=7084
How to use replacement character:
http://dev.w3.org/2006/webapi/WebIDL/#dfn-obtain-unicode
The current WebKit throws SYNTAX_ERR. Following w3c-test is failing because of this behavior:
http://www.w3c-test.org/webapps/WebSockets/tests/submissions/Microsoft/Send-Unpaired-Surrogates.htm
Attachments
Patch
(16.25 KB, patch)
2012-11-08 03:06 PST
,
Kenichi Ishibashi
no flags
Details
Formatted Diff
Diff
Patch
(16.24 KB, patch)
2012-11-08 04:14 PST
,
Kenichi Ishibashi
no flags
Details
Formatted Diff
Diff
Patch
(12.26 KB, patch)
2012-11-11 06:27 PST
,
Kenichi Ishibashi
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Kenichi Ishibashi
Comment 1
2012-11-08 03:06:59 PST
Created
attachment 172980
[details]
Patch
Build Bot
Comment 2
2012-11-08 04:06:07 PST
Comment on
attachment 172980
[details]
Patch
Attachment 172980
[details]
did not pass win-ews (win): Output:
http://queues.webkit.org/results/14759745
Kenichi Ishibashi
Comment 3
2012-11-08 04:14:02 PST
Created
attachment 173006
[details]
Patch
Alexey Proskuryakov
Comment 4
2012-11-08 10:34:07 PST
Comment on
attachment 173006
[details]
Patch This is generic UTF-8 manipulation code, it should be in WTF, not in WebSocket files. Also, I'm not sure why we need two passes now.
Kenichi Ishibashi
Comment 5
2012-11-08 18:01:18 PST
(In reply to
comment #4
)
> (From update of
attachment 173006
[details]
) > This is generic UTF-8 manipulation code, it should be in WTF, not in WebSocket files.
I see. The code would be able to merge with String::utf8(). I'll create a separate bug entry for it.
> Also, I'm not sure why we need two passes now.
m_channel can be null in WebSocketChannel::close() so we need to check the length of reason in utf-8 at WebSocket::close().
Kenichi Ishibashi
Comment 6
2012-11-11 06:27:40 PST
Created
attachment 173505
[details]
Patch
Kenichi Ishibashi
Comment 7
2012-11-13 16:30:28 PST
Hi Alexey, Could you take another look?
Kenichi Ishibashi
Comment 8
2012-11-13 17:30:26 PST
Comment on
attachment 173505
[details]
Patch Thanks!
WebKit Review Bot
Comment 9
2012-11-13 17:53:07 PST
Comment on
attachment 173505
[details]
Patch Clearing flags on attachment: 173505 Committed
r134515
: <
http://trac.webkit.org/changeset/134515
>
WebKit Review Bot
Comment 10
2012-11-13 17:53:10 PST
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug