forked from mirrors/gecko-dev
Bug 1843086: Line participants use block start ascent, instead of not-yet stored baseline. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D183432
This commit is contained in:
parent
0b1afe7e6d
commit
e86d57ef18
3 changed files with 36 additions and 4 deletions
|
|
@ -1349,16 +1349,19 @@ void nsLineLayout::PlaceFrame(PerFrameData* pfd, ReflowOutput& aMetrics) {
|
||||||
? lineWM.IsLineInverted() ? 0 : aMetrics.BSize(lineWM)
|
? lineWM.IsLineInverted() ? 0 : aMetrics.BSize(lineWM)
|
||||||
: aMetrics.BSize(lineWM) / 2;
|
: aMetrics.BSize(lineWM) / 2;
|
||||||
} else {
|
} else {
|
||||||
if (pfd->mFrame->StyleDisplay()->mBaselineSource ==
|
// For inline reflow participants, baseline may get assigned as the frame is
|
||||||
StyleBaselineSource::Auto) {
|
// vertically aligned, which happens after this.
|
||||||
|
const auto baselineSource = pfd->mFrame->StyleDisplay()->mBaselineSource;
|
||||||
|
if (baselineSource == StyleBaselineSource::Auto ||
|
||||||
|
pfd->mFrame->IsFrameOfType(nsIFrame::eLineParticipant)) {
|
||||||
if (aMetrics.BlockStartAscent() == ReflowOutput::ASK_FOR_BASELINE) {
|
if (aMetrics.BlockStartAscent() == ReflowOutput::ASK_FOR_BASELINE) {
|
||||||
pfd->mAscent = pfd->mFrame->GetLogicalBaseline(lineWM);
|
pfd->mAscent = pfd->mFrame->GetLogicalBaseline(lineWM);
|
||||||
} else {
|
} else {
|
||||||
pfd->mAscent = aMetrics.BlockStartAscent();
|
pfd->mAscent = aMetrics.BlockStartAscent();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const auto sourceGroup = [pfd]() {
|
const auto sourceGroup = [baselineSource]() {
|
||||||
switch (pfd->mFrame->StyleDisplay()->mBaselineSource) {
|
switch (baselineSource) {
|
||||||
case StyleBaselineSource::First:
|
case StyleBaselineSource::First:
|
||||||
return BaselineSharingGroup::First;
|
return BaselineSharingGroup::First;
|
||||||
case StyleBaselineSource::Last:
|
case StyleBaselineSource::Last:
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<link rel="stylesheet" href="/fonts/ahem.css">
|
||||||
|
<style>
|
||||||
|
div {
|
||||||
|
border: 1px solid;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div>
|
||||||
|
<span>a</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<link rel="author" title="David Shin" href="mailto:dshin@mozilla.com">
|
||||||
|
<meta name="assert" content="Ensure that specifying baseline-source on inline boxes have no effect.">
|
||||||
|
<link rel="help" href="https://drafts.csswg.org/css-inline-3/#baseline-source">
|
||||||
|
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1792501">
|
||||||
|
<link rel="stylesheet" href="/fonts/ahem.css">
|
||||||
|
<link rel="match" href="baseline-source-inline-box-ref.html">
|
||||||
|
<style>
|
||||||
|
div {
|
||||||
|
border: 1px solid;
|
||||||
|
}
|
||||||
|
span {
|
||||||
|
baseline-source: first;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div>
|
||||||
|
<span>a</span>
|
||||||
|
</div>
|
||||||
Loading…
Reference in a new issue