Bug 1319318: When resolving a video/audio frame's shrinkwrapped BSize from controls, check whether controls are orthogonal when reading its size. r=mats
authorDaniel Holbert <dholbert@cs.stanford.edu>
Thu, 08 Dec 2016 09:20:25 -1000
changeset 325615 70a0740cbd8129b84aabb426a50c3cf3240f8266
parent 325614 ff00ebb732744d3196d30b8c1ce1c4feaf20db1a
child 325616 33044cd4c5dbe20994d10541db6ecbe9180fdc69
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +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/crashtests/crashtests.list
layout/generic/nsVideoFrame.cpp
--- a/layout/generic/crashtests/crashtests.list
+++ b/layout/generic/crashtests/crashtests.list
@@ -624,17 +624,17 @@ load text-overflow-bug666751-1.html
 load text-overflow-bug666751-2.html
 load text-overflow-bug670564.xhtml
 load text-overflow-bug671796.xhtml
 load text-overflow-bug713610.html
 load text-overflow-form-elements.html
 load text-overflow-iframe.html
 asserts-if(Android,2-4) asserts-if(!Android,4) load 1225005.html # bug 682647 and bug 448083
 load 1233191.html
-asserts(3) load 1271765.html # bug 1319318
+load 1271765.html
 asserts(2) load 1272983-1.html # bug 586628
 asserts(2) load 1272983-2.html # bug 586628
 load 1275059.html
 load 1278007.html
 load 1279814.html
 load large-border-radius-dashed.html
 load large-border-radius-dashed2.html
 load large-border-radius-dotted.html
--- 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) {