Crash in visiblePositionForIndex
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Feb 2012 01:43:50 +0000 (01:43 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Feb 2012 01:43:50 +0000 (01:43 +0000)
commitdd7274c798c46f3e04f40df8e52f6313df3c1dc2
tree5b67db002c2532b2988c24923731329f3b7d9676
parentf95ade39ddcd76cce606bcd31572f40f1aaee6c7
Crash in visiblePositionForIndex
https://bugs.webkit.org/show_bug.cgi?id=77683

Reviewed by Eric Seidel.

Source/WebCore:

Fixed the crash.

Test: editing/execCommand/applyblockelement-visiblepositionforindex-crash.html

* editing/ApplyBlockElementCommand.cpp:
(WebCore::ApplyBlockElementCommand::doApply):
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::doApply):
* editing/htmlediting.cpp:
(WebCore::indexForVisiblePosition):
* editing/htmlediting.h:
(WebCore):

LayoutTests:

Add a regression test. It crashes Webkit with very high frequency.

* editing/execCommand/applyblockelement-visiblepositionforindex-crash-expected.txt: Added.
* editing/execCommand/applyblockelement-visiblepositionforindex-crash.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@108009 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/execCommand/applyblockelement-visiblepositionforindex-crash-expected.txt [new file with mode: 0644]
LayoutTests/editing/execCommand/applyblockelement-visiblepositionforindex-crash.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/editing/ApplyBlockElementCommand.cpp
Source/WebCore/editing/InsertListCommand.cpp
Source/WebCore/editing/htmlediting.cpp
Source/WebCore/editing/htmlediting.h