Bug 1313285 - remove nsVideoFrame::mBorderPadding. r=dholbert draft
authorRay Lin <ralin@mozilla.com>
Fri, 25 Nov 2016 14:03:15 +0800
changeset 443764 5122d102ab0a6f7f1c786a1adbbf2c30dc432b20
parent 443602 bad312aefb42982f492ad2cf36f4c6c3d698f4f7
child 538137 350eaca86b5467e463a3066e49c40f03799e3c02
push id37090
push userbmo:ralin@mozilla.com
push dateFri, 25 Nov 2016 06:26:24 +0000
reviewersdholbert
bugs1313285
milestone53.0a1
Bug 1313285 - remove nsVideoFrame::mBorderPadding. r=dholbert MozReview-Commit-ID: Cz5JQqWxQWH
layout/generic/nsVideoFrame.cpp
layout/generic/nsVideoFrame.h
--- a/layout/generic/nsVideoFrame.cpp
+++ b/layout/generic/nsVideoFrame.cpp
@@ -305,17 +305,17 @@ nsVideoFrame::Reflow(nsPresContext* aPre
   const bool isBSizeShrinkWrapping = (contentBoxBSize == NS_INTRINSICSIZE);
 
   nscoord borderBoxBSize;
   if (!isBSizeShrinkWrapping) {
     borderBoxBSize = contentBoxBSize +
       aReflowInput.ComputedLogicalBorderPadding().BStartEnd(myWM);
   }
 
-  mBorderPadding   = aReflowInput.ComputedPhysicalBorderPadding();
+  nsMargin borderPadding = aReflowInput.ComputedPhysicalBorderPadding();
 
   // Reflow the child frames. We may have up to three: an image
   // frame (for the poster image), a container frame for the controls,
   // and a container frame for the caption.
   for (nsIFrame* child : mFrames) {
     nsSize oldChildSize = child->GetSize();
 
     if (child->GetContent() == mPosterImage) {
@@ -330,17 +330,17 @@ nsVideoFrame::Reflow(nsPresContext* aPre
                                        aReflowInput,
                                        imageFrame,
                                        availableSize,
                                        &cbSize);
 
       nsRect posterRenderRect;
       if (ShouldDisplayPoster()) {
         posterRenderRect =
-          nsRect(nsPoint(mBorderPadding.left, mBorderPadding.top),
+          nsRect(nsPoint(borderPadding.left, borderPadding.top),
                  nsSize(aReflowInput.ComputedWidth(),
                         aReflowInput.ComputedHeight()));
       }
       kidReflowInput.SetComputedWidth(posterRenderRect.width);
       kidReflowInput.SetComputedHeight(posterRenderRect.height);
       ReflowChild(imageFrame, aPresContext, kidDesiredSize, kidReflowInput,
                   posterRenderRect.x, posterRenderRect.y, 0, aStatus);
       FinishReflowChild(imageFrame, aPresContext,
@@ -350,18 +350,18 @@ nsVideoFrame::Reflow(nsPresContext* aPre
 // Android still uses XUL media controls & hence needs this XUL-friendly
 // custom reflow code. This will go away in bug 1310907.
 #ifdef ANDROID
     } else if (child->GetContent() == mVideoControls) {
       // Reflow the video controls frame.
       nsBoxLayoutState boxState(PresContext(), aReflowInput.mRenderingContext);
       nsBoxFrame::LayoutChildAt(boxState,
                                 child,
-                                nsRect(mBorderPadding.left,
-                                       mBorderPadding.top,
+                                nsRect(borderPadding.left,
+                                       borderPadding.top,
                                        aReflowInput.ComputedWidth(),
                                        aReflowInput.ComputedHeight()));
 
 #endif // ANDROID
     } else if (child->GetContent() == mCaptionDiv ||
                child->GetContent() == mVideoControls) {
       // Reflow the caption and control bar frames.
       WritingMode wm = child->GetWritingMode();
@@ -369,25 +369,25 @@ nsVideoFrame::Reflow(nsPresContext* aPre
       availableSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
 
       ReflowInput kidReflowInput(aPresContext,
                                        aReflowInput,
                                        child,
                                        availableSize);
       ReflowOutput kidDesiredSize(kidReflowInput);
       ReflowChild(child, aPresContext, kidDesiredSize, kidReflowInput,
-                  mBorderPadding.left, mBorderPadding.top, 0, aStatus);
+                  borderPadding.left, borderPadding.top, 0, aStatus);
 
       if (child->GetContent() == mVideoControls && isBSizeShrinkWrapping) {
         contentBoxBSize = kidDesiredSize.BSize(myWM);
       }
 
       FinishReflowChild(child, aPresContext,
                         kidDesiredSize, &kidReflowInput,
-                        mBorderPadding.left, mBorderPadding.top, 0);
+                        borderPadding.left, borderPadding.top, 0);
     }
 
     if (child->GetContent() == mVideoControls && child->GetSize() != oldChildSize) {
       RefPtr<Runnable> event = new DispatchResizeToControls(child->GetContent());
       nsContentUtils::AddScriptRunner(event);
     }
   }
 
--- a/layout/generic/nsVideoFrame.h
+++ b/layout/generic/nsVideoFrame.h
@@ -125,18 +125,16 @@ protected:
 
   // Sets the mPosterImage's src attribute to be the video's poster attribute,
   // if we're the frame for a video element. Only call on frames for video
   // elements, not for frames for audio elements.
   void UpdatePosterSource(bool aNotify);
 
   virtual ~nsVideoFrame();
 
-  nsMargin mBorderPadding;
-
   // Anonymous child which is bound via XBL to the video controls.
   nsCOMPtr<nsIContent> mVideoControls;
 
   // Anonymous child which is the image element of the poster frame.
   nsCOMPtr<nsIContent> mPosterImage;
 
   // Anonymous child which is the text track caption display div.
   nsCOMPtr<nsIContent> mCaptionDiv;