Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dispatching slotchange within a compound microtask #734

Closed
annevk opened this issue Feb 17, 2019 · 4 comments
Closed

Dispatching slotchange within a compound microtask #734

annevk opened this issue Feb 17, 2019 · 4 comments
Labels
topic: shadow Relates to shadow trees (as defined in DOM)

Comments

@annevk
Copy link
Member

annevk commented Feb 17, 2019

HTML requires that "execute a compound microtask subtask" is used to invoke callbacks within a "compound microtask", as I understand it. However, we don't do this for the slotchange event. And it's not clear to me that we can, since dispatching the slotchange event can result in multiple listeners being triggered, each with their own callback. Surely we don't want to weave "execute a compound microtask subtask" through all that?

So how do browsers implement the last step of https://dom.spec.whatwg.org/#notify-mutation-observers today?

cc @whatwg/components

@annevk annevk added the topic: shadow Relates to shadow trees (as defined in DOM) label Feb 17, 2019
@rniwa
Copy link
Collaborator

rniwa commented Mar 15, 2019

WebKit's code: https://trac.webkit.org/browser/trunk/Source/WebCore/dom/MutationObserver.cpp#L259

I don't think we even implement compound microtask subtask.

@smaug----
Copy link
Collaborator

Gecko's code looks pretty similar, but I think not exactly the same if there also some promises around.
If I read the code right, webkit loops over [mutationobservers, slotschanges] until there aren't any, but
Gecko it is more like loop all microtasks, where one can be [mutationobservers, slotchanges.]
But perhaps I'm missing where webkit deals with 'performing a microtask checkpoint' flag

@annevk
Copy link
Member Author

annevk commented Mar 19, 2019

whatwg/html#4437 to investigate removing compound microtasks from HTML.

annevk added a commit that referenced this issue Mar 22, 2019
Complements whatwg/html#4437.

Also clarify which agent the mutation observer microtask queued member is obtained from.

Fixes #734.
@annevk
Copy link
Member Author

annevk commented Mar 22, 2019

FYI: based on the HTML PR thread the conclusion here seems to be that we remove the compound microtask infrastructure. This results in a minor simplification of the DOM Standard shown in #741.

domenic pushed a commit that referenced this issue Mar 29, 2019
Complements whatwg/html#4437.

Also clarify which agent the mutation observer microtask queued member is obtained from.

Fixes #734.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: shadow Relates to shadow trees (as defined in DOM)
Development

No branches or pull requests

3 participants