/// - `verify` — dense path PLUS an A/B assert against the reference; the e2e corpus run with this
pub fn should_replace_with(&self, new_width: AvailableSpace, new_has_floats: bool) -> bool {
// +spec:display-property:b7f4bf - anonymous inline/block boxes are both called "anonymous boxes"
let mut run_arcs: alloc::collections::BTreeSet<usize> = alloc::collections::BTreeSet::new();
if let (Some(hot), Some(cold)) = (self.nodes.get_mut(node_index), self.cold.get(node_index))
pub fn get_inline_layout_for_node(&self, layout_index: usize) -> Option<&Arc<UnifiedLayout>> {
fn compute_subtree_needs_intrinsic(styled_dom: &StyledDom, tree: &LayoutTree) -> Vec<bool> {
let node_idx = self.create_node_from_dom(styled_dom, dom_id, parent_idx, debug_messages);
let raw_display = if raw_display.is_layout_internal() && is_replaced_element(node_data) {
// +spec:display-property:5572e7 - Anonymous block boxes: wrap inline runs when block container
// properties inherited from enclosing non-anonymous box; non-inherited props get initial values
// +spec:table-layout:6bb84e - Anonymous table object generation (stages 1-3: remove irrelevant
// +spec:display-property:ee83bf - Anonymous box generation: boxes not associated with elements,
// +spec:display-property:6ff51a - anonymous block boxes have no styles (box_props default), so
let collected = collect_box_props(styled_dom, dom_id, debug_messages, self.viewport_size);
hierarchy: &azul_core::id::NodeDataContainerRef<'_, azul_core::styled_dom::NodeHierarchyItem>,
// +spec:display-property:697082 - outer display type determines principal box's role in flow layout
// 'list-item', 'table' generate block-level boxes +spec:display-property:9464be - block-level vs
// +spec:display-property:c2520b - Block containers with only inline-level children establish IFC;
// +spec:display-property:75d642 - block container with only inline-level content establishes IFC
// +spec:display-property:c188d6 - IFC: all inline content within a containing block flows together
pub(crate) fn has_only_inline_children(styled_dom: &StyledDom, node_id: NodeId) -> bool {
fn compute_layout_style(styled_dom: &StyledDom, dom_id: NodeId) -> ComputedLayoutStyle {
let position = get_position(styled_dom, dom_id, &styled_node_state).unwrap_or_default();
let own_wm = get_writing_mode(styled_dom, dom_id, &styled_node_state).unwrap_or_default();
let direction = get_direction(styled_dom, dom_id, &styled_node_state).unwrap_or_default();
let text_align = get_text_align(styled_dom, dom_id, &styled_node_state).unwrap_or_default();
// +spec:box-model:ec6466 - percentage margins/padding resolve to 0 when containing block is
/// Collects box properties from the styled DOM and returns both unresolved and resolved forms.
#[allow(clippy::too_many_lines)] // large but cohesive: single-purpose layout/render/parse routine
let style_zeroes_width = |s: BorderStyle| matches!(s, BorderStyle::None | BorderStyle::Hidden);
/// - CSS 2.2 section 17.2.1 (tables): whitespace between table structural elements is "irrelevant"
/// Returns true if the given display type is a "proper table child" of a table/inline-table box.
// +spec:display-contents:95faa5 - blockification has no effect on none/contents (other => other)
// +spec:display-property:f68848 - Automatic box type transformations: blockification of computed
/// +spec:display-property:d50f70 - blockification affects computed values, determining principal
// +spec:display-property:ee2d65 - blockification of inline-level display types (CSS Display 3 §2.7)
// +spec:display-property:285fe7 - block box establishing a BFC (block-level block container with
fn establishes_new_block_formatting_context(styled_dom: &StyledDom, node_id: NodeId) -> bool {
// +spec:replaced-elements:4f494d - replaced elements always establish an independent formatting
// +spec:display-property:0d93f1 - maps display value to box generation (principal box, none, or
/// Like `determine_formatting_context`, but uses an explicit (possibly blockified) display type
// +spec:display-property:80f43f - inner display type defines formatting context for non-replaced
// elements +spec:display-property:46e71c - Maps outer display (block/inline) and inner display
// display types to formatting contexts (inline-level, block-level, atomic inline, block container)
// enum/value mapping/dispatch table: one arm per input variant (or cross-type bindings that can't
!has_children && crate::solver3::getters::is_node_contenteditable_inherited(styled_dom, node_id)
fn determine_formatting_context(styled_dom: &StyledDom, node_id: NodeId) -> FormattingContext {