Calling window.find immediately after mutating the document crashes WebKit.
authorRyosuke Niwa <rniwa@webkit.org>
Thu, 28 Jul 2011 05:24:41 +0000 (05:24 +0000)
committerAdemar de Souza Reis Jr <ademar.reis@openbossa.org>
Fri, 29 Jul 2011 14:52:51 +0000 (11:52 -0300)
commit8c104c0f5f21a71269716ea9d84ba20ca78b81ab
tree5ceee9fcac7ce705796b4ff64c47eb9e2dad3e7b
parenteb83f1fc36d6c59b13b2b6f077d6eb7027d35fc6
Calling window.find immediately after mutating the document crashes WebKit.
https://bugs.webkit.org/show_bug.cgi?id=65296

Reviewed by Darin Adler.

Source/WebCore:

Don't forget to layout first.

Test: editing/text-iterator/find-after-mutation.html

* editing/TextIterator.cpp:
(WebCore::findPlainText):

LayoutTests:

Added a test to ensure WebKit doesn't crash when searching for string after mutating the document.

* editing/text-iterator/find-after-mutation-expected.txt: Added.
* editing/text-iterator/find-after-mutation.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@91908 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/text-iterator/find-after-mutation-expected.txt [new file with mode: 0644]
LayoutTests/editing/text-iterator/find-after-mutation.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/editing/TextIterator.cpp