servo/components/layout_2020/flexbox
Martin Robinson 459a7d26aa
Simplify layout of absolutes with static insets
Absolutes with static insets need to be laid out at their ancestor
containing blocks, but their position is dependent on their parent's
layout. The static layout position is passed up the tree during hoisting
and ancestors each add their own offset to the position until it is
relative to the containing block that contains the absolute.

This is currently done with a closure and a fairly tricky "tree rank"
numbering system that needs to be threaded through the entire layout.
This change replaces that system.

Every time a child is laid out we create a positioning context to hold
any absolute children (this can be optimized away at a later time). At
each of these moments, we call a method to aggregate offsets to the
static insets of hoisted absolutes. This makes the logic easier to
follow and will also allow implementing this behavior for inline-blocks,
which was impossible with the old system.
2023-06-20 11:44:25 +02:00
..
construct.rs Combine DOM-related concepts in Layout 2020 into dom.rs 2023-05-13 11:52:59 +02:00
geom.rs First pass at implementing the Flex Layout Algorithm 2020-06-23 00:41:27 +02:00
layout.rs Simplify layout of absolutes with static insets 2023-06-20 11:44:25 +02:00
mod.rs First pass at implementing the Flex Layout Algorithm 2020-06-23 00:41:27 +02:00