Bug 1809568 - Part 2: Provide GetNaturalBaselineBOffset with baseline export context. r=emilio
Some baseline exports are context-sensitive. One example: In line-layout scenario, the last baseline of a scroll container is always the margin-end. In other (e.g. flex, grid) scenarios, it's the border-box clamped offset to the last line in the container. This enables the required 3 different behaviours for `inline-block` scroll containers for 3 different `baseline-source` values: - `auto`: Last baseline, margin-end - `first`: Border-box clamped offset to the first line - `last`: Border-box clamped offset to the last line Differential Revision: https://phabricator.services.mozilla.com/D173886
This commit is contained in:
@@ -851,7 +851,8 @@ nscoord nsFieldSetFrame::SynthesizeFallbackBaseline(
|
||||
}
|
||||
|
||||
Maybe<nscoord> nsFieldSetFrame::GetNaturalBaselineBOffset(
|
||||
WritingMode aWM, BaselineSharingGroup aBaselineGroup) const {
|
||||
WritingMode aWM, BaselineSharingGroup aBaselineGroup,
|
||||
BaselineExportContext aExportContext) const {
|
||||
if (StyleDisplay()->IsContainLayout()) {
|
||||
// If we are layout-contained, our child 'inner' should not
|
||||
// affect how we calculate our baseline.
|
||||
@@ -862,7 +863,8 @@ Maybe<nscoord> nsFieldSetFrame::GetNaturalBaselineBOffset(
|
||||
return Nothing{};
|
||||
}
|
||||
MOZ_ASSERT(!inner->GetWritingMode().IsOrthogonalTo(aWM));
|
||||
const auto result = inner->GetNaturalBaselineBOffset(aWM, aBaselineGroup);
|
||||
const auto result =
|
||||
inner->GetNaturalBaselineBOffset(aWM, aBaselineGroup, aExportContext);
|
||||
if (!result) {
|
||||
return Nothing{};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user