Patch for Bug 78069 will emulate shadowRoot(), removeShadowRoot(), and setShadowRoot() using shadowRootList(). These API should be removed and replaced using ShadowRootList API.
Created attachment 128976 [details] Patch
Comment on attachment 128976 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=128976&action=review Basically looks good. Could you polish a bit? > Source/WebCore/ChangeLog:9 > + Could you mention now ShadowTree is on its own heap? > Source/WebCore/dom/Element.cpp:125 > + if (hasShadowRoot()) Can be hasShadowTree()? > Source/WebCore/dom/Element.cpp:126 > + shadowTree()->removeAllShadowRoots(); It looks we can do removeAllShadowRoots() in the ShadowTree dtor then we can just delete the ShadowTree instance here.
(In reply to comment #2) > (From update of attachment 128976 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=128976&action=review > > Basically looks good. Could you polish a bit? > > > Source/WebCore/ChangeLog:9 > > + > > Could you mention now ShadowTree is on its own heap? > > > Source/WebCore/dom/Element.cpp:125 > > + if (hasShadowRoot()) > > Can be hasShadowTree()? > > > Source/WebCore/dom/Element.cpp:126 > > + shadowTree()->removeAllShadowRoots(); > > It looks we can do removeAllShadowRoots() in the ShadowTree dtor then we can just delete the ShadowTree instance here. Unfortunately removeAllShadowRoots() now requires the element. So what I can do here is just to call rareData()->m_shadowTree.clear(). Currently our code assumes that a shadow root could be removed from an element now, and we have tests for it. However, since we should not have such API, we can remove that assumption. This will reduce the code and make it clear. I think it should be done in another bug though.
Created attachment 128982 [details] Patch
Comment on attachment 128982 [details] Patch >Unfortunately removeAllShadowRoots() now requires the element. So what I can do here is just to call rareData()->m_shadowTree.clear(). > >Currently our code assumes that a shadow root could be removed from an element now, and we have tests for it. However, since we should not have such API, we can remove that assumption. This will reduce the code and make it clear. I think it should be done in another bug though. This looks reasonable. When we need the host element, there should be at least one shadow root. If there is no shadow root. We won't need the reference the the host.
Created attachment 129189 [details] Patch for landing
Comment on attachment 129189 [details] Patch for landing Attachment 129189 [details] did not pass qt-ews (qt): Output: http://queues.webkit.org/results/11644419
Created attachment 129192 [details] Patch for landing
Committed r109084: <http://trac.webkit.org/changeset/109084>