This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 26678 - MediaKeySession.generateRequest() should not fail if callable is false
Summary: MediaKeySession.generateRequest() should not fail if callable is false
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: Encrypted Media Extensions (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: David Dorwin
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-26 22:46 UTC by Chris Pearce
Modified: 2014-08-26 23:56 UTC (History)
4 users (show)

See Also:


Attachments

Description Chris Pearce 2014-08-26 22:46:15 UTC
The spec for MediaKeySession.generateRequest() is:

<quote>

The generateRequest(initDataType, initData) method creates a new MediaKeySession object for the initData. It must run the following steps:

The contents of initData are container-specific Initialization Data. initDataType is the initialization data type that indicates how to interpret initData.

    If this object's callable value is false, return a promise rejected with a new DOMException whose name is "InvalidStateError".

</quote>

callable is set to true after the request is sent.

https://dvcs.w3.org/hg/html-media/raw-file/default/encrypted-media/encrypted-media.html#dom-generaterequest

Since generateRequest() is the only thing that sets callable to true, and it aborts if callable is false, nothing else will ever set callable to true, so no function will be usable.

I think this must be a copy-paste error, and the "If this object's callable value is false" step should be removed from generateRequest().
Comment 1 David Dorwin 2014-08-26 23:53:56 UTC
"uninitialized" was mistakenly replaced with "callable" when I as adding this step to the other methods. The line should be as follows, which matches load():
'If this object's uninitialized value is false, return a promise rejected with a new DOMException whose name is "InvalidStateError".'
Comment 2 David Dorwin 2014-08-26 23:56:42 UTC
Fixed in https://dvcs.w3.org/hg/html-media/rev/c9a7c05b70c6. Thanks for catching that!