Bug 1691205 - Initialize the intrinsic block-size to zero in case there is no :root frame. r=TYLin

Note that this only happens for chrome: documents that have been
invasively styled by userChrome.css sheets.  Content documents
are never intrinsically sized, and our own chrome: sheets that
use intrinsic sizing never set 'display:none' on the :root as
far as I know.  I think this is an argument for removing support
for userChrome.css.

Differential Revision: https://phabricator.services.mozilla.com/D104715
This commit is contained in:
Mats Palmgren 2021-02-20 04:25:25 +00:00
Родитель 25d1d214ab
Коммит 2381162c81
1 изменённых файлов: 5 добавлений и 0 удалений

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

@ -749,6 +749,11 @@ void nsCanvasFrame::Reflow(nsPresContext* aPresContext,
// We may also have a nsPopupSetFrame child (mPopupSetFrame).
const WritingMode wm = aReflowInput.GetWritingMode();
aDesiredSize.SetSize(wm, aReflowInput.ComputedSize());
if (aReflowInput.ComputedBSize() == NS_UNCONSTRAINEDSIZE) {
// Set the block-size to zero for now in case we don't have any non-
// placeholder children that would update the size in the loop below.
aDesiredSize.BSize(wm) = nscoord(0);
}
aDesiredSize.SetOverflowAreasToDesiredBounds();
nsIFrame* nextKid = nullptr;
for (auto* kidFrame = mFrames.FirstChild(); kidFrame; kidFrame = nextKid) {