Remove trailing whitespace from many display list related files
authorMiko Mynttinen <mikokm@gmail.com>
Mon, 15 May 2017 13:45:14 +0200
changeset 659484 cd50bb04a85957bfa9eeb1232fd7863135b189c4
parent 659483 35d46f26a1260a8297c3732d973d3f950c37af86
child 659485 0f48900c519a7d11ecfc5f73a4841732ffa3cf26
push id78143
push userbmo:ethlin@mozilla.com
push dateWed, 06 Sep 2017 04:00:32 +0000
milestone55.0a1
Remove trailing whitespace from many display list related files
layout/forms/nsButtonFrameRenderer.cpp
layout/forms/nsFieldSetFrame.cpp
layout/forms/nsRangeFrame.cpp
layout/forms/nsSelectsAreaFrame.cpp
layout/generic/TextOverflow.cpp
layout/generic/nsCanvasFrame.cpp
layout/generic/nsCanvasFrame.h
layout/generic/nsHTMLCanvasFrame.cpp
layout/generic/nsImageFrame.cpp
layout/generic/nsImageFrame.h
layout/generic/nsPageFrame.cpp
layout/generic/nsPluginFrame.cpp
layout/generic/nsPluginFrame.h
layout/mathml/nsMathMLChar.cpp
layout/mathml/nsMathMLmtableFrame.cpp
layout/tables/nsTableCellFrame.cpp
layout/xul/nsImageBoxFrame.h
layout/xul/nsTextBoxFrame.cpp
layout/xul/tree/nsTreeBodyFrame.cpp
--- a/layout/forms/nsButtonFrameRenderer.cpp
+++ b/layout/forms/nsButtonFrameRenderer.cpp
@@ -63,35 +63,35 @@ nsButtonFrameRenderer::SetDisabled(bool 
   if (aDisabled)
     mFrame->GetContent()->SetAttr(kNameSpaceID_None, nsGkAtoms::disabled, EmptyString(),
                                   notify);
   else
     mFrame->GetContent()->UnsetAttr(kNameSpaceID_None, nsGkAtoms::disabled, notify);
 }
 
 bool
-nsButtonFrameRenderer::isDisabled() 
+nsButtonFrameRenderer::isDisabled()
 {
   return mFrame->GetContent()->AsElement()->
     State().HasState(NS_EVENT_STATE_DISABLED);
 }
 
 class nsDisplayButtonBoxShadowOuter : public nsDisplayItem {
 public:
   nsDisplayButtonBoxShadowOuter(nsDisplayListBuilder* aBuilder,
                                 nsButtonFrameRenderer* aRenderer)
     : nsDisplayItem(aBuilder, aRenderer->GetFrame()) {
     MOZ_COUNT_CTOR(nsDisplayButtonBoxShadowOuter);
   }
 #ifdef NS_BUILD_REFCNT_LOGGING
   virtual ~nsDisplayButtonBoxShadowOuter() {
     MOZ_COUNT_DTOR(nsDisplayButtonBoxShadowOuter);
   }
-#endif  
-  
+#endif
+
   virtual void Paint(nsDisplayListBuilder* aBuilder,
                      nsRenderingContext* aCtx) override;
   virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder,
                            bool* aSnap) override;
   NS_DISPLAY_DECL_NAME("ButtonBoxShadowOuter", TYPE_BUTTON_BOX_SHADOW_OUTER)
 };
 
 nsRect
@@ -266,17 +266,17 @@ public:
                             nsButtonFrameRenderer* aRenderer)
     : nsDisplayItem(aBuilder, aRenderer->GetFrame()), mBFR(aRenderer) {
     MOZ_COUNT_CTOR(nsDisplayButtonForeground);
   }
 #ifdef NS_BUILD_REFCNT_LOGGING
   virtual ~nsDisplayButtonForeground() {
     MOZ_COUNT_DTOR(nsDisplayButtonForeground);
   }
-#endif  
+#endif
 
   nsDisplayItemGeometry* AllocateGeometry(nsDisplayListBuilder* aBuilder) override;
   void ComputeInvalidationRegion(nsDisplayListBuilder* aBuilder,
                                  const nsDisplayItemGeometry* aGeometry,
                                  nsRegion *aInvalidRegion) override;
   virtual void Paint(nsDisplayListBuilder* aBuilder,
                      nsRenderingContext* aCtx) override;
   virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder,
@@ -432,17 +432,17 @@ nsButtonFrameRenderer::PaintInnerFocusBo
   nsRect rect;
 
   PaintBorderFlags flags = aBuilder->ShouldSyncDecodeImages()
                          ? PaintBorderFlags::SYNC_DECODE_IMAGES
                          : PaintBorderFlags();
 
   DrawResult result = DrawResult::SUCCESS;
 
-  if (mInnerFocusStyle) { 
+  if (mInnerFocusStyle) {
     GetButtonInnerFocusRect(aRect, rect);
 
     result &=
       nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, mFrame,
                                   aDirtyRect, rect, mInnerFocusStyle, flags);
   }
 
   return result;
@@ -533,17 +533,17 @@ nsButtonFrameRenderer::GetStyleContext(i
   switch (aIndex) {
   case NS_BUTTON_RENDERER_FOCUS_INNER_CONTEXT_INDEX:
     return mInnerFocusStyle;
   default:
     return nullptr;
   }
 }
 
-void 
+void
 nsButtonFrameRenderer::SetStyleContext(int32_t aIndex, nsStyleContext* aStyleContext)
 {
   switch (aIndex) {
   case NS_BUTTON_RENDERER_FOCUS_INNER_CONTEXT_INDEX:
 #ifdef DEBUG
     if (mInnerFocusStyle) {
       mInnerFocusStyle->FrameRelease();
     }
--- a/layout/forms/nsFieldSetFrame.cpp
+++ b/layout/forms/nsFieldSetFrame.cpp
@@ -169,17 +169,17 @@ nsFieldSetFrame::BuildDisplayList(nsDisp
 
     nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
       aBuilder, this, VisualBorderRectRelativeToSelf(),
       aLists.BorderBackground(),
       /* aAllowWillPaintBorderOptimization = */ false);
 
     aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
       nsDisplayFieldSetBorder(aBuilder, this));
-  
+
     DisplayOutlineUnconditional(aBuilder, aLists);
 
     DO_GLOBAL_REFLOW_COUNT_DSP("nsFieldSetFrame");
   }
 
   if (GetPrevInFlow()) {
     DisplayOverflowContainers(aBuilder, aLists);
   }
--- a/layout/forms/nsRangeFrame.cpp
+++ b/layout/forms/nsRangeFrame.cpp
@@ -491,24 +491,24 @@ nsRangeFrame::GetValueAsFractionOfRange(
   MOZ_ASSERT(input->ControlType() == NS_FORM_INPUT_RANGE);
 
   Decimal value = input->GetValueAsDecimal();
   Decimal minimum = input->GetMinimum();
   Decimal maximum = input->GetMaximum();
 
   MOZ_ASSERT(value.isFinite() && minimum.isFinite() && maximum.isFinite(),
              "type=range should have a default maximum/minimum");
-  
+
   if (maximum <= minimum) {
     MOZ_ASSERT(value == minimum, "Unsanitized value");
     return 0.0;
   }
-  
+
   MOZ_ASSERT(value >= minimum && value <= maximum, "Unsanitized value");
-  
+
   return ((value - minimum) / (maximum - minimum)).toDouble();
 }
 
 Decimal
 nsRangeFrame::GetValueAtEventPoint(WidgetGUIEvent* aEvent)
 {
   MOZ_ASSERT(aEvent->mClass == eMouseEventClass ||
              aEvent->mClass == eTouchEventClass,
--- a/layout/forms/nsSelectsAreaFrame.cpp
+++ b/layout/forms/nsSelectsAreaFrame.cpp
@@ -152,19 +152,19 @@ nsSelectsAreaFrame::BuildDisplayListInte
     // because then the list's scrollframe won't clip it (the scrollframe
     // only clips contained descendants).
     aLists.Outlines()->AppendNewToTop(new (aBuilder)
       nsDisplayListFocus(aBuilder, this));
   }
 }
 
 void
-nsSelectsAreaFrame::Reflow(nsPresContext*           aPresContext, 
+nsSelectsAreaFrame::Reflow(nsPresContext*           aPresContext,
                            ReflowOutput&     aDesiredSize,
-                           const ReflowInput& aReflowInput, 
+                           const ReflowInput& aReflowInput,
                            nsReflowStatus&          aStatus)
 {
   nsListControlFrame* list = GetEnclosingListFrame(this);
   NS_ASSERTION(list,
                "Must have an nsListControlFrame!  Frame constructor is "
                "broken");
 
   bool isInDropdownMode = list->IsInDropDownMode();
--- a/layout/generic/TextOverflow.cpp
+++ b/layout/generic/TextOverflow.cpp
@@ -512,17 +512,17 @@ TextOverflow::ExamineLineFrames(nsLineBo
   do {
     // Setup marker strings as needed.
     if (guessIStart) {
       mIStart.SetupString(mBlock);
     }
     if (guessIEnd) {
       mIEnd.SetupString(mBlock);
     }
-    
+
     // If there is insufficient space for both markers then keep the one on the
     // end side per the block's 'direction'.
     nscoord istartMarkerISize = mIStart.mActive ? mIStart.mISize : 0;
     nscoord iendMarkerISize = mIEnd.mActive ? mIEnd.mISize : 0;
     if (istartMarkerISize && iendMarkerISize &&
         istartMarkerISize + iendMarkerISize > contentArea.ISize(mBlockWM)) {
       istartMarkerISize = 0;
     }
@@ -678,17 +678,17 @@ TextOverflow::PruneDisplayListContents(n
 
     nsDisplayList* wrapper = item->GetSameCoordinateSystemChildren();
     if (wrapper) {
       if (!itemFrame || GetSelfOrNearestBlock(itemFrame) == mBlock) {
         PruneDisplayListContents(aBuilder, wrapper, aFramesToHide, aInsideMarkersArea);
       }
     }
 
-    nsCharClipDisplayItem* charClip = itemFrame ? 
+    nsCharClipDisplayItem* charClip = itemFrame ?
       nsCharClipDisplayItem::CheckCast(item) : nullptr;
     if (charClip && GetSelfOrNearestBlock(itemFrame) == mBlock) {
       LogicalRect rect =
         GetLogicalScrollableOverflowRectRelativeToBlock(itemFrame);
       if (mIStart.IsNeeded()) {
         nscoord istart =
           aInsideMarkersArea.IStart(mBlockWM) - rect.IStart(mBlockWM);
         if (istart > 0) {
--- a/layout/generic/nsCanvasFrame.cpp
+++ b/layout/generic/nsCanvasFrame.cpp
@@ -358,17 +358,17 @@ nsDisplayCanvasBackgroundImage::Paint(ns
   gfxRect destRect;
   if (IsSingleFixedPositionImage(aBuilder, bgClipRect, &destRect) &&
       aBuilder->IsPaintingToWindow() && !aBuilder->IsCompositingCheap() &&
       !dest->CurrentMatrix().HasNonIntegerTranslation()) {
     // Snap image rectangle to nearest pixel boundaries. This is the right way
     // to snap for this context, because we checked HasNonIntegerTranslation
     // above.
     destRect.Round();
-    RefPtr<DrawTarget> dt = 
+    RefPtr<DrawTarget> dt =
       Frame()->Properties().Get(nsIFrame::CachedBackgroundImageDT());
     DrawTarget* destDT = dest->GetDrawTarget();
     if (dt) {
       BlitSurface(destDT, destRect, dt);
       return;
     }
 
     dt = destDT->CreateSimilarDrawTarget(IntSize::Ceil(destRect.width,
@@ -491,17 +491,17 @@ nsCanvasFrame::BuildDisplayList(nsDispla
     nsStyleContext* bgSC;
     const nsStyleBackground* bg = nullptr;
     bool isThemed = IsThemed();
     if (!isThemed && nsCSSRendering::FindBackground(this, &bgSC)) {
       bg = bgSC->StyleBackground();
     }
     aLists.BorderBackground()->AppendNewToTop(
         new (aBuilder) nsDisplayCanvasBackgroundColor(aBuilder, this));
-  
+
     if (isThemed) {
       aLists.BorderBackground()->AppendNewToTop(
         new (aBuilder) nsDisplayCanvasThemedBackground(aBuilder, this));
       return;
     }
 
     if (!bg) {
       return;
@@ -597,30 +597,30 @@ nsCanvasFrame::BuildDisplayList(nsDispla
 
   bool hasFocus = false;
   nsCOMPtr<nsISupports> container;
   aPresContext->GetContainer(getter_AddRefs(container));
   nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(container));
   if (docShell) {
     docShell->GetHasFocus(&hasFocus);
     nsRect dirty = aBuilder->GetDirtyRect();
-    printf("%p - nsCanvasFrame::Paint R:%d,%d,%d,%d  DR: %d,%d,%d,%d\n", this, 
+    printf("%p - nsCanvasFrame::Paint R:%d,%d,%d,%d  DR: %d,%d,%d,%d\n", this,
             mRect.x, mRect.y, mRect.width, mRect.height,
             dirty.x, dirty.y, dirty.width, dirty.height);
   }
-  printf("%p - Focus: %s   c: %p  DoPaint:%s\n", docShell.get(), hasFocus?"Y":"N", 
+  printf("%p - Focus: %s   c: %p  DoPaint:%s\n", docShell.get(), hasFocus?"Y":"N",
          focusContent.get(), mDoPaintFocus?"Y":"N");
 #endif
 
   if (!mDoPaintFocus)
     return;
   // Only paint the focus if we're visible
   if (!StyleVisibility()->IsVisible())
     return;
-  
+
   aLists.Outlines()->AppendNewToTop(new (aBuilder)
     nsDisplayCanvasFocus(aBuilder, this));
 }
 
 void
 nsCanvasFrame::PaintFocus(DrawTarget* aDrawTarget, nsPoint aPt)
 {
   nsRect focusRect(aPt, GetSize());
@@ -698,17 +698,17 @@ nsCanvasFrame::Reflow(nsPresContext*    
       // reflowed but must not be lost until the canvas frame is destroyed.
       mFrames.InsertFrames(this, nullptr, *overflow);
     }
   }
 
   // Set our size up front, since some parts of reflow depend on it
   // being already set.  Note that the computed height may be
   // unconstrained; that's ok.  Consumers should watch out for that.
-  SetSize(nsSize(aReflowInput.ComputedWidth(), aReflowInput.ComputedHeight())); 
+  SetSize(nsSize(aReflowInput.ComputedWidth(), aReflowInput.ComputedHeight()));
 
   // Reflow our one and only normal child frame. It's either the root
   // element's frame or a placeholder for that frame, if the root element
   // is abs-pos or fixed-pos. We may have additional children which
   // are placeholders for continuations of fixed-pos content, but those
   // don't need to be reflowed. The normal child is always comes before
   // the fixed-pos placeholders, because we insert it at the start
   // of the child list, above.
@@ -775,17 +775,17 @@ nsCanvasFrame::Reflow(nsPresContext*    
       // scroll frame ensures that we are always the size of the viewport.
       // Also note: GetPosition() on a CanvasFrame is always going to return
       // (0, 0). We only want to invalidate GetRect() since Get*OverflowRect()
       // could also include overflow to our top and left (out of the viewport)
       // which doesn't need to be painted.
       nsIFrame* viewport = PresContext()->GetPresShell()->GetRootFrame();
       viewport->InvalidateFrame();
     }
-    
+
     // Return our desired size. Normally it's what we're told, but
     // sometimes we can be given an unconstrained height (when a window
     // is sizing-to-content), and we should compute our desired height.
     LogicalSize finalSize(wm);
     finalSize.ISize(wm) = aReflowInput.ComputedISize();
     if (aReflowInput.ComputedBSize() == NS_UNCONSTRAINEDSIZE) {
       finalSize.BSize(wm) = kidFrame->GetLogicalSize(wm).BSize(wm) +
         kidReflowInput.ComputedLogicalMargin().BStartEnd(wm);
@@ -812,17 +812,17 @@ nsCanvasFrame::Reflow(nsPresContext*    
 }
 
 nsIAtom*
 nsCanvasFrame::GetType() const
 {
   return nsGkAtoms::canvasFrame;
 }
 
-nsresult 
+nsresult
 nsCanvasFrame::GetContentForEvent(WidgetEvent* aEvent,
                                   nsIContent** aContent)
 {
   NS_ENSURE_ARG_POINTER(aContent);
   nsresult rv = nsFrame::GetContentForEvent(aEvent,
                                             aContent);
   if (NS_FAILED(rv) || !*aContent) {
     nsIFrame* kid = mFrames.FirstChild();
--- a/layout/generic/nsCanvasFrame.h
+++ b/layout/generic/nsCanvasFrame.h
@@ -199,26 +199,26 @@ public:
   }
 
   virtual void Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) override;
 
   virtual void NotifyRenderingChanged() override
   {
     mFrame->Properties().Delete(nsIFrame::CachedBackgroundImageDT());
   }
- 
-  // We still need to paint a background color as well as an image for this item, 
+
+  // We still need to paint a background color as well as an image for this item,
   // so we can't support this yet.
   virtual bool SupportsOptimizingToImage() override { return false; }
 
   bool IsSingleFixedPositionImage(nsDisplayListBuilder* aBuilder,
                                   const nsRect& aClipRect,
                                   gfxRect* aDestRect);
-  
-  
+
+
   NS_DISPLAY_DECL_NAME("CanvasBackgroundImage", TYPE_CANVAS_BACKGROUND_IMAGE)
 };
 
 class nsDisplayCanvasThemedBackground : public nsDisplayThemedBackground {
 public:
   nsDisplayCanvasThemedBackground(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame)
     : nsDisplayThemedBackground(aBuilder, aFrame,
                                 aFrame->GetRectRelativeToSelf() + aBuilder->ToReferenceFrame(aFrame))
--- a/layout/generic/nsHTMLCanvasFrame.cpp
+++ b/layout/generic/nsHTMLCanvasFrame.cpp
@@ -300,17 +300,17 @@ nsHTMLCanvasFrame::Reflow(nsPresContext*
                    aMetrics.ISize(wm), aMetrics.BSize(wm)));
   NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aMetrics);
 }
 
 // FIXME taken from nsImageFrame, but then had splittable frame stuff
 // removed.  That needs to be fixed.
 // XXXdholbert As in nsImageFrame, this function's clients should probably
 // just be calling GetContentRectRelativeToSelf().
-nsRect 
+nsRect
 nsHTMLCanvasFrame::GetInnerArea() const
 {
   nsMargin bp = mBorderPadding.GetPhysicalMargin(GetWritingMode());
   nsRect r;
   r.x = bp.left;
   r.y = bp.top;
   r.width = mRect.width - bp.left - bp.right;
   r.height = mRect.height - bp.top - bp.bottom;
@@ -391,17 +391,17 @@ nsHTMLCanvasFrame::BuildDisplayList(nsDi
 nsIAtom*
 nsHTMLCanvasFrame::GetType() const
 {
   return nsGkAtoms::HTMLCanvasFrame;
 }
 
 // get the offset into the content area of the image where aImg starts if it is a continuation.
 // from nsImageFrame
-nscoord 
+nscoord
 nsHTMLCanvasFrame::GetContinuationOffset(nscoord* aWidth) const
 {
   nscoord offset = 0;
   if (aWidth) {
     *aWidth = 0;
   }
 
   if (GetPrevInFlow()) {
--- a/layout/generic/nsImageFrame.cpp
+++ b/layout/generic/nsImageFrame.cpp
@@ -208,20 +208,20 @@ nsImageFrame::DestroyFrom(nsIFrame* aDes
     nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(mContent);
     if (imageLoader) {
       // Notify our image loading content that we are going away so it can
       // deregister with our refresh driver.
       imageLoader->FrameDestroyed(this);
 
       imageLoader->RemoveObserver(mListener);
     }
-    
+
     reinterpret_cast<nsImageListener*>(mListener.get())->SetFrame(nullptr);
   }
-  
+
   mListener = nullptr;
 
   // If we were displaying an icon, take ourselves off the list
   if (mDisplayingIcon)
     gIconLoad->RemoveIconObserver(this);
 
   nsAtomicContainerFrame::DestroyFrom(aDestructRoot);
 }
@@ -266,17 +266,17 @@ nsImageFrame::Init(nsIContent*       aCo
   nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(aContent);
   if (!imageLoader) {
     MOZ_CRASH("Why do we have an nsImageFrame here at all?");
   }
 
   imageLoader->AddObserver(mListener);
 
   nsPresContext *aPresContext = PresContext();
-  
+
   if (!gIconLoad)
     LoadIcons(aPresContext);
 
   // We have a PresContext now, so we need to notify the image content node
   // that it can register images.
   imageLoader->FrameCreated(this);
 
   // Give image loads associated with an image frame a small priority boost!
@@ -460,17 +460,17 @@ nsImageFrame::ShouldCreateImageFrameFor(
   //  - else if our "do not show placeholders" pref is set, skip the icon
   //  - else:
   //  - if there is a src attribute, there is no alt attribute,
   //    and this is not an <object> (which could not possibly have
   //    such an attribute), show an icon.
   //  - if QuirksMode, and the IMG has a size show an icon.
   //  - otherwise, skip the icon
   bool useSizedBox;
-  
+
   if (aStyleContext->StyleUIReset()->mForceBrokenImageIcon) {
     useSizedBox = true;
   }
   else if (gIconLoad && gIconLoad->mPrefForceInlineAltText) {
     useSizedBox = false;
   }
   else if (aElement->HasAttr(kNameSpaceID_None, nsGkAtoms::src) &&
            !aElement->HasAttr(kNameSpaceID_None, nsGkAtoms::alt) &&
@@ -527,17 +527,17 @@ static bool
 SizeIsAvailable(imgIRequest* aRequest)
 {
   if (!aRequest)
     return false;
 
   uint32_t imageStatus = 0;
   nsresult rv = aRequest->GetImageStatus(&imageStatus);
 
-  return NS_SUCCEEDED(rv) && (imageStatus & imgIRequest::STATUS_SIZE_AVAILABLE); 
+  return NS_SUCCEEDED(rv) && (imageStatus & imgIRequest::STATUS_SIZE_AVAILABLE);
 }
 
 nsresult
 nsImageFrame::OnSizeAvailable(imgIRequest* aRequest, imgIContainer* aImage)
 {
   if (!aImage) return NS_ERROR_INVALID_ARG;
 
   /* Get requested animation policy from the pres context:
@@ -570,20 +570,20 @@ nsImageFrame::OnSizeAvailable(imgIReques
     mIntrinsicSize.height.SetCoordValue(0);
     mIntrinsicRatio.SizeTo(0, 0);
     intrinsicSizeChanged = true;
   }
 
   if (intrinsicSizeChanged && (mState & IMAGE_GOTINITIALREFLOW)) {
     // Now we need to reflow if we have an unconstrained size and have
     // already gotten the initial reflow
-    if (!(mState & IMAGE_SIZECONSTRAINED)) { 
+    if (!(mState & IMAGE_SIZECONSTRAINED)) {
       nsIPresShell *presShell = presContext->GetPresShell();
       NS_ASSERTION(presShell, "No PresShell.");
-      if (presShell) { 
+      if (presShell) {
         presShell->FrameNeedsReflow(this, nsIPresShell::eStyleChange,
                                     NS_FRAME_IS_DIRTY);
       }
     } else {
       // We've already gotten the initial reflow, and our size hasn't changed,
       // so we're ready to request a decode.
       MaybeDecodeForPredictedSize();
     }
@@ -598,17 +598,17 @@ nsresult
 nsImageFrame::OnFrameUpdate(imgIRequest* aRequest, const nsIntRect* aRect)
 {
   NS_ENSURE_ARG_POINTER(aRect);
 
   if (!(mState & IMAGE_GOTINITIALREFLOW)) {
     // Don't bother to do anything; we have a reflow coming up!
     return NS_OK;
   }
-  
+
   if (mFirstFrameComplete && !StyleVisibility()->IsVisible()) {
     return NS_OK;
   }
 
   if (IsPendingLoad(aRequest)) {
     // We don't care
     return NS_OK;
   }
@@ -874,34 +874,34 @@ nsImageFrame::ComputeSize(nsRenderingCon
   return ComputeSizeWithIntrinsicDimensions(aRenderingContext, aWM,
                                             intrinsicSize, mIntrinsicRatio,
                                             aCBSize, aMargin, aBorder, aPadding,
                                             aFlags);
 }
 
 // XXXdholbert This function's clients should probably just be calling
 // GetContentRectRelativeToSelf() directly.
-nsRect 
+nsRect
 nsImageFrame::GetInnerArea() const
 {
   return GetContentRectRelativeToSelf();
 }
 
 Element*
 nsImageFrame::GetMapElement() const
 {
   nsAutoString usemap;
   if (mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::usemap, usemap)) {
     return mContent->OwnerDoc()->FindImageMap(usemap);
   }
   return nullptr;
 }
 
 // get the offset into the content area of the image where aImg starts if it is a continuation.
-nscoord 
+nscoord
 nsImageFrame::GetContinuationOffset() const
 {
   nscoord offset = 0;
   for (nsIFrame *f = GetPrevInFlow(); f; f = f->GetPrevInFlow()) {
     offset += f->GetContentRect().height;
   }
   NS_ASSERTION(offset >= 0, "bogus GetContentRect");
   return offset;
@@ -969,26 +969,26 @@ nsImageFrame::Reflow(nsPresContext*     
   }
 
   // XXXldb These two bits are almost exact opposites (except in the
   // middle of the initial reflow); remove IMAGE_GOTINITIALREFLOW.
   if (GetStateBits() & NS_FRAME_FIRST_REFLOW) {
     mState |= IMAGE_GOTINITIALREFLOW;
   }
 
-  mComputedSize = 
+  mComputedSize =
     nsSize(aReflowInput.ComputedWidth(), aReflowInput.ComputedHeight());
 
   aMetrics.Width() = mComputedSize.width;
   aMetrics.Height() = mComputedSize.height;
 
   // add borders and padding
   aMetrics.Width()  += aReflowInput.ComputedPhysicalBorderPadding().LeftRight();
   aMetrics.Height() += aReflowInput.ComputedPhysicalBorderPadding().TopBottom();
-  
+
   if (GetPrevInFlow()) {
     aMetrics.Width() = GetPrevInFlow()->GetSize().width;
     nscoord y = GetContinuationOffset();
     aMetrics.Height() -= y + aReflowInput.ComputedPhysicalBorderPadding().top;
     aMetrics.Height() = std::max(0, aMetrics.Height());
   }
 
 
@@ -1002,18 +1002,18 @@ nsImageFrame::Reflow(nsPresContext*     
     imageLoader->GetRequest(nsIImageLoadingContent::CURRENT_REQUEST,
                             getter_AddRefs(currentRequest));
     if (currentRequest) {
       currentRequest->GetImageStatus(&loadStatus);
     }
   }
   if (aPresContext->IsPaginated() &&
       ((loadStatus & imgIRequest::STATUS_SIZE_AVAILABLE) || (mState & IMAGE_SIZECONSTRAINED)) &&
-      NS_UNCONSTRAINEDSIZE != aReflowInput.AvailableHeight() && 
-      aMetrics.Height() > aReflowInput.AvailableHeight()) { 
+      NS_UNCONSTRAINEDSIZE != aReflowInput.AvailableHeight() &&
+      aMetrics.Height() > aReflowInput.AvailableHeight()) {
     // our desired height was greater than 0, so to avoid infinite
     // splitting, use 1 pixel as the min
     aMetrics.Height() = std::max(nsPresContext::CSSPixelsToAppUnits(1), aReflowInput.AvailableHeight());
     aStatus.Reset();
     aStatus.SetIncomplete();
   }
 
   aMetrics.SetOverflowAreasToDesiredBounds();
@@ -1104,17 +1104,17 @@ nsImageFrame::MeasureString(const char16
     bool      trailingSpace = false;
     for (int32_t i = 0; i < aLength; i++) {
       if (dom::IsSpaceCharacter(aString[i]) && (i > 0)) {
         len = i;  // don't include the space when measuring
         trailingSpace = true;
         break;
       }
     }
-  
+
     // Measure this chunk of text, and see if it fits
     nscoord width =
       nsLayoutUtils::AppUnitWidthOfStringBidi(aString, len, this, aFontMetrics,
                                               aContext);
     bool    fits = (totalWidth + width) <= aMaxWidth;
 
     // If it fits on the line, or it's the first word we've processed then
     // include it
@@ -1369,17 +1369,17 @@ nsImageFrame::DisplayAltFeedback(nsRende
       nsCSSRendering::PaintBorderWithStyleBorder(PresContext(), aRenderingContext,
                                                  this, inner, inner,
                                                  recessedBorder, mStyleContext,
                                                  PaintBorderFlags::SYNC_DECODE_IMAGES);
   }
 
   // Adjust the inner rect to account for the one pixel recessed border,
   // and a six pixel padding on each edge
-  inner.Deflate(nsPresContext::CSSPixelsToAppUnits(ICON_PADDING+ALT_BORDER_WIDTH), 
+  inner.Deflate(nsPresContext::CSSPixelsToAppUnits(ICON_PADDING+ALT_BORDER_WIDTH),
                 nsPresContext::CSSPixelsToAppUnits(ICON_PADDING+ALT_BORDER_WIDTH));
   if (inner.IsEmpty()) {
     return DrawResult::SUCCESS;
   }
 
   DrawTarget* drawTarget = aRenderingContext.GetDrawTarget();
   gfxContext* gfx = aRenderingContext.ThebesContext();
 
@@ -1818,17 +1818,17 @@ nsImageFrame::ShouldDisplaySelection()
   nsPresContext* presContext = PresContext();
   int16_t displaySelection = presContext->PresShell()->GetSelectionFlags();
   if (!(displaySelection & nsISelectionDisplay::DISPLAY_IMAGES))
     return false;//no need to check the blue border, we cannot be drawn selected
 //insert hook here for image selection drawing
 #if IMAGE_EDITOR_CHECK
   //check to see if this frame is in an editor context
   //isEditor check. this needs to be changed to have better way to check
-  if (displaySelection == nsISelectionDisplay::DISPLAY_ALL) 
+  if (displaySelection == nsISelectionDisplay::DISPLAY_ALL)
   {
     nsCOMPtr<nsISelectionController> selCon;
     result = GetSelectionController(presContext, getter_AddRefs(selCon));
     if (NS_SUCCEEDED(result) && selCon)
     {
       nsCOMPtr<nsISelection> selection;
       result = selCon->GetSelection(nsISelectionController::SELECTION_NORMAL, getter_AddRefs(selection));
       if (NS_SUCCEEDED(result) && selection)
@@ -1934,17 +1934,17 @@ nsImageFrame::GetAnchorHREFTargetAndNode
       }
       NS_ADDREF(*aNode = content);
       break;
     }
   }
   return status;
 }
 
-nsresult  
+nsresult
 nsImageFrame::GetContentForEvent(WidgetEvent* aEvent,
                                  nsIContent** aContent)
 {
   NS_ENSURE_ARG_POINTER(aContent);
 
   nsIFrame* f = nsLayoutUtils::GetNonGeneratedAncestor(this);
   if (f != this) {
     return f->GetContentForEvent(aEvent, aContent);
@@ -2055,17 +2055,17 @@ nsImageFrame::GetCursor(const nsPoint& a
     TranslateEventCoords(aPoint, p);
     nsCOMPtr<nsIContent> area = map->GetArea(p.x, p.y);
     if (area) {
       // Use the cursor from the style of the *area* element.
       // XXX Using the image as the parent style context isn't
       // technically correct, but it's probably the right thing to do
       // here, since it means that areas on which the cursor isn't
       // specified will inherit the style from the image.
-      RefPtr<nsStyleContext> areaStyle = 
+      RefPtr<nsStyleContext> areaStyle =
         PresContext()->PresShell()->StyleSet()->
           ResolveStyleFor(area->AsElement(), StyleContext(),
                           LazyComputeBehavior::Allow);
       FillCursorInformationFromStyle(areaStyle->StyleUserInterface(),
                                      aCursor);
       if (NS_STYLE_CURSOR_AUTO == aCursor.mCursor) {
         aCursor.mCursor = NS_STYLE_CURSOR_DEFAULT;
       }
@@ -2241,18 +2241,18 @@ nsImageFrame::SpecToURI(const nsAString&
                          nsIURI **aURI)
 {
   nsCOMPtr<nsIURI> baseURI;
   if (mContent) {
     baseURI = mContent->GetBaseURI();
   }
   nsAutoCString charset;
   GetDocumentCharacterSet(charset);
-  NS_NewURI(aURI, aSpec, 
-            charset.IsEmpty() ? nullptr : charset.get(), 
+  NS_NewURI(aURI, aSpec,
+            charset.IsEmpty() ? nullptr : charset.get(),
             baseURI, aIOService);
 }
 
 void
 nsImageFrame::GetLoadGroup(nsPresContext *aPresContext, nsILoadGroup **aLoadGroup)
 {
   if (!aPresContext)
     return;
--- a/layout/generic/nsImageFrame.h
+++ b/layout/generic/nsImageFrame.h
@@ -87,17 +87,17 @@ public:
   virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;
   virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
   virtual mozilla::IntrinsicSize GetIntrinsicSize() override;
   virtual nsSize GetIntrinsicRatio() override;
   virtual void Reflow(nsPresContext*           aPresContext,
                       ReflowOutput&     aDesiredSize,
                       const ReflowInput& aReflowInput,
                       nsReflowStatus&          aStatus) override;
-  
+
   virtual nsresult  GetContentForEvent(mozilla::WidgetEvent* aEvent,
                                        nsIContent** aContent) override;
   virtual nsresult HandleEvent(nsPresContext* aPresContext,
                                mozilla::WidgetGUIEvent* aEvent,
                                nsEventStatus* aEventStatus) override;
   virtual nsresult GetCursor(const nsPoint& aPoint,
                              nsIFrame::Cursor& aCursor) override;
   virtual nsresult AttributeChanged(int32_t aNameSpaceID,
@@ -116,17 +116,17 @@ public:
   virtual bool IsFrameOfType(uint32_t aFlags) const override
   {
     return nsAtomicContainerFrame::IsFrameOfType(aFlags &
       ~(nsIFrame::eReplaced | nsIFrame::eReplacedSizing));
   }
 
 #ifdef DEBUG_FRAME_DUMP
   virtual nsresult GetFrameName(nsAString& aResult) const override;
-  void List(FILE* out = stderr, const char* aPrefix = "", 
+  void List(FILE* out = stderr, const char* aPrefix = "",
             uint32_t aFlags = 0) const override;
 #endif
 
   nsSplittableType GetSplittableType() const override
   {
     return NS_FRAME_SPLITTABLE;
   }
 
@@ -146,17 +146,17 @@ public:
 
   /**
    * Function to test whether aContent, which has aStyleContext as its style,
    * should get an image frame.  Note that this method is only used by the
    * frame constructor; it's only here because it uses gIconLoad for now.
    */
   static bool ShouldCreateImageFrameFor(mozilla::dom::Element* aElement,
                                           nsStyleContext* aStyleContext);
-  
+
   DrawResult DisplayAltFeedback(nsRenderingContext& aRenderingContext,
                                 const nsRect& aDirtyRect,
                                 nsPoint aPt,
                                 uint32_t aFlags);
 
   nsRect GetInnerArea() const;
 
   /**
@@ -335,17 +335,17 @@ private:
   nsSize mIntrinsicRatio;
 
   bool mDisplayingIcon;
   bool mFirstFrameComplete;
   bool mReflowCallbackPosted;
   bool mForceSyncDecoding;
 
   static nsIIOService* sIOService;
-  
+
   /* loading / broken image icon support */
 
   // XXXbz this should be handled by the prescontext, I think; that
   // way we would have a single iconload per mozilla session instead
   // of one per document...
 
   // LoadIcons: initiate the loading of the static icons used to show
   // loading / broken images
@@ -387,20 +387,20 @@ private:
 
   public:
     RefPtr<imgRequestProxy> mLoadingImage;
     RefPtr<imgRequestProxy> mBrokenImage;
     bool             mPrefForceInlineAltText;
     bool             mPrefShowPlaceholders;
     bool             mPrefShowLoadingPlaceholder;
   };
-  
+
 public:
   static IconLoad* gIconLoad; // singleton pattern: one LoadIcons instance is used
-  
+
   friend class nsDisplayImage;
 };
 
 /**
  * Note that nsDisplayImage does not receive events. However, an image element
  * is replaced content so its background will be z-adjacent to the
  * image itself, and hence receive events just as if the image itself
  * received events.
--- a/layout/generic/nsPageFrame.cpp
+++ b/layout/generic/nsPageFrame.cpp
@@ -178,23 +178,23 @@ nsPageFrame::GetType() const
 #ifdef DEBUG_FRAME_DUMP
 nsresult
 nsPageFrame::GetFrameName(nsAString& aResult) const
 {
   return MakeFrameName(NS_LITERAL_STRING("Page"), aResult);
 }
 #endif
 
-void 
+void
 nsPageFrame::ProcessSpecialCodes(const nsString& aStr, nsString& aNewStr)
 {
 
   aNewStr = aStr;
 
-  // Search to see if the &D code is in the string 
+  // Search to see if the &D code is in the string
   // then subst in the current date/time
   NS_NAMED_LITERAL_STRING(kDate, "&D");
   if (aStr.Find(kDate) != kNotFound) {
     aNewStr.ReplaceSubstring(kDate, mPD->mDateTimeStr);
   }
 
   // NOTE: Must search for &PT before searching for &P
   //
@@ -234,17 +234,17 @@ nsPageFrame::ProcessSpecialCodes(const n
     free(uStr);
   }
 }
 
 
 //------------------------------------------------------------------------------
 nscoord nsPageFrame::GetXPosition(nsRenderingContext& aRenderingContext,
                                   nsFontMetrics&       aFontMetrics,
-                                  const nsRect&        aRect, 
+                                  const nsRect&        aRect,
                                   int32_t              aJust,
                                   const nsString&      aStr)
 {
   nscoord width = nsLayoutUtils::AppUnitWidthOfStringBidi(aStr, this,
                                                           aFontMetrics,
                                                           aRenderingContext);
   nscoord x = aRect.x;
   switch (aJust) {
@@ -364,20 +364,20 @@ nsPageFrame::DrawHeaderFooter(nsRenderin
           // these font metrics!
           str.Truncate(indx-3);
           str.AppendLiteral("...");
         } else {
           // We can only fit 3 or fewer chars.  Just show nothing
           str.Truncate();
         }
       }
-    } else { 
+    } else {
       return; // bail if couldn't find the correct length
     }
-    
+
     if (HasRTLChars(str)) {
       PresContext()->SetBidiEnabled();
     }
 
     // cacl the x and y positions of the text
     nscoord x = GetXPosition(aRenderingContext, aFontMetrics, aRect, aJust, str);
     nscoord y;
     if (aHeaderFooter == eHeader) {
@@ -606,19 +606,19 @@ nsPageFrame::BuildDisplayList(nsDisplayL
         nsDisplayHeaderFooter(aBuilder, this));
   }
 
   set.MoveTo(aLists);
 }
 
 //------------------------------------------------------------------------------
 void
-nsPageFrame::SetPageNumInfo(int32_t aPageNumber, int32_t aTotalPages) 
-{ 
-  mPageNum     = aPageNumber; 
+nsPageFrame::SetPageNumInfo(int32_t aPageNumber, int32_t aTotalPages)
+{
+  mPageNum     = aPageNumber;
   mTotNumPages = aTotalPages;
 }
 
 
 void
 nsPageFrame::PaintHeaderFooter(nsRenderingContext& aRenderingContext,
                                nsPoint aPt, bool aDisableSubpixelAA)
 {
@@ -665,18 +665,18 @@ nsPageFrame::PaintHeaderFooter(nsRenderi
   mPD->mPrintSettings->GetFooterStrCenter(getter_Copies(footerCenter));
   mPD->mPrintSettings->GetFooterStrRight(getter_Copies(footerRight));
   DrawHeaderFooter(aRenderingContext, *fontMet, eFooter,
                    footerLeft, footerCenter, footerRight,
                    rect, ascent, visibleHeight);
 }
 
 void
-nsPageFrame::SetSharedPageData(nsSharedPageData* aPD) 
-{ 
+nsPageFrame::SetSharedPageData(nsSharedPageData* aPD)
+{
   mPD = aPD;
   // Set the shared data into the page frame before reflow
   nsPageContentFrame * pcf = static_cast<nsPageContentFrame*>(mFrames.FirstChild());
   if (pcf) {
     pcf->SetSharedPageData(mPD);
   }
 
 }
@@ -732,17 +732,17 @@ nsPageBreakFrame::Reflow(nsPresContext* 
   // round the height down to the nearest pixel
   finalSize.BSize(wm) -=
     finalSize.BSize(wm) % nsPresContext::CSSPixelsToAppUnits(1);
   aDesiredSize.SetSize(wm, finalSize);
 
   // Note: not using NS_FRAME_FIRST_REFLOW here, since it's not clear whether
   // DidReflow will always get called before the next Reflow() call.
   mHaveReflowed = true;
-  aStatus.Reset(); 
+  aStatus.Reset();
 }
 
 nsIAtom*
 nsPageBreakFrame::GetType() const
 {
   return nsGkAtoms::pageBreakFrame;
 }
 
--- a/layout/generic/nsPluginFrame.cpp
+++ b/layout/generic/nsPluginFrame.cpp
@@ -229,59 +229,59 @@ nsPluginFrame::DestroyFrom(nsIFrame* aDe
 
 /* virtual */ void
 nsPluginFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext)
 {
   if (HasView()) {
     nsView* view = GetView();
     nsViewManager* vm = view->GetViewManager();
     if (vm) {
-      nsViewVisibility visibility = 
+      nsViewVisibility visibility =
         IsHidden() ? nsViewVisibility_kHide : nsViewVisibility_kShow;
       vm->SetViewVisibility(view, visibility);
     }
   }
 
   nsFrame::DidSetStyleContext(aOldStyleContext);
 }
 
 nsIAtom*
 nsPluginFrame::GetType() const
 {
-  return nsGkAtoms::objectFrame; 
+  return nsGkAtoms::objectFrame;
 }
 
 #ifdef DEBUG_FRAME_DUMP
 nsresult
 nsPluginFrame::GetFrameName(nsAString& aResult) const
 {
   return MakeFrameName(NS_LITERAL_STRING("PluginFrame"), aResult);
 }
 #endif
 
 nsresult
 nsPluginFrame::PrepForDrawing(nsIWidget *aWidget)
 {
   mWidget = aWidget;
 
   nsView* view = GetView();
-  NS_ASSERTION(view, "Object frames must have views");  
+  NS_ASSERTION(view, "Object frames must have views");
   if (!view) {
     return NS_ERROR_FAILURE;
   }
 
   nsViewManager* viewMan = view->GetViewManager();
   // mark the view as hidden since we don't know the (x,y) until Paint
   // XXX is the above comment correct?
   viewMan->SetViewVisibility(view, nsViewVisibility_kHide);
 
   //this is ugly. it was ripped off from didreflow(). MMP
   // Position and size view relative to its parent, not relative to our
   // parent frame (our parent frame may not have a view).
-  
+
   nsView* parentWithView;
   nsPoint origin;
   nsRect r(0, 0, mRect.width, mRect.height);
 
   GetOffsetFromView(origin, &parentWithView);
   viewMan->ResizeView(view, r);
   viewMan->MoveViewTo(view, origin.x, origin.y);
 
@@ -331,17 +331,17 @@ nsPluginFrame::PrepForDrawing(nsIWidget 
     // the PaintedLayer containing the plugin is updated.
     if (parentWidget == GetNearestWidget()) {
       InvalidateFrame();
     }
 #endif
 
     RegisterPluginForGeometryUpdates();
 
-    // Here we set the background color for this widget because some plugins will use 
+    // Here we set the background color for this widget because some plugins will use
     // the child window background color when painting. If it's not set, it may default to gray
     // Sometimes, a frame doesn't have a background color or is transparent. In this
     // case, walk up the frame tree until we do find a frame with a background color
     for (nsIFrame* frame = this; frame; frame = frame->GetParent()) {
       nscolor bgcolor = frame->
         GetVisitedDependentColor(&nsStyleBackground::mBackgroundColor);
       if (NS_GET_A(bgcolor) > 0) {  // make sure we got an actual color
         mWidget->SetBackgroundColor(bgcolor);
@@ -596,23 +596,23 @@ nsPluginFrame::FixupWindow(const nsSize&
 
   NotifyPluginReflowObservers();
 }
 
 nsresult
 nsPluginFrame::CallSetWindow(bool aCheckIsHidden)
 {
   NPWindow *win = nullptr;
- 
+
   nsresult rv = NS_ERROR_FAILURE;
   RefPtr<nsNPAPIPluginInstance> pi;
   if (!mInstanceOwner ||
       NS_FAILED(rv = mInstanceOwner->GetInstance(getter_AddRefs(pi))) ||
       !pi ||
-      NS_FAILED(rv = mInstanceOwner->GetWindow(win)) || 
+      NS_FAILED(rv = mInstanceOwner->GetWindow(win)) ||
       !win)
     return rv;
 
   nsPluginNativeWindow *window = (nsPluginNativeWindow *)win;
 
   if (aCheckIsHidden && IsHidden())
     return NS_ERROR_FAILURE;
 
@@ -760,17 +760,17 @@ nsPluginFrame::IsFocusable(int32_t *aTab
   return nsFrame::IsFocusable(aTabIndex, aWithMouse);
 }
 
 bool
 nsPluginFrame::IsHidden(bool aCheckVisibilityStyle) const
 {
   if (aCheckVisibilityStyle) {
     if (!StyleVisibility()->IsVisibleOrCollapsed())
-      return true;    
+      return true;
   }
 
   // only <embed> tags support the HIDDEN attribute
   if (mContent->IsHTMLElement(nsGkAtoms::embed)) {
     // Yes, these are really the kooky ways that you could tell 4.x
     // not to hide the <embed> once you'd put the 'hidden' attribute
     // on the tag...
 
--- a/layout/generic/nsPluginFrame.h
+++ b/layout/generic/nsPluginFrame.h
@@ -102,17 +102,17 @@ public:
   virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
 
   virtual void DidSetStyleContext(nsStyleContext* aOldStyleContext) override;
 
   NS_IMETHOD GetPluginInstance(nsNPAPIPluginInstance** aPluginInstance) override;
 
   virtual void SetIsDocumentActive(bool aIsActive) override;
 
-  virtual nsresult GetCursor(const nsPoint& aPoint, 
+  virtual nsresult GetCursor(const nsPoint& aPoint,
                              nsIFrame::Cursor& aCursor) override;
 
   // APIs used by nsRootPresContext to set up the widget position/size/clip
   // region.
   /**
    * Set the next widget configuration for the plugin to the desired
    * position of the plugin's widget, on the assumption that it is not visible
    * (clipped out or covered by opaque content).
@@ -229,28 +229,28 @@ protected:
   virtual ~nsPluginFrame();
 
   // NOTE:  This frame class does not inherit from |nsLeafFrame|, so
   // this is not a virtual method implementation.
   void GetDesiredSize(nsPresContext* aPresContext,
                       const ReflowInput& aReflowInput,
                       ReflowOutput& aDesiredSize);
 
-  bool IsFocusable(int32_t *aTabIndex = nullptr, 
+  bool IsFocusable(int32_t *aTabIndex = nullptr,
                    bool aWithMouse = false) override;
 
   // check attributes and optionally CSS to see if we should display anything
   bool IsHidden(bool aCheckVisibilityStyle = true) const;
 
   bool IsOpaque() const;
   bool IsTransparentMode() const;
   bool IsPaintedByGecko() const;
 
   nsIntPoint GetWindowOriginInPixels(bool aWindowless);
-  
+
   /*
    * If this frame is in a remote tab, return the tab offset to
    * the origin of the chrome window. In non-e10s, this return 0,0.
    * This api sends a sync ipc request so be careful about use.
    */
   LayoutDeviceIntPoint GetRemoteTabChromeOffset();
 
   static void PaintPrintPlugin(nsIFrame* aFrame,
@@ -289,19 +289,19 @@ private:
     for (uint32_t i = 0; i < aRects.Length(); ++i) {
       region.Or(region, aRects[i]);
     }
     return region;
   }
 
   class PluginEventNotifier : public mozilla::Runnable {
   public:
-    explicit PluginEventNotifier(const nsString &aEventType) : 
+    explicit PluginEventNotifier(const nsString &aEventType) :
       mEventType(aEventType) {}
-    
+
     NS_IMETHOD Run() override;
   private:
     nsString mEventType;
   };
 
   nsPluginInstanceOwner*          mInstanceOwner; // WEAK
   nsView*                         mOuterView;
   nsView*                         mInnerView;
@@ -360,17 +360,17 @@ public:
 
   NS_DISPLAY_DECL_NAME("Plugin", TYPE_PLUGIN)
 
   virtual already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
                                              LayerManager* aManager,
                                              const ContainerLayerParameters& aContainerParameters) override
   {
     return static_cast<nsPluginFrame*>(mFrame)->BuildLayer(aBuilder,
-                                                           aManager, 
+                                                           aManager,
                                                            this,
                                                            aContainerParameters);
   }
 
   virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder,
                                    LayerManager* aManager,
                                    const ContainerLayerParameters& aParameters) override
   {
--- a/layout/mathml/nsMathMLChar.cpp
+++ b/layout/mathml/nsMathMLChar.cpp
@@ -1448,17 +1448,17 @@ nsMathMLChar::StretchEnumContext::EnumCa
       unquotedFamilyName.AppendToString(familyName);
       glyphTable = gGlyphTableList->GetGlyphTableFor(familyName);
     }
   }
 
   if (!openTypeTable) {
     if (context->mTablesTried.Contains(glyphTable))
       return true; // already tried this one
-    
+
     // Only try this table once.
     context->mTablesTried.AppendElement(glyphTable);
   }
 
   // If the unicode table is being used, then search all font families.  If a
   // special table is being used then the font in this family should have the
   // specified glyphs.
   const FontFamilyList& familyList = glyphTable == &gGlyphTableList->mUnicodeTable ?
@@ -1615,17 +1615,17 @@ nsMathMLChar::StretchInternal(nsPresCont
     isVertical ? initialSize.ascent + initialSize.descent
     : initialSize.rightBearing - initialSize.leftBearing;
 
   bool done = false;
 
   if (!maxWidth && !largeop) {
     // Doing Stretch() not GetMaxWidth(),
     // and not a largeop in display mode; we're done if size fits
-    if ((targetSize <= 0) || 
+    if ((targetSize <= 0) ||
         ((isVertical && charSize >= targetSize) ||
          IsSizeOK(charSize, targetSize, aStretchHint)))
       done = true;
   }
 
   //////////////////////////////////////////////////////////////////////////////
   // 2/3. Search for a glyph or set of part glyphs of appropriate size
   //////////////////////////////////////////////////////////////////////////////
@@ -1667,34 +1667,34 @@ nsMathMLChar::StretchInternal(nsPresCont
     }
   }
 
   if (!maxWidth) {
     // Now, we know how we are going to draw the char. Update the member
     // variables accordingly.
     mUnscaledAscent = aDesiredStretchSize.ascent;
   }
-    
+
   if (glyphFound) {
     return NS_OK;
   }
 
   // We did not find a size variant or a glyph assembly to stretch this
   // operator. Verify whether a font with an OpenType MATH table is available
   // and record missing math script otherwise.
   gfxMissingFontRecorder* MFR = aPresContext->MissingFontRecorder();
   if (MFR && !fm->GetThebesFontGroup()->GetFirstMathFont()) {
     MFR->RecordScript(unicode::Script::MATHEMATICAL_NOTATION);
   }
 
   // If the scale_stretchy_operators option is disabled, we are done.
   if (!Preferences::GetBool("mathml.scale_stretchy_operators.enabled", true)) {
     return NS_OK;
   }
-  
+
   // stretchy character
   if (stretchy) {
     if (isVertical) {
       float scale =
         std::min(kMaxScaleFactor, float(aContainerSize.ascent + aContainerSize.descent) /
         (aDesiredStretchSize.ascent + aDesiredStretchSize.descent));
       if (!largeop || scale > 1.0) {
         // make the character match the desired height.
@@ -1852,17 +1852,17 @@ void nsDisplayMathMLSelectionRect::Paint
   drawTarget->FillRect(rect, ColorPattern(ToDeviceColor(bgColor)));
 }
 
 class nsDisplayMathMLCharForeground : public nsDisplayItem {
 public:
   nsDisplayMathMLCharForeground(nsDisplayListBuilder* aBuilder,
                                 nsIFrame* aFrame, nsMathMLChar* aChar,
 				                uint32_t aIndex, bool aIsSelected)
-    : nsDisplayItem(aBuilder, aFrame), mChar(aChar), 
+    : nsDisplayItem(aBuilder, aFrame), mChar(aChar),
       mIndex(aIndex), mIsSelected(aIsSelected) {
     MOZ_COUNT_CTOR(nsDisplayMathMLCharForeground);
   }
 #ifdef NS_BUILD_REFCNT_LOGGING
   virtual ~nsDisplayMathMLCharForeground() {
     MOZ_COUNT_DTOR(nsDisplayMathMLCharForeground);
   }
 #endif
@@ -1875,32 +1875,31 @@ public:
     nsBoundingMetrics bm;
     mChar->GetBoundingMetrics(bm);
     nsRect temp(offset.x + bm.leftBearing, offset.y,
                 bm.rightBearing - bm.leftBearing, bm.ascent + bm.descent);
     // Bug 748220
     temp.Inflate(mFrame->PresContext()->AppUnitsPerDevPixel());
     return temp;
   }
-  
+
   virtual void Paint(nsDisplayListBuilder* aBuilder,
                      nsRenderingContext* aCtx) override
   {
     mChar->PaintForeground(mFrame->PresContext(), *aCtx,
                            ToReferenceFrame(), mIsSelected);
   }
 
   NS_DISPLAY_DECL_NAME("MathMLCharForeground", TYPE_MATHML_CHAR_FOREGROUND)
 
   virtual nsRect GetComponentAlphaBounds(nsDisplayListBuilder* aBuilder) override
   {
     bool snap;
     return GetBounds(aBuilder, &snap);
   }
-  
   virtual uint32_t GetPerFrameKey() override {
     return (mIndex << TYPE_BITS)
       | nsDisplayItem::GetPerFrameKey();
   }
 
 private:
   nsMathMLChar* mChar;
   uint32_t      mIndex;
@@ -2343,17 +2342,17 @@ nsMathMLChar::PaintHorizontally(nsPresCo
     // Do this now so that we can get the other dimensions right.
     // (This may not achieve much with non-rectangular transformations.)
     dx = SnapToDevPixels(aThebesContext, oneDevPixel, nsPoint(dx, dy)).x;
     // abcissa passed to Draw
     offset[i] = dx;
     // _cairo_scaled_font_glyph_device_extents rounds outwards to the nearest
     // pixel, so the bm values can include 1 row of faint pixels on each edge.
     // Don't rely on this pixel as it can look like a gap.
-    if (bm.rightBearing - bm.leftBearing >= 2 * oneDevPixel) { 
+    if (bm.rightBearing - bm.leftBearing >= 2 * oneDevPixel) {
       start[i] = dx + bm.leftBearing + oneDevPixel; // left join
       end[i] = dx + bm.rightBearing - oneDevPixel; // right join
     } else {
       // To avoid overlaps, we don't add one pixel on each side when the part
       // is too small.
       start[i] = dx + bm.leftBearing; // left join
       end[i] = dx + bm.rightBearing; // right join
     }
--- a/layout/mathml/nsMathMLmtableFrame.cpp
+++ b/layout/mathml/nsMathMLmtableFrame.cpp
@@ -280,23 +280,23 @@ public:
   }
 
   void ComputeInvalidationRegion(nsDisplayListBuilder* aBuilder,
                                  const nsDisplayItemGeometry* aGeometry,
                                  nsRegion* aInvalidRegion) override
   {
     auto geometry =
       static_cast<const nsDisplayItemGenericImageGeometry*>(aGeometry);
-  
+
     if (aBuilder->ShouldSyncDecodeImages() &&
         geometry->ShouldInvalidateToSyncDecodeImages()) {
       bool snap;
       aInvalidRegion->Or(*aInvalidRegion, GetBounds(aBuilder, &snap));
     }
-  
+
     nsDisplayItem::ComputeInvalidationRegion(aBuilder, aGeometry, aInvalidRegion);
   }
 
   virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) override
   {
     *aSnap = true;
     nsStyleBorder styleBorder = *mFrame->StyleBorder();
     nsMathMLmtdFrame* frame = static_cast<nsMathMLmtdFrame*>(mFrame);
@@ -609,20 +609,20 @@ MapAllAttributesIntoCSS(nsMathMLmtableFr
   }
 }
 
 // the align attribute of mtable can have a row number which indicates
 // from where to anchor the table, e.g., top 5 means anchor the table at
 // the top of the 5th row, axis -1 means anchor the table on the axis of
 // the last row
 
-// The REC says that the syntax is 
-// '\s*(top|bottom|center|baseline|axis)(\s+-?[0-9]+)?\s*' 
+// The REC says that the syntax is
+// '\s*(top|bottom|center|baseline|axis)(\s+-?[0-9]+)?\s*'
 // the parsing could have been simpler with that syntax
-// but for backward compatibility we make optional 
+// but for backward compatibility we make optional
 // the whitespaces between the alignment name and the row number
 
 enum eAlign {
   eAlign_top,
   eAlign_bottom,
   eAlign_center,
   eAlign_baseline,
   eAlign_axis
@@ -631,17 +631,17 @@ enum eAlign {
 static void
 ParseAlignAttribute(nsString& aValue, eAlign& aAlign, int32_t& aRowIndex)
 {
   // by default, the table is centered about the axis
   aRowIndex = 0;
   aAlign = eAlign_axis;
   int32_t len = 0;
 
-  // we only have to remove the leading spaces because 
+  // we only have to remove the leading spaces because
   // ToInteger ignores the whitespaces around the number
   aValue.CompressWhitespace(true, false);
 
   if (0 == aValue.Find("top")) {
     len = 3; // 3 is the length of 'top'
     aAlign = eAlign_top;
   }
   else if (0 == aValue.Find("bottom")) {
@@ -696,39 +696,39 @@ NS_QUERYFRAME_TAIL_INHERITING(nsTableWra
 
 nsContainerFrame*
 NS_NewMathMLmtableOuterFrame (nsIPresShell* aPresShell, nsStyleContext* aContext)
 {
   return new (aPresShell) nsMathMLmtableWrapperFrame(aContext);
 }
 
 NS_IMPL_FRAMEARENA_HELPERS(nsMathMLmtableWrapperFrame)
- 
+
 nsMathMLmtableWrapperFrame::~nsMathMLmtableWrapperFrame()
 {
 }
 
 nsresult
 nsMathMLmtableWrapperFrame::AttributeChanged(int32_t  aNameSpaceID,
                                              nsIAtom* aAttribute,
                                              int32_t  aModType)
 {
   // Attributes specific to <mtable>:
   // frame         : in mathml.css
   // framespacing  : here
   // groupalign    : not yet supported
-  // equalrows     : not yet supported 
-  // equalcolumns  : not yet supported 
+  // equalrows     : not yet supported
+  // equalcolumns  : not yet supported
   // displaystyle  : here and in mathml.css
-  // align         : in reflow 
+  // align         : in reflow
   // rowalign      : here
-  // rowlines      : here 
+  // rowlines      : here
   // rowspacing    : here
-  // columnalign   : here 
-  // columnlines   : here 
+  // columnalign   : here
+  // columnlines   : here
   // columnspacing : here
 
   // mtable is simple and only has one (pseudo) row-group inside our inner-table
   nsIFrame* tableFrame = mFrames.FirstChild();
   NS_ASSERTION(tableFrame && tableFrame->GetType() == nsGkAtoms::tableFrame,
                "should always have an inner table frame");
   nsIFrame* rgFrame = tableFrame->PrincipalChildList().FirstChild();
   if (!rgFrame || rgFrame->GetType() != nsGkAtoms::tableRowGroupFrame)
@@ -1225,17 +1225,17 @@ nsMathMLmtdFrame::AttributeChanged(int32
 
     // Reparse the attribute.
     ParseFrameAttribute(this, aAttribute, false);
     return NS_OK;
   }
 
   if (aAttribute == nsGkAtoms::rowspan ||
       aAttribute == nsGkAtoms::columnspan_) {
-    // use the naming expected by the base class 
+    // use the naming expected by the base class
     if (aAttribute == nsGkAtoms::columnspan_)
       aAttribute = nsGkAtoms::colspan;
     return nsTableCellFrame::AttributeChanged(aNameSpaceID, aAttribute, aModType);
   }
 
   return NS_OK;
 }
 
--- a/layout/tables/nsTableCellFrame.cpp
+++ b/layout/tables/nsTableCellFrame.cpp
@@ -497,17 +497,17 @@ nsTableCellFrame::BuildDisplayList(nsDis
     if (StyleVisibility()->IsVisible() &&
         (NS_STYLE_TABLE_EMPTY_CELLS_HIDE != emptyCellStyle)) {
       // display outset box-shadows if we need to.
       bool hasBoxShadow = !!StyleEffects()->mBoxShadow;
       if (hasBoxShadow) {
         aLists.BorderBackground()->AppendNewToTop(
           new (aBuilder) nsDisplayBoxShadowOuter(aBuilder, this));
       }
-    
+
       // display background if we need to.
       if (aBuilder->IsForEventDelivery() ||
           !StyleBackground()->IsTransparent(this) ||
           StyleDisplay()->UsedAppearance()) {
         if (!tableFrame->IsBorderCollapse()) {
           nsDisplayBackgroundImage::AppendBackgroundItemsToTop(aBuilder,
               this,
               GetRectRelativeToSelf(),
@@ -525,35 +525,35 @@ nsTableCellFrame::BuildDisplayList(nsDis
           // The nsTablePainter will paint our background. Make sure it
           // knows if we're background-attachment:fixed.
           nsDisplayTableItem* currentItem = aBuilder->GetCurrentTableItem();
           if (currentItem) {
             currentItem->UpdateForFrameBackground(this);
           }
         }
       }
-    
+
       // display inset box-shadows if we need to.
       if (hasBoxShadow) {
         aLists.BorderBackground()->AppendNewToTop(
           new (aBuilder) nsDisplayBoxShadowInner(aBuilder, this));
       }
-    
+
       // display borders if we need to
       ProcessBorders(tableFrame, aBuilder, aLists);
-    
+
       // and display the selection border if we need to
       if (IsSelected()) {
         aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
           nsDisplayGeneric(aBuilder, this, ::PaintTableCellSelection,
                            "TableCellSelection",
                            TYPE_TABLE_CELL_SELECTION));
       }
     }
-    
+
     // the 'empty-cells' property has no effect on 'outline'
     DisplayOutline(aBuilder, aLists);
   }
 
   // Push a null 'current table item' so that descendant tables can't
   // accidentally mess with our table
   nsAutoPushCurrentTableItem pushTableItem;
   pushTableItem.Push(aBuilder, nullptr);
--- a/layout/xul/nsImageBoxFrame.h
+++ b/layout/xul/nsImageBoxFrame.h
@@ -68,17 +68,17 @@ public:
 
   virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
 
   virtual nsIAtom* GetType() const override;
 #ifdef DEBUG_FRAME_DUMP
   virtual nsresult GetFrameName(nsAString& aResult) const override;
 #endif
 
-  /** 
+  /**
    * Update mUseSrcAttr from appropriate content attributes or from
    * style, throw away the current image, and load the appropriate
    * image.
    * */
   void UpdateImage();
 
   /**
    * Update mLoadFlags from content attributes. Does not attempt to reload the
--- a/layout/xul/nsTextBoxFrame.cpp
+++ b/layout/xul/nsTextBoxFrame.cpp
@@ -365,17 +365,17 @@ nsDisplayXULTextBox::GetComponentAlphaBo
 void
 nsTextBoxFrame::BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                                  const nsDisplayListSet& aLists)
 {
     if (!IsVisibleForPainting(aBuilder))
         return;
 
     nsLeafBoxFrame::BuildDisplayList(aBuilder, aLists);
-    
+
     aLists.Content()->AppendNewToTop(new (aBuilder)
         nsDisplayXULTextBox(aBuilder, this));
 }
 
 void
 nsTextBoxFrame::PaintTitle(nsRenderingContext& aRenderingContext,
                            const nsRect&        aDirtyRect,
                            nsPoint              aPt,
@@ -899,20 +899,20 @@ nsTextBoxFrame::UpdateAccessIndex()
         } else {
             if (!mAccessKeyInfo) {
                 mAccessKeyInfo = new nsAccessKeyInfo();
                 if (!mAccessKeyInfo)
                     return;
             }
 
             nsAString::const_iterator start, end;
-                
+
             mCroppedTitle.BeginReading(start);
             mCroppedTitle.EndReading(end);
-            
+
             // remember the beginning of the string
             nsAString::const_iterator originalStart = start;
 
             bool found;
             if (!AlwaysAppendAccessKey()) {
                 // not appending access key - do case-sensitive search
                 // first
                 found = FindInReadable(mAccessKey, start, end);
@@ -921,17 +921,17 @@ nsTextBoxFrame::UpdateAccessIndex()
                     start = originalStart;
                     found = FindInReadable(mAccessKey, start, end,
                                            nsCaseInsensitiveStringComparator());
                 }
             } else {
                 found = RFindInReadable(mAccessKey, start, end,
                                         nsCaseInsensitiveStringComparator());
             }
-            
+
             if (found)
                 mAccessKeyInfo->mAccesskeyIndex = Distance(originalStart, start);
             else
                 mAccessKeyInfo->mAccesskeyIndex = kNotFound;
         }
     }
 }
 
@@ -983,33 +983,33 @@ nsTextBoxFrame::DoXULLayout(nsBoxLayoutS
         mNeedsReflowCallback = false;
     }
 
     nsresult rv = nsLeafBoxFrame::DoXULLayout(aBoxLayoutState);
 
     CalcDrawRect(*aBoxLayoutState.GetRenderingContext());
 
     const nsStyleText* textStyle = StyleText();
-    
+
     nsRect scrollBounds(nsPoint(0, 0), GetSize());
     nsRect textRect = mTextDrawRect;
-    
+
     RefPtr<nsFontMetrics> fontMet =
       nsLayoutUtils::GetFontMetricsForFrame(this, 1.0f);
-    nsBoundingMetrics metrics = 
+    nsBoundingMetrics metrics =
       fontMet->GetInkBoundsForVisualOverflow(mCroppedTitle.get(),
                                              mCroppedTitle.Length(),
                                              aBoxLayoutState.GetRenderingContext()->GetDrawTarget());
 
     WritingMode wm = GetWritingMode();
     LogicalRect tr(wm, textRect, GetSize());
 
     tr.IStart(wm) -= metrics.leftBearing;
     tr.ISize(wm) = metrics.width;
-    // In DrawText() we always draw with the baseline at MaxAscent() (relative to mTextDrawRect), 
+    // In DrawText() we always draw with the baseline at MaxAscent() (relative to mTextDrawRect),
     tr.BStart(wm) += fontMet->MaxAscent() - metrics.ascent;
     tr.BSize(wm) = metrics.ascent + metrics.descent;
 
     textRect = tr.GetPhysicalRect(wm, GetSize());
 
     // Our scrollable overflow is our bounds; our visual overflow may
     // extend beyond that.
     nsRect visualBounds;
@@ -1194,17 +1194,17 @@ nsresult
 nsTextBoxFrame::GetFrameName(nsAString& aResult) const
 {
     MakeFrameName(NS_LITERAL_STRING("TextBox"), aResult);
     aResult += NS_LITERAL_STRING("[value=") + mTitle + NS_LITERAL_STRING("]");
     return NS_OK;
 }
 #endif
 
-// If you make changes to this function, check its counterparts 
+// If you make changes to this function, check its counterparts
 // in nsBoxFrame and nsXULLabelFrame
 nsresult
 nsTextBoxFrame::RegUnregAccessKey(bool aDoReg)
 {
     // if we have no content, we can't do anything
     if (!mContent)
         return NS_ERROR_FAILURE;
 
@@ -1221,17 +1221,17 @@ nsTextBoxFrame::RegUnregAccessKey(bool a
 
     // see if we even have an access key
     nsAutoString accessKey;
     mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::accesskey, accessKey);
 
     if (accessKey.IsEmpty())
         return NS_OK;
 
-    // With a valid PresContext we can get the ESM 
+    // With a valid PresContext we can get the ESM
     // and (un)register the access key
     EventStateManager* esm = PresContext()->EventStateManager();
 
     uint32_t key = accessKey.First();
     if (aDoReg)
         esm->RegisterAccessKey(mContent, key);
     else
         esm->UnregisterAccessKey(mContent, key);
--- a/layout/xul/tree/nsTreeBodyFrame.cpp
+++ b/layout/xul/tree/nsTreeBodyFrame.cpp
@@ -274,17 +274,17 @@ void
 nsTreeBodyFrame::DestroyFrom(nsIFrame* aDestructRoot)
 {
   if (mScrollbarActivity) {
     mScrollbarActivity->Destroy();
     mScrollbarActivity = nullptr;
   }
 
   mScrollEvent.Revoke();
-  // Make sure we cancel any posted callbacks. 
+  // Make sure we cancel any posted callbacks.
   if (mReflowCallbackPosted) {
     PresContext()->PresShell()->CancelReflowCallback(this);
     mReflowCallbackPosted = false;
   }
 
   if (mColumns)
     mColumns->SetTree(nullptr);
 
@@ -488,21 +488,21 @@ nsTreeBodyFrame::SetView(nsITreeView * a
     mView->SetTree(nullptr);
 
     // Only reset the top row index and delete the columns if we had an old non-null view.
     mTopRowIndex = 0;
   }
 
   // Tree, meet the view.
   mView = aView;
- 
+
   // Changing the view causes us to refetch our data.  This will
   // necessarily entail a full invalidation of the tree.
   Invalidate();
- 
+
   nsIContent *treeContent = GetBaseElement();
   if (treeContent) {
 #ifdef ACCESSIBILITY
     nsAccessibilityService* accService = nsIPresShell::AccService();
     if (accService)
       accService->TreeViewChanged(PresContext()->GetPresShell(), treeContent, mView);
 #endif
     FireDOMEvent(NS_LITERAL_STRING("TreeViewChanged"), treeContent);
@@ -521,26 +521,26 @@ nsTreeBodyFrame::SetView(nsITreeView * a
       mView->SetSelection(sel);
     }
 
     // View, meet the tree.
     AutoWeakFrame weakFrame(this);
     mView->SetTree(mTreeBoxObject);
     NS_ENSURE_STATE(weakFrame.IsAlive());
     mView->GetRowCount(&mRowCount);
- 
+
     if (!PresContext()->PresShell()->IsReflowLocked()) {
       // The scrollbar will need to be updated.
       FullScrollbarsUpdate(false);
     } else if (!mReflowCallbackPosted) {
       mReflowCallbackPosted = true;
       PresContext()->PresShell()->PostReflowCallback(this);
     }
   }
- 
+
   return NS_OK;
 }
 
 nsresult
 nsTreeBodyFrame::SetFocused(bool aFocused)
 {
   if (mFocused != aFocused) {
     mFocused = aFocused;
@@ -771,17 +771,17 @@ nsTreeBodyFrame::InvalidateColumnRange(i
   if (nsIPresShell::IsAccessibilityActive()) {
     int32_t end =
       mRowCount > 0 ? ((mRowCount <= aEnd) ? mRowCount - 1 : aEnd) : 0;
     FireInvalidateEvent(aStart, end, aCol, aCol);
   }
 #endif
 
   nsRect rangeRect;
-  nsresult rv = col->GetRect(this, 
+  nsresult rv = col->GetRect(this,
                              mInnerBox.y+mRowHeight*(aStart-mTopRowIndex),
                              mRowHeight*(aEnd-aStart+1),
                              &rangeRect);
   NS_ENSURE_SUCCESS(rv, rv);
 
   InvalidateFrameWithRect(rangeRect);
 
   return NS_OK;
@@ -792,32 +792,32 @@ FindScrollParts(nsIFrame* aCurrFrame, ns
 {
   if (!aResult->mColumnsScrollFrame) {
     nsIScrollableFrame* f = do_QueryFrame(aCurrFrame);
     if (f) {
       aResult->mColumnsFrame = aCurrFrame;
       aResult->mColumnsScrollFrame = f;
     }
   }
-  
+
   nsScrollbarFrame *sf = do_QueryFrame(aCurrFrame);
   if (sf) {
     if (!aCurrFrame->IsXULHorizontal()) {
       if (!aResult->mVScrollbar) {
         aResult->mVScrollbar = sf;
       }
     } else {
       if (!aResult->mHScrollbar) {
         aResult->mHScrollbar = sf;
       }
     }
     // don't bother searching inside a scrollbar
     return;
   }
-  
+
   nsIFrame* child = aCurrFrame->PrincipalChildList().FirstChild();
   while (child &&
          !child->GetContent()->IsRootOfNativeAnonymousSubtree() &&
          (!aResult->mVScrollbar || !aResult->mHScrollbar ||
           !aResult->mColumnsScrollFrame)) {
     FindScrollParts(child, aResult);
     child = child->GetNextSibling();
   }
@@ -889,17 +889,17 @@ nsTreeBodyFrame::CheckOverflow(const Scr
     mVerticalOverflow = false;
     verticalOverflowChanged = true;
   }
 
   if (aParts.mColumnsFrame) {
     nsRect bounds = aParts.mColumnsFrame->GetRect();
     if (bounds.width != 0) {
       /* Ignore overflows that are less than half a pixel. Yes these happen
-         all over the place when flex boxes are compressed real small. 
+         all over the place when flex boxes are compressed real small.
          Probably a result of a rounding errors somewhere in the layout code. */
       bounds.width += nsPresContext::CSSPixelsToAppUnits(0.5f);
       if (!mHorizontalOverflow && bounds.width < mHorzWidth) {
         mHorizontalOverflow = true;
         horizontalOverflowChanged = true;
       } else if (mHorizontalOverflow && bounds.width >= mHorzWidth) {
         mHorizontalOverflow = false;
         horizontalOverflowChanged = true;
@@ -949,17 +949,17 @@ nsTreeBodyFrame::CheckOverflow(const Scr
 void
 nsTreeBodyFrame::InvalidateScrollbars(const ScrollParts& aParts, AutoWeakFrame& aWeakColumnsFrame)
 {
   if (mUpdateBatchNest || !mView)
     return;
   AutoWeakFrame weakFrame(this);
 
   if (aParts.mVScrollbar) {
-    // Do Vertical Scrollbar 
+    // Do Vertical Scrollbar
     nsAutoString maxposStr;
 
     nscoord rowHeightAsPixels = nsPresContext::AppUnitsToIntCSSPixels(mRowHeight);
 
     int32_t size = rowHeightAsPixels * (mRowCount > mPageLength ? mRowCount - mPageLength : 0);
     maxposStr.AppendInt(size);
     aParts.mVScrollbarContent->
       SetAttr(kNameSpaceID_None, nsGkAtoms::maxpos, maxposStr, true);
@@ -978,23 +978,23 @@ nsTreeBodyFrame::InvalidateScrollbars(co
     // And now Horizontal scrollbar
     nsRect bounds = aParts.mColumnsFrame->GetRect();
     nsAutoString maxposStr;
 
     maxposStr.AppendInt(mHorzWidth > bounds.width ? mHorzWidth - bounds.width : 0);
     aParts.mHScrollbarContent->
       SetAttr(kNameSpaceID_None, nsGkAtoms::maxpos, maxposStr, true);
     ENSURE_TRUE(weakFrame.IsAlive());
-  
+
     nsAutoString pageStr;
     pageStr.AppendInt(bounds.width);
     aParts.mHScrollbarContent->
       SetAttr(kNameSpaceID_None, nsGkAtoms::pageincrement, pageStr, true);
     ENSURE_TRUE(weakFrame.IsAlive());
-  
+
     pageStr.Truncate();
     pageStr.AppendInt(nsPresContext::CSSPixelsToAppUnits(16));
     aParts.mHScrollbarContent->
       SetAttr(kNameSpaceID_None, nsGkAtoms::increment, pageStr, true);
   }
 
   if (weakFrame.IsAlive() && mScrollbarActivity) {
     mScrollbarActivity->ActivityOccurred();
@@ -1071,46 +1071,46 @@ nsTreeBodyFrame::GetCellAt(int32_t aX, i
   return NS_OK;
 }
 
 
 //
 // GetCoordsForCellItem
 //
 // Find the x/y location and width/height (all in PIXELS) of the given object
-// in the given column. 
+// in the given column.
 //
 // XXX IMPORTANT XXX:
 // Hyatt says in the bug for this, that the following needs to be done:
-// (1) You need to deal with overflow when computing cell rects.  See other column 
-// iteration examples... if you don't deal with this, you'll mistakenly extend the 
+// (1) You need to deal with overflow when computing cell rects.  See other column
+// iteration examples... if you don't deal with this, you'll mistakenly extend the
 // cell into the scrollbar's rect.
 //
-// (2) You are adjusting the cell rect by the *row" border padding.  That's 
-// wrong.  You need to first adjust a row rect by its border/padding, and then the 
-// cell rect fits inside the adjusted row rect.  It also can have border/padding 
-// as well as margins.  The vertical direction isn't that important, but you need 
+// (2) You are adjusting the cell rect by the *row" border padding.  That's
+// wrong.  You need to first adjust a row rect by its border/padding, and then the
+// cell rect fits inside the adjusted row rect.  It also can have border/padding
+// as well as margins.  The vertical direction isn't that important, but you need
 // to get the horizontal direction right.
 //
-// (3) GetImageSize() does not include margins (but it does include border/padding).  
+// (3) GetImageSize() does not include margins (but it does include border/padding).
 // You need to make sure to add in the image's margins as well.
 //
 nsresult
-nsTreeBodyFrame::GetCoordsForCellItem(int32_t aRow, nsITreeColumn* aCol, const nsACString& aElement, 
+nsTreeBodyFrame::GetCoordsForCellItem(int32_t aRow, nsITreeColumn* aCol, const nsACString& aElement,
                                       int32_t *aX, int32_t *aY, int32_t *aWidth, int32_t *aHeight)
 {
   *aX = 0;
   *aY = 0;
   *aWidth = 0;
   *aHeight = 0;
 
   bool isRTL = StyleVisibility()->mDirection == NS_STYLE_DIRECTION_RTL;
   nscoord currX = mInnerBox.x - mHorzPosition;
 
-  // The Rect for the requested item. 
+  // The Rect for the requested item.
   nsRect theRect;
 
   nsPresContext* presContext = PresContext();
 
   for (nsTreeColumn* currCol = mColumns->GetFirstColumn(); currCol; currCol = currCol->GetNext()) {
 
     // The Rect for the current cell.
     nscoord colWidth;
@@ -1118,91 +1118,91 @@ nsTreeBodyFrame::GetCoordsForCellItem(in
     nsresult rv =
 #endif
       currCol->GetWidthInTwips(this, &colWidth);
     NS_ASSERTION(NS_SUCCEEDED(rv), "invalid column");
 
     nsRect cellRect(currX, mInnerBox.y + mRowHeight * (aRow - mTopRowIndex),
                     colWidth, mRowHeight);
 
-    // Check the ID of the current column to see if it matches. If it doesn't 
+    // Check the ID of the current column to see if it matches. If it doesn't
     // increment the current X value and continue to the next column.
     if (currCol != aCol) {
       currX += cellRect.width;
       continue;
     }
     // Now obtain the properties for our cell.
     PrefillPropertyArray(aRow, currCol);
 
     nsAutoString properties;
     mView->GetCellProperties(aRow, currCol, properties);
     nsTreeUtils::TokenizeProperties(properties, mScratchArray);
 
     nsStyleContext* rowContext = GetPseudoStyleContext(nsCSSAnonBoxes::moztreerow);
 
     // We don't want to consider any of the decorations that may be present
-    // on the current row, so we have to deflate the rect by the border and 
-    // padding and offset its left and top coordinates appropriately. 
+    // on the current row, so we have to deflate the rect by the border and
+    // padding and offset its left and top coordinates appropriately.
     AdjustForBorderPadding(rowContext, cellRect);
 
     nsStyleContext* cellContext = GetPseudoStyleContext(nsCSSAnonBoxes::moztreecell);
 
     NS_NAMED_LITERAL_CSTRING(cell, "cell");
     if (currCol->IsCycler() || cell.Equals(aElement)) {
-      // If the current Column is a Cycler, then the Rect is just the cell - the margins. 
-      // Similarly, if we're just being asked for the cell rect, provide it. 
+      // If the current Column is a Cycler, then the Rect is just the cell - the margins.
+      // Similarly, if we're just being asked for the cell rect, provide it.
 
       theRect = cellRect;
       nsMargin cellMargin;
       cellContext->StyleMargin()->GetMargin(cellMargin);
       theRect.Deflate(cellMargin);
       break;
     }
 
     // Since we're not looking for the cell, and since the cell isn't a cycler,
-    // we're looking for some subcomponent, and now we need to subtract the 
-    // borders and padding of the cell from cellRect so this does not 
+    // we're looking for some subcomponent, and now we need to subtract the
+    // borders and padding of the cell from cellRect so this does not
     // interfere with our computations.
     AdjustForBorderPadding(cellContext, cellRect);
 
     nsRenderingContext rc(
       presContext->PresShell()->CreateReferenceRenderingContext());
 
-    // Now we'll start making our way across the cell, starting at the edge of 
-    // the cell and proceeding until we hit the right edge. |cellX| is the 
+    // Now we'll start making our way across the cell, starting at the edge of
+    // the cell and proceeding until we hit the right edge. |cellX| is the
     // working X value that we will increment as we crawl from left to right.
     nscoord cellX = cellRect.x;
     nscoord remainWidth = cellRect.width;
 
     if (currCol->IsPrimary()) {
       // If the current Column is a Primary, then we need to take into account the indentation
-      // and possibly a twisty. 
-
-      // The amount of indentation is the indentation width (|mIndentation|) by the level. 
+      // and possibly a twisty.
+
+      // The amount of indentation is the indentation width (|mIndentation|) by the level.
       int32_t level;
       mView->GetLevel(aRow, &level);
       if (!isRTL)
         cellX += mIndentation * level;
       remainWidth -= mIndentation * level;
 
-      // Find the twisty rect by computing its size. 
+      // Find the twisty rect by computing its size.
       nsRect imageRect;
       nsRect twistyRect(cellRect);
       nsStyleContext* twistyContext = GetPseudoStyleContext(nsCSSAnonBoxes::moztreetwisty);
       GetTwistyRect(aRow, currCol, imageRect, twistyRect, presContext,
                     twistyContext);
 
       if (NS_LITERAL_CSTRING("twisty").Equals(aElement)) {
         // If we're looking for the twisty Rect, just return the size
         theRect = twistyRect;
         break;
       }
-      
-      // Now we need to add in the margins of the twisty element, so that we 
-      // can find the offset of the next element in the cell. 
+
+      // Now we need to add in the margins of the twisty element, so that we
+      // can find the offset of the next element in the cell.
       nsMargin twistyMargin;
       twistyContext->StyleMargin()->GetMargin(twistyMargin);
       twistyRect.Inflate(twistyMargin);
 
       // Adjust our working X value with the twisty width (image size, margins,
       // borders, padding.
       if (!isRTL)
         cellX += twistyRect.width;
@@ -1222,34 +1222,34 @@ nsTreeBodyFrame::GetCoordsForCellItem(in
     // Add in the margins of the cell image.
     nsMargin imageMargin;
     imageContext->StyleMargin()->GetMargin(imageMargin);
     imageSize.Inflate(imageMargin);
 
     // Increment cellX by the image width
     if (!isRTL)
       cellX += imageSize.width;
-    
-    // Cell Text 
+
+    // Cell Text
     nsAutoString cellText;
     mView->GetCellText(aRow, currCol, cellText);
     // We're going to measure this text so we need to ensure bidi is enabled if
     // necessary
     CheckTextForBidi(cellText);
 
-    // Create a scratch rect to represent the text rectangle, with the current 
-    // X and Y coords, and a guess at the width and height. The width is the 
+    // Create a scratch rect to represent the text rectangle, with the current
+    // X and Y coords, and a guess at the width and height. The width is the
     // remaining width we have left to traverse in the cell, which will be the
-    // widest possible value for the text rect, and the row height. 
+    // widest possible value for the text rect, and the row height.
     nsRect textRect(cellX, cellRect.y, remainWidth, cellRect.height);
 
-    // Measure the width of the text. If the width of the text is greater than 
-    // the remaining width available, then we just assume that the text has 
+    // Measure the width of the text. If the width of the text is greater than
+    // the remaining width available, then we just assume that the text has
     // been cropped and use the remaining rect as the text Rect. Otherwise,
-    // we add in borders and padding to the text dimension and give that back. 
+    // we add in borders and padding to the text dimension and give that back.
     nsStyleContext* textContext = GetPseudoStyleContext(nsCSSAnonBoxes::moztreecelltext);
 
     RefPtr<nsFontMetrics> fm =
       nsLayoutUtils::GetFontMetricsForStyleContext(textContext);
     nscoord height = fm->MaxHeight();
 
     nsMargin textMargin;
     textContext->StyleMargin()->GetMargin(textMargin);
@@ -1476,32 +1476,32 @@ nsTreeBodyFrame::AdjustForCellText(nsAut
     }
     break;
   }
 
   aTextRect.width = width;
 }
 
 nsIAtom*
-nsTreeBodyFrame::GetItemWithinCellAt(nscoord aX, const nsRect& aCellRect, 
+nsTreeBodyFrame::GetItemWithinCellAt(nscoord aX, const nsRect& aCellRect,
                                      int32_t aRowIndex,
                                      nsTreeColumn* aColumn)
 {
   NS_PRECONDITION(aColumn && aColumn->GetFrame(), "invalid column passed");
 
   // Obtain the properties for our cell.
   PrefillPropertyArray(aRowIndex, aColumn);
   nsAutoString properties;
   mView->GetCellProperties(aRowIndex, aColumn, properties);
   nsTreeUtils::TokenizeProperties(properties, mScratchArray);
 
   // Resolve style for the cell.
   nsStyleContext* cellContext = GetPseudoStyleContext(nsCSSAnonBoxes::moztreecell);
 
-  // Obtain the margins for the cell and then deflate our rect by that 
+  // Obtain the margins for the cell and then deflate our rect by that
   // amount.  The cell is assumed to be contained within the deflated rect.
   nsRect cellRect(aCellRect);
   nsMargin cellMargin;
   cellContext->StyleMargin()->GetMargin(cellMargin);
   cellRect.Deflate(cellMargin);
 
   // Adjust the rect for its border and padding.
   AdjustForBorderPadding(cellContext, cellRect);
@@ -1571,22 +1571,22 @@ nsTreeBodyFrame::GetItemWithinCellAt(nsc
       if (hasTwisty)
         return nsCSSAnonBoxes::moztreetwisty;
       else
         return nsCSSAnonBoxes::moztreecell;
     }
 
     if (!isRTL)
       currX += twistyRect.width;
-    remainingWidth -= twistyRect.width;    
+    remainingWidth -= twistyRect.width;
   }
-  
+
   // Now test to see if the user hit the icon for the cell.
   nsRect iconRect(currX, cellRect.y, remainingWidth, cellRect.height);
-  
+
   // Resolve style for the image.
   nsStyleContext* imageContext = GetPseudoStyleContext(nsCSSAnonBoxes::moztreeimage);
 
   nsRect iconSize = GetImageSize(aRowIndex, aColumn, false, imageContext);
   nsMargin imageMargin;
   imageContext->StyleMargin()->GetMargin(imageMargin);
   iconSize.Inflate(imageMargin);
   iconRect.width = iconSize.width;
@@ -1595,17 +1595,17 @@ nsTreeBodyFrame::GetItemWithinCellAt(nsc
 
   if (aX >= iconRect.x && aX < iconRect.x + iconRect.width) {
     // The user clicked on the image.
     return nsCSSAnonBoxes::moztreeimage;
   }
 
   if (!isRTL)
     currX += iconRect.width;
-  remainingWidth -= iconRect.width;    
+  remainingWidth -= iconRect.width;
 
   nsAutoString cellText;
   mView->GetCellText(aRowIndex, aColumn, cellText);
   // We're going to measure this text so we need to ensure bidi is enabled if
   // necessary
   CheckTextForBidi(cellText);
 
   nsRect textRect(currX, cellRect.y, remainingWidth, cellRect.height);
@@ -1635,17 +1635,17 @@ nsTreeBodyFrame::GetCellAt(nscoord aX, n
   *aCol = nullptr;
   *aChildElt = nullptr;
 
   *aRow = GetRowAt(aX, aY);
   if (*aRow < 0)
     return;
 
   // Determine the column hit.
-  for (nsTreeColumn* currCol = mColumns->GetFirstColumn(); currCol; 
+  for (nsTreeColumn* currCol = mColumns->GetFirstColumn(); currCol;
        currCol = currCol->GetNext()) {
     nsRect cellRect;
     nsresult rv = currCol->GetRect(this,
                                    mInnerBox.y +
                                          mRowHeight * (*aRow - mTopRowIndex),
                                    mRowHeight,
                                    &cellRect);
     if (NS_FAILED(rv)) {
@@ -1693,24 +1693,24 @@ nsTreeBodyFrame::GetCellWidth(int32_t aR
   nsStyleContext* cellContext = GetPseudoStyleContext(nsCSSAnonBoxes::moztreecell);
   nsMargin bp(0,0,0,0);
   GetBorderPadding(cellContext, bp);
 
   aCurrentSize = cellRect.width;
   aDesiredSize = bp.left + bp.right;
 
   if (aCol->IsPrimary()) {
-    // If the current Column is a Primary, then we need to take into account 
-    // the indentation and possibly a twisty. 
+    // If the current Column is a Primary, then we need to take into account
+    // the indentation and possibly a twisty.
 
     // The amount of indentation is the indentation width (|mIndentation|) by the level.
     int32_t level;
     mView->GetLevel(aRow, &level);
     aDesiredSize += mIndentation * level;
-    
+
     // Find the twisty rect by computing its size.
     nsStyleContext* twistyContext = GetPseudoStyleContext(nsCSSAnonBoxes::moztreetwisty);
 
     nsRect imageSize;
     nsRect twistyRect(cellRect);
     GetTwistyRect(aRow, aCol, imageSize, twistyRect, PresContext(),
                   twistyContext);
 
@@ -1727,17 +1727,17 @@ nsTreeBodyFrame::GetCellWidth(int32_t aR
   // Account for the width of the cell image.
   nsRect imageSize = GetImageSize(aRow, aCol, false, imageContext);
   // Add in the margins of the cell image.
   nsMargin imageMargin;
   imageContext->StyleMargin()->GetMargin(imageMargin);
   imageSize.Inflate(imageMargin);
 
   aDesiredSize += imageSize.width;
-  
+
   // Get the cell text.
   nsAutoString cellText;
   mView->GetCellText(aRow, aCol, cellText);
   // We're going to measure this text so we need to ensure bidi is enabled if
   // necessary
   CheckTextForBidi(cellText);
 
   nsStyleContext* textContext = GetPseudoStyleContext(nsCSSAnonBoxes::moztreecelltext);
@@ -1752,17 +1752,17 @@ nsTreeBodyFrame::GetCellWidth(int32_t aR
                                                           *aRenderingContext);
   nscoord totalTextWidth = width + bp.left + bp.right;
   aDesiredSize += totalTextWidth;
   return NS_OK;
 }
 
 nsresult
 nsTreeBodyFrame::IsCellCropped(int32_t aRow, nsITreeColumn* aCol, bool *_retval)
-{  
+{
   nscoord currentSize, desiredSize;
   nsresult rv;
 
   RefPtr<nsTreeColumn> col = GetColumnImpl(aCol);
   if (!col)
     return NS_ERROR_INVALID_ARG;
 
   nsRenderingContext rc(
@@ -1845,20 +1845,20 @@ nsTreeBodyFrame::RowCountChanged(int32_t
   mView->GetRowCount(&rowCount);
   NS_ASSERTION(rowCount == mRowCount, "row count did not change by the amount suggested, check caller");
 #endif
 
   int32_t count = Abs(aCount);
   int32_t last = LastVisibleRow();
   if (aIndex >= mTopRowIndex && aIndex <= last)
     InvalidateRange(aIndex, last);
-    
+
   ScrollParts parts = GetScrollParts();
 
-  if (mTopRowIndex == 0) {    
+  if (mTopRowIndex == 0) {
     // Just update the scrollbar and return.
     if (FullScrollbarsUpdate(false)) {
       MarkDirtyIfSelect();
     }
     return NS_OK;
   }
 
   bool needsInvalidation = false;
@@ -1920,17 +1920,17 @@ nsTreeBodyFrame::EndUpdateBatch()
   return NS_OK;
 }
 
 void
 nsTreeBodyFrame::PrefillPropertyArray(int32_t aRowIndex, nsTreeColumn* aCol)
 {
   NS_PRECONDITION(!aCol || aCol->GetFrame(), "invalid column passed");
   mScratchArray.Clear();
-  
+
   // focus
   if (mFocused)
     mScratchArray.AppendElement(nsGkAtoms::focus);
 
   // sort
   bool sorted = false;
   mView->IsSorted(&sorted);
   if (sorted)
@@ -1938,33 +1938,33 @@ nsTreeBodyFrame::PrefillPropertyArray(in
 
   // drag session
   if (mSlots && mSlots->mIsDragging)
     mScratchArray.AppendElement(nsGkAtoms::dragSession);
 
   if (aRowIndex != -1) {
     if (aRowIndex == mMouseOverRow)
       mScratchArray.AppendElement(nsGkAtoms::hover);
-  
+
     nsCOMPtr<nsITreeSelection> selection;
     mView->GetSelection(getter_AddRefs(selection));
 
     if (selection) {
       // selected
       bool isSelected;
       selection->IsSelected(aRowIndex, &isSelected);
       if (isSelected)
         mScratchArray.AppendElement(nsGkAtoms::selected);
 
       // current
       int32_t currentIndex;
       selection->GetCurrentIndex(&currentIndex);
       if (aRowIndex == currentIndex)
         mScratchArray.AppendElement(nsGkAtoms::current);
-  
+
       // active
       if (aCol) {
         nsCOMPtr<nsITreeColumn> currentColumn;
         selection->GetCurrentColumn(getter_AddRefs(currentColumn));
         if (aCol == currentColumn)
           mScratchArray.AppendElement(nsGkAtoms::active);
       }
     }
@@ -2253,43 +2253,43 @@ nsRect nsTreeBodyFrame::GetImageSize(int
   }
 
   if (myPosition->mWidth.GetUnit() == eStyleUnit_Coord)  {
     int32_t val = myPosition->mWidth.GetCoordValue();
     r.width += val;
   }
   else if (useImageRegion && myList->mImageRegion.width > 0)
     r.width += myList->mImageRegion.width;
-  else 
+  else
     needWidth = true;
 
   if (myPosition->mHeight.GetUnit() == eStyleUnit_Coord)  {
     int32_t val = myPosition->mHeight.GetCoordValue();
     r.height += val;
   }
   else if (useImageRegion && myList->mImageRegion.height > 0)
     r.height += myList->mImageRegion.height;
-  else 
+  else
     needHeight = true;
 
   if (image) {
     if (needWidth || needHeight) {
       // Get the natural image size.
 
       if (needWidth) {
         // Get the size from the image.
         nscoord width;
         image->GetWidth(&width);
-        r.width += nsPresContext::CSSPixelsToAppUnits(width); 
+        r.width += nsPresContext::CSSPixelsToAppUnits(width);
       }
-    
+
       if (needHeight) {
         nscoord height;
         image->GetHeight(&height);
-        r.height += nsPresContext::CSSPixelsToAppUnits(height); 
+        r.height += nsPresContext::CSSPixelsToAppUnits(height);
       }
     }
   }
 
   return r;
 }
 
 // GetImageDestSize returns the destination size of the image.
@@ -2493,18 +2493,18 @@ nsTreeBodyFrame::CalcHorzWidth(const Scr
   // visibility of the columnpicker and the scrollbar.
   if (aParts.mColumnsFrame)
     mAdjustWidth = mRect.width - aParts.mColumnsFrame->GetRect().width;
   else
     mAdjustWidth = 0;
 
   nscoord width = 0;
 
-  // We calculate this from the scrollable frame, so that it 
-  // properly covers all contingencies of what could be 
+  // We calculate this from the scrollable frame, so that it
+  // properly covers all contingencies of what could be
   // scrollable (columns, body, etc...)
 
   if (aParts.mColumnsScrollFrame) {
     width = aParts.mColumnsScrollFrame->GetScrollRange().width +
       aParts.mColumnsScrollFrame->GetScrollPortRect().width;
   }
 
   // If no horz scrolling periphery is present, then just return our width
@@ -2648,17 +2648,17 @@ nsTreeBodyFrame::HandleEvent(nsPresConte
                     getter_AddRefs(mSlots->mTimer),
                     "nsTreeBodyFrame::LazyScrollCallback");
        }
 #endif
       // Bail out to prevent spring loaded timer and feedback line settings.
       return NS_OK;
     }
 
-    // If changed from last time, invalidate primary cell at the old location and if allowed, 
+    // If changed from last time, invalidate primary cell at the old location and if allowed,
     // invalidate primary cell at the new location. If nothing changed, just bail.
     if (mSlots->mDropRow != lastDropRow ||
         mSlots->mDropOrient != lastDropOrient ||
         mSlots->mDragAction != lastDragAction) {
 
       // Invalidate row at the old location.
       if (mSlots->mDropAllowed) {
         mSlots->mDropAllowed = false;
@@ -2993,17 +2993,17 @@ nsTreeBodyFrame::PaintColumn(nsTreeColum
   nsAutoString properties;
   mView->GetColumnProperties(aColumn, properties);
   nsTreeUtils::TokenizeProperties(properties, mScratchArray);
 
   // Resolve style for the column.  It contains all the info we need to lay ourselves
   // out and to paint.
   nsStyleContext* colContext = GetPseudoStyleContext(nsCSSAnonBoxes::moztreecolumn);
 
-  // Obtain the margins for the cell and then deflate our rect by that 
+  // Obtain the margins for the cell and then deflate our rect by that
   // amount.  The cell is assumed to be contained within the deflated rect.
   nsRect colRect(aColumnRect);
   nsMargin colMargin;
   colContext->StyleMargin()->GetMargin(colMargin);
   colRect.Deflate(colMargin);
 
   return PaintBackgroundLayer(colContext, aPresContext, aRenderingContext,
                               colRect, aDirtyRect);
@@ -3014,17 +3014,17 @@ nsTreeBodyFrame::PaintRow(int32_t       
                           const nsRect&        aRowRect,
                           nsPresContext*       aPresContext,
                           nsRenderingContext& aRenderingContext,
                           const nsRect&        aDirtyRect,
                           nsPoint              aPt)
 {
   // We have been given a rect for our row.  We treat this row like a full-blown
   // frame, meaning that it can have borders, margins, padding, and a background.
-  
+
   // Without a view, we have no data. Check for this up front.
   if (!mView) {
     return DrawResult::SUCCESS;
   }
 
   nsresult rv;
 
   // Now obtain the properties for our row.
@@ -3034,17 +3034,17 @@ nsTreeBodyFrame::PaintRow(int32_t       
   nsAutoString properties;
   mView->GetRowProperties(aRowIndex, properties);
   nsTreeUtils::TokenizeProperties(properties, mScratchArray);
 
   // Resolve style for the row.  It contains all the info we need to lay ourselves
   // out and to paint.
   nsStyleContext* rowContext = GetPseudoStyleContext(nsCSSAnonBoxes::moztreerow);
 
-  // Obtain the margins for the row and then deflate our rect by that 
+  // Obtain the margins for the row and then deflate our rect by that
   // amount.  The row is assumed to be contained within the deflated rect.
   nsRect rowRect(aRowRect);
   nsMargin rowMargin;
   rowContext->StyleMargin()->GetMargin(rowMargin);
   rowRect.Deflate(rowMargin);
 
   DrawResult result = DrawResult::SUCCESS;
 
@@ -3067,17 +3067,17 @@ nsTreeBodyFrame::PaintRow(int32_t       
     nsRect dirty;
     dirty.IntersectRect(rowRect, aDirtyRect);
     theme->DrawWidgetBackground(&aRenderingContext, this, appearance, rowRect,
                                 dirty);
   } else {
     result &= PaintBackgroundLayer(rowContext, aPresContext, aRenderingContext,
                                    rowRect, aDirtyRect);
   }
-  
+
   // Adjust the rect for its border and padding.
   nsRect originalRowRect = rowRect;
   AdjustForBorderPadding(rowContext, rowRect);
 
   bool isSeparator = false;
   mView->IsSeparator(aRowIndex, &isSeparator);
   if (isSeparator) {
     // The row is a separator.
@@ -3199,31 +3199,31 @@ nsTreeBodyFrame::PaintSeparator(int32_t 
 
   DrawResult result = DrawResult::SUCCESS;
 
   // use -moz-appearance if provided.
   if (useTheme) {
     nsRect dirty;
     dirty.IntersectRect(aSeparatorRect, aDirtyRect);
     theme->DrawWidgetBackground(&aRenderingContext, this,
-                                displayData->UsedAppearance(), aSeparatorRect, dirty); 
+                                displayData->UsedAppearance(), aSeparatorRect, dirty);
   }
   else {
     const nsStylePosition* stylePosition = separatorContext->StylePosition();
 
     // Obtain the height for the separator or use the default value.
     nscoord height;
     if (stylePosition->mHeight.GetUnit() == eStyleUnit_Coord)
       height = stylePosition->mHeight.GetCoordValue();
     else {
       // Use default height 2px.
       height = nsPresContext::CSSPixelsToAppUnits(2);
     }
 
-    // Obtain the margins for the separator and then deflate our rect by that 
+    // Obtain the margins for the separator and then deflate our rect by that
     // amount. The separator is assumed to be contained within the deflated rect.
     nsRect separatorRect(aSeparatorRect.x, aSeparatorRect.y, aSeparatorRect.width, height);
     nsMargin separatorMargin;
     separatorContext->StyleMargin()->GetMargin(separatorMargin);
     separatorRect.Deflate(separatorMargin);
 
     // Center the separator.
     separatorRect.y += (aSeparatorRect.height - height) / 2;
@@ -3256,17 +3256,17 @@ nsTreeBodyFrame::PaintCell(int32_t      
   nsTreeUtils::TokenizeProperties(properties, mScratchArray);
 
   // Resolve style for the cell.  It contains all the info we need to lay ourselves
   // out and to paint.
   nsStyleContext* cellContext = GetPseudoStyleContext(nsCSSAnonBoxes::moztreecell);
 
   bool isRTL = StyleVisibility()->mDirection == NS_STYLE_DIRECTION_RTL;
 
-  // Obtain the margins for the cell and then deflate our rect by that 
+  // Obtain the margins for the cell and then deflate our rect by that
   // amount.  The cell is assumed to be contained within the deflated rect.
   nsRect cellRect(aCellRect);
   nsMargin cellMargin;
   cellContext->StyleMargin()->GetMargin(cellMargin);
   cellRect.Deflate(cellMargin);
 
   // Paint our borders and background for our row rect.
   DrawResult result = PaintBackgroundLayer(cellContext, aPresContext,
@@ -3275,34 +3275,34 @@ nsTreeBodyFrame::PaintCell(int32_t      
 
   // Adjust the rect for its border and padding.
   AdjustForBorderPadding(cellContext, cellRect);
 
   nscoord currX = cellRect.x;
   nscoord remainingWidth = cellRect.width;
 
   // Now we paint the contents of the cells.
-  // Directionality of the tree determines the order in which we paint.  
+  // Directionality of the tree determines the order in which we paint.
   // NS_STYLE_DIRECTION_LTR means paint from left to right.
   // NS_STYLE_DIRECTION_RTL means paint from right to left.
 
   if (aColumn->IsPrimary()) {
     // If we're the primary column, we need to indent and paint the twisty and any connecting lines
     // between siblings.
 
     int32_t level;
     mView->GetLevel(aRowIndex, &level);
 
     if (!isRTL)
       currX += mIndentation * level;
     remainingWidth -= mIndentation * level;
 
     // Resolve the style to use for the connecting lines.
     nsStyleContext* lineContext = GetPseudoStyleContext(nsCSSAnonBoxes::moztreeline);
-    
+
     if (mIndentation && level &&
         lineContext->StyleVisibility()->IsVisibleOrCollapsed()) {
       // Paint the thread lines.
 
       // Get the size of the twisty. We don't want to paint the twisty
       // before painting of connecting lines since it would paint lines over
       // the twisty. But we need to leave a place for it.
       nsStyleContext* twistyContext = GetPseudoStyleContext(nsCSSAnonBoxes::moztreetwisty);
@@ -3367,17 +3367,17 @@ nsTreeBodyFrame::PaintCell(int32_t      
             if (hasNextSibling)
               p2.y = pc->AppUnitsToGfxUnits(lineY + mRowHeight);
             else if (i == level)
               p2.y = pc->AppUnitsToGfxUnits(lineY + mRowHeight / 2);
 
             SnapLineToDevicePixelsForStroking(p1, p2, *drawTarget,
                                               strokeOptions.mLineWidth);
             drawTarget->StrokeLine(p1, p2, colorPatt, strokeOptions);
-          }          
+          }
         }
 
         int32_t parent;
         if (NS_FAILED(mView->GetParentIndex(currentParent, &parent)) || parent < 0)
           break;
         currentParent = parent;
         srcX -= mIndentation;
       }
@@ -3386,28 +3386,28 @@ nsTreeBodyFrame::PaintCell(int32_t      
     }
 
     // Always leave space for the twisty.
     nsRect twistyRect(currX, cellRect.y, remainingWidth, cellRect.height);
     result &= PaintTwisty(aRowIndex, aColumn, twistyRect, aPresContext,
                           aRenderingContext, aDirtyRect, remainingWidth,
                           currX);
   }
-  
+
   // Now paint the icon for our cell.
   nsRect iconRect(currX, cellRect.y, remainingWidth, cellRect.height);
   nsRect dirtyRect;
   if (dirtyRect.IntersectRect(aDirtyRect, iconRect)) {
     result &= PaintImage(aRowIndex, aColumn, iconRect, aPresContext,
                          aRenderingContext, aDirtyRect, remainingWidth,
                          currX);
   }
 
   // Now paint our element, but only if we aren't a cycler column.
-  // XXX until we have the ability to load images, allow the view to 
+  // XXX until we have the ability to load images, allow the view to
   // insert text into cycler columns...
   if (!aColumn->IsCycler()) {
     nsRect elementRect(currX, cellRect.y, remainingWidth, cellRect.height);
     nsRect dirtyRect;
     if (dirtyRect.IntersectRect(aDirtyRect, elementRect)) {
       switch (aColumn->GetType()) {
         case nsITreeColumn::TYPE_TEXT:
         case nsITreeColumn::TYPE_PASSWORD:
@@ -3467,28 +3467,28 @@ nsTreeBodyFrame::PaintTwisty(int32_t    
     mView->IsContainerEmpty(aRowIndex, &isContainerEmpty);
     if (!isContainerEmpty)
       shouldPaint = true;
   }
 
   // Resolve style for the twisty.
   nsStyleContext* twistyContext = GetPseudoStyleContext(nsCSSAnonBoxes::moztreetwisty);
 
-  // Obtain the margins for the twisty and then deflate our rect by that 
+  // Obtain the margins for the twisty and then deflate our rect by that
   // amount.  The twisty is assumed to be contained within the deflated rect.
   nsRect twistyRect(aTwistyRect);
   nsMargin twistyMargin;
   twistyContext->StyleMargin()->GetMargin(twistyMargin);
   twistyRect.Deflate(twistyMargin);
 
   nsRect imageSize;
   nsITheme* theme = GetTwistyRect(aRowIndex, aColumn, imageSize, twistyRect,
                                   aPresContext, twistyContext);
 
-  // Subtract out the remaining width.  This is done even when we don't actually paint a twisty in 
+  // Subtract out the remaining width.  This is done even when we don't actually paint a twisty in
   // this cell, so that cells in different rows still line up.
   nsRect copyRect(twistyRect);
   copyRect.Inflate(twistyMargin);
   aRemainingWidth -= copyRect.width;
   if (!isRTL)
     aCurrX += copyRect.width;
 
   DrawResult result = DrawResult::SUCCESS;
@@ -3502,17 +3502,17 @@ nsTreeBodyFrame::PaintTwisty(int32_t    
     if (theme) {
       if (isRTL)
         twistyRect.x = rightEdge - twistyRect.width;
       // yeah, I know it says we're drawing a background, but a twisty is really a fg
       // object since it doesn't have anything that gecko would want to draw over it. Besides,
       // we have to prevent imagelib from drawing it.
       nsRect dirty;
       dirty.IntersectRect(twistyRect, aDirtyRect);
-      theme->DrawWidgetBackground(&aRenderingContext, this, 
+      theme->DrawWidgetBackground(&aRenderingContext, this,
                                   twistyContext->StyleDisplay()->UsedAppearance(), twistyRect, dirty);
     }
     else {
       // Time to paint the twisty.
       // Adjust the rect for its border and padding.
       nsMargin bp(0,0,0,0);
       GetBorderPadding(twistyContext, bp);
       twistyRect.Deflate(bp);
@@ -3765,17 +3765,17 @@ nsTreeBodyFrame::PaintText(int32_t      
 
   // Resolve style for the text.  It contains all the info we need to lay ourselves
   // out and to paint.
   nsStyleContext* textContext = GetPseudoStyleContext(nsCSSAnonBoxes::moztreecelltext);
 
   // Obtain opacity value for the image.
   float opacity = textContext->StyleEffects()->mOpacity;
 
-  // Obtain the margins for the text and then deflate our rect by that 
+  // Obtain the margins for the text and then deflate our rect by that
   // amount.  The text is assumed to be contained within the deflated rect.
   nsRect textRect(aTextRect);
   nsMargin textMargin;
   textContext->StyleMargin()->GetMargin(textMargin);
   textRect.Deflate(textMargin);
 
   // Adjust the rect for its border and padding.
   nsMargin bp(0,0,0,0);
@@ -3874,23 +3874,23 @@ nsTreeBodyFrame::PaintCheckbox(int32_t  
 {
   NS_PRECONDITION(aColumn && aColumn->GetFrame(), "invalid column passed");
 
   // Resolve style for the checkbox.
   nsStyleContext* checkboxContext = GetPseudoStyleContext(nsCSSAnonBoxes::moztreecheckbox);
 
   nscoord rightEdge = aCheckboxRect.XMost();
 
-  // Obtain the margins for the checkbox and then deflate our rect by that 
+  // Obtain the margins for the checkbox and then deflate our rect by that
   // amount.  The checkbox is assumed to be contained within the deflated rect.
   nsRect checkboxRect(aCheckboxRect);
   nsMargin checkboxMargin;
   checkboxContext->StyleMargin()->GetMargin(checkboxMargin);
   checkboxRect.Deflate(checkboxMargin);
-  
+
   nsRect imageSize = GetImageSize(aRowIndex, aColumn, true, checkboxContext);
 
   if (imageSize.height > checkboxRect.height)
     imageSize.height = checkboxRect.height;
   if (imageSize.width > checkboxRect.width)
     imageSize.width = checkboxRect.width;
 
   if (StyleVisibility()->mDirection == NS_STYLE_DIRECTION_RTL)
@@ -3908,17 +3908,17 @@ nsTreeBodyFrame::PaintCheckbox(int32_t  
   checkboxRect.Deflate(bp);
 
   // Get the image for drawing.
   nsCOMPtr<imgIContainer> image;
   bool useImageRegion = true;
   GetImage(aRowIndex, aColumn, true, checkboxContext, useImageRegion, getter_AddRefs(image));
   if (image) {
     nsPoint pt = checkboxRect.TopLeft();
-          
+
     if (imageSize.height < checkboxRect.height) {
       pt.y += (checkboxRect.height - imageSize.height)/2;
     }
 
     if (imageSize.width < checkboxRect.width) {
       pt.x += (checkboxRect.width - imageSize.width)/2;
     }
 
@@ -3942,30 +3942,30 @@ nsTreeBodyFrame::PaintProgressMeter(int3
                                     const nsRect&        aDirtyRect)
 {
   NS_PRECONDITION(aColumn && aColumn->GetFrame(), "invalid column passed");
 
   // Resolve style for the progress meter.  It contains all the info we need
   // to lay ourselves out and to paint.
   nsStyleContext* meterContext = GetPseudoStyleContext(nsCSSAnonBoxes::moztreeprogressmeter);
 
-  // Obtain the margins for the progress meter and then deflate our rect by that 
+  // Obtain the margins for the progress meter and then deflate our rect by that
   // amount. The progress meter is assumed to be contained within the deflated
   // rect.
   nsRect meterRect(aProgressMeterRect);
   nsMargin meterMargin;
   meterContext->StyleMargin()->GetMargin(meterMargin);
   meterRect.Deflate(meterMargin);
 
   // Paint our borders and background for our progress meter rect.
   DrawResult result = PaintBackgroundLayer(meterContext, aPresContext,
                                            aRenderingContext, meterRect,
                                            aDirtyRect);
 
-  // Time to paint our progress. 
+  // Time to paint our progress.
   int32_t state;
   mView->GetProgressMode(aRowIndex, aColumn, &state);
   if (state == nsITreeView::PROGRESS_NORMAL) {
     // Adjust the rect for its border and padding.
     AdjustForBorderPadding(meterContext, meterRect);
 
     // Now obtain the value for our cell.
     nsAutoString value;
@@ -4065,17 +4065,17 @@ nsTreeBodyFrame::PaintDropFeedback(const
 
   DrawResult result = DrawResult::SUCCESS;
 
   // Paint only if it is visible.
   if (feedbackContext->StyleVisibility()->IsVisibleOrCollapsed()) {
     int32_t level;
     mView->GetLevel(mSlots->mDropRow, &level);
 
-    // If our previous or next row has greater level use that for 
+    // If our previous or next row has greater level use that for
     // correct visual indentation.
     if (mSlots->mDropOrient == nsITreeView::DROP_BEFORE) {
       if (mSlots->mDropRow > 0) {
         int32_t previousLevel;
         mView->GetLevel(mSlots->mDropRow - 1, &previousLevel);
         if (previousLevel > level)
           level = previousLevel;
       }
@@ -4218,17 +4218,17 @@ nsTreeBodyFrame::EnsureCellIsVisible(int
   nscoord columnWidth;
   rv = col->GetWidthInTwips(this, &columnWidth);
   if(NS_FAILED(rv)) return rv;
 
   // If the start of the column is before the
   // start of the horizontal view, then scroll
   if (columnPos < mHorzPosition)
     result = columnPos;
-  // If the end of the column is past the end of 
+  // If the end of the column is past the end of
   // the horizontal view, then scroll
   else if ((columnPos + columnWidth) > (mHorzPosition + mInnerBox.width))
     result = ((columnPos + columnWidth) - (mHorzPosition + mInnerBox.width)) + mHorzPosition;
 
   if (result != -1) {
     rv = ScrollHorzInternal(parts, result);
     if(NS_FAILED(rv)) return rv;
   }
@@ -4357,17 +4357,17 @@ nsTreeBodyFrame::ScrollHorzInternal(cons
 
   if (aPosition == mHorzPosition)
     return NS_OK;
 
   if (aPosition < 0 || aPosition > mHorzWidth)
     return NS_OK;
 
   nsRect bounds = aParts.mColumnsFrame->GetRect();
-  if (aPosition > (mHorzWidth - bounds.width)) 
+  if (aPosition > (mHorzWidth - bounds.width))
     aPosition = mHorzWidth - bounds.width;
 
   mHorzPosition = aPosition;
 
   Invalidate();
 
   // Update the column scroll view
   AutoWeakFrame weakFrame(this);
@@ -4390,17 +4390,17 @@ nsTreeBodyFrame::ScrollByPage(nsScrollba
   ScrollByPages(aDirection);
 }
 
 void
 nsTreeBodyFrame::ScrollByWhole(nsScrollbarFrame* aScrollbar, int32_t aDirection,
                                nsIScrollbarMediator::ScrollSnapMode aSnap)
 {
   // CSS Scroll Snapping is not enabled for XUL, aSnap is ignored
-  MOZ_ASSERT(aScrollbar != nullptr); 
+  MOZ_ASSERT(aScrollbar != nullptr);
   int32_t newIndex = aDirection < 0 ? 0 : mTopRowIndex;
   ScrollToRow(newIndex);
 }
 
 void
 nsTreeBodyFrame::ScrollByLine(nsScrollbarFrame* aScrollbar, int32_t aDirection,
                               nsIScrollbarMediator::ScrollSnapMode aSnap)
 {
@@ -4441,23 +4441,23 @@ nsTreeBodyFrame::RepeatButtonScroll(nsSc
 }
 
 void
 nsTreeBodyFrame::ThumbMoved(nsScrollbarFrame* aScrollbar,
                             nscoord aOldPos,
                             nscoord aNewPos)
 {
   ScrollParts parts = GetScrollParts();
-  
+
   if (aOldPos == aNewPos)
     return;
 
   AutoWeakFrame weakFrame(this);
 
-  // Vertical Scrollbar 
+  // Vertical Scrollbar
   if (parts.mVScrollbar == aScrollbar) {
     nscoord rh = nsPresContext::AppUnitsToIntCSSPixels(mRowHeight);
     nscoord newIndex = nsPresContext::AppUnitsToIntCSSPixels(aNewPos);
     nscoord newrow = newIndex/rh;
     ScrollInternal(parts, newrow);
   // Horizontal Scrollbar
   } else if (parts.mHScrollbar == aScrollbar) {
     int32_t newIndex = nsPresContext::AppUnitsToIntCSSPixels(aNewPos);
@@ -4534,17 +4534,17 @@ nsTreeBodyFrame::DidSetStyleContext(nsSt
   // XXX The following is hacky, but it's not incorrect,
   // and appears to fix a few bugs with style changes, like text zoom and
   // dpi changes
   mIndentation = GetIndentation();
   mRowHeight = GetRowHeight();
   mStringWidth = -1;
 }
 
-bool 
+bool
 nsTreeBodyFrame::OffsetForHorzScroll(nsRect& rect, bool clip)
 {
   rect.x -= mHorzPosition;
 
   // Scrolled out before
   if (rect.XMost() <= mInnerBox.x)
     return false;
 
@@ -4586,17 +4586,17 @@ nsTreeBodyFrame::CanAutoScroll(int32_t a
 // Doesn't query the content about if the drag is allowable, that's done elsewhere.
 //
 // For containers, we break up the vertical space of the row as follows: if in
 // the topmost 25%, the drop is _before_ the row the mouse is over; if in the
 // last 25%, _after_; in the middle 50%, we consider it a drop _on_ the container.
 //
 // For non-containers, if the mouse is in the top 50% of the row, the drop is
 // _before_ and the bottom 50% _after_
-void 
+void
 nsTreeBodyFrame::ComputeDropPosition(WidgetGUIEvent* aEvent,
                                      int32_t* aRow,
                                      int16_t* aOrient,
                                      int16_t* aScrollLines)
 {
   *aOrient = -1;
   *aScrollLines = 0;
 
@@ -4605,17 +4605,17 @@ nsTreeBodyFrame::ComputeDropPosition(Wid
   nsPoint pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, this);
   int32_t xTwips = pt.x - mInnerBox.x;
   int32_t yTwips = pt.y - mInnerBox.y;
 
   *aRow = GetRowAt(xTwips, yTwips);
   if (*aRow >=0) {
     // Compute the top/bottom of the row in question.
     int32_t yOffset = yTwips - mRowHeight * (*aRow - mTopRowIndex);
-   
+
     bool isContainer = false;
     mView->IsContainer (*aRow, &isContainer);
     if (isContainer) {
       // for a container, use a 25%/50%/25% breakdown
       if (yOffset < mRowHeight / 4)
         *aOrient = nsITreeView::DROP_BEFORE;
       else if (yOffset > mRowHeight - (mRowHeight / 4))
         *aOrient = nsITreeView::DROP_AFTER;