mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Distinguish cached inline_content_sizes()
from uncached ones (#34595)
Several structs and enums had a `inline_content_sizes()` method, but it wasn't clear which ones would try to cache the result, and which ones would always compute it. Therefore, this performs some clarifying renaming: - Cached ones stay as `inline_content_sizes()` - Uncached ones become `compute_inline_content_sizes()` Also, to simplify calls to `LayoutBoxBase::inline_content_sizes()`, `compute_inline_content_sizes()` is moved into a new trait. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
874e106924
commit
f7e2ec3a0f
9 changed files with 152 additions and 125 deletions
|
@ -38,7 +38,9 @@ use crate::geom::{AuOrAuto, LogicalRect, LogicalSides, LogicalVec2, Size};
|
|||
use crate::positioned::{
|
||||
relative_adjustement, AbsolutelyPositionedBox, PositioningContext, PositioningContextLength,
|
||||
};
|
||||
use crate::sizing::{ContentSizes, InlineContentSizesResult, IntrinsicSizingMode};
|
||||
use crate::sizing::{
|
||||
ComputeInlineContentSizes, ContentSizes, InlineContentSizesResult, IntrinsicSizingMode,
|
||||
};
|
||||
use crate::style_ext::{
|
||||
AspectRatio, Clamp, ComputedValuesExt, ContentBoxSizesAndPBMDeprecated, PaddingBorderMargin,
|
||||
};
|
||||
|
@ -411,17 +413,17 @@ struct FlexItemBoxInlineContentSizesInfo {
|
|||
depends_on_block_constraints: bool,
|
||||
}
|
||||
|
||||
impl FlexContainer {
|
||||
impl ComputeInlineContentSizes for FlexContainer {
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(
|
||||
name = "FlexContainer::inline_content_sizes",
|
||||
name = "FlexContainer::compute_inline_content_sizes",
|
||||
skip_all,
|
||||
fields(servo_profiling = true),
|
||||
level = "trace",
|
||||
)
|
||||
)]
|
||||
pub fn inline_content_sizes(
|
||||
fn compute_inline_content_sizes(
|
||||
&self,
|
||||
layout_context: &LayoutContext,
|
||||
constraint_space: &ConstraintSpace,
|
||||
|
@ -437,7 +439,9 @@ impl FlexContainer {
|
|||
FlexAxis::Column => self.cross_content_sizes(layout_context, &constraint_space.into()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl FlexContainer {
|
||||
fn cross_content_sizes(
|
||||
&self,
|
||||
layout_context: &LayoutContext,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue