Crash from empty anonymous block preceding :before content
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Feb 2012 21:56:33 +0000 (21:56 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Feb 2012 21:56:33 +0000 (21:56 +0000)
commit5b67f3fb7b591db5f4868d55f6ad0408066b959c
treef8c32592388f4e6ed7acf607fb5e0d7be640e92f
parentf201fabb467ab8d4c275f5d27792fe7ba721f13e
Crash from empty anonymous block preceding :before content
https://bugs.webkit.org/show_bug.cgi?id=78250

Patch by Ken Buchanan <kenrb@chromium.org> on 2012-02-22
Reviewed by David Hyatt.

Source/WebCore:

RenderListMarkers getting removed from the tree in updateMarkerLocation()
can leave parent anonymous blocks behind with no children. This was
confusing updateBeforeAfterContent() because it does not expect
an empty block to precede :before content renderers.

Fix is to remove the anonymous block if it will lose all of its children.

* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::updateMarkerLocation):

LayoutTests:

Test exercises a crashing condition from extra :before content being
created after a RenderListMarker in an anonymous block has been moved.

Also rebasing some tests that had extraneous anonymous blocks in their
render tree dumps.

* fast/css-generated-content/before-content-with-list-marker-in-anon-block-crash-expected.txt: Added
* fast/css-generated-content/before-content-with-list-marker-in-anon-block-crash.html: Added
* platform/chromium-win/editing/execCommand/create-list-with-hr-expected.txt:
* platform/gtk/editing/execCommand/create-list-with-hr-expected.txt:
* platform/mac/editing/execCommand/create-list-with-hr-expected.txt:
* platform/qt/editing/execCommand/create-list-with-hr-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108548 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css-generated-content/before-content-with-list-marker-in-anon-block-crash-expected.txt [new file with mode: 0644]
LayoutTests/fast/css-generated-content/before-content-with-list-marker-in-anon-block-crash.html [new file with mode: 0644]
LayoutTests/platform/chromium-win/editing/execCommand/create-list-with-hr-expected.txt
LayoutTests/platform/gtk/editing/execCommand/create-list-with-hr-expected.txt
LayoutTests/platform/mac/editing/execCommand/create-list-with-hr-expected.txt
LayoutTests/platform/qt/editing/execCommand/create-list-with-hr-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderListItem.cpp