[Bug 25458] [Shadow]: The return type of Event.path should be EventTarget[], instead of NodeList

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

--- Comment #8 from Hayato Ito <hayato@chromium.org> ---
(In reply to Boris Zbarsky from comment #7)
> > Can they be real arrays with the exact semantics specified in prose?
> 
> Yes.  You can put "object" in the IDL and then specify in prose.
> 
> That specification could even leverage WebIDL sequences in the sense of
> creating one, converting to a JS value, and caching the result.
> 
> The only open question is whether the result should be frozen or whether we
> should just let the consumer munge it.  Does anything internal look at .path
> on events?  If so, we may want to either freeze it or specify an internal
> accessor that returns the actual path.

My expected behavior is 'frozen'.

If the following event listener is given,

button.addEventListener("click", function(event) {
  console.log(event.path.length);
  var p = event.path;
  p.pop();
  console.log(event.path.length);
  console.log(p.length);
  event.path = [];
  console.log(event.path);
});


this event listener should print the following as example:
  4
  4
  3
  4

As far as I tested, the current WebIDL implementation of blink for `readonly
attribute T[]` behaves like that.

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

Received on Monday, 28 April 2014 07:11:59 UTC