Changeset 259619 in webkit
- Timestamp:
- Apr 6, 2020, 6:45:56 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/editing/indent-pre-user-select-all-crash-expected.txt (added)
-
LayoutTests/fast/editing/indent-pre-user-select-all-crash.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/editing/ApplyBlockElementCommand.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r259612 r259619 1 2020-04-06 Jack Lee <shihchieh_lee@apple.com> 2 3 Nullptr crash in WebCore::lastPositionInNode when indenting text node that has user-select:all parent. 4 https://bugs.webkit.org/show_bug.cgi?id=210016 5 <rdar://problem/61014577> 6 7 Reviewed by Ryosuke Niwa. 8 9 Added a regression test for the crash. 10 11 * fast/editing/indent-pre-user-select-all-crash-expected.txt: Added. 12 * fast/editing/indent-pre-user-select-all-crash.html: Added. 13 1 14 2020-04-06 Jason Lawrence <lawrence.j@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r259618 r259619 1 2020-04-06 Jack Lee <shihchieh_lee@apple.com> 2 3 Nullptr crash in WebCore::lastPositionInNode when indenting text node that has user-select:all parent. 4 https://bugs.webkit.org/show_bug.cgi?id=210016 5 <rdar://problem/61014577> 6 7 Reviewed by Ryosuke Niwa. 8 9 In rangeForParagraphSplittingTextNodesIfNeeded, added null check for previousSibling() 10 after splitTextNode is called, and returns empty positions to caller. 11 12 In formatSelection, check the returned positions from rangeForParagraphSplittingTextNodesIfNeeded 13 and stop indenting the rest of the paragraphs. 14 15 Test: fast/editing/indent-pre-user-select-all-crash.html 16 17 * editing/ApplyBlockElementCommand.cpp: 18 (WebCore::ApplyBlockElementCommand::formatSelection): 19 (WebCore::ApplyBlockElementCommand::rangeForParagraphSplittingTextNodesIfNeeded): 20 1 21 2020-04-06 Devin Rousso <drousso@apple.com> 2 22 -
trunk/Source/WebCore/editing/ApplyBlockElementCommand.cpp
r246490 r259619 134 134 135 135 rangeForParagraphSplittingTextNodesIfNeeded(endOfCurrentParagraph, start, end); 136 if (start.isNull() || end.isNull()) 137 break; 138 136 139 endOfCurrentParagraph = end; 137 140 … … 242 245 RefPtr<Text> endContainer = end.containerText(); 243 246 splitTextNode(*endContainer, end.offsetInContainerNode()); 247 if (is<Text>(endContainer) && !endContainer->previousSibling()) { 248 start = { }; 249 end = { }; 250 return; 251 } 244 252 if (isStartAndEndOnSameNode) 245 253 start = firstPositionInOrBeforeNode(endContainer->previousSibling());
Note:
See TracChangeset
for help on using the changeset viewer.