layout: Shape text only once (#31146)

Shape text during InlineFormattingContext construction rather than doing
it twice during fragment tree construction. This is a step on the way
toward proper font fallback.

This also moves all `TextRun` related code into `text_run.rs` to try to
trim down the size of `inline.rs`.
<!-- Please describe your changes on the following line: -->


---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by
`[X]` when the step is complete, and replace `___` with appropriate
data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because this should only have
performance impacts.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox
is checked, so that we can help you if you get stuck somewhere along the
way.-->

<!-- Pull requests that do not address these steps are welcome, but they
will require additional verification as part of the review process. -->
This commit is contained in:
Martin Robinson 2024-01-25 15:33:47 +01:00 committed by GitHub
parent bb04c97f15
commit 094f7845b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 289 additions and 268 deletions

View file

@ -39,6 +39,7 @@ pub mod float;
pub mod inline;
mod line;
mod root;
pub mod text_run;
pub(crate) use construct::BlockContainerBuilder;
pub use root::{BoxTree, CanvasBackground};