Changeset 277373 in webkit
- Timestamp:
- May 12, 2021, 10:13:20 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/shadow-dom/insert-host-child-with-slot-renderer-teardown-crash-expected.txt (added)
-
LayoutTests/fast/shadow-dom/insert-host-child-with-slot-renderer-teardown-crash.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/dom/SlotAssignment.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r277371 r277373 1 2021-05-12 Ryosuke Niwa <rniwa@webkit.org> 2 3 REGRESSION: Release assert in SlotAssignment::assignedNodesForSlot via ComposedTreeIterator::traverseNextInShadowTree in Element::insertedIntoAncestor 4 https://bugs.webkit.org/show_bug.cgi?id=225684 5 6 Reviewed by Darin Adler. 7 8 Added a regression test. 9 10 * fast/shadow-dom/insert-host-child-with-slot-renderer-teardown-crash-expected.txt: Added. 11 * fast/shadow-dom/insert-host-child-with-slot-renderer-teardown-crash.html: Added. 12 1 13 2021-05-12 Sergio Villar Senin <svillar@igalia.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r277372 r277373 1 2021-05-12 Ryosuke Niwa <rniwa@webkit.org> 2 3 REGRESSION: Release assert in SlotAssignment::assignedNodesForSlot via ComposedTreeIterator::traverseNextInShadowTree 4 in Element::insertedIntoAncestor 5 https://bugs.webkit.org/show_bug.cgi?id=225684 6 7 Reviewed by Darin Adler. 8 9 The release assertion failure was caused by RenderTreeUpdater::tearDownRenderers end up traversing the parts of the DOM 10 for which Element::insertedIntoAncestor had not been called yet. Since HTMLSlotElement::insertedIntoAncestor is where 11 SlotAssignment::Slot is updated for a newly inserted slot, SlotAssignment::Slot may not contain this slot element. 12 13 Fixed the bug by returning early in SlotAssignment::assignedNodesForSlot when this condition holds, which is when 14 the shadow root is connected to a document but HTMLSlotElement isn't since its connected flag has not been updated yet. 15 16 Test: fast/shadow-dom/insert-host-child-with-slot-renderer-teardown-crash.html 17 18 * dom/SlotAssignment.cpp: 19 (WebCore::SlotAssignment::assignedNodesForSlot): 20 1 21 2021-05-12 Peng Liu <peng.liu6@apple.com> 2 22 -
trunk/Source/WebCore/dom/SlotAssignment.cpp
r276010 r277373 333 333 const AtomString& slotName = slotNameFromAttributeValue(slotElement.attributeWithoutSynchronization(nameAttr)); 334 334 auto* slot = m_slots.get(slotName); 335 336 bool hasNotCalledInsertedIntoAncestorOnSlot = shadowRoot.isConnected() && !slotElement.isConnected(); 337 if (hasNotCalledInsertedIntoAncestorOnSlot) 338 return nullptr; 335 339 RELEASE_ASSERT(slot); 336 340
Note:
See TracChangeset
for help on using the changeset viewer.