mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
layout: Clean up inline layout data structures (#33149)
- Rename `InlineFormattingContextState` to `InlineFormattingContextLayout`. - Have `InlineFormattingContextLayout` hold a reference to the `InlineFormattingContext`, so that it does not need to be passed around as an argument - Have `LineItemLayout` hold a reference to `InlineFormattingContextLayout` to avoid duplicating so much data. - Rename some members of `LineItemLayout` to make it clearer what they do. - Give beter names to many lifetimes and combine some that are effectively the same. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
This commit is contained in:
parent
60ef6bc461
commit
e956b53827
3 changed files with 154 additions and 194 deletions
|
@ -27,7 +27,7 @@ use unicode_script::Script;
|
|||
use xi_unicode::linebreak_property;
|
||||
|
||||
use super::line_breaker::LineBreaker;
|
||||
use super::{FontKeyAndMetrics, InlineFormattingContextState};
|
||||
use super::{FontKeyAndMetrics, InlineFormattingContextLayout};
|
||||
use crate::fragment_tree::BaseFragmentInfo;
|
||||
|
||||
// These constants are the xi-unicode line breaking classes that are defined in
|
||||
|
@ -136,7 +136,7 @@ impl TextRunSegment {
|
|||
&self,
|
||||
text_run: &TextRun,
|
||||
mut soft_wrap_policy: SegmentStartSoftWrapPolicy,
|
||||
ifc: &mut InlineFormattingContextState,
|
||||
ifc: &mut InlineFormattingContextLayout,
|
||||
) {
|
||||
if self.break_at_start && soft_wrap_policy == SegmentStartSoftWrapPolicy::FollowLinebreaker
|
||||
{
|
||||
|
@ -492,7 +492,7 @@ impl TextRun {
|
|||
results
|
||||
}
|
||||
|
||||
pub(super) fn layout_into_line_items(&self, ifc: &mut InlineFormattingContextState) {
|
||||
pub(super) fn layout_into_line_items(&self, ifc: &mut InlineFormattingContextLayout) {
|
||||
if self.text_range.is_empty() {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue