diff options
author | Martin Robinson <mrobinson@igalia.com> | 2025-05-01 17:23:10 +0200 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2025-05-01 17:32:18 +0200 |
commit | 84bf00c2787bbc121f79cc843cb437efe3c24b08 (patch) | |
tree | 263c6bd64848ef810d75cfffe38cf6784dd48e03 /components/script/dom/bindings/codegen/parser/module.patch | |
parent | d1f7a906195b81daa8a5120f6c1a25a0cbd9fcdc (diff) | |
download | servo-84bf00c2787bbc121f79cc843cb437efe3c24b08.tar.gz servo-84bf00c2787bbc121f79cc843cb437efe3c24b08.zip |
layout: Simplify `PositioningContext`
`PositioiningContext` held two vectors, one inside an `Optional`, to
differeniate between the version used for a containing block for all
descendants (including `position: absolute` and `position: fixed`) or
only for `position: absolute` descendants. This distinction was really
hard to reason about and required a lot of bookkeeping about what kind
of `PositioningContext` a layout box's parent expected. In addition, it
led to a lot of mistakes.
This change simplifies things so that `PositioningContext` only holds a
single vector. When it comes time lay out hoisted absolutely positioned
fragments, the code then either:
- lays out all of them (in the case of a `PositioningContext` for all
descendants), or
- only lays out the `position: absolute` descendants and preserves the
`position: fixed` descendants (in the case the `PositioningContext`
is only for `position: absolute`.)
It's possible that this way of dealing with hoisted absolutes is a bit
less efficient, but in general, the number of these descendants is quite
small, so it should not be significant. In addition, this decreases the
size in memory of all `PositioningContexts` which are created in more
situations everyday.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Diffstat (limited to 'components/script/dom/bindings/codegen/parser/module.patch')
0 files changed, 0 insertions, 0 deletions