Commit fa627bb
Pre-paint: Avoid inlines that aren't present in a fragmentainer.
If the parent block fragment isn't an inline formatting context, we
generally don't need to enter inlines, except that we need to clear the
paint flags. Therefore, only enter inlines if the parent is at the last
fragment. Entering at any other fragment may cause us to update the
paint offset, which might set paint invalidation flags for no good
reason.
In the test included, there's a tall float in an inline formatting
context, taking up three columns. There's a line in the first column
with just a BR element. There's also a wide inline-block, but it doesn't
fit beside the float, so it gets pushed to the third column, where we
create a line for it below the float. When a float in an inline
formatting context breaks, it's resumed as a regular block. An inline
formatting context will only be created if there's actual inline content
there as well. So, the second column doesn't get any inline content at
all (i.e. no fragment items).
Therefore we'd visit the BR element in the first column (correct - this
is where the element is). We'd then re-enter it in the second column
(because we had no inline formatting context to search, and just enter
everything - this is bad), and update the paint offset (and possibly
other things), and set invalidation flags. In the third column we'll not
enter it, because there we have an inline formatting context to search
(and the BR will not be found). So we'd end up with paint invalidation
flags not cleared.
Bug: 1249769
Change-Id: Icaa583c0bb1a034a7a2690ab6bc27cbcb7010f75
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3162102
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/main@{#922120}1 parent c9a9e8d commit fa627bb
1 file changed
+8
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
0 commit comments