Changeset 277425 in webkit
- Timestamp:
- May 12, 2021, 11:45:07 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
editing/FrameSelection.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r277424 r277425 1 2021-05-12 Frederic Wang <fwang@igalia.com> 2 3 RELEASE_ASSERT(m_selection->isNone()) fails in Document::removedLastRef 4 https://bugs.webkit.org/show_bug.cgi?id=225434 5 6 Reviewed by Ryosuke Niwa. 7 8 Document::removedLastRef asserts that the document's selection is not set. However, setting 9 that selection is possible in FrameSelection::setSelectionWithoutUpdatingAppearance when the 10 document has not been destroyed yet but is already detached from its frame. This patch 11 instead clears the selection in that case. 12 13 No new tests. 14 15 * editing/FrameSelection.cpp: 16 (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance): Clears the selection when 17 newSelection is in a detached document. Given the other conditions, this is actually 18 checking equivalent to !m_document->frame(). 19 1 20 2021-05-12 Peng Liu <peng.liu6@apple.com> 2 21 -
trunk/Source/WebCore/editing/FrameSelection.cpp
r277069 r277425 364 364 } 365 365 366 if (!m_document || !m_document->frame()) {366 if (!m_document) { 367 367 m_selection = newSelection; 368 368 updateAssociatedLiveRange(); … … 372 372 bool selectionEndpointsBelongToMultipleDocuments = newSelection.base().document() && !newSelection.document(); 373 373 bool selectionIsInAnotherDocument = newSelection.document() && newSelection.document() != m_document.get(); 374 if (selectionEndpointsBelongToMultipleDocuments || selectionIsInAnotherDocument) { 374 bool selectionIsInDetachedDocument = newSelection.document() && !newSelection.document()->frame(); 375 if (selectionEndpointsBelongToMultipleDocuments || selectionIsInAnotherDocument || selectionIsInDetachedDocument) { 375 376 clear(); 376 377 return false;
Note:
See TracChangeset
for help on using the changeset viewer.