[Bug 26372] Report issues/events not related to a specific method call

https://www.w3.org/Bugs/Public/show_bug.cgi?id=26372

--- Comment #26 from David Dorwin <ddorwin@google.com> ---
(In reply to Boris Zbarsky from comment #25)
> > Although not currently in WebIDL, it sounds like it will be added soon
> 
> There's not really anything Web IDL can do with [Observable] (other than
> helpfully annotating which things should be).  The important part is JS
> engine support for Object.observe and the actual prose that defines the
> attribute in question creating observer records as needed.
> 
> > 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.
> 
> There is no such thing as an "observable object".  The thing that can be
> observed is an (object, property name) pair.
> 
> It sounds like this case if falling under bug 23682 comment 0 item B.  The
> value of the property would be a JS array object.  If the value is supposed
> to change, the underlying implementation would create a new JS array object,
> set it, and send the corresponding change notification as needed.

In this case, this seems equivalent to a simple event with an attribute or
method to query, right? We could use [observable] to indicate changes to the
|expiration|, closed status, and keys, but is such a solution really better
than having a simple event (or promise, as is the case for |closed|) for each
one?


Another idea: What if MediaKeySession had a method named getKeys() that
returned (a reference to) an array of key IDs that could then be observed.
Would this allow the returned (reference to the) array to receive updates? I
still think we'd need to have something like a map to allow us to report
added/removed key IDs as well as changes to their status. Is there something
like a map already defined that we could use?

Object.observe() allows applications to be informed of the exact change and
take action, but it probably adds some TBD amount of complexity to the spec.
Application developers, do you think the complexity is worthwhile?

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Monday, 22 September 2014 21:13:10 UTC