aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/platform/macos.py
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2025-05-01 17:23:10 +0200
committerMartin Robinson <mrobinson@igalia.com>2025-05-01 17:32:18 +0200
commit84bf00c2787bbc121f79cc843cb437efe3c24b08 (patch)
tree263c6bd64848ef810d75cfffe38cf6784dd48e03 /python/servo/platform/macos.py
parentd1f7a906195b81daa8a5120f6c1a25a0cbd9fcdc (diff)
downloadservo-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 'python/servo/platform/macos.py')
0 files changed, 0 insertions, 0 deletions