Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1135)

Unified Diff: Source/core/rendering/RenderObject.cpp

Issue 540453003: Get rid of anonymous table* wrappers when they are no longer needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/table/remove-anonymous-row-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « LayoutTests/fast/table/remove-anonymous-row-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698