Changeset 221128 in webkit
- Timestamp:
- Aug 23, 2017, 9:12:55 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/LayoutTests/ChangeLog ¶
r221115 r221128 1 2017-08-23 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 DeleteSelectionCommand should be robust when starting and ending editable positions cannot be found 4 https://bugs.webkit.org/show_bug.cgi?id=175914 5 <rdar://problem/29792688> 6 7 Reviewed by Ryosuke Niwa. 8 9 Adds a new LayoutTest. This test passes if WebKit successfully loaded the page. 10 11 * editing/execCommand/forward-delete-read-write-canvas-expected.txt: Added. 12 * editing/execCommand/forward-delete-read-write-canvas.html: Added. 13 1 14 2017-08-23 Matt Lewis <jlewis3@apple.com> 2 15 -
TabularUnified trunk/Source/WebCore/ChangeLog ¶
r221123 r221128 1 2017-08-23 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 DeleteSelectionCommand should be robust when starting and ending editable positions cannot be found 4 https://bugs.webkit.org/show_bug.cgi?id=175914 5 <rdar://problem/29792688> 6 7 Reviewed by Ryosuke Niwa. 8 9 DeleteSelectionCommand can cause a null dereference if editable start and end positions are not found. This can 10 happen when attempting to delete after selecting the contents within a canvas or output element with `read-write` 11 `-webkit-user-modify` style. To fix this, we make the initialization step of the DeleteSelectionCommand robust 12 when editable start and end positions are missing. 13 14 Test: editing/execCommand/forward-delete-read-write-canvas.html 15 16 * editing/DeleteSelectionCommand.cpp: 17 (WebCore::DeleteSelectionCommand::initializePositionData): 18 19 Make this initialization helper indicate failure via a bool return value. DeleteSelectionCommand::doApply bails 20 early if initializePositionData returned false. 21 22 (WebCore::DeleteSelectionCommand::doApply): 23 * editing/DeleteSelectionCommand.h: 24 1 25 2017-08-23 Youenn Fablet <youenn@apple.com> 2 26 -
TabularUnified trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp ¶
r216233 r221128 173 173 } 174 174 175 voidDeleteSelectionCommand::initializePositionData()175 bool DeleteSelectionCommand::initializePositionData() 176 176 { 177 177 Position start, end; … … 182 182 if (!isEditablePosition(end, ContentIsEditable)) 183 183 end = lastEditablePositionBeforePositionInRoot(end, highestEditableRoot(start)); 184 185 if (start.isNull() || end.isNull()) 186 return false; 184 187 185 188 m_upstreamStart = start.upstream(); … … 273 276 m_startBlock = enclosingNodeOfType(m_downstreamStart.parentAnchoredEquivalent(), &isBlock, CanCrossEditingBoundary); 274 277 m_endBlock = enclosingNodeOfType(m_upstreamEnd.parentAnchoredEquivalent(), &isBlock, CanCrossEditingBoundary); 278 279 return true; 275 280 } 276 281 … … 858 863 859 864 // set up our state 860 initializePositionData(); 865 if (!initializePositionData()) 866 return; 861 867 862 868 // Delete any text that may hinder our ability to fixup whitespace after the delete -
TabularUnified trunk/Source/WebCore/editing/DeleteSelectionCommand.h ¶
r216233 r221128 55 55 void initializeStartEnd(Position&, Position&); 56 56 void setStartingSelectionOnSmartDelete(const Position&, const Position&); 57 voidinitializePositionData();57 bool initializePositionData(); 58 58 void saveTypingStyleState(); 59 59 void insertPlaceholderForAncestorBlockContent();
Note:
See TracChangeset
for help on using the changeset viewer.