Null dereference loading Blink layout test editing/execCommand/insert-html-to-documen...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Oct 2015 22:03:55 +0000 (22:03 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Oct 2015 22:03:55 +0000 (22:03 +0000)
commit41892c2cdca37e0e0cfd6ea727fa4c34f8e5aba1
tree3e341ea4d7c2e119c01615c0ad88e5cd82668a88
parent6145745a4d24de8d747f7d67aff109db44438175
Null dereference loading Blink layout test editing/execCommand/insert-html-to-document-element-crash.html
https://bugs.webkit.org/show_bug.cgi?id=149294
<rdar://problem/22746657>

Patch by Jiewen Tan <jiewen_tan@apple.com> on 2015-10-26
Reviewed by Darin Adler.

Source/WebCore:

This is a merge of Blink r175019:
https://codereview.chromium.org/300143012

Test: editing/execCommand/insert-html-to-document-element-crash.html

* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
check nullable value |element->parentNode()| before using it.

LayoutTests:

* editing/execCommand/insert-html-to-document-element-crash-expected.txt: Added.
* editing/execCommand/insert-html-to-document-element-crash.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191604 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/execCommand/insert-html-to-document-element-crash-expected.txt [new file with mode: 0644]
LayoutTests/editing/execCommand/insert-html-to-document-element-crash.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/editing/ReplaceSelectionCommand.cpp