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 25902 - [EME] Don't use Date for MediaKeySession.expiration
Summary: [EME] Don't use Date for MediaKeySession.expiration
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: Encrypted Media Extensions (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: David Dorwin
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-28 04:29 UTC by Chris Pearce
Modified: 2014-06-24 21:39 UTC (History)
5 users (show)

See Also:


Attachments

Description Chris Pearce 2014-05-28 04:29:55 UTC
Having MediaKeySession.expiration return a Date is a bad idea.

There's a big thread at https://www.w3.org/Bugs/Public/show_bug.cgi?id=22824 about why Date is bad, but the short of it is that if you have a Date-valued attribute it will return a new Date object every single time you do the get.  This means that you get things like:

  if (foo.expired == foo.expired) // Always tests false!

So how about making the expiration the number of milliseconds since the Unix epoch after which the license expires? This can then be passed into a JavaScript Date() constructor if desired.

NaN can be returned when the expiration is not known.
Comment 1 David Dorwin 2014-05-28 17:26:21 UTC
Are you proposing to use UnrestrictedDouble?
UnsignedLongLong would also work (the Date() constructor takes an integer) but would not support NaN.
Comment 2 Boris Zbarsky 2014-05-28 17:43:09 UTC
"unrestricted double" would work here, yes.