This directory contains the implementation of Blink's new layout engine “LayoutNG”.
This README can be viewed in formatted form here.
The original design document can be seen here.
CSS has many different types of layout modes, controlled by the display
property. (In addition to this specific HTML elements have custom layout modes as well). For each different type of layout, we have a NGLayoutAlgorithm.
The input to an NGLayoutAlgorithm is the same tuple for every kind of layout:
The NGBox which we are currently performing layout for. The following information is accessed:
The ComputedStyle for the node which we are currently performing laying for.
The list of children NGBoxes to perform layout upon, and their respective style objects.
The NGConstraintSpace which represents the “space” in which the current layout should produce a NGPhysicalFragment.
TODO(layout-dev): BreakTokens should go here once implemented.
The current layout should not access any information outside this set, this will break invariants in the system. (As a concrete example we intend to cache NGPhysicalFragments based on this set, accessing additional information outside this set will break caching behaviour).
TODO(layout-dev): Document with lots of pretty pictures.
TODO(layout-dev): Document with lots of pretty pictures.
TODO(layout-dev): Document with lots of pretty pictures.
This section contains details specific to the NGBlockLayoutAlgorithm.
TODO(layout-dev): Document with lots of pretty pictures.
TODO(layout-dev): Document with lots of pretty pictures.