Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283//! Every value the engine has for a box when it calls the `margin_classify` generated//! function, under the one name and type each value has, and the fixed fields of the//! function's answer.//!//! The function's types file (`margin_classify_types.rs`) is written by a model, and the//! engine fills its inputs struct without knowing in advance which values it holds: the//! call sites (`fragment.rs` `stack_children`, `layout_inline_children` and//! `layout_table_children`) build a [`MarginClassifyEngineValues`], and//! `margin_classify::inputs_from`, which `build.rs` writes from the types file in place,//! copies each field the inputs struct declares from the field of the same name here. So a//! types file's inputs struct may only take fields of [`MarginClassifyEngineValues`], under//! the same names and types, and its outputs struct has exactly the fields of//! [`MarginClassifyEngineAnswer`]. `job-check types --engine` checks both on the file alone//! (`jobs/src/types_file.rs` `check_names`).//!//! The list holds more than the function needs on purpose: choosing which values the//! specification's rules read is the types file's work. A value not listed here is not//! available at the call, because the engine does not compute it at that point. The//! computed `min-height` is one: the engine reads no `min-height` anywhere, so the rule's//! "zero computed `min-height`" condition is taken as met.//!//! A value whose doc has a paragraph opening `Needed:` is one the specification's rules//! read whenever the specification text says one of the quoted phrases in it: a types//! file written from that text takes the value. `job-check types --engine <file>//! --specification <folder>` refuses a types file that does not while the text says the//! phrase (`jobs/src/types_file.rs` `check_needs`).
/// Every value the engine has worked out for the box at the call, and nothing else.#[derive(Debug, Clone, Copy, PartialEq, Eq)]pub struct MarginClassifyEngineValues { /// Whether the box has a top border or top padding wider than zero. /// /// Needed: the specification text says "top or bottom borders". pub has_top_border_or_padding: bool, /// Whether the box has a bottom border or bottom padding wider than zero. /// /// Needed: the specification text says "top or bottom padding". pub has_bottom_border_or_padding: bool, /// Whether the box establishes a new block formatting context: the root element, or a /// box whose `overflow` is not `visible`, or a float, an absolutely positioned box, a /// table cell or a table. /// /// Needed: the specification text says "block formatting context". pub establishes_bfc: bool, /// Whether the box's computed `height` is `auto`. A box with a non-degenerate /// `aspect-ratio` reports `false`, because the ratio gives it a height. An intrinsic /// sizing keyword, a percentage and a `calc()` are not `auto` here. /// /// Needed: the specification text says "'height'". pub height_is_auto: bool, /// Whether the box's computed `height` is the length zero. /// /// Needed: the specification text says "'height'". pub height_is_explicit_zero: bool, /// Whether the box has no in-flow content: no in-flow children, or every in-flow child /// is itself self-collapsing. A box with a line box (an inline formatting context with /// an atomic inline in it) reports `false`. /// /// Needed: the specification text says "in-flow children". pub no_in_flow_content: bool,}
/// The fields of the function's answer, which the engine reads by these names: a types/// file's outputs struct declares exactly these.#[derive(Debug, Clone, Copy, PartialEq, Eq)]pub struct MarginClassifyEngineAnswer { /// Whether the box's own top and bottom margins collapse into one and the box takes /// zero height (CSS 2.1 8.3.1, the box's own margins collapse). The engine never /// treats the root element as self-collapsing, whatever this says. pub self_collapsing: bool, /// Whether the box's margin-top is free to adjoin its parent's margin-top, which is /// the same as whether this box lets its own first in-flow child's margin-top escape /// past it. pub top_open: bool, /// Whether the box's margin-bottom is free to adjoin its parent's margin-bottom, which /// is the same as whether this box lets its own last in-flow child's margin-bottom /// escape past it. pub bottom_open: bool, /// Whether the box's margin-top is free to adjoin the margin-bottom of the in-flow /// sibling before it. pub sibling_adjoin: bool,}