When we calculate the minimum width of an inline block, the size of the
trailing space is already removed by split_first_line. There’s no need to
remove it twice.
We should probably fix split_first_line to remove the trailing space only when
it’s been asked to. But there’s no obvious situation when we want the minimum
width to include trailing spaces, as the minimum size requires line breaks
everywhere, including after each space.
At least, this commit doesn’t remove trailing spaces twice.
Related to #1520.
This supports the `overflow-wrap` value `anywhere`: `anywhere` is like
`break-word`, but the soft breaks it allows *are* considered when
calculating min-content intrinsic sizes.
Handling footnote-display requires the footnote area children to be recreated
each time one footnote is added: as footnotes can be blocks or inlines, we have
to create anonymous boxes each time, and thus to do the whole footnote area
layout.
There’s nothing in the specification about that, but here’s what we do now:
- The style of a footnote inherits from its parent’s style, it doesn’t inherit
from the footnote area’s style. That’s how cascade works for real elements, and
there’s no real reason or way to avoid this.
- The style of a footnote marker inherits from the footnote style. The marker
is just like a ::before block regarding to its style, even if it is actually
put before the footnote element in the footnote body.
- The style of a footnote call inherits from the footnote parent’s style. It
doesn’t inherit from the footnote’s style, that’s actually applied to the
footnote and inherited by its marker.
This way, we keep the "normal" cascade for "normal" elements, and have
everything else being quite obvious.
The 1st point is annoying in real-life use cases, because we’d really like to
see the footnote’s style inherit from the footnote area’s style. But we really
don’t want to break the cascade. Do we? No, we don’t.
The 3rd point is probably the most disturbing one, mainly because
.footnote::footnote-call doesn’t match the call: to match a footnote call in a
paragraph, for example, we have to use p::footnote-call instead.