Commit d9617b1
committed
Block reusing may remove floating object too early
https://bugs.webkit.org/show_bug.cgi?id=290862
<rdar://147215658>
Reviewed by Antti Koivisto.
"Reusing block" type mutations (see RenderTreeBuilder::Inline::splitFlow) followed by float removal may lead to an unexpected state where we have a float to remove, but we have already destroyed m_floatingObjects, causing us to incorrectly assume that the float no longer belongs here (markSiblingsWithFloatsForLayout) and, therefore, does not need to be removed from sibling blocks (in case it is intrusive).
What happens here is:
1. tree mutation makes an anon block reused (pre block)
2. a float is removed from said anon block's subtree
At #1 we call removeFloatingObjects() which simply clears and destroys m_floatingObjects on the anon block.
Now at #2, when we try to remove this float from sibling block containers by calling RenderBlockFlow::markSiblingsWithFloatsForLayout, and we consult
m_floatingObjects to see if there's any float associated with the block and we early return as we had already cleared this set at #1.
This patch ensures that when markSiblingsWithFloatsForLayout is called with a valid float, we always try to clean up sibling content.
* LayoutTests/fast/block/float-remove-after-block-collapse-crash-expected.txt: Added.
* LayoutTests/fast/block/float-remove-after-block-collapse-crash.html: Added.
* Source/WebCore/rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::markSiblingsWithFloatsForLayout):
Change
for (siblings)
for (set items)
to
for (set items)
for (siblings)
so that the 'for (siblings)' logic can be moved to a lambda and used when there's a valid incoming float.
Canonical link: https://commits.webkit.org/293094@main1 parent 2275c98 commit d9617b1
File tree
3 files changed
+65
-15
lines changed- LayoutTests/fast/block
- Source/WebCore/rendering
3 files changed
+65
-15
lines changedLines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Lines changed: 44 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3069 | 3069 | | |
3070 | 3070 | | |
3071 | 3071 | | |
3072 | | - | |
3073 | | - | |
3074 | | - | |
3075 | | - | |
3076 | | - | |
3077 | | - | |
3078 | | - | |
3079 | | - | |
3080 | | - | |
3081 | | - | |
| 3072 | + | |
3082 | 3073 | | |
3083 | | - | |
3084 | | - | |
3085 | | - | |
| 3074 | + | |
| 3075 | + | |
| 3076 | + | |
| 3077 | + | |
3086 | 3078 | | |
3087 | | - | |
3088 | | - | |
| 3079 | + | |
| 3080 | + | |
3089 | 3081 | | |
| 3082 | + | |
| 3083 | + | |
| 3084 | + | |
| 3085 | + | |
| 3086 | + | |
3090 | 3087 | | |
| 3088 | + | |
| 3089 | + | |
| 3090 | + | |
| 3091 | + | |
| 3092 | + | |
| 3093 | + | |
3091 | 3094 | | |
3092 | 3095 | | |
3093 | 3096 | | |
| |||
0 commit comments