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

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

Issue 1843213002: Don't attempt to collapse empty anonymous blocks if they might already have been destroyed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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/fast/lists/remove-listmarker-and-make-anonblock-empty-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 0905478e71eb3e1aee3bff94043203efd3b8ef9c..6724ab10d058fba3e41a378bdae5c630255ff8ad 100644
--- a/third_party/WebKit/Source/core/layout/LayoutListItem.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutListItem.cpp
@@ -313,11 +313,12 @@ bool LayoutListItem::updateMarkerLocation()
if (markerParent != lineBoxParent) {
m_marker->remove();
- lineBoxParent->addChild(m_marker, firstNonMarkerChild(lineBoxParent));
- m_marker->updateMarginsAndContent();
- // If markerParent is an anonymous block with no children, destroy it.
+ // 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));
+ m_marker->updateMarginsAndContent();
return true;
}
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/lists/remove-listmarker-and-make-anonblock-empty-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698