[jsplugins] Support |\u 4 hexadecimal digits| format in json in rpc

RESOLVED FIXED in Firefox 55

Status

()

Core
Plug-ins
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: Ya-Chieh Wu (inactive), Assigned: Ya-Chieh Wu (inactive))

Tracking

(Blocks: 1 bug)

unspecified
mozilla55
Points:
---

Firefox Tracking Flags

(firefox55 fixed)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

a year ago
+++ This bug was initially created as a clone of Bug #1325896 +++

We need to implement PPB_KeyboardInputEvent_Create for "backspace" and "escape".


We found that "ESC" would be passing into rpc as |\u 4 hexadecimal digits| in json. Currently, our rpc only recognize |\u0000| but the rest of characters that use this format. We would need to support this format at least for "ESC".
(Assignee)

Updated

a year ago
Assignee: nobody → ywu
Component: General → Plug-ins
Product: Firefox → Core
(Assignee)

Comment 1

a year ago
Created attachment 8830596 [details] [diff] [review]
Support json unicode character escape sequence for ESC

Hey Peter,

Could you help with this patch? This patch is a quick fix for "Esc" which only handles unicode character escape sequence for "ESC". However, we probably need to do some studies to know if we need to fully support |\u 4 hexadecimal digits| json format.

Thank you very much.
Attachment #8830596 - Flags: review?(peterv)
So, Ecmascript specifies that stringify outputs \uxxxx for characters with a "value less than the space character", so 0000 to 001F. You could check for |*(next + 1) == '0'| and |*(next + 2) == '0'| and then convert using strtol for example.
(Assignee)

Comment 3

a year ago
Created attachment 8837959 [details] [diff] [review]
Handle Control characters code units from U+0000 to U+001F in rpc.h

Hey peter, 

This patch supports escape sequence from U+0000 to U+001F in rpc.h when we parse JSON to string.

Could you take a look at it?
thanks
Attachment #8830596 - Attachment is obsolete: true
Attachment #8830596 - Flags: review?(peterv)
Attachment #8837959 - Flags: review?(peterv)
Attachment #8837959 - Flags: review?(peterv) → review+
(Assignee)

Comment 4

a year ago
Created attachment 8844292 [details] [diff] [review]
0001-Bug-1331298-Handle-Control-characters-code-units-fro.patch

Result of try:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=6f9cb3f4f8ff9ee908e8c29ba0c220ad306b0df8
Attachment #8837959 - Attachment is obsolete: true
(Assignee)

Updated

a year ago
Keywords: checkin-needed

Comment 5

a year ago
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/dc335045a33b
Handle Control characters code units from U+0000 to U+001F in rpc.h. r=peterv
Keywords: checkin-needed

Comment 6

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/dc335045a33b
Status: NEW → RESOLVED
Last Resolved: a year ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.