Bug 1024350 - Remove redundant trailing spaces.r=smaug
authorJohn Dai <jdai@mozilla.com>
Mon, 30 May 2016 02:41:00 +0200
changeset 338953 f58633cc1d45d543d97531d5ab6ac9ac4154f3c8
parent 338952 a6e49cbb3a5b30a007417dc8d798253b92f6f22f
child 338954 2b8c4bcdaef9a9d71ebe61fd5111389ce3629355
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1024350
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1024350 - Remove redundant trailing spaces.r=smaug
browser/base/content/test/general/browser_selectpopup.js
layout/forms/nsIListControlFrame.h
layout/forms/nsListControlFrame.cpp
layout/forms/nsListControlFrame.h
--- a/browser/base/content/test/general/browser_selectpopup.js
+++ b/browser/base/content/test/general/browser_selectpopup.js
@@ -106,17 +106,17 @@ function doSelectTests(contentType, dtd)
   EventUtils.synthesizeKey("KEY_ArrowDown", { code: "ArrowDown" });
   is(menulist.menuBoxObject.activeChild, menulist.getItemAtIndex(3), "Select item 3");
   is(menulist.selectedIndex, isWindows ? 3 : 1, "Select item 3 selectedIndex");
 
   EventUtils.synthesizeKey("KEY_ArrowDown", { code: "ArrowDown" });
 
   // On Windows, one can navigate on disabled menuitems
   let expectedIndex = isWindows ? 5 : 9;
-     
+
   is(menulist.menuBoxObject.activeChild, menulist.getItemAtIndex(expectedIndex),
      "Skip optgroup header and disabled items select item 7");
   is(menulist.selectedIndex, isWindows ? 5 : 1, "Select or skip disabled item selectedIndex");
 
   for (let i = 0; i < 10; i++) {
     is(menulist.getItemAtIndex(i).disabled, i >= 4 && i <= 7, "item " + i + " disabled")
   }
 
@@ -180,17 +180,17 @@ add_task(function*() {
   yield openSelectPopup(selectPopup, true, "#one");
 
   yield ContentTask.spawn(gBrowser.selectedBrowser, {}, function() {
     content.document.body.removeChild(content.document.getElementById("two"));
   });
 
   // Wait a bit just to make sure the popup won't close.
   yield new Promise(resolve => setTimeout(resolve, 1000));
-  
+
   is(selectPopup.state, "open", "Different popup did not affect open popup");
 
   yield hideSelectPopup(selectPopup);
 
   // Next, try it when the same <select> element than the one that is open is removed
   yield openSelectPopup(selectPopup, true, "#three");
 
   let popupHiddenPromise = BrowserTestUtils.waitForEvent(selectPopup, "popuphidden");
--- a/layout/forms/nsIListControlFrame.h
+++ b/layout/forms/nsIListControlFrame.h
@@ -11,17 +11,17 @@
 class nsAString;
 
 namespace mozilla {
 namespace dom {
 class HTMLOptionElement;
 } // namespace dom
 } // namespace mozilla
 
-/** 
+/**
   * nsIListControlFrame is the interface for frame-based listboxes.
   */
 class nsIListControlFrame : public nsQueryFrame
 {
 public:
   NS_DECL_QUERYFRAME_TARGET(nsIListControlFrame)
 
   /**
--- a/layout/forms/nsListControlFrame.cpp
+++ b/layout/forms/nsListControlFrame.cpp
@@ -154,17 +154,17 @@ nsListControlFrame::DestroyFrom(nsIFrame
 }
 
 void
 nsListControlFrame::BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                                      const nsRect&           aDirtyRect,
                                      const nsDisplayListSet& aLists)
 {
   // We allow visibility:hidden <select>s to contain visible options.
-  
+
   // Don't allow painting of list controls when painting is suppressed.
   // XXX why do we need this here? we should never reach this. Maybe
   // because these can have widgets? Hmm
   if (aBuilder->IsBackgroundOnly())
     return;
 
   DO_GLOBAL_REFLOW_COUNT_DSP("nsListControlFrame");
 
@@ -219,17 +219,17 @@ void nsListControlFrame::PaintFocus(Draw
       fRect.height = CalcFallbackRowBSize(inflation);
     } else {
       fRect.width = CalcFallbackRowBSize(inflation);
       fRect.height = GetScrollPortRect().height;
     }
     fRect.MoveBy(containerFrame->GetOffsetTo(this));
   }
   fRect += aPt;
-  
+
   bool lastItemIsSelected = false;
   if (focusedContent) {
     nsCOMPtr<nsIDOMHTMLOptionElement> domOpt =
       do_QueryInterface(focusedContent);
     if (domOpt) {
       domOpt->GetSelected(&lastItemIsSelected);
     }
   }
@@ -349,29 +349,29 @@ nsListControlFrame::GetMinISize(nsRender
   LogicalMargin scrollbarSize(wm, GetDesiredScrollbarSizes(PresContext(),
                                                            aRenderingContext));
   result += scrollbarSize.IStartEnd(wm);
 
   return result;
 }
 
 void
-nsListControlFrame::Reflow(nsPresContext*           aPresContext, 
+nsListControlFrame::Reflow(nsPresContext*           aPresContext,
                            nsHTMLReflowMetrics&     aDesiredSize,
-                           const nsHTMLReflowState& aReflowState, 
+                           const nsHTMLReflowState& aReflowState,
                            nsReflowStatus&          aStatus)
 {
   NS_PRECONDITION(aReflowState.ComputedISize() != NS_UNCONSTRAINEDSIZE,
                   "Must have a computed inline size");
 
   SchedulePaint();
 
   mHasPendingInterruptAtStartOfReflow = aPresContext->HasPendingInterrupt();
 
-  // If all the content and frames are here 
+  // If all the content and frames are here
   // then initialize it before reflow
   if (mIsAllContentHere && !mHasBeenInitialized) {
     if (false == mIsAllFramesHere) {
       CheckIfAllFramesHere();
     }
     if (mIsAllFramesHere && !mHasBeenInitialized) {
       mHasBeenInitialized = true;
     }
@@ -408,17 +408,17 @@ nsListControlFrame::Reflow(nsPresContext
    *   child, then compute the new max block size and it's the same as
    *   the old one.
    */
 
   bool autoBSize = (aReflowState.ComputedBSize() == NS_UNCONSTRAINEDSIZE);
 
   mMightNeedSecondPass = autoBSize &&
     (NS_SUBTREE_DIRTY(this) || aReflowState.ShouldReflowAllKids());
-  
+
   nsHTMLReflowState state(aReflowState);
   int32_t length = GetNumberOfRows();
 
   nscoord oldBSizeOfARow = BSizeOfARow();
 
   if (!(GetStateBits() & NS_FRAME_FIRST_REFLOW) && autoBSize) {
     // When not doing an initial reflow, and when the block size is
     // auto, start off with our computed block size set to what we'd
@@ -487,24 +487,24 @@ nsListControlFrame::Reflow(nsPresContext
 
   // XXXbz to make the ascent really correct, we should add our
   // mComputedPadding.top to it (and subtract it from descent).  Need that
   // because nsGfxScrollFrame just adds in the border....
   nsHTMLScrollFrame::Reflow(aPresContext, aDesiredSize, state, aStatus);
 }
 
 void
-nsListControlFrame::ReflowAsDropdown(nsPresContext*           aPresContext, 
+nsListControlFrame::ReflowAsDropdown(nsPresContext*           aPresContext,
                                      nsHTMLReflowMetrics&     aDesiredSize,
-                                     const nsHTMLReflowState& aReflowState, 
+                                     const nsHTMLReflowState& aReflowState,
                                      nsReflowStatus&          aStatus)
 {
   NS_PRECONDITION(aReflowState.ComputedBSize() == NS_UNCONSTRAINEDSIZE,
                   "We should not have a computed block size here!");
-  
+
   mMightNeedSecondPass = NS_SUBTREE_DIRTY(this) ||
     aReflowState.ShouldReflowAllKids();
 
   WritingMode wm = aReflowState.GetWritingMode();
 #ifdef DEBUG
   nscoord oldBSizeOfARow = BSizeOfARow();
   nscoord oldVisibleBSize = (GetStateBits() & NS_FRAME_FIRST_REFLOW) ?
     NS_UNCONSTRAINEDSIZE : GetScrolledFrame()->BSize(wm);
@@ -881,24 +881,24 @@ nsListControlFrame::CaptureMouseEvents(b
       // This shouldn't be necessary. We should simply ensure that events targeting
       // scrollbars are never visible to DOM consumers.
       nsIPresShell::SetCapturingContent(nullptr, 0);
     }
   }
 }
 
 //---------------------------------------------------------
-nsresult 
+nsresult
 nsListControlFrame::HandleEvent(nsPresContext* aPresContext,
                                 WidgetGUIEvent* aEvent,
                                 nsEventStatus* aEventStatus)
 {
   NS_ENSURE_ARG_POINTER(aEventStatus);
 
-  /*const char * desc[] = {"eMouseMove", 
+  /*const char * desc[] = {"eMouseMove",
                           "NS_MOUSE_LEFT_BUTTON_UP",
                           "NS_MOUSE_LEFT_BUTTON_DOWN",
                           "<NA>","<NA>","<NA>","<NA>","<NA>","<NA>","<NA>",
                           "NS_MOUSE_MIDDLE_BUTTON_UP",
                           "NS_MOUSE_MIDDLE_BUTTON_DOWN",
                           "<NA>","<NA>","<NA>","<NA>","<NA>","<NA>","<NA>","<NA>",
                           "NS_MOUSE_RIGHT_BUTTON_UP",
                           "NS_MOUSE_RIGHT_BUTTON_DOWN",
@@ -1026,20 +1026,20 @@ nsListControlFrame::OnOptionSelected(int
 }
 
 void
 nsListControlFrame::OnContentReset()
 {
   ResetList(true);
 }
 
-void 
+void
 nsListControlFrame::ResetList(bool aAllowScrolling)
 {
-  // if all the frames aren't here 
+  // if all the frames aren't here
   // don't bother reseting
   if (!mIsAllFramesHere) {
     return;
   }
 
   if (aAllowScrolling) {
     mPostChildrenLoadedReset = true;
 
@@ -1057,19 +1057,19 @@ nsListControlFrame::ResetList(bool aAllo
       }
     }
   }
 
   mStartSelectionIndex = kNothingSelected;
   mEndSelectionIndex = kNothingSelected;
   InvalidateFocus();
   // Combobox will redisplay itself with the OnOptionSelected event
-} 
- 
-void 
+}
+
+void
 nsListControlFrame::SetFocus(bool aOn, bool aRepaint)
 {
   InvalidateFocus();
 
   if (aOn) {
     ComboboxFocusSet();
     mFocused = this;
   } else {
@@ -1134,17 +1134,17 @@ nsListControlFrame::GetCurrentOption()
     if (!selectElement->IsOptionDisabled(node)) {
       return node;
     }
   }
 
   return nullptr;
 }
 
-bool 
+bool
 nsListControlFrame::IsInDropDownMode() const
 {
   return (mComboboxFrame != nullptr);
 }
 
 uint32_t
 nsListControlFrame::GetNumberOfOptions()
 {
@@ -1174,17 +1174,17 @@ bool nsListControlFrame::CheckIfAllFrame
   return mIsAllFramesHere;
 }
 
 NS_IMETHODIMP
 nsListControlFrame::DoneAddingChildren(bool aIsDone)
 {
   mIsAllContentHere = aIsDone;
   if (mIsAllContentHere) {
-    // Here we check to see if all the frames have been created 
+    // Here we check to see if all the frames have been created
     // for all the content.
     // If so, then we can initialize;
     if (!mIsAllFramesHere) {
       // if all the frames are now present we can initialize
       if (CheckIfAllFramesHere()) {
         mHasBeenInitialized = true;
         ResetList(true);
       }
@@ -1510,17 +1510,17 @@ nsListControlFrame::DidReflow(nsPresCont
   }
 
   mHasPendingInterruptAtStartOfReflow = false;
 }
 
 nsIAtom*
 nsListControlFrame::GetType() const
 {
-  return nsGkAtoms::listControlFrame; 
+  return nsGkAtoms::listControlFrame;
 }
 
 #ifdef DEBUG_FRAME_DUMP
 nsresult
 nsListControlFrame::GetFrameName(nsAString& aResult) const
 {
   return MakeFrameName(NS_LITERAL_STRING("ListControl"), aResult);
 }
@@ -1627,17 +1627,17 @@ nsListControlFrame::MouseUp(nsIDOMEvent*
       return NS_ERROR_FAILURE; // means consume event
     } else {
       CaptureMouseEvents(false);
       return NS_OK;
     }
   }
 
   const nsStyleVisibility* vis = StyleVisibility();
-      
+
   if (!vis->IsVisible()) {
     return NS_OK;
   }
 
   if (IsInDropDownMode()) {
     // XXX This is a bit of a hack, but.....
     // But the idea here is to make sure you get an "onclick" event when you mouse
     // down on the select and the drag over an option and let go
@@ -1730,17 +1730,17 @@ nsListControlFrame::FireMenuItemActiveEv
     return;
   }
 
   FireDOMEvent(NS_LITERAL_STRING("DOMMenuItemActive"), optionContent);
 }
 #endif
 
 nsresult
-nsListControlFrame::GetIndexFromDOMEvent(nsIDOMEvent* aMouseEvent, 
+nsListControlFrame::GetIndexFromDOMEvent(nsIDOMEvent* aMouseEvent,
                                          int32_t&     aCurIndex)
 {
   if (IgnoreMouseEventForSelection(aMouseEvent))
     return NS_ERROR_FAILURE;
 
   if (nsIPresShell::GetCapturingContent() != mContent) {
     // If we're not capturing, then ignore movement in the border
     nsPoint pt = nsLayoutUtils::GetDOMEventCoordinatesRelativeTo(aMouseEvent, this);
@@ -1861,17 +1861,17 @@ nsresult
 nsListControlFrame::MouseMove(nsIDOMEvent* aMouseEvent)
 {
   NS_ASSERTION(aMouseEvent, "aMouseEvent is null.");
   nsCOMPtr<nsIDOMMouseEvent> mouseEvent = do_QueryInterface(aMouseEvent);
   NS_ENSURE_TRUE(mouseEvent, NS_ERROR_FAILURE);
 
   UpdateInListState(aMouseEvent);
 
-  if (IsInDropDownMode()) { 
+  if (IsInDropDownMode()) {
     if (mComboboxFrame->IsDroppedDown()) {
       int32_t selectedIndex;
       if (NS_SUCCEEDED(GetIndexFromDOMEvent(aMouseEvent, selectedIndex))) {
         PerformSelection(selectedIndex, false, false); // might destroy us
       }
     }
   } else {// XXX - temporary until we get drag events
     if (mButtonDown) {
@@ -1883,17 +1883,17 @@ nsListControlFrame::MouseMove(nsIDOMEven
 
 nsresult
 nsListControlFrame::DragMove(nsIDOMEvent* aMouseEvent)
 {
   NS_ASSERTION(aMouseEvent, "aMouseEvent is null.");
 
   UpdateInListState(aMouseEvent);
 
-  if (!IsInDropDownMode()) { 
+  if (!IsInDropDownMode()) {
     int32_t selectedIndex;
     if (NS_SUCCEEDED(GetIndexFromDOMEvent(aMouseEvent, selectedIndex))) {
       // Don't waste cycles if we already dragged over this item
       if (selectedIndex == mEndSelectionIndex) {
         return NS_OK;
       }
       nsCOMPtr<nsIDOMMouseEvent> mouseEvent = do_QueryInterface(aMouseEvent);
       NS_ASSERTION(mouseEvent, "aMouseEvent is not an nsIDOMMouseEvent!");
@@ -1946,22 +1946,22 @@ nsListControlFrame::ScrollToFrame(dom::H
                               nsRect(nsPoint(0, 0), childFrame->GetSize()),
                               nsIPresShell::ScrollAxis(), nsIPresShell::ScrollAxis(),
                               nsIPresShell::SCROLL_OVERFLOW_HIDDEN |
                               nsIPresShell::SCROLL_FIRST_ANCESTOR_ONLY);
   }
 }
 
 //---------------------------------------------------------------------
-// Ok, the entire idea of this routine is to move to the next item that 
-// is suppose to be selected. If the item is disabled then we search in 
-// the same direction looking for the next item to select. If we run off 
-// the end of the list then we start at the end of the list and search 
+// Ok, the entire idea of this routine is to move to the next item that
+// is suppose to be selected. If the item is disabled then we search in
+// the same direction looking for the next item to select. If we run off
+// the end of the list then we start at the end of the list and search
 // backwards until we get back to the original item or an enabled option
-// 
+//
 // aStartIndex - the index to start searching from
 // aNewIndex - will get set to the new index if it finds one
 // aNumOptions - the total number of options in the list
 // aDoAdjustInc - the initial increment 1-n
 // aDoAdjustIncNext - the increment used to search for the next enabled option
 //
 // the aDoAdjustInc could be a "1" for a single item or
 // any number greater representing a page of items
@@ -2042,19 +2042,19 @@ nsListControlFrame::AdjustIndexForDisabl
       }
     }
   }
 
   // Looks like we found one
   aNewIndex     = newIndex;
 }
 
-nsAString& 
+nsAString&
 nsListControlFrame::GetIncrementalString()
-{ 
+{
   if (sIncrementalString == nullptr)
     sIncrementalString = new nsString();
 
   return *sIncrementalString;
 }
 
 void
 nsListControlFrame::Shutdown()
@@ -2341,17 +2341,17 @@ nsListControlFrame::KeyPress(nsIDOMEvent
       return NS_OK;
     }
 
     GetIncrementalString().Truncate();
   }
 
   gLastKeyTime = keyEvent->mTime;
 
-  // Append this keystroke to the search string. 
+  // Append this keystroke to the search string.
   char16_t uniChar = ToLowerCase(static_cast<char16_t>(keyEvent->mCharCode));
   GetIncrementalString().Append(uniChar);
 
   // See bug 188199, if all letters in incremental string are same, just try to
   // match the first one
   nsAutoString incrementalString(GetIncrementalString());
   uint32_t charIndex = 1, stringLength = incrementalString.Length();
   while (charIndex < stringLength &&
@@ -2361,17 +2361,17 @@ nsListControlFrame::KeyPress(nsIDOMEvent
   if (charIndex == stringLength) {
     incrementalString.Truncate(1);
     stringLength = 1;
   }
 
   // Determine where we're going to start reading the string
   // If we have multiple characters to look for, we start looking *at* the
   // current option.  If we have only one character to look for, we start
-  // looking *after* the current option.	
+  // looking *after* the current option.
   // Exception: if there is no option selected to start at, we always start
   // *at* 0.
   int32_t startIndex = GetSelectedIndex();
   if (startIndex == kNothingSelected) {
     startIndex = 0;
   } else if (stringLength == 1) {
     startIndex++;
   }
--- a/layout/forms/nsListControlFrame.h
+++ b/layout/forms/nsListControlFrame.h
@@ -55,34 +55,34 @@ public:
 
   NS_DECL_QUERYFRAME
   NS_DECL_FRAMEARENA_HELPERS
 
     // nsIFrame
   virtual nsresult HandleEvent(nsPresContext* aPresContext,
                                mozilla::WidgetGUIEvent* aEvent,
                                nsEventStatus* aEventStatus) override;
-  
+
   virtual void SetInitialChildList(ChildListID     aListID,
                                    nsFrameList&    aChildList) override;
 
   virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
   virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;
 
   virtual void Reflow(nsPresContext*           aCX,
                       nsHTMLReflowMetrics&     aDesiredSize,
                       const nsHTMLReflowState& aReflowState,
                       nsReflowStatus&          aStatus) override;
 
   virtual void Init(nsIContent*       aContent,
                     nsContainerFrame* aParent,
                     nsIFrame*         aPrevInFlow) override;
 
-  virtual void DidReflow(nsPresContext*            aPresContext, 
-                         const nsHTMLReflowState*  aReflowState, 
+  virtual void DidReflow(nsPresContext*            aPresContext,
+                         const nsHTMLReflowState*  aReflowState,
                          nsDidReflowStatus         aStatus) override;
   virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
 
   virtual void BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                                 const nsRect&           aDirtyRect,
                                 const nsDisplayListSet& aLists) override;
 
   virtual nsContainerFrame* GetContentInsertionFrame() override;
@@ -246,17 +246,17 @@ public:
   /**
    * Frees statics owned by this class.
    */
   static void Shutdown();
 
 #ifdef ACCESSIBILITY
   /**
    * Post a custom DOM event for the change, so that accessibility can
-   * fire a native focus event for accessibility 
+   * fire a native focus event for accessibility
    * (Some 3rd party products need to track our focus)
    */
   void FireMenuItemActiveEvent(); // Inform assistive tech what got focused
 #endif
 
 protected:
   /**
    * Updates the selected text in a combobox and then calls FireOnChange().
@@ -314,17 +314,17 @@ protected:
    * those values as determined by the original HTML
    */
   virtual void ResetList(bool aAllowScrolling);
 
   explicit nsListControlFrame(nsStyleContext* aContext);
   virtual ~nsListControlFrame();
 
   /**
-   * Sets the mSelectedIndex and mOldSelectedIndex from figuring out what 
+   * Sets the mSelectedIndex and mOldSelectedIndex from figuring out what
    * item was selected using content
    * @param aPoint the event point, in listcontrolframe coordinates
    * @return NS_OK if it successfully found the selection
    */
   nsresult GetIndexFromDOMEvent(nsIDOMEvent* aMouseEvent, int32_t& aCurIndex);
 
   bool     CheckIfAllFramesHere();
   bool     IsLeftButton(nsIDOMEvent* aMouseEvent);
@@ -384,17 +384,17 @@ protected:
   nscoord BSizeOfARow() {
     return GetOptionsContainer()->BSizeOfARow();
   }
 
   /**
    * @return how many displayable options/optgroups this frame has.
    */
   uint32_t GetNumberOfRows();
-  
+
   // Data Members
   int32_t      mStartSelectionIndex;
   int32_t      mEndSelectionIndex;
 
   nsIComboboxControlFrame *mComboboxFrame;
   uint32_t     mNumDisplayRows;
   bool mChangesSinceDragStart:1;
   bool mButtonDown:1;
@@ -422,27 +422,27 @@ protected:
   bool mHasPendingInterruptAtStartOfReflow:1;
 
   // True if the drop-down can show more rows.  Always false if this list
   // is not in drop-down mode.
   bool mDropdownCanGrow:1;
 
   // True if the selection can be set to nothing or disabled options.
   bool mForceSelection:1;
-  
+
   // The last computed block size we reflowed at if we're a combobox
   // dropdown.
   // XXXbz should we be using a subclass here?  Or just not worry
   // about the extra member on listboxes?
   nscoord mLastDropdownComputedBSize;
 
   // At the time of our last dropdown, the backstop color to draw in case we
   // are translucent.
   nscolor mLastDropdownBackstopColor;
-  
+
   RefPtr<nsListEventListener> mEventListener;
 
   static nsListControlFrame * mFocused;
   static nsString * sIncrementalString;
 
 #ifdef DO_REFLOW_COUNTER
   int32_t mReflowId;
 #endif