Skip to content

Commit

Permalink
Fix crash during counters attachment
Browse files Browse the repository at this point in the history
Counters stack can be empty when we do LeaveElement, instead of DCHECK,
check it in if and just leave function.

DCHECK was hit when there is some li without ol/ul element at first that
create ListOrdinal, but after it in the tree there is another li that
is not sibling or descendant of previous li and doesn't have
ListOrdinal. In this case second li would remove first one during
RemoveStaleCounters, and later would try to remove itself during
RemoveCounterIfAncestorExists, assuming that it created the counter
itself.

Fixed: 339592908, 339641168
Change-Id: I09caa992256bba4e4844b3d0943f6d6c7047f6a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5526739
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Commit-Queue: Daniil Sakhapov <sakhapov@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1299205}
  • Loading branch information
danielsakhapov authored and chromium-wpt-export-bot committed May 10, 2024
1 parent ecc87da commit 69bf0d4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions css/css-lists/li-without-ul-counter-crash.html
@@ -0,0 +1,6 @@
<!doctype html>
<html>
<link rel="help" href="http://crbug.com/339592908">
<div><li></li></div>
<div><li style="display: inline-flex;"></li></div>
</html>

0 comments on commit 69bf0d4

Please sign in to comment.