Document
Represents a document with a hierarchical structure of elements, styles, and layout capabilities. The Document class manages the layout and styling system by utilizing a Layouter and an observable list of stylesheets.
Features include:
The ability to manage styles through a list of
StyleSheetobjects.Automatic tracking of changes to stylesheets to ensure layout updates are performed when necessary.
Support for laying out the document body based on computed styles from the provided stylesheets.
A controllable lifecycle to clean up resources when the document is no longer in use.
Implements AutoCloseable to ensure that resources such as controlManager, styleSheets, and body are cleaned up appropriately.
Properties
true when the whole layout has to be computed again, like when the window is resized
the elements that asked for their layout to be computed again, see Element.requestLayout
What the media queries of the style sheets are evaluated against; when it changes in a way that changes which style sheets apply, the styles are computed again
Functions
Computes the styles that can have changed, and the layout when it can have changed. adjustStyles changes the computed styles before the layout, like transitions and animations do, and gives true when it changed properties that lay out.