Re: [heycam/webidl] Modernize invoking user code (#113)

Thank you for linkifying the '!'/?' and for putting up a generated version.  Made this much more pleasant!

The one remaining concern I have is the microtask checkpoint bit.  I think morally that's the right thing to do (and have been meaning to make that change in Firefox; it's blocked by some other issues in how we handle microtasks), but I'm not sure what UAs do right now.  For example, during event dispatch, do promise callbacks run after every event listener?

I tried creating a testcase for that:

    <body>
    <script>
    function logger(i) {
      console.log("Call for " + i);
      Promise.resolve().then(function() { console.log("Promise callback for " + i) });
    }
    document.body.addEventListener("click", logger.bind(undefined, 1));
    document.body.addEventListener("click", logger.bind(undefined, 2));
    document.documentElement.addEventListener("click", logger.bind(undefined, 3));
    console.log("before click");
    document.body.click();
    console.log("after click");
    </script>

and all of Firefox, Chrome, Safari log:

    before click
    Call for 1
    Call for 2
    Call for 3
    after click
    Promise callback for 1
    Promise callback for 2
    Promise callback for 3

which is not the output I was expecting if any of them performed a microtask checkpoint there... though maybe I misunderstand what microtask checkpoints do.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/pull/113#issuecomment-220159000

Received on Wednesday, 18 May 2016 21:10:10 UTC