Re: Imperative API for Node Distribution in Shadow DOM (Revisited)

On Thu, Apr 30, 2015 at 9:54 PM Anne van Kesteren <annevk@annevk.nl> wrote:

> On Thu, Apr 30, 2015 at 2:44 PM, Domenic Denicola <d@domenic.me> wrote:
> > From: Anne van Kesteren <annevk@annevk.nl>
> >>  var x = new Event(eventType)
> >>  someNodeThatIsDistributed.addEventListener(eventType, e =>
> console.log(e.path))
> >>  someNodeThatIsDistributed.dispatchEvent(ev);
> >
> > Can you explain in a bit more detail why this causes interop problems?
> What browsers would give different results for this code? What would those
> results be?
>
> This essentially forces distribution to happen since you can observe
> the result of distribution this way. Same with element.offsetWidth
> etc.


That's the exactly intended behavior in the current spec.
The timing of distribution is not observable. That enables UA to optimize
the distribution calc. We can delay the calculation of the distribution as
possible as we can. We don't need to calc distribution every time when a
mutation occurs.

If you find any interop issue in the current spec about distribution,
please file a bug with a concrete example.





>
> --
> https://annevankesteren.nl/
>
>

Received on Thursday, 30 April 2015 13:06:13 UTC