Closed Bug 1121994 Opened 6 years ago Closed 3 years ago

Implement adopted callback for custom elements

Categories

(Core :: DOM: Core & HTML, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: gkrizsanits, Assigned: jdai)

References

Details

(Whiteboard: dom-ce-m3)

Attachments

(1 file, 1 obsolete file)

The spec does not mention this callback yet, but there were numerous talks where everybody agreed that we need this callback.
Do you think this callback could end up in the spec soonish? Is there any disagreement about it? Do we know exactly when it should be called? (I'm just trying to decide when would it make sense to start working on this)
Assignee: nobody → gkrizsanits
Flags: needinfo?(annevk)
I think there's still disagreement about whether callbacks should have symbols as names or not. If not, I would expect "adoptedCallback" that is passed the old and new document.
Flags: needinfo?(annevk)
Mark this bug as a duplicate of bug 1293921 since we plan to implement all lifecycle callback in bug 1293921.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1293921
On a second thought, we decide splitting bug 1293921 into smaller pieces, so re-open this bug for implementing adoptedCallback.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Priority: -- → P3
Whiteboard: dom-ce-m3
Assignee: gkrizsanits → jdai
Attached patch patch, v1 (obsolete) — Splinter Review
Follow the spec[1] implements adopted callback for custom elements. I only tested on my local, hence, could you give me some feedback about this patch? Thank you.

[1] https://dom.spec.whatwg.org/#concept-node-adopt
Flags: needinfo?(bugs)
Comment on attachment 8905947 [details] [diff] [review]
patch, v1


>+++ b/dom/base/CustomElementRegistry.h
>@@ -35,41 +35,55 @@ class Promise;
> struct LifecycleCallbackArgs
> {
>   nsString name;
>   nsString oldValue;
>   nsString newValue;
>   nsString namespaceURI;
> };
> 
>+struct LifecycleAdoptedCallbackArgs
>+{
>+  nsIDocument* oldDocument;
>+  nsIDocument* newDocument;
>+};
I think these both should be nsCOMPtr<nsIDocument>. And normal coding style would be to
call them mOldDocument and mNewDocument, but I see the previous struct doesn't use that either, so naming is up to you.
Flags: needinfo?(bugs)
Attachment #8905947 - Flags: review+
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/0ad5ea4a3f1c
Implement adopted callback for custom elements. r=smaug
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/0ad5ea4a3f1c
Status: REOPENED → RESOLVED
Closed: 4 years ago3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.