Expand description
The style tree: resolved styling.
Styling enters as CSS. A built-in user-agent stylesheet supplies the defaults; author CSS cascades over it. What comes out is one computed style per content node and one page master per situation a page can be in, and that is the whole of what layout is told.
content tree + CSS ─► style tree ─► box tree ─► …Font faces reach the registry here too: @font-face names a
source, the host loader hands back bytes, and every node’s face is
an id by the time layout sees it.
Modules§
- subset
- The CSS subset as data.
Structs§
- Ancestor
- One element an inspected element sits inside.
- Background
- What one box paints behind its content.
- Background
Position - Where the image sits in the box, from
background-position. - Border
- One border edge: its style, its width and its colour.
- Border
Radius - The four corners of a box, each rounded by what
border-radiusset. - Color
- A colour: three eight-bit channels and an eight-bit alpha, where 255 is opaque.
- Column
Rule - The rule painted down a page’s gutters, from
column-rule-widthandcolumn-rule-style. It takes no room: the gutter is the room it has. - Columns
- How a page’s content box divides, from
column-count,column-widthandcolumn-gap. - Computed
Style - One node’s resolved style: what every downstream pass reads.
- Corner
Radius - How far one corner of a box is rounded, as the cascade computed it.
- Decoration
Line - Which rules a run has drawn across it, from
text-decoration-line. - Edges
- The four edges of a box, in whatever the property resolves to:
points for
marginandpadding, aBorderforborder. - Font
Face - One
@font-face: an identity, and the sources to try for it. - Font
Variant Ligatures - Which ligatures a run is set with, from
font-variant-ligatures. A group left atNonekeeps whatever the shaper does with it, which isliga,cligandcalton and the rest off. - Font
Variant Numeric - Which figures a run is set with, from
font-variant-numeric. - Inspected
Declaration - One declaration of a matched rule.
- Inspection
- What one element, or one page margin box, answers with.
- Margin
BoxStyle - One page margin box: what it paints and the style it paints with.
- Matched
Rule - One rule that matched.
- NoFonts
- A loader that resolves nothing.
- Node
Style - One node’s place in the tree: what it is, and which style it got.
- Page
Geometry - Page trim, margins and columns, in points: the resolved
@pagebox. - Page
Master - One page master, named and situated.
- Page
Query - Which page a
@pagelookup is about. - Page
Style - One resolved page master: the page box, and what its margin boxes paint.
- Shape
Point - One point of a
polygon(), from the top left of the margin box. - Sheet
Position - Where something was written in a stylesheet: the sheet’s name, and the line and column of its first character, counted the way a warning counts them.
- Source
- One stylesheet handed to the compiler: its text, a name for diagnostics, and the origin it cascades at.
- String
Set - One
string-setentry: a named string, and what the element sets it to when the flow reaches it. - Style
Tree - The compiled styling of one book.
- Stylesheets
- Parsed stylesheets: the built-in sheet, then whatever the host added, ready to compile against a book.
- Text
Decoration - What a run has drawn across it: the rules, what they are painted in, how they are drawn, and how thick they are.
- Url
- A url the sheet named, and where it was written.
- Written
- One declaration as the author wrote it, and the longhands it became.
- Written
Page - One
@pagerule as it was written. - Written
Rule - One style rule as it was written.
- Written
Sheet - One sheet as it was written. See
Stylesheets::written.
Enums§
- Align
- Where in its band a margin box’s content sits.
Centercentres on the trim rather than on the content box: a folio belongs on the page’s axis, and mirrored margins put the content box off it. - Align
Content - Where a page’s content sits down its content box, from
align-contenton@page. - Background
Repeat - Whether the image repeats to fill the box, from
background-repeat. - Background
Size - How large the image is drawn, from
background-size. - Band
- Which margin a painted margin box lives in.
- Border
Collapse - Whether the cells of a table share their borders, from
border-collapse. - Border
Style - How a border edge is drawn.
- BoxDecoration
Break - What a block’s decoration does where a page break splits it, from
box-decoration-break. - Break
- A fragmentation instruction: the value of
break-before,break-afterandbreak-inside.rectoandversoare the book’s names forrightandleft. - Column
Span - How many columns of a divided page a block is set across, from
column-span. - Content
- What a page margin box paints, or what a pseudo-element generates.
- Content
Piece - One piece of a
contentvalue that names another element. - Coord
- One coordinate of a shape: a length, or a fraction of the box the shape is read against.
- Corner
- Which corner a one-cornered property sets.
- Counter
Style - How a counter’s value is spelled.
- Decoration
Style - How one rule is drawn, from
text-decoration-style. - Edge
- Which edge a one-sided box property sets.
- Family
- A font family as a stylesheet names it.
- Figures
- Which shape the figures take.
- Font
Style - Upright or italic.
- Font
Variant Alternates - Which alternate glyphs a run is set with, from
font-variant-alternates. - Font
Variant Caps - Which capitals a run is drawn with, from
font-variant-caps. - Fractions
- How a fraction is set.
- Hyphens
- Whether words may be broken at syllable boundaries.
- Inset
- How far one edge of a positioned box sits from the matching edge of
the page area, from
top,right,bottomandleft. - Length
- A CSS length, before it is resolved against what it is relative to.
- Line
Height line-height, before the font size it multiplies is known.- List
Style Type - The marker a list item is set with, from
list-style-type. - Margin
Box - A page margin box, named as CSS names them.
- Numeric
Spacing - How much width each figure takes.
- Origin
- Where a stylesheet came from. The cascade sorts by this before it sorts by anything else: author CSS overrides the built-in sheet however specific the built-in rule was.
- Position
- Whether an element sits in the flow or against the page.
- Shape
Outside - The contour prose sets around, from
shape-outside. - Shape
Source shape-outsideas the sheet wrote it, before the cascade knows the font size its lengths are relative to.- Situation
- The situation a page finds itself in, which is what
@pageselects on beyond the page’s name. - Size
Source background-sizeas the sheet wrote it, before the cascade knows the font size its lengths are relative to.- Src
- One entry of a
@font-facesrclist. - String
Piece - One piece of a
string-setvalue. - Target
- The element a reference names.
- Text
Align - How a line’s inline content is distributed across the measure.
- Text
Justify - What justification opens up to fill the measure.
- Text
Transform - What a run’s letters are transformed to before they are shaped,
from
text-transform. - Width
- The size a box is asked to take on one axis, from
width,heightormin-height. - Wrap
Flow - Which side of an exclusion the prose sets on, from
wrap-flow. An exclusion is a box that the text keeps clear of.
Constants§
- USER_
AGENT_ CSS - The defaults, as a stylesheet. There are no style constants in the engine; this file is where the trade paperback lives.
Traits§
- Font
Loader - Resolves
@font-facesources to font bytes.
Functions§
- defaults
- One book’s styling under the built-in sheet alone.