Changeset 286553 in webkit
- Timestamp:
- Dec 6, 2021, 11:13:26 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/editing/execCommand/insert-line-break-crash-expected.txt (added)
-
LayoutTests/editing/execCommand/insert-line-break-crash.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/editing/InsertLineBreakCommand.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r286550 r286553 1 2021-12-06 Rob Buis <rbuis@igalia.com> 2 3 Null check in shouldUseBreakElement 4 https://bugs.webkit.org/show_bug.cgi?id=229275 5 6 Reviewed by Ryosuke Niwa. 7 8 * editing/execCommand/insert-line-break-crash-expected.txt: Added. 9 * editing/execCommand/insert-line-break-crash.html: Added. 10 1 11 2021-12-06 Tadeu Zagallo <tzagallo@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r286550 r286553 1 2021-12-06 Rob Buis <rbuis@igalia.com> 2 3 Null check in shouldUseBreakElement 4 https://bugs.webkit.org/show_bug.cgi?id=229275 5 6 Reviewed by Ryosuke Niwa. 7 8 Need to null check node in shouldUseBreakElement. 9 Also bail out early in InsertLineBreakCommand::doApply 10 in case position is not editable. 11 12 Test: editing/execCommand/insert-line-break-crash.html 13 14 * editing/InsertLineBreakCommand.cpp: 15 (WebCore::InsertLineBreakCommand::shouldUseBreakElement): 16 (WebCore::InsertLineBreakCommand::doApply): 17 1 18 2021-12-06 Tadeu Zagallo <tzagallo@apple.com> 2 19 -
trunk/Source/WebCore/editing/InsertLineBreakCommand.cpp
r266557 r286553 61 61 // parent's renderer. 62 62 auto* node = position.parentAnchoredEquivalent().deprecatedNode(); 63 return node ->renderer() && !node->renderer()->style().preserveNewline();63 return node && node->renderer() && !node->renderer()->style().preserveNewline(); 64 64 } 65 65 … … 82 82 position = positionOutsideTabSpan(position); 83 83 84 if (!isEditablePosition(position)) 85 return; 86 84 87 RefPtr<Node> nodeToInsert; 85 88 if (shouldUseBreakElement(position)) … … 92 95 if (isEndOfParagraph(caret) && !lineBreakExistsAtVisiblePosition(caret)) { 93 96 bool needExtraLineBreak = !is<HTMLHRElement>(*position.deprecatedNode()) && !is<HTMLTableElement>(*position.deprecatedNode()); 94 97 95 98 insertNodeAt(*nodeToInsert, position); 96 99
Note:
See TracChangeset
for help on using the changeset viewer.