Index: Source/core/rendering/RenderObject.cpp |
diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp |
index 0d5279c5aaa1c30e03cd5b8cd70168e6318c9e38..d905112ba5ca62891de0e4d640c25c2288f23a47 100644 |
--- a/Source/core/rendering/RenderObject.cpp |
+++ b/Source/core/rendering/RenderObject.cpp |
@@ -2807,7 +2807,14 @@ void RenderObject::destroyAndCleanupAnonymousWrappers() |
if (destroyRootParent->isRenderFlowThread() || destroyRootParent->isAnonymousColumnSpanBlock()) |
break; |
- if (destroyRootParent->slowFirstChild() != this || destroyRootParent->slowLastChild() != this) |
+ if (destroyRootParent->slowFirstChild() != destroyRoot || destroyRootParent->slowLastChild() != destroyRoot) |
+ break; // Need to keep the anonymous parent, since it won't become empty by the removal of this renderer. |
+ |
+ // If it's an anonymous table* renderer ancestor that's going to become empty, destroy it, |
+ // no matter how far up in the ancestry it is. Otherwise, stop when we have walked one level |
+ // up. Table* renderers is the only case where we know that it's necessary and safe to walk |
+ // further up than one level. |
+ if (destroyRoot != this && !destroyRootParent->isTableCell() && !destroyRootParent->isTableRow() && !destroyRootParent->isTableSection() && !destroyRootParent->isTable()) |
Julien - ping for review
2014/09/08 21:28:49
This seems very artificial to limit this to table
mstensho (USE GERRIT)
2014/09/16 13:00:07
Done.
|
break; |
} |