mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01: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
|
@ -25,7 +25,7 @@ use crate::geom::{
|
|||
SizeConstraint,
|
||||
};
|
||||
use crate::positioned::{AbsolutelyPositionedBox, PositioningContext, PositioningContextLength};
|
||||
use crate::sizing::{ContentSizes, InlineContentSizesResult};
|
||||
use crate::sizing::{ComputeInlineContentSizes, ContentSizes, InlineContentSizesResult};
|
||||
use crate::style_ext::ComputedValuesExt;
|
||||
use crate::{ConstraintSpace, ContainingBlock, ContainingBlockSize};
|
||||
|
||||
|
@ -307,8 +307,8 @@ impl taffy::LayoutGridContainer for TaffyContainerContext<'_> {
|
|||
}
|
||||
}
|
||||
|
||||
impl TaffyContainer {
|
||||
pub fn inline_content_sizes(
|
||||
impl ComputeInlineContentSizes for TaffyContainer {
|
||||
fn compute_inline_content_sizes(
|
||||
&self,
|
||||
layout_context: &LayoutContext,
|
||||
_constraint_space: &ConstraintSpace,
|
||||
|
@ -382,7 +382,9 @@ impl TaffyContainer {
|
|||
depends_on_block_constraints: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl TaffyContainer {
|
||||
/// <https://drafts.csswg.org/css-grid/#layout-algorithm>
|
||||
pub(crate) fn layout(
|
||||
&self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue