Closed Bug 1231265 Opened 9 years ago Closed 7 years ago

support custom-element lifecycle callbacks with content from external document

Categories

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

42 Branch
x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: shogun70, Assigned: edgar)

References

Details

(Whiteboard: btpp-backlog)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:42.0) Gecko/20100101 Firefox/42.0
Build ID: 20151029151421

Steps to reproduce:

With webcomponents enabled in Firefox, navigate to 
   http://playground.meekostuff.net/test/custom-elements/customelement-externalcontent.html

This will run a test which:
1. Installs a custom-element registration which logs lifecycle callbacks
    document.registerElement('custom-element', ...)
2. Creates an inert HTMLDocument 
    var doc = document.implementation.createHTMLDocument('')
3. Adds some content including a custom-element
    doc.body.innerHTML = '<div><custom-element /></div>'
4. Inserts the content into the current document
    document.body.appendChild(content)



Actual results:

The createCallback() is called immediately after the content is created **in the inert external document**, even though that document has no custom-element registrations.

The attachedCallback() is called immediately after the content is inserted into the current document. As it should.


Expected results:

The createdCallback() should be called when the custom-element node becomes part of the current document. That is, it should be called after the node is inserted into the current document and before the attachedCallback() is called.
The URL mentioned above can be used to demonstrate other (presumably related) bugs. 

A. Navigate to 
    http://playground.meekostuff.net/test/custom-elements/customelement-externalcontent.html?creation=DOMParser&adoption=none

    This creates the same content but using (new DOMParser).parserFromString() to create the external document.
    In this case neither createdCallback() or attachedCallback() are ever called. 
    They should both be called when the node is inserted into the current document. 


B. Navigate to 
    http://playground.meekostuff.net/test/custom-elements/customelement-externalcontent.html?creation=DOMParser&adoption=adopt

    This is the same as (A) but uses document.adoptNode() to explicitly bring the external content into the current document.
    Again, neither createdCallback() or attachedCallback() are ever called.


C. Navigate to 
    http://playground.meekostuff.net/test/custom-elements/customelement-externalcontent.html?creation=XHR&adoption=adopt

    This is the same as (B) but uses XHR to obtain an external document which contains a custom-element.
    Again, neither createdCallback() or attachedCallback() are ever called.
Hi, 

I have tested this on Mac OS X 10.6 with FF Nightly 45.0a1 and when I go to the link that you suggested, I receive a message:"Aborting: This browser doesn't support CustomElements." it's an expected situation to receive this message?
Please download the Firefox Nightly from here: https://nightly.mozilla.org/ and retest the problem.
Flags: needinfo?(shogun70)
OS: Unspecified → Mac OS X
Hardware: Unspecified → x86
Hi Ovidiu Boca,

That is the message you will get if `document.registerElement` isn't defined. 
Did you enable web-components?

Sean
Flags: needinfo?(shogun70)
User Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:46.0) Gecko/20100101 Firefox/46.0
Build ID 20151217072309

Hi Sean, 

I enable dom.webcomponents and I tested this on Mac 10.6 and 10.10 with FF Nightly 46.0a1 and I receive the same thing like you from the attachment: customelement-externalcontent.html

Phil can you please take a look at this bug? I saw that you are working with this type of problems. Can you help me to choose the right component for this bug?
Thank you very much.
Flags: needinfo?(philringnalda)
I finally figured out what connection I have to custom elements - I filed a bug about the fact that an automated custom element test fails sometimes. That is the only thing I know about them.
Flags: needinfo?(philringnalda)
Hi William can you please take a look at this bug? Thank you
Component: Untriaged → DOM
Flags: needinfo?(wchen)
Product: Firefox → Core
Jocelyn may be interested in this as she's working on Custom Elements.
Flags: needinfo?(wchen) → needinfo?(joliu)
The bug was filed based on our existing experimental implementation which is different from the latest spec we are going to support. We don't think we will spend time on fixing the existing behavior, but we will make sure lifecycle callbacks work well with the new stuff. I will set the dependency to the meta bug for the new implementation.
Flags: needinfo?(joliu)
Summary: Bugs in custom-element lifecycle callbacks with content from external document → support custom-element lifecycle callbacks with content from external document
Whiteboard: btpp-backlog
Created callback is removed from the latest custom elements spec, and we plan to remove the implementation for created callback in bug 1396620.
Mark as INVALID per comment #9.
Assignee: nobody → echen
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: