Bug 1401807 Part 1 - Give unconstrained block size when reflowing mPosterImage. r=dholbert

Also, added MOZ_ASSERT to ensure all the video frame's children are fully
complete after reflowing (except for the mVideoControls special case on
Android).

This fixed aStatus.IsEmpty() assertion for the test case added in Part 2.

MozReview-Commit-ID: HKze4EZoaJY

--HG--
extra : rebase_source : d695ee3a7c884450ba7dd9da41e14ab3621c89ed
This commit is contained in:
Ting-Yu Lin 2017-09-27 23:04:42 +08:00
Родитель 6b6cd79992
Коммит 03b735b023
1 изменённых файлов: 9 добавлений и 0 удалений

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

@ -321,6 +321,8 @@ nsVideoFrame::Reflow(nsPresContext* aPresContext,
ReflowOutput kidDesiredSize(aReflowInput);
WritingMode wm = imageFrame->GetWritingMode();
LogicalSize availableSize = aReflowInput.AvailableSize(wm);
availableSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
LogicalSize cbSize = aMetrics.Size(aMetrics.GetWritingMode()).
ConvertTo(wm, aMetrics.GetWritingMode());
ReflowInput kidReflowInput(aPresContext,
@ -340,6 +342,10 @@ nsVideoFrame::Reflow(nsPresContext* aPresContext,
kidReflowInput.SetComputedHeight(posterRenderRect.height);
ReflowChild(imageFrame, aPresContext, kidDesiredSize, kidReflowInput,
posterRenderRect.x, posterRenderRect.y, 0, aStatus);
MOZ_ASSERT(aStatus.IsFullyComplete(),
"We gave our child unconstrained available block-size, "
"so it should be complete!");
FinishReflowChild(imageFrame, aPresContext,
kidDesiredSize, &kidReflowInput,
posterRenderRect.x, posterRenderRect.y, 0);
@ -372,6 +378,9 @@ nsVideoFrame::Reflow(nsPresContext* aPresContext,
ReflowOutput kidDesiredSize(kidReflowInput);
ReflowChild(child, aPresContext, kidDesiredSize, kidReflowInput,
borderPadding.left, borderPadding.top, 0, aStatus);
MOZ_ASSERT(aStatus.IsFullyComplete(),
"We gave our child unconstrained available block-size, "
"so it should be complete!");
if (child->GetContent() == mVideoControls && isBSizeShrinkWrapping) {
// Resolve our own BSize based on the controls' size in the same axis.