Skip to content

Commit

Permalink
Bug 1731319 [wpt PR 30800] - Pre-paint: Avoid inlines that aren't pre…
Browse files Browse the repository at this point in the history
…sent in a fragmentainer., a=testonly

Automatic update from web-platform-tests
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 <[email protected]>
Commit-Queue: Morten Stenshorne <[email protected]>
Cr-Commit-Position: refs/heads/main@{#922120}

--

wpt-commits: fa627bbd3e4b5a00cb3f91975a57ff0817abdb6a
wpt-pr: 30800
  • Loading branch information
mstensho authored and moz-wptsync-bot committed Oct 4, 2021
1 parent 6dd326e commit c918f8e
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mailto:[email protected]">
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1249769">
<div style="columns:3; column-fill:auto; height:100px;">
<div style="float:left; width:50px; height:250px;"></div>
<br>
<div style="display:inline-block; width:100%; height:10px;"></div>
</div>

0 comments on commit c918f8e

Please sign in to comment.