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

[Custom] Should attachedCallback/detachedCallback callbacks be called when element is added to / removed from shadom dom which is attached to a in-document host? (bugzilla: 26943) #191

Closed
hayatoito opened this issue Jul 6, 2015 · 10 comments

Comments

@hayatoito
Copy link
Contributor

Title: [Custom] Should attachedCallback/detachedCallback callbacks be called when element is added to / removed from shadom dom which is attached to a in-document host? (bugzilla: 26943)

Migrated from: https://www.w3.org/Bugs/Public/show_bug.cgi?id=26943


comment: 0
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=26943#c0
Olli Pettay wrote on 2014-10-01 09:43:50 +0000.

Per the current spec attachedCallback/detachedCallback explicitly aren't
called if the element isn't inserted into / removed from a document.
I think we want the callbacks to be called also in shadow DOM case.

@rniwa
Copy link
Collaborator

rniwa commented Mar 1, 2016

Also see the issue #362.

@rniwa rniwa added the v1 label Mar 1, 2016
@domenic
Copy link
Collaborator

domenic commented Mar 7, 2016

I specced this per #362:

If inclusiveDescendant is a custom element, and was previously in a composed document, but now is not, enqueue a custom element callback action with inclusiveDescendant, callback name "disconnectedCallback", and an arguments list containing the document which is parent's inclusive composed ancestor.

(and similarly for connectedCallback).

Please re-open or open a new issue/pull request if I got that wrong.

@domenic domenic closed this as completed Mar 7, 2016
@annevk
Copy link
Collaborator

annevk commented Mar 8, 2016

What about newAncestor/oldAncestor?

@annevk annevk reopened this Mar 8, 2016
@domenic
Copy link
Collaborator

domenic commented Mar 8, 2016

What about it? What is it?

@annevk
Copy link
Collaborator

annevk commented Mar 8, 2016

It's the argument passed to "insertion steps" / "removing steps".

@domenic
Copy link
Collaborator

domenic commented Mar 8, 2016

Why is that relevant here?

@annevk
Copy link
Collaborator

annevk commented Mar 8, 2016

Because why should that primitive not be exposed to connected/disconnected?

@domenic
Copy link
Collaborator

domenic commented Mar 8, 2016

Because connected/disconnected are different from inserted/removed, and we never discussed this previously, so you're proposing an entirely new feature?

@annevk
Copy link
Collaborator

annevk commented Mar 8, 2016

The only difference is that connected/disconnected require the element's shadow-host-including root to be a document, right? How does that change what context you might need?

I guess I'm fine not exposing this for now, we can add it when there's a need.

@domenic
Copy link
Collaborator

domenic commented Mar 8, 2016

Sounds good. Feel free to open a new issue proposing it for wider discussion.

@domenic domenic closed this as completed Mar 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants