Changeset 286049 in webkit
- Timestamp:
- Nov 18, 2021, 11:30:40 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/editing/text-iterator/backward-textiterator-object-crash-expected.txt (added)
-
LayoutTests/editing/text-iterator/backward-textiterator-object-crash.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/editing/FrameSelection.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r286044 r286049 1 2021-11-18 Frédéric Wang <fwang@igalia.com> 2 3 Nullptr crash in SimplifiedBackwardsTextIterator::range() via previousSentencePosition 4 https://bugs.webkit.org/show_bug.cgi?id=229282 5 6 Reviewed by Darin Adler. 7 8 Add regression test. 9 10 * editing/text-iterator/backward-textiterator-object-crash-expected.txt: Added. 11 * editing/text-iterator/backward-textiterator-object-crash.html: Added. 12 1 13 2021-11-18 Ben Nham <nham@apple.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r286048 r286049 1 2021-11-18 Frédéric Wang <fwang@igalia.com> 2 3 Nullptr crash in SimplifiedBackwardsTextIterator::range() via previousSentencePosition 4 https://bugs.webkit.org/show_bug.cgi?id=229282 5 6 Reviewed by Darin Adler. 7 8 Constructors of TextIterator and SimplifiedBackwardsTextIterator update layout, which may 9 make HTMLObjectElement switch to fallback content and invalidate their renderer. As a 10 consequence their advance() method may incorrectly treat them as replaced elements. This 11 patch updates the layout at the beginning of FrameSelection::modify and disable post 12 resolution callbacks in order to prevent this kind of unaverted tree changes while browsing 13 the tree for selection update. 14 15 Test: editing/text-iterator/backward-textiterator-object-crash.html 16 17 * editing/FrameSelection.cpp: 18 (WebCore::FrameSelection::modify): Update layout and disable post resolution callback, so that 19 all iterators used during the execution of the function handle <object>s consistently. 20 1 21 2021-11-18 Antoine Quint <graouts@webkit.org> 2 22 -
trunk/Source/WebCore/editing/FrameSelection.cpp
r285655 r286049 72 72 #include "SpatialNavigation.h" 73 73 #include "StyleProperties.h" 74 #include "StyleTreeResolver.h" 74 75 #include "TypingCommand.h" 75 76 #include "VisibleUnits.h" … … 1344 1345 1345 1346 willBeModified(alter, direction); 1347 1348 // Before modifying selection, update layout and disable post resolution callbacks. 1349 // That way, unaverted tree changes are avoided while browsing the document. 1350 auto selectionDocument = m_selection.document(); 1351 if (!selectionDocument) 1352 return false; 1353 selectionDocument->updateLayoutIgnorePendingStylesheets(); 1354 Style::PostResolutionCallbackDisabler disabler(*selectionDocument); 1346 1355 1347 1356 bool reachedBoundary = false;
Note:
See TracChangeset
for help on using the changeset viewer.