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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutListItem.cpp

Issue 1879553003: parent->addChild() can delete parent and any of its siblings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@396717-2
Patch Set: Updated Created 4 years, 8 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 | « third_party/WebKit/LayoutTests/platform/linux/editing/execCommand/create-list-with-hr-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutListItem.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutListItem.cpp b/third_party/WebKit/Source/core/layout/LayoutListItem.cpp
index 6724ab10d058fba3e41a378bdae5c630255ff8ad..68e9df7691a728257a35cb63f73d1b0e33067038 100644
--- a/third_party/WebKit/Source/core/layout/LayoutListItem.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutListItem.cpp
@@ -313,11 +313,9 @@ bool LayoutListItem::updateMarkerLocation()
if (markerParent != lineBoxParent) {
m_marker->remove();
- // If markerParent is now an anonymous block with no children, this is the time to attempt to remove it
- // as it might have gone away after addChild().
- if (markerParent && markerParent->isAnonymousBlock() && !toLayoutBlock(markerParent)->firstChild() && !toLayoutBlock(markerParent)->continuation())
- markerParent->destroy();
lineBoxParent->addChild(m_marker, firstNonMarkerChild(lineBoxParent));
+ // TODO(rhogan): lineBoxParent and markerParent may be deleted by addChild, so they are not safe to reference here.
+ // Once we have a safe way of referencing them delete markerParent if it is an empty anonymous block.
m_marker->updateMarginsAndContent();
return true;
}
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/linux/editing/execCommand/create-list-with-hr-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698