- From: <bugzilla@jessica.w3.org>
- Date: Fri, 19 Sep 2014 18:27:59 +0000
- To: public-html-bugzilla@w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=26372 David Dorwin <ddorwin@google.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |annevk@annevk.nl, | |bzbarsky@mit.edu --- Comment #24 from David Dorwin <ddorwin@google.com> --- (In reply to Mark Watson from comment #21) > (In reply to David Dorwin from comment #20) > > (In reply to Mark Watson from comment #18) > > > Or (IIUC) the attribute could be [Observable], if that is not too > > > new-fangled. > > > > Do you have a reference for [Observable]? I'd like to understand how that > > might apply. > > I forget where I saw a reference to it. I believe > http://wiki.ecmascript.org/doku.php?id=harmony:observe is getting attention > right now and [Observable] is an idea for an IDL keyword that would indicate > that the Object.observe pattern can be used with an attribute. I expect > Boris and Anne know more. Although not currently in WebIDL, it sounds like it will be added soon so this may be an option. It's unclear how we would use it for this case, though. Object.observe() allows observation of changes to objects, including property modification and array modification. I could be wrong, but it doesn't appear appropriate to make the entire MediaKeySession object observable when we really want to monitor elements of only one of its properties. (It might be useful for replacing the |expiration| and |closed| attributes, though.) Therefore, I think we'd need some other object exposed by MediaKeySession to be observable. We could expose an observable array of key IDs from MediaKeySession. That would allow the application to observe 'add' and 'delete'. However, we'd either need an array of pairs or a map to handle 'update' of the MediaKeyStatus. That might work, but WebIDL states that "any sequence returned from a platform object will be a copy" [1] and "if an array is read only, then it is also implicitly fixed length" [2]. It doesn't make sense for the application to be able to modify the array, but it seems unlikely that a copy could observe the underlying changes and the array must be variable length. Maybe someone more familiar with Object.observe() and/or WebIDL can comment. [1] http://heycam.github.io/webidl/#idl-sequence [2] http://heycam.github.io/webidl/#idl-array -- You are receiving this mail because: You are the QA Contact for the bug.
Received on Friday, 19 September 2014 18:28:01 UTC