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

On Thu, Apr 30, 2015 at 2:30 PM, Domenic Denicola <d@domenic.me> wrote:
> Can someone point me to the part of the spec that is problematic? That is,
> where is the line that says "UAs may run this algorithm at any time"? I am
> not sure what to Ctrl+F for.

At the end of section 3.4 it states "If any condition which affects
the distribution result changes, the distribution result must be
updated before any use of the distribution result." which basically
means you can't make use of a "dirty" tree.


> Secondly, could someone produce a code snippet that would cause such interop
> problems, given the current spec?

  var x = new Event(eventType)
  someNodeThatIsDistributed.addEventListener(eventType, e =>
console.log(e.path))
  someNodeThatIsDistributed.dispatchEvent(ev);


> Finally, assuming we have such an example, would there be a way to tighten
> the spec language such that we don't need to specify e.g. when style
> recalculation happens, but instead specify constraints? Like "offsetTop must
> always reflect the redistributions" or something.

That is what the specification currently does and what prevents us
from defining an imperative API. For an imperative API it is
imperative (mahaha) that we get the timing with respect to tasks
right. (Or as per my proposal, leave timing up to developers.)


-- 
https://annevankesteren.nl/

Received on Thursday, 30 April 2015 12:41:52 UTC