Bug 1631941 - Make nsIFrame::ContentSize and nsIFrame::SynthesizeBaselineBOffsetFromContentBox apply skip sides correctly for orthogonal writing modes. r=jfkthame

Differential Revision: https://phabricator.services.mozilla.com/D71884
This commit is contained in:
L. David Baron 2020-04-22 23:43:53 +00:00
Родитель c94de28dad
Коммит b3bbfa3a41
2 изменённых файлов: 9 добавлений и 5 удалений

Просмотреть файл

@ -1021,8 +1021,10 @@ class nsIFrame : public nsQueryFrame {
return ContentSize(GetWritingMode());
}
mozilla::LogicalSize ContentSize(mozilla::WritingMode aWritingMode) const {
const auto bp = GetLogicalUsedBorderAndPadding(aWritingMode)
.ApplySkipSides(GetLogicalSkipSides());
mozilla::WritingMode wm = GetWritingMode();
const auto bp = GetLogicalUsedBorderAndPadding(wm)
.ApplySkipSides(GetLogicalSkipSides())
.ConvertTo(aWritingMode, wm);
const auto size = GetLogicalSize(aWritingMode);
return mozilla::LogicalSize(
aWritingMode,

Просмотреть файл

@ -135,9 +135,11 @@ nscoord nsIFrame::SynthesizeBaselineBOffsetFromBorderBox(
nscoord nsIFrame::SynthesizeBaselineBOffsetFromContentBox(
mozilla::WritingMode aWM, BaselineSharingGroup aGroup) const {
MOZ_ASSERT(!aWM.IsOrthogonalTo(GetWritingMode()));
const auto bp =
GetLogicalUsedBorderAndPadding(aWM).ApplySkipSides(GetLogicalSkipSides());
mozilla::WritingMode wm = GetWritingMode();
MOZ_ASSERT(!aWM.IsOrthogonalTo(wm));
const auto bp = GetLogicalUsedBorderAndPadding(wm)
.ApplySkipSides(GetLogicalSkipSides())
.ConvertTo(aWM, wm);
if (MOZ_UNLIKELY(aWM.IsCentralBaseline())) {
nscoord contentBoxBSize = BSize(aWM) - bp.BStartEnd(aWM);