pub fn apply_ua_style_defaults(
tag: &str,
attrs: &Attributes,
page_gate: bool,
style: &mut Style,
)Expand description
The UA-origin per-tag sizing defaults (D3 / task #29) live in
skins/ua.css now - an always-on stylesheet folded into the cascade
beneath any skin and beneath app CSS (see crate::skins::UA and
run::loading::load_ir), so a skinless app still gets a sizing
floor without a Rust-side table to keep in sync.
Four cases don’t fit a plain CSS rule and stay here, running at spawn
and at every restyle after the cascade and inline attrs have been folded
into attrs:
<switch>wants its UAmin-widthonly whenwidthis ALSO unset (an explicit width already gives it a usable footprint). CSS has no “set this property only if that other property is unset” syntax, so this stays a Rust conditional instead of aua.cssrule.- A page host box fills the window. A multi-page app mounts each page
inside a synthetic gate keyed on the reserved active-page signal,
and that gate is the page’s containing block: left at its content
size, a page whose shell asks for
height: 100%resolves the percentage against the shell itself and the bottom of the shell lands past the bottom of the window. Pinning the gate to<root>’s padding box gives every page the same full-window rect, which is what Qt’sQStackedWidgetand Slint’s page containers do; taking it out of flow at the same time is what keeps the gates of the pages that are NOT mounted - one empty sibling per page file - from dividing the window between them. The gate is spelled<if>, and an author’s own<if>is an ordinary in-flow element, so the rule keys on the signal rather than the tag and cannot be aua.cssselector. - A
<dialog>covers its parent:position: absolutewith every inset0, unless a rule or an attribute placed it. The rule would fit inua.css, but that sheet also reaches the web target’s stylesheet, where a modal dialog sits in the browser’s top layer and has to stayposition: fixed. <input>/<textarea>default tooverflow: hiddenonly when neither theoverflowshorthand noroverflow-x/overflow-ywas authored anywhere.lumen_ir::cssnever expands theoverflowshorthand into the longhands - they’re independent properties to the cascade, reconciled only afterward inlumen_ir::convertvia.or(), which doesn’t know about origin. A plainua.cssoverflow-xrule would therefore out-rank an author’s shorthand-onlyoverflow: visible, instead of losing to it as the current behavior requires - so this checks the fully-resolvedattrsdirectly instead.