Bug 1319318: When resolving a video/audio frame's shrinkwrapped BSize from controls, check whether controls are orthogonal when reading its size. r?mats draft
authorDaniel Holbert <dholbert@cs.stanford.edu>
Thu, 08 Dec 2016 09:20:25 -1000
changeset 447957 ee7e240e647e645f7ff5f29f86f4f5cfea47fa0c
parent 447934 d8f63b2935af0915a6a24b3ea8e27d9a09f66416
child 539172 4e000ddd6aa17e6dc47a9e2a2d762d367e77b593
push id38214
push userdholbert@mozilla.com
push dateThu, 08 Dec 2016 19:21:07 +0000
reviewersmats
bugs1319318
milestone53.0a1
Bug 1319318: When resolving a video/audio frame's shrinkwrapped BSize from controls, check whether controls are orthogonal when reading its size. r?mats MozReview-Commit-ID: 9kH7rLF66zd
layout/generic/nsVideoFrame.cpp
--- a/layout/generic/nsVideoFrame.cpp
+++ b/layout/generic/nsVideoFrame.cpp
@@ -372,17 +372,19 @@ nsVideoFrame::Reflow(nsPresContext* aPre
                                        aReflowInput,
                                        child,
                                        availableSize);
       ReflowOutput kidDesiredSize(kidReflowInput);
       ReflowChild(child, aPresContext, kidDesiredSize, kidReflowInput,
                   borderPadding.left, borderPadding.top, 0, aStatus);
 
       if (child->GetContent() == mVideoControls && isBSizeShrinkWrapping) {
-        contentBoxBSize = kidDesiredSize.BSize(myWM);
+        // Resolve our own BSize based on the controls' size in the same axis.
+        contentBoxBSize = myWM.IsOrthogonalTo(wm) ?
+          kidDesiredSize.ISize(wm) : kidDesiredSize.BSize(wm);
       }
 
       FinishReflowChild(child, aPresContext,
                         kidDesiredSize, &kidReflowInput,
                         borderPadding.left, borderPadding.top, 0);
     }
 
     if (child->GetContent() == mVideoControls && child->GetSize() != oldChildSize) {