Changeset 228724 in webkit
- Timestamp:
- Feb 19, 2018, 7:21:53 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r228718 r228724 1 2018-02-19 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 null m_lastNodeInserted dereference at ReplaceSelectionCommand::InsertedNodes::lastLeafInserted 4 https://bugs.webkit.org/show_bug.cgi?id=161947 5 6 Reviewed by Ryosuke Niwa. 7 8 * platform/gtk/TestExpectations: 9 Unmarked editing/execCommand/crash-replacing-list-by-list.html and editing/inserting/insert-table-in-paragraph-crash.html. 10 1 11 2018-02-19 Antoine Quint <graouts@apple.com> 2 12 -
trunk/LayoutTests/platform/gtk/TestExpectations
r228618 r228724 1301 1301 webkit.org/b/172281 accessibility/insert-children-assert.html [ Crash ] 1302 1302 1303 webkit.org/b/172951 editing/execCommand/crash-replacing-list-by-list.html [ Crash ]1304 webkit.org/b/172951 editing/inserting/insert-table-in-paragraph-crash.html [ Crash ]1305 1306 1303 webkit.org/b/172955 media/video-preload.html [ Crash Pass ] 1307 1304 -
trunk/Source/WebCore/ChangeLog
r228721 r228724 1 2018-02-19 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 null m_lastNodeInserted dereference at ReplaceSelectionCommand::InsertedNodes::lastLeafInserted 4 https://bugs.webkit.org/show_bug.cgi?id=161947 5 6 Reviewed by Ryosuke Niwa. 7 8 InsertedNodes happened to be empty if the inserted nodes were 9 removed. Add more checks if InsertedNodes is empty. 10 11 No new tests (Covered by existing tests). 12 13 * editing/ReplaceSelectionCommand.cpp: 14 (WebCore::ReplaceSelectionCommand::doApply): Return early if InsertedNodes becomes empty. 15 * editing/ReplaceSelectionCommand.h: 16 (WebCore::ReplaceSelectionCommand::InsertedNodes::isEmpty): New method. 17 (WebCore::ReplaceSelectionCommand::InsertedNodes::lastLeafInserted const): 18 Assert m_lastNodeInserted is not null. 19 (WebCore::ReplaceSelectionCommand::InsertedNodes::pastLastLeaf const): Ditto. 20 1 21 2018-02-19 Said Abou-Hallawa <sabouhallawa@apple.com> 2 22 -
trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp
r228482 r228724 1143 1143 } 1144 1144 1145 if (insertedNodes.isEmpty()) 1146 return; 1145 1147 removeUnrenderedTextNodesAtEnds(insertedNodes); 1146 1148 … … 1149 1151 1150 1152 // Mutation events (bug 20161) may have already removed the inserted content 1151 if (!insertedNodes.firstNodeInserted() || !insertedNodes.firstNodeInserted()->isConnected()) 1153 if (insertedNodes.isEmpty()) 1154 return; 1155 if (!insertedNodes.firstNodeInserted()->isConnected()) 1152 1156 return; 1153 1157 … … 1170 1174 1171 1175 makeInsertedContentRoundTrippableWithHTMLTreeBuilder(insertedNodes); 1176 if (insertedNodes.isEmpty()) 1177 return; 1172 1178 1173 1179 removeRedundantStylesAndKeepStyleSpanInline(insertedNodes); 1180 if (insertedNodes.isEmpty()) 1181 return; 1174 1182 1175 1183 if (m_sanitizeFragment) -
trunk/Source/WebCore/editing/ReplaceSelectionCommand.h
r216351 r228724 70 70 void didReplaceNode(Node*, Node* newNode); 71 71 72 bool isEmpty() { return !m_firstNodeInserted; } 72 73 Node* firstNodeInserted() const { return m_firstNodeInserted.get(); } 73 Node* lastLeafInserted() const { return m_lastNodeInserted->lastDescendant(); } 74 Node* lastLeafInserted() const 75 { 76 ASSERT(m_lastNodeInserted); 77 return m_lastNodeInserted->lastDescendant(); 78 } 74 79 Node* pastLastLeaf() const 75 80 { 76 if (m_lastNodeInserted) { 77 ASSERT(lastLeafInserted()); 78 return NodeTraversal::next(*lastLeafInserted()); 79 } 80 return nullptr; 81 ASSERT(m_lastNodeInserted); 82 return NodeTraversal::next(*lastLeafInserted()); 81 83 } 82 84
Note:
See TracChangeset
for help on using the changeset viewer.