Bug 1367711 - Bail out early when initializing ReflowInput for a placeholder frame, which has a trivial Reflow method. r=mats

This commit is contained in:
Jonathan Kew 2017-05-30 23:55:02 +01:00
Родитель 5e2804200d
Коммит 18938a04a9
2 изменённых файлов: 10 добавлений и 0 удалений

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

@ -391,6 +391,12 @@ ReflowInput::Init(nsPresContext* aPresContext,
mStyleText = mFrame->StyleText();
LayoutFrameType type = mFrame->Type();
if (type == mozilla::LayoutFrameType::Placeholder) {
// Placeholders have a no-op Reflow method that doesn't need the rest of
// this initialization, so we bail out early.
ComputedBSize() = ComputedISize() = 0;
return;
}
InitFrameType(type);
InitCBReflowInput();

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

@ -110,6 +110,10 @@ nsPlaceholderFrame::Reflow(nsPresContext* aPresContext,
const ReflowInput& aReflowInput,
nsReflowStatus& aStatus)
{
// NOTE that the ReflowInput passed to this method is not fully initialized,
// on the grounds that reflowing a placeholder is a rather trivial operation.
// (See bug 1367711.)
#ifdef DEBUG
// We should be getting reflowed before our out-of-flow.
// If this is our first reflow, and our out-of-flow has already received its