Created with the help of AI.
Problem Description:
Throughout the specification, algorithms checking for zero-length BufferSource parameters (such as ArrayBuffer or Uint8Array) use the phrase "is an empty array". This is technically incorrect and inconsistent with WebIDL and modern specification standards.
A BufferSource is a union type of (ArrayBufferView or ArrayBuffer). Neither of these types are technically "arrays" in WebIDL or JavaScript. They do not have an "empty" state in the way a sequence or a JS Array might; rather, they are defined by their content length (byte length). Referring to them as "empty arrays" is confusing and technically inaccurate.
Affected Locations:
- Section 5.1
setServerCertificate() Step 2:
"If serverCertificate is an empty array, return a promise rejected with a new a newly created TypeError."
- Section 6.2
generateRequest() Step 5:
"If initData is an empty array, return a promise rejected with a newly created TypeError."
- Section 6.2
update() Step 3:
"If response is an empty array, return a promise rejected with a newly created TypeError."
Historical Context
BufferSource was introduced to EME in
0666263. However, the "empty array" terminology existed before this change.
Reference to Standards:
Modern specifications handle BufferSource inputs by utilizing the Web IDL algorithm for getting a copy of the bytes held by the buffer source. This converts the input into an Infra byte sequence, which can then be checked for "emptiness."
Suggested Fix:
Update the identified steps to use the standard Web IDL terminology for processing BufferSource data:
- Let buffer be the result of getting a copy of the bytes held by the [parameter name] parameter.
- If buffer is empty, return a promise rejected with a newly created TypeError.
Created with the help of AI.
Problem Description:
Throughout the specification, algorithms checking for zero-length
BufferSourceparameters (such asArrayBufferorUint8Array) use the phrase "is an empty array". This is technically incorrect and inconsistent with WebIDL and modern specification standards.A
BufferSourceis a union type of(ArrayBufferView or ArrayBuffer). Neither of these types are technically "arrays" in WebIDL or JavaScript. They do not have an "empty" state in the way a sequence or a JS Array might; rather, they are defined by their content length (byte length). Referring to them as "empty arrays" is confusing and technically inaccurate.Affected Locations:
setServerCertificate()Step 2:generateRequest()Step 5:update()Step 3:Historical Context
BufferSourcewas introduced to EME in0666263. However, the "empty array" terminology existed before this change.
Reference to Standards:
Modern specifications handle
BufferSourceinputs by utilizing the Web IDL algorithm for getting a copy of the bytes held by the buffer source. This converts the input into an Infra byte sequence, which can then be checked for "emptiness."BufferSourcetypes have an associated byte length. (See Web IDL § BufferSource)encrypt()method, the spec uses this technique to process thedataparameter:Suggested Fix:
Update the identified steps to use the standard Web IDL terminology for processing
BufferSourcedata: