Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement TextDecoder. #4769
Implement TextDecoder. #4769
Comments
|
Alright, time to actually move from easy to less easy, lemme try and flex my muscles on this one. |
|
Yep! See https://github.com/servo/servo/wiki/Adding-a-new-WebIDL-binding for reference. |
|
Question... in the HTML spec it says that the |
|
Good question! I've filed a spec bug about that: https://www.w3.org/Bugs/Public/show_bug.cgi?id=27979 . Googling around, I found http://heycam.github.io/webidl/#common-BufferSource, so I suggest adding that definition to the file for now. |
|
Okay, so the question becomes "what is an |
|
Nope - ArrayBuffer actually corresponds to a |
|
Well, it's uses Uint8ClampedArray, but that's just a a specialized form of ArrayBuffer. |
|
Oh, big problem - the python script that generates the bindings threw an exception saying |
|
Slight issue... now when JavaScript does I tried |
|
Pre-existing bug; I'll deal with it. |
|
Is there an issue number that tracks the bug that @Ms2ger mentioned? The |
|
I see the the sample code posted by jdm using
as depict in file: |
|
You'll need changes like servo/mozjs#25 and servo/rust-mozjs#128, and then use |
|
See, I will do the changes to servo/mozjs first. |
|
@KiChjang Thanks Ms2ger, now we can use all TypedArray. |
|
Oh, #4998 only updated rust-mozjs, not mozjs. Use |
|
It says |
|
OK I found, use |
|
I'm not entirely sure how to use these yet... I did |
|
I would suggest using |
|
That wouldn't work either; it would just tell me |
Spec: https://encoding.spec.whatwg.org/#interface-textdecoder.
Most of the actual decoding infrastructure should already be implemented in
rust-encoding.This includes enabling the relevant tests by adding
[encoding] skip: falseto
tests/wpt/include.ini.This may also include updating the
mozjsandrust-mozjsdependencies to ensure we can work with typed arrays.