Index: Source/core/rendering/RenderObjectChildList.cpp |
diff --git a/Source/core/rendering/RenderObjectChildList.cpp b/Source/core/rendering/RenderObjectChildList.cpp |
index 37dd867b906b1e813ddc27fc2626dd35c74a18aa..8eff97c2c4c9c8f7a8f4c72187128989586f9b8a 100644 |
--- a/Source/core/rendering/RenderObjectChildList.cpp |
+++ b/Source/core/rendering/RenderObjectChildList.cpp |
@@ -45,16 +45,14 @@ void RenderObjectChildList::trace(Visitor* visitor) |
void RenderObjectChildList::destroyLeftoverChildren() |
{ |
while (firstChild()) { |
- // List markers are owned by their enclosing list and so don't get destroyed by this container. |
- if (firstChild()->isListMarker()) { |
- firstChild()->remove(); |
- continue; |
+ if (firstChild()->isListMarker() || (firstChild()->style()->styleType() == FIRST_LETTER && !firstChild()->isText())) { |
+ firstChild()->remove(); // List markers are owned by their enclosing list and so don't get destroyed by this container. Similarly, first letters are destroyed by their remaining text fragment. |
+ } else { |
+ // Destroy any anonymous children remaining in the render tree, as well as implicit (shadow) DOM elements like those used in the engine-based text fields. |
+ if (firstChild()->node()) |
+ firstChild()->node()->setRenderer(0); |
+ firstChild()->destroy(); |
} |
- |
- // Destroy any anonymous children remaining in the render tree, as well as implicit (shadow) DOM elements like those used in the engine-based text fields. |
- if (firstChild()->node()) |
- firstChild()->node()->setRenderer(0); |
- firstChild()->destroy(); |
} |
} |