Crashes in WebCore::AppendNodeCommand::create().
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Sep 2011 09:13:19 +0000 (09:13 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Sep 2011 09:13:19 +0000 (09:13 +0000)
commit74b0577aeb810c062d8cc0be9825d8794ce030a9
treee575e43799ef78c04c30b800b71256e0816457b6
parent1b99cd84b47ba14440cb45d71cd87eb6dd3a594d
Crashes in WebCore::AppendNodeCommand::create().
https://bugs.webkit.org/show_bug.cgi?id=67767

Patch by Shinya Kawanaka <shinyak@google.com> on 2011-09-09
Reviewed by Darin Adler.

Source/WebCore:

In CompositeEditCommand::closeParagraphUnderNewElement(), lastNode could be a non Element node.
The current code assumes lastNode is an Element node. This patch checks it.

Test: editing/execCommand/ident-crashes-topnode-is-text.html

* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::cloneParagraphUnderNewElement): Added an element node check.

LayoutTests:

Added a crash test case.

* editing/execCommand/ident-crashes-topnode-is-text-expected.txt: Added.
* editing/execCommand/ident-crashes-topnode-is-text.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94841 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/execCommand/ident-crashes-topnode-is-text-expected.txt [new file with mode: 0644]
LayoutTests/editing/execCommand/ident-crashes-topnode-is-text.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/editing/CompositeEditCommand.cpp