Commit 1b53933
committed
[css-lists]
https://bugs.webkit.org/show_bug.cgi?id=254575
Reviewed by Antti Koivisto.
1. In order to update counters in IFC, the containing RenderBlockFlow needs to get invalidated (a new InlineTextBox is created for the text).
2. With in-flow pseudo renderers, where the RenderCounter is nested inside an inline box,
invalidation goes through the normal styleDidChange codepath.
RenderBlockFlow (A) <- this is where the counter is.
<pseudo> RenderInline (B) <- in-flow :after
RenderCounter (C)
However out-of-flow pseudo content initiates a different type of tree structure
where the RenderCounter is not part of the initial RenderBlockFlow anymore
RenderBlockFlow (A) <- this is where the counter is
<pseudo> RenderBlockFlow (B) <- out-of-flow :after
RenderCounter (C)
Which means invalidating (A) (where the style change happens) does not trigger an IFC tree re-build at (B)
and we end up re-layouting the exact same content over again (C).
This patch ensures we always invalidate the block flow where the damage happens
(and this should cover some more involved cases with counters in arbitrary number of subtrees).
* LayoutTests/fast/dynamic/out-of-flow-counter-do-not-update-expected.html: Added.
* LayoutTests/fast/dynamic/out-of-flow-counter-do-not-update.html: Added.
* Source/WebCore/rendering/CounterNode.cpp:
(WebCore::CounterNode::resetRenderers): This function is called whenever a new counter node is added/removed/updated. This is also where we call setNeedsLayoutAndPrefWidthsRecalc
which eventually updates the counter for legacy line layout.
Canonical link: https://commits.webkit.org/262269@maincontent: counter() does not update visually if position: absolute is set1 parent b7ff1b3 commit 1b53933
File tree
3 files changed
+26
-1
lines changed- LayoutTests/fast/dynamic
- Source/WebCore/rendering
3 files changed
+26
-1
lines changedLines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
Lines changed: 15 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
179 | 180 | | |
180 | 181 | | |
181 | 182 | | |
182 | | - | |
| 183 | + | |
183 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
184 | 188 | | |
185 | 189 | | |
186 | 190 | | |
| |||
0 commit comments