Where is shadow-root children attached in main flat tree

18 views
Skip to first unread message

jungle panda

unread,
May 18, 2023, 2:47:39 PM5/18/23
to blink-dev, cbies...@chromium.org
I have basic understanding of dom-tree, flat-tree and slots.

I am trying to trace the flow for following scenario -
We have a html page and one button which attaches a shadow root to a div using "attachShadow" js function.

In blink code, the children from shadow-root are added into a document-fragment.
We are getting the point in blink code where the older children from div ( shadow-host ) are removed and the point where new children from shadow-root are attached in document-fragment.

Element::CreateAndAttachShadowRoot() is the function responsible for creating shadow-root node and attaching it to div ( shadow-host )
ContainerNode::InsertNodeVector() is the function responsible for creating flat tree for document-fragment.

But we want to find out the function that is responsible for attaching this document-fragment to div ( shadow-host ) i.e. the point where mini shadow root tree is attached to main flat tree.

Any related information in this regard will be helpful. Thank you.
Reply all
Reply to author
Forward
0 new messages