gecko-dev/layout
Timothy Nikkel 5fe231c04b Bug 1677568. Handle a rare case of a placeholder and its out of flow frame not being in the same continuation of it's containing block frame in retained display list code. r=mstange
This testcase hits a rare condition where the abs pos frame is under the first continuation of the containing block frame, but the placeholder frame is under the next continuation of th containing block frame. This means that the walk in FindContainingBlocks which adds the ForceDescendIntoIfVisible bit to all ancestors of modified frames (walking through placeholders) never marks the first continuation of the containing block frame, which is the actual frame that contains the modified frame. That means that we don't walk into the containing block for the modified abs pos frame, and so we don't call MarkAbsoluteFramesForDisplayList, which computes the dirty rect for the abs pos frame, and if it is non-empty it would walk it's ancestor chain through placeholders and add the NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO bit. But we don't do that, so when we come to build the display list for the placeholder frame, the placeholder frame has size 0x0 of course, so we determine it is not visible, and even though the ForceDescendIntoIfVisible bit is set on it, since it's not visible we don't descend into it. We need the NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO bit which would have been set.

So for this to work we need to make sure in addition to the ancestor chain walking through placeholders has the ForceDescendIntoIfVisible bit set, we also need to make sure the normal GetParent ancestor chain has that bit set. So anywhere that we use GetDisplayListParent where this kind of fix seems like it is needed we need to modify. We try to be a bit clever to try to avoid any extra work for this rare case. We do this by checking if we are going to be jumping to the placeholder, and if so we make sure to mark the parent of the current frame, before continuing up the GetDisplayListParent walk. This doesn't visit anymore frames as in the common case we stop the walk when we get to the parent frame because the ForceDescendIntoIfVisible bit is set on it. This does add a function call overhead though.

When we hit this condition we do have to walk more frames. To make sure this condition isn't too common, and thus aren't making ourselves walk a lot more frames, I did a full try run on linux to see how often it was hit. We hit it 3 times. layout/base/crashtests/1464641.html which is a reduced testcase of another retained display list bug. testing/web-platform/tests/svg/layout/svg-with-precent-dimensions-relayout.html. And layout/reftests/display-list/1709452-1.html which is another retained display list bug, which also has to do with continuations and it is almost an identical copy of the reduced testcase of this bug.

Differential Revision: https://phabricator.services.mozilla.com/D174458
2023-04-12 10:52:05 +00:00
..
base Bug 1677568. Handle a rare case of a placeholder and its out of flow frame not being in the same continuation of it's containing block frame in retained display list code. r=mstange 2023-04-12 10:52:05 +00:00
build Bug 1824489 - Remove nsBoxFrame, nsBoxLayout and related code. r=jwatt 2023-03-27 23:25:42 +00:00
docs Bug 1807899 - Remove the trailing whitespace and Windows CR on md files r=linter-reviewers,necko-reviewers,marco,jesup 2022-12-30 15:23:21 +00:00
forms Bug 1827304 - Don't override BuildDisplayList in nsFileControlFrame. r=dholbert 2023-04-11 01:07:22 +00:00
generic Bug 1827411 - Compilation failure when enabling NOISY_FINAL_SIZE or REALLY_NOISY_REFLOW flags. r=emilio 2023-04-12 08:40:41 +00:00
inspector Bug 1826517 - Simplify DevTools' walker. r=smaug,devtools-reviewers,nchevobbe 2023-04-10 11:18:38 +00:00
ipc
mathml Bug 1519636 - Reformat recent changes to the Google coding style. r=glandium 2023-02-13 15:02:07 +00:00
media
painting Bug 1677568. Handle a rare case of a placeholder and its out of flow frame not being in the same continuation of it's containing block frame in retained display list code. r=mstange 2023-04-12 10:52:05 +00:00
printing Bug 1819468 - Do not propagate page names from subclasses of block frames r=dholbert 2023-03-28 22:22:59 +00:00
reftests Bug 1677568. Handle a rare case of a placeholder and its out of flow frame not being in the same continuation of it's containing block frame in retained display list code. r=mstange 2023-04-12 10:52:05 +00:00
style Bug 1751025 - Opacity CSS property should apply to all children of text elements r=jfkthame 2023-04-11 22:08:24 +00:00
svg Bug 1751025 - Opacity CSS property should apply to all children of text elements r=jfkthame 2023-04-11 22:08:24 +00:00
tables Bug 1055894 - Add GetLogicalNormalRect() and adapt some callers of GetNormalRect(). r=emilio 2023-04-01 04:17:05 +00:00
tools Bug 1818604 - unbreak loading files using 'open file' in the layout debugger, r=emilio 2023-03-31 14:43:06 +00:00
xul Bug 1751025 - Opacity CSS property should apply to all children of text elements r=jfkthame 2023-04-11 22:08:24 +00:00
moz.build