Instead of passing a `damage` variable around during a single layout,
have the
damage update flags immediately on the `LayoutImpl`. This ensure that
damage from a restyle are not lost event when a layout query doesn't
need a display list or stacking context tree. In addition, it makes it
so that this is handled consistently across all different kinds of
layout (from queries or for display lists).
Testing: This should fix the test case from #40367.
Fixes: #40367.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>