WebKit Bugzilla
Attachment 356718 Details for
Bug 192461
: Remove children of ShadowRoot before deleting it
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
WIP
wip192461.patch (text/plain), 1.91 KB, created by
Ryosuke Niwa
on 2018-12-05 23:20:23 PST
(
hide
)
Description:
WIP
Filename:
MIME Type:
Creator:
Ryosuke Niwa
Created:
2018-12-05 23:20:23 PST
Size:
1.91 KB
patch
obsolete
>Index: Source/WebCore/dom/Node.cpp >=================================================================== >--- Source/WebCore/dom/Node.cpp (revision 238927) >+++ Source/WebCore/dom/Node.cpp (working copy) >@@ -2532,6 +2532,9 @@ > if (is<Document>(*this)) { > downcast<Document>(*this).removedLastRef(); > return; >+ } else if (is<ShadowRoot>(*this)) { >+ downcast<ShadowRoot>(*this).removedLastRef(); >+ return; > } > > #ifndef NDEBUG >Index: Source/WebCore/dom/ShadowRoot.cpp >=================================================================== >--- Source/WebCore/dom/ShadowRoot.cpp (revision 238927) >+++ Source/WebCore/dom/ShadowRoot.cpp (working copy) >@@ -72,7 +72,6 @@ > { > } > >- > ShadowRoot::~ShadowRoot() > { > if (isConnected()) >@@ -86,14 +85,20 @@ > // clears Node::m_treeScope thus ContainerNode is no longer able > // to access it Document reference after that. > willBeDeletedFrom(document()); >+} > >+void ShadowRoot::removedLastRef() >+{ >+ ASSERT(!m_deletionHasBegun); >+ ASSERT(refCount() <= 0); >+ > ASSERT(!m_hasBegunDeletingDetachedChildren); > m_hasBegunDeletingDetachedChildren = true; > >- // We must remove all of our children first before the TreeScope destructor >- // runs so we don't go through Node::setTreeScopeRecursively for each child with a >- // destructed tree scope in each descendant. > removeDetachedChildren(); >+ >+ m_deletionHasBegun = true; >+ delete this; > } > > Node::InsertedIntoAncestorResult ShadowRoot::insertedIntoAncestor(InsertionType insertionType, ContainerNode& parentOfInsertedTree) >Index: Source/WebCore/dom/ShadowRoot.h >=================================================================== >--- Source/WebCore/dom/ShadowRoot.h (revision 238927) >+++ Source/WebCore/dom/ShadowRoot.h (working copy) >@@ -54,6 +54,8 @@ > > using TreeScope::rootNode; > >+ void removedLastRef(); >+ > Style::Scope& styleScope(); > StyleSheetList& styleSheets(); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192461
:
356718
|
356742
|
357033
|
357036
|
359073
|
359089