Null dereference loading Blink layout test editing/execCommand/delete-hidden-crash...
authorjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Nov 2015 00:46:34 +0000 (00:46 +0000)
committerjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Nov 2015 00:46:34 +0000 (00:46 +0000)
commit821fe57df297ad215e158f66fe283a2cc4effa46
tree5ab3c07b8db65cc988a65b02c36432eca41cc90d
parent8e6653c0549509f771319ddfdfe0752da27aaa25
Null dereference loading Blink layout test editing/execCommand/delete-hidden-crash.html
https://bugs.webkit.org/show_bug.cgi?id=149289
<rdar://problem/22746352>

Reviewed by Enrica Casucci.

Source/WebCore:

This is a merge of Blink r176497:
https://codereview.chromium.org/340713003

It ensures the start & end positions in DeleteSelectionCommand::initializePositionData
are editable.

Test: editing/execCommand/delete-hidden-crash.html

* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::initializePositionData):
* editing/Editor.cpp:
(WebCore::Editor::advanceToNextMisspelling):
* editing/htmlediting.cpp:
(WebCore::firstEditablePositionAfterPositionInRoot):
(WebCore::lastEditablePositionBeforePositionInRoot):
These two functions don't make any sense to return VisiblePosition. Change them
to return Position instead. Since there is a viable conversion from Position to
VisiblePosition. It should not change the behavior of any other components depending
on it.
* editing/htmlediting.h:

LayoutTests:

* editing/execCommand/delete-hidden-crash-expected.txt: Added.
* editing/execCommand/delete-hidden-crash.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192043 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/execCommand/delete-hidden-crash-expected.txt [new file with mode: 0644]
LayoutTests/editing/execCommand/delete-hidden-crash.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/editing/DeleteSelectionCommand.cpp
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/htmlediting.cpp
Source/WebCore/editing/htmlediting.h