Bug 1861539 - Use logical ReflowChild() and FinishReflowChild() to reflow table column group & table column. r=layout-reviewers,jfkthame

Differential Revision: https://phabricator.services.mozilla.com/D192041
This commit is contained in:
Ting-Yu Lin 2023-11-02 18:37:10 +00:00
Родитель 5e8c456621
Коммит 84409099da
2 изменённых файлов: 17 добавлений и 13 удалений

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

@ -338,22 +338,21 @@ void nsTableColGroupFrame::Reflow(nsPresContext* aPresContext,
if (collapseGroup) {
GetTableFrame()->SetNeedToCollapse(true);
}
// for every content child that (is a column thingy and does not already have
// a frame) create a frame and adjust it's style
for (nsIFrame* kidFrame = mFrames.FirstChild(); kidFrame;
kidFrame = kidFrame->GetNextSibling()) {
const WritingMode wm = GetWritingMode();
for (nsIFrame* kidFrame : mFrames) {
// Give the child frame a chance to reflow, even though we know it'll have 0
// size
ReflowOutput kidSize(aReflowInput);
ReflowInput kidReflowInput(aPresContext, aReflowInput, kidFrame,
LogicalSize(kidFrame->GetWritingMode()));
const LogicalPoint dummyPos(wm);
const nsSize dummyContainerSize;
nsReflowStatus status;
ReflowChild(kidFrame, aPresContext, kidSize, kidReflowInput, 0, 0,
ReflowChildFlags::Default, status);
FinishReflowChild(kidFrame, aPresContext, kidSize, &kidReflowInput, 0, 0,
ReflowChildFlags::Default);
ReflowChild(kidFrame, aPresContext, kidSize, kidReflowInput, wm, dummyPos,
dummyContainerSize, ReflowChildFlags::Default, status);
FinishReflowChild(kidFrame, aPresContext, kidSize, &kidReflowInput, wm,
dummyPos, dummyContainerSize, ReflowChildFlags::Default);
}
aDesiredSize.ClearSize();

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

@ -3046,17 +3046,22 @@ void nsTableFrame::ReflowChildren(TableReflowInput& aReflowInput,
void nsTableFrame::ReflowColGroups(gfxContext* aRenderingContext) {
if (!GetPrevInFlow() && !HaveReflowedColGroups()) {
ReflowOutput kidMet(GetWritingMode());
const WritingMode wm = GetWritingMode();
nsPresContext* presContext = PresContext();
for (nsIFrame* kidFrame : mColGroups) {
if (kidFrame->IsSubtreeDirty()) {
// The column groups don't care about dimensions or reflow inputs.
ReflowOutput kidSize(wm);
ReflowInput kidReflowInput(presContext, kidFrame, aRenderingContext,
LogicalSize(kidFrame->GetWritingMode()));
nsReflowStatus cgStatus;
ReflowChild(kidFrame, presContext, kidMet, kidReflowInput, 0, 0,
ReflowChildFlags::Default, cgStatus);
FinishReflowChild(kidFrame, presContext, kidMet, &kidReflowInput, 0, 0,
const LogicalPoint dummyPos(wm);
const nsSize dummyContainerSize;
ReflowChild(kidFrame, presContext, kidSize, kidReflowInput, wm,
dummyPos, dummyContainerSize, ReflowChildFlags::Default,
cgStatus);
FinishReflowChild(kidFrame, presContext, kidSize, &kidReflowInput, wm,
dummyPos, dummyContainerSize,
ReflowChildFlags::Default);
}
}