Changeset 208378 in webkit
- Timestamp:
- Nov 3, 2016 11:21:06 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r208371 r208378 1 2016-11-03 Antti Koivisto <antti@apple.com> 2 3 REGRESSION (r207717): DumpRenderTree crashed in com.apple.WebCore: WebCore::Style::Scope::flushPendingUpdate + 16 4 https://bugs.webkit.org/show_bug.cgi?id=164397 5 <rdar://problem/29100135> 6 7 Reviewed by Ryosuke Niwa. 8 9 The problem here was that we were leaving stale pointers to Document::m_inDocumentShadowRoots set when 10 using fast-path document teardown. 11 12 (Patch and stories mostly by rniwa). 13 14 * dom/Document.cpp: 15 (WebCore::Document::~Document): 16 (WebCore::Document::didInsertInDocumentShadowRoot): 17 (WebCore::Document::didRemoveInDocumentShadowRoot): 18 19 Improve asserts. 20 21 * dom/Element.cpp: 22 (WebCore::Element::removeShadowRoot): 23 24 Remove the superfluous call to notifyChildNodeRemoved in Element::removeShadowRoot to 25 avoid invoking notifyChildNodeRemoved during a document teardown, which is incorrect. It's sufficient that 26 ~ShadowRoot calls ContainerNode::removeDetachedChildren(), and in turn removeDetachedChildrenInContainer() 27 since the latter function tears down nodes via the deletion queue during a document destruction and use 28 notifyChildNodeRemoved() on nodes that outlive the shadow root. 29 30 * dom/ShadowRoot.cpp: 31 (WebCore::ShadowRoot::~ShadowRoot): 32 33 Take care to clean up inDocumentShadowRoots for fast-pathed destruction too. 34 35 (WebCore::ShadowRoot::insertedInto): 36 (WebCore::ShadowRoot::removedFrom): 37 38 Improve ShadowRoot's insertedInto and removedFrom so that they only try to add and remove itself from 39 m_inDocumentShadowRoots when the connected-ness changes. 40 1 41 2016-11-03 Simon Fraser <simon.fraser@apple.com> 2 42 -
trunk/Source/WebCore/dom/Document.cpp
r208371 r208378 592 592 ASSERT(!m_parentTreeScope); 593 593 ASSERT(!m_disabledFieldsetElementsCount); 594 ASSERT(m_inDocumentShadowRoots.isEmpty()); 594 595 595 596 #if ENABLE(DEVICE_ORIENTATION) && PLATFORM(IOS) … … 6981 6982 { 6982 6983 ASSERT(shadowRoot.inDocument()); 6984 ASSERT(!m_inDocumentShadowRoots.contains(&shadowRoot)); 6983 6985 m_inDocumentShadowRoots.add(&shadowRoot); 6984 6986 } -
trunk/Source/WebCore/dom/Element.cpp
r208356 r208378 1785 1785 oldRoot->setHost(nullptr); 1786 1786 oldRoot->setParentTreeScope(&document()); 1787 1788 notifyChildNodeRemoved(*this, *oldRoot);1789 1787 } 1790 1788 -
trunk/Source/WebCore/dom/ShadowRoot.cpp
r208356 r208378 71 71 ShadowRoot::~ShadowRoot() 72 72 { 73 if (inDocument()) 74 document().didRemoveInDocumentShadowRoot(*this); 75 73 76 // We cannot let ContainerNode destructor call willBeDeletedFrom() 74 77 // for this ShadowRoot instance because TreeScope destructor … … 85 88 Node::InsertionNotificationRequest ShadowRoot::insertedInto(ContainerNode& insertionPoint) 86 89 { 87 auto result = DocumentFragment::insertedInto(insertionPoint); 88 if (inDocument()) 90 bool wasInDocument = inDocument(); 91 DocumentFragment::insertedInto(insertionPoint); 92 if (insertionPoint.inDocument() && !wasInDocument) 89 93 document().didInsertInDocumentShadowRoot(*this); 90 return result;94 return InsertionDone; 91 95 } 92 96 93 97 void ShadowRoot::removedFrom(ContainerNode& insertionPoint) 94 98 { 95 if (inDocument()) 99 DocumentFragment::removedFrom(insertionPoint); 100 if (insertionPoint.inDocument() && !inDocument()) 96 101 document().didRemoveInDocumentShadowRoot(*this); 97 DocumentFragment::removedFrom(insertionPoint);98 102 } 99 103
Note: See TracChangeset
for help on using the changeset viewer.