1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//! Box content-shape classification.
//!
//! [`BoxKind`] distinguishes a box's *content shape* — what it carries —
//! independently of the box's outer / inner display roles. A flex container
//! is still [`BoxKind::Normal`]; only its
//! [`crate::layout::LayoutBox::inner_formatting_context`] switches to
//! [`crate::layout::FormattingContext::Flex`].
//!
//! ## Variants
//!
//! - [`BoxKind::Normal`] — Regular block container.
//! - [`BoxKind::Replaced`] — Leaf whose content is supplied outside the DOM
//! (an `<img>` rasterisation today; room for `<video>` / `<input>` later).
//! - [`BoxKind::Anonymous`] — Synthetic wrapper emitted by the layout engine
//! itself.
/// Content payload of a [`BoxKind::Replaced`] box.
///
/// Browsers treat `<img>` as a *replaced element*: the box's content is
/// supplied by an external source (the image file) rather than by the box's
/// own subtree. The engine extends that model to the form controls, which
/// own their terminal chrome and interactive value instead of rendering a
/// subtree.
/// Distinguishes the rendering shape of a layout box.