No bug - Strip EOL whitespace from widget/windows/nsWindow.cpp.
authorJeff Gilbert <jgilbert@mozilla.com>
Wed, 17 Oct 2018 14:44:07 -0700
changeset 441790 0ef00ee6c5312035280635f06e4790abd8b13729
parent 441789 1ee3bf5fd803b1382548e6c0ae77ae8dcab9dd91
child 441791 06e5a5bfd05ef276dce035af837f2ba76e9a55a4
push id109045
push userjgilbert@mozilla.com
push dateWed, 17 Oct 2018 23:15:01 +0000
treeherdermozilla-inbound@0ef00ee6c531 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone64.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
No bug - Strip EOL whitespace from widget/windows/nsWindow.cpp. MozReview-Commit-ID: 31tcxJWLRG2
widget/windows/nsWindow.cpp
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sts=2 sw=2 et cin: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * nsWindow - Native window management and event handling.
- * 
+ *
  * nsWindow is organized into a set of major blocks and
  * block subsections. The layout is as follows:
  *
  *  Includes
  *  Variables
  *  nsIWidget impl.
  *     nsIWidget methods and utilities
  *  nsSwitchToUIThread impl.
@@ -223,17 +223,17 @@ using namespace mozilla::layers;
 using namespace mozilla::widget;
 using namespace mozilla::plugins;
 
 /**************************************************************
  **************************************************************
  **
  ** BLOCK: Variables
  **
- ** nsWindow Class static initializations and global variables. 
+ ** nsWindow Class static initializations and global variables.
  **
  **************************************************************
  **************************************************************/
 
 /**************************************************************
  *
  * SECTION: nsWindow statics
  *
@@ -860,17 +860,17 @@ nsWindow::Create(nsIWidget* aParent,
   // non-popup windows this gets corrected by the WM_DPICHANGED message which resets
   // mDefaultScale, but for popup windows we don't reset mDefaultScale on that message.
   // In order to ensure that popup windows spawned on a non-primary monitor end up
   // with the correct scale, we reset mDefaultScale here so that it gets recomputed
   // using the correct monitor now that we have a mWnd.
   mDefaultScale = -1.0;
 
   if (mIsRTL) {
-    DWORD dwAttribute = TRUE;    
+    DWORD dwAttribute = TRUE;
     DwmSetWindowAttribute(mWnd, DWMWA_NONCLIENT_RTL_LAYOUT, &dwAttribute, sizeof dwAttribute);
   }
 
   if (mOpeningAnimationSuppressed) {
     SuppressAnimation(true);
   }
 
   if (!IsPlugin() &&
@@ -997,17 +997,17 @@ void nsWindow::Destroy()
   // destroys timers, removes clipboard ownership, and breaks the clipboard viewer chain (if
   // the window is at the top of the viewer chain).
   //
   // If the specified window is a parent or owner window, DestroyWindow automatically destroys
   // the associated child or owned windows when it destroys the parent or owner window. The
   // function first destroys child or owned windows, and then it destroys the parent or owner
   // window.
   VERIFY(::DestroyWindow(mWnd));
-  
+
   // Our windows can be subclassed which may prevent us receiving WM_DESTROY. If OnDestroy()
   // didn't get called, call it now.
   if (false == mOnDestroyCalled) {
     MSGResult msgResult;
     mWindowHook.Notify(mWnd, WM_DESTROY, 0, 0, msgResult);
     OnDestroy();
   }
 }
@@ -1386,17 +1386,17 @@ nsWindow::GetParentWindowBase(bool aIncl
           widget = nullptr;
         }
       }
     }
   }
 
   return static_cast<nsWindowBase*>(widget);
 }
- 
+
 BOOL CALLBACK
 nsWindow::EnumAllChildWindProc(HWND aWnd, LPARAM aParam)
 {
   nsWindow *wnd = WinUtils::GetNSWindowPtr(aWnd);
   if (wnd) {
     reinterpret_cast<nsTArray<nsWindow*>*>(aParam)->AppendElement(wnd);
   }
   return TRUE;
@@ -1713,17 +1713,17 @@ void nsWindow::SetThemeRegion()
   // so default constants are used for part and state. At some point we might need part and
   // state values from nsNativeThemeWin's GetThemePartAndState, but currently windows that
   // change shape based on state haven't come up.
   if (!HasGlass() &&
       (mWindowType == eWindowType_popup && !IsPopupWithTitleBar() &&
        (mPopupType == ePopupTypeTooltip || mPopupType == ePopupTypePanel))) {
     HRGN hRgn = nullptr;
     RECT rect = {0,0,mBounds.Width(),mBounds.Height()};
-    
+
     HDC dc = ::GetDC(mWnd);
     GetThemeBackgroundRegion(nsUXThemeData::GetTheme(eUXTooltip), dc, TTP_STANDARD, TS_NORMAL, &rect, &hRgn);
     if (hRgn) {
       if (!SetWindowRgn(mWnd, hRgn, false)) // do not delete or alter hRgn if accepted.
         DeleteObject(hRgn);
     }
     ::ReleaseDC(mWnd, dc);
   }
@@ -2496,23 +2496,23 @@ static WindowsDllInterceptor::FuncHookTy
 
 BOOL WINAPI
 GetWindowInfoHook(HWND hWnd, PWINDOWINFO pwi)
 {
   if (!sGetWindowInfoPtrStub) {
     NS_ASSERTION(FALSE, "Something is horribly wrong in GetWindowInfoHook!");
     return FALSE;
   }
-  int windowStatus = 
+  int windowStatus =
     reinterpret_cast<LONG_PTR>(GetPropW(hWnd, kManageWindowInfoProperty));
   // No property set, return the default data.
   if (!windowStatus)
     return sGetWindowInfoPtrStub(hWnd, pwi);
   // Call GetWindowInfo and update dwWindowStatus with our
-  // internally tracked value. 
+  // internally tracked value.
   BOOL result = sGetWindowInfoPtrStub(hWnd, pwi);
   if (result && pwi)
     pwi->dwWindowStatus = (windowStatus == 1 ? 0 : WS_ACTIVECAPTION);
   return result;
 }
 
 void
 nsWindow::UpdateGetWindowInfoCaptionStatus(bool aActiveCaption)
@@ -2771,17 +2771,17 @@ nsWindow::InvalidateNonClientRegion()
   // +-+-----------------------+-+
   // | | app non-client chrome | |
   // | +-----------------------+ |
   // | |   app client chrome   | | }
   // | +-----------------------+ | }
   // | |      app content      | | } area we don't want to invalidate
   // | +-----------------------+ | }
   // | |   app client chrome   | | }
-  // | +-----------------------+ | 
+  // | +-----------------------+ |
   // +---------------------------+ <
   //  ^                         ^    windows non-client chrome
   // client area = app *
   RECT rect;
   GetWindowRect(mWnd, &rect);
   MapWindowPoints(nullptr, mWnd, (LPPOINT)&rect, 2);
   HRGN winRgn = CreateRectRgnIndirect(&rect);
 
@@ -2989,17 +2989,17 @@ nsWindow::SetCursor(nsCursor aCursor)
     default:
       NS_ERROR("Invalid cursor type");
       break;
   }
 
   if (nullptr != newCursor) {
     mCursor = aCursor;
     HCURSOR oldCursor = ::SetCursor(newCursor);
-    
+
     if (sHCursor == oldCursor) {
       NS_IF_RELEASE(sCursorImgContainer);
       if (sHCursor != nullptr)
         ::DestroyIcon(sHCursor);
       sHCursor = nullptr;
     }
   }
 }
@@ -3716,31 +3716,31 @@ nsWindow::SetIcon(const nsAString& aIcon
     if (icon)
       ::DestroyIcon(icon);
     mIconBig = bigIcon;
   }
 #ifdef DEBUG_SetIcon
   else {
     NS_LossyConvertUTF16toASCII cPath(iconPath);
     MOZ_LOG(gWindowsLog, LogLevel::Info,
-           ("\nIcon load error; icon=%s, rc=0x%08X\n\n", 
+           ("\nIcon load error; icon=%s, rc=0x%08X\n\n",
             cPath.get(), ::GetLastError()));
   }
 #endif
   if (smallIcon) {
     HICON icon = (HICON) ::SendMessageW(mWnd, WM_SETICON, (WPARAM)ICON_SMALL, (LPARAM)smallIcon);
     if (icon)
       ::DestroyIcon(icon);
     mIconSmall = smallIcon;
   }
 #ifdef DEBUG_SetIcon
   else {
     NS_LossyConvertUTF16toASCII cPath(iconPath);
     MOZ_LOG(gWindowsLog, LogLevel::Info,
-           ("\nSmall icon load error; icon=%s, rc=0x%08X\n\n", 
+           ("\nSmall icon load error; icon=%s, rc=0x%08X\n\n",
             cPath.get(), ::GetLastError()));
   }
 #endif
 }
 
 /**************************************************************
  *
  * SECTION: nsIWidget::WidgetToScreenOffset
@@ -3876,17 +3876,17 @@ nsWindow::GetAttention(int32_t aCycleCou
   // Got window?
   if (!mWnd)
     return NS_ERROR_NOT_INITIALIZED;
 
   HWND flashWnd = WinUtils::GetTopLevelHWND(mWnd, false, false);
   HWND fgWnd = ::GetForegroundWindow();
   // Don't flash if the flash count is 0 or if the foreground window is our
   // window handle or that of our owned-most window.
-  if (aCycleCount == 0 || 
+  if (aCycleCount == 0 ||
       flashWnd == fgWnd ||
       flashWnd == WinUtils::GetTopLevelHWND(fgWnd, false, false)) {
     return NS_OK;
   }
 
   DWORD defaultCycleCount = 0;
   ::SystemParametersInfo(SPI_GETFOREGROUNDFLASHCOUNT, 0, &defaultCycleCount, 0);
 
@@ -4134,17 +4134,17 @@ nsWindow::SetWindowClass(const nsAString
   mIsEarlyBlankWindow = xulWinType.EqualsLiteral("navigator:blank");
 }
 
 /**************************************************************
  **************************************************************
  **
  ** BLOCK: Moz Events
  **
- ** Moz GUI event management. 
+ ** Moz GUI event management.
  **
  **************************************************************
  **************************************************************/
 
 /**************************************************************
  *
  * SECTION: Mozilla event initialization
  *
@@ -4663,17 +4663,17 @@ nsWindow::DispatchMouseEvent(EventMessag
       LayoutDeviceIntRect rect = GetBounds();
       rect.MoveTo(0, 0);
 
       if (rect.Contains(event.mRefPoint)) {
         if (sCurrentWindow == nullptr || sCurrentWindow != this) {
           if ((nullptr != sCurrentWindow) && (!sCurrentWindow->mInDtor)) {
             LPARAM pos = sCurrentWindow->lParamToClient(lParamToScreen(lParam));
             sCurrentWindow->DispatchMouseEvent(eMouseExitFromWidget,
-                                               wParam, pos, false, 
+                                               wParam, pos, false,
                                                WidgetMouseEvent::eLeftButton,
                                                aInputSource, aPointerInfo);
           }
           sCurrentWindow = this;
           if (!mInDtor) {
             LPARAM pos = sCurrentWindow->lParamToClient(lParamToScreen(lParam));
             sCurrentWindow->DispatchMouseEvent(eMouseEnterIntoWidget,
                                                wParam, pos, false,
@@ -5261,17 +5261,17 @@ nsWindow::ProcessMessage(UINT msg, WPARA
       break;
 
     case WM_SYSCOLORCHANGE:
       OnSysColorChanged();
       break;
 
     case WM_THEMECHANGED:
     {
-      // Update non-client margin offsets 
+      // Update non-client margin offsets
       UpdateNonClientMargins();
       nsUXThemeData::UpdateNativeThemeInfo();
 
       NotifyThemeChanged();
 
       // Invalidate the window so that the repaint will
       // pick up the new theme.
       Invalidate(true, true, true);
@@ -5966,17 +5966,17 @@ nsWindow::ProcessMessage(UINT msg, WPARA
       }
       break;
     }
 
     case WM_NCLBUTTONDBLCLK:
       DispatchMouseEvent(eMouseDoubleClick, 0, lParamToClient(lParam),
                          false, WidgetMouseEvent::eLeftButton,
                          MOUSE_INPUT_SOURCE());
-      result = 
+      result =
         DispatchMouseEvent(eMouseUp, 0, lParamToClient(lParam),
                            false, WidgetMouseEvent::eLeftButton,
                            MOUSE_INPUT_SOURCE());
       DispatchPendingEvents();
       break;
 
     case WM_APPCOMMAND:
     {
@@ -6388,17 +6388,17 @@ BOOL CALLBACK nsWindow::BroadcastMsg(HWN
   ::EnumChildWindows(aTopWindow, nsWindow::BroadcastMsgToChildren, aMsg);
   return TRUE;
 }
 
 /**************************************************************
  *
  * SECTION: Event processing helpers
  *
- * Special processing for certain event types and 
+ * Special processing for certain event types and
  * synthesized events.
  *
  **************************************************************/
 
 int32_t
 nsWindow::ClientMarginHitTestPoint(int32_t mx, int32_t my)
 {
   if (mSizeMode == nsSizeMode_Minimized ||
@@ -6747,37 +6747,37 @@ void nsWindow::OnWindowPosChanged(WINDOW
     else if (mFullscreenMode)
       mSizeMode = nsSizeMode_Fullscreen;
     else
       mSizeMode = nsSizeMode_Normal;
 
 #ifdef WINSTATE_DEBUG_OUTPUT
     switch (mSizeMode) {
       case nsSizeMode_Normal:
-          MOZ_LOG(gWindowsLog, LogLevel::Info, 
+          MOZ_LOG(gWindowsLog, LogLevel::Info,
                  ("*** mSizeMode: nsSizeMode_Normal\n"));
         break;
       case nsSizeMode_Minimized:
-        MOZ_LOG(gWindowsLog, LogLevel::Info, 
+        MOZ_LOG(gWindowsLog, LogLevel::Info,
                ("*** mSizeMode: nsSizeMode_Minimized\n"));
         break;
       case nsSizeMode_Maximized:
-          MOZ_LOG(gWindowsLog, LogLevel::Info, 
+          MOZ_LOG(gWindowsLog, LogLevel::Info,
                  ("*** mSizeMode: nsSizeMode_Maximized\n"));
         break;
       default:
           MOZ_LOG(gWindowsLog, LogLevel::Info, ("*** mSizeMode: ??????\n"));
         break;
     }
 #endif
 
     if (mWidgetListener && mSizeMode != previousSizeMode)
       mWidgetListener->SizeModeChanged(mSizeMode);
 
-    // If window was restored, window activation was bypassed during the 
+    // If window was restored, window activation was bypassed during the
     // SetSizeMode call originating from OnWindowPosChanging to avoid saving
     // pre-restore attributes. Force activation now to get correct attributes.
     if (mLastSizeMode != nsSizeMode_Normal && mSizeMode == nsSizeMode_Normal)
       DispatchFocusToTopLevelWindow(true);
 
     mLastSizeMode = mSizeMode;
 
     // Skip window size change events below on minimization.
@@ -6836,18 +6836,18 @@ void nsWindow::OnWindowPosChanged(WINDOW
                      RDW_ALLCHILDREN);
     }
 
     mBounds.SizeTo(newWidth, newHeight);
     mLastSize.width  = newWidth;
     mLastSize.height = newHeight;
 
 #ifdef WINSTATE_DEBUG_OUTPUT
-    MOZ_LOG(gWindowsLog, LogLevel::Info, 
-           ("*** Resize window: %d x %d x %d x %d\n", wp->x, wp->y, 
+    MOZ_LOG(gWindowsLog, LogLevel::Info,
+           ("*** Resize window: %d x %d x %d x %d\n", wp->x, wp->y,
             newWidth, newHeight));
 #endif
 
     // If a maximized window is resized, recalculate the non-client margins.
     if (mSizeMode == nsSizeMode_Maximized) {
       if (UpdateNonClientMargins(nsSizeMode_Maximized, true)) {
         // gecko resize event already sent by UpdateNonClientMargins.
         return;
@@ -6877,17 +6877,17 @@ void nsWindow::OnWindowPosChanged(WINDOW
   }
 }
 
 void nsWindow::OnWindowPosChanging(LPWINDOWPOS& info)
 {
   // Update non-client margins if the frame size is changing, and let the
   // browser know we are changing size modes, so alternative css can kick in.
   // If we're going into fullscreen mode, ignore this, since it'll reset
-  // margins to normal mode. 
+  // margins to normal mode.
   if ((info->flags & SWP_FRAMECHANGED && !(info->flags & SWP_NOSIZE)) &&
       mSizeMode != nsSizeMode_Fullscreen) {
     WINDOWPLACEMENT pl;
     pl.length = sizeof(pl);
     ::GetWindowPlacement(mWnd, &pl);
     nsSizeMode sizeMode;
     if (pl.showCmd == SW_SHOWMAXIMIZED)
       sizeMode = (mFullscreenMode ? nsSizeMode_Fullscreen : nsSizeMode_Maximized);
@@ -7109,17 +7109,17 @@ bool nsWindow::OnGesture(WPARAM wParam, 
     return true;
   }
 
   // Other gestures translate into simple gesture events:
   WidgetSimpleGestureEvent event(true, eVoidEvent, this);
   if ( !mGesture.ProcessGestureMessage(mWnd, wParam, lParam, event) ) {
     return false; // fall through to DefWndProc
   }
-  
+
   // Polish up and send off the new event
   ModifierKeyState modifierKeyState;
   modifierKeyState.InitInputEvent(event);
   event.button    = 0;
   event.mTime     = ::GetMessageTime();
   event.mTimeStamp = GetMessageTimeStamp(event.mTime);
   event.inputSource = MouseEvent_Binding::MOZ_SOURCE_TOUCH;
 
@@ -7251,17 +7251,17 @@ nsWindow::SetWindowClipRegion(const nsTA
 
 // WM_DESTROY event handler
 void nsWindow::OnDestroy()
 {
   mOnDestroyCalled = true;
 
   // Make sure we don't get destroyed in the process of tearing down.
   nsCOMPtr<nsIWidget> kungFuDeathGrip(this);
-  
+
   // Dispatch the destroy notification.
   if (!mInDtor)
     NotifyWindowDestroyed();
 
   // Prevent the widget from sending additional events.
   mWidgetListener = nullptr;
   mAttachedWidgetListener = nullptr;
 
@@ -7277,17 +7277,17 @@ void nsWindow::OnDestroy()
   if (sCurrentWindow == this)
     sCurrentWindow = nullptr;
 
   // Disconnects us from our parent, will call our GetParent().
   nsBaseWidget::Destroy();
 
   // Release references to children, device context, toolkit, and app shell.
   nsBaseWidget::OnDestroy();
-  
+
   // Clear our native parent handle.
   // XXX Windows will take care of this in the proper order, and SetParent(nullptr)'s
   // remove child on the parent already took place in nsBaseWidget's Destroy call above.
   //SetParent(nullptr);
   mParent = nullptr;
 
   // We have to destroy the native drag target before we null out our window pointer.
   EnableDragDrop(false);
@@ -7678,24 +7678,24 @@ LRESULT CALLBACK nsWindow::MozSpecialMsg
 
     int inx = 0;
     while (gMSGFEvents[inx].mId != code && gMSGFEvents[inx].mStr != nullptr) {
       inx++;
     }
     if (code != gLastMsgCode) {
       if (gMSGFEvents[inx].mId == code) {
 #ifdef DEBUG
-        MOZ_LOG(gWindowsLog, LogLevel::Info, 
-               ("MozSpecialMessageProc - code: 0x%X  - %s  hw: %p\n", 
+        MOZ_LOG(gWindowsLog, LogLevel::Info,
+               ("MozSpecialMessageProc - code: 0x%X  - %s  hw: %p\n",
                 code, gMSGFEvents[inx].mStr, pMsg->hwnd));
 #endif
       } else {
 #ifdef DEBUG
-        MOZ_LOG(gWindowsLog, LogLevel::Info, 
-               ("MozSpecialMessageProc - code: 0x%X  - %d  hw: %p\n", 
+        MOZ_LOG(gWindowsLog, LogLevel::Info,
+               ("MozSpecialMessageProc - code: 0x%X  - %d  hw: %p\n",
                 code, gMSGFEvents[inx].mId, pMsg->hwnd));
 #endif
       }
       gLastMsgCode = code;
     }
     PrintEvent(pMsg->message, FALSE, FALSE);
   }
 #endif // #ifdef POPUP_ROLLUP_DEBUG_OUTPUT
@@ -7770,43 +7770,43 @@ void nsWindow::RegisterSpecialDropdownHo
 
   // Install msg hook for moving the window and resizing
   if (!sMsgFilterHook) {
     DISPLAY_NMM_PRT("***** Hooking sMsgFilterHook!\n");
     sMsgFilterHook = SetWindowsHookEx(WH_MSGFILTER, MozSpecialMsgFilter,
                                       nullptr, GetCurrentThreadId());
 #ifdef POPUP_ROLLUP_DEBUG_OUTPUT
     if (!sMsgFilterHook) {
-      MOZ_LOG(gWindowsLog, LogLevel::Info, 
+      MOZ_LOG(gWindowsLog, LogLevel::Info,
              ("***** SetWindowsHookEx is NOT installed for WH_MSGFILTER!\n"));
     }
 #endif
   }
 
   // Install msg hook for menus
   if (!sCallProcHook) {
     DISPLAY_NMM_PRT("***** Hooking sCallProcHook!\n");
     sCallProcHook  = SetWindowsHookEx(WH_CALLWNDPROC, MozSpecialWndProc,
                                       nullptr, GetCurrentThreadId());
 #ifdef POPUP_ROLLUP_DEBUG_OUTPUT
     if (!sCallProcHook) {
-      MOZ_LOG(gWindowsLog, LogLevel::Info, 
+      MOZ_LOG(gWindowsLog, LogLevel::Info,
              ("***** SetWindowsHookEx is NOT installed for WH_CALLWNDPROC!\n"));
     }
 #endif
   }
 
   // Install msg hook for the mouse
   if (!sCallMouseHook) {
     DISPLAY_NMM_PRT("***** Hooking sCallMouseHook!\n");
     sCallMouseHook  = SetWindowsHookEx(WH_MOUSE, MozSpecialMouseProc,
                                        nullptr, GetCurrentThreadId());
 #ifdef POPUP_ROLLUP_DEBUG_OUTPUT
     if (!sCallMouseHook) {
-      MOZ_LOG(gWindowsLog, LogLevel::Info, 
+      MOZ_LOG(gWindowsLog, LogLevel::Info,
              ("***** SetWindowsHookEx is NOT installed for WH_MOUSE!\n"));
     }
 #endif
   }
 }
 
 // Unhook special message hooks for dropdowns.
 void nsWindow::UnregisterSpecialDropdownHooks()
@@ -7864,17 +7864,17 @@ VOID CALLBACK nsWindow::HookTimerForPopu
   }
 }
 
 BOOL CALLBACK nsWindow::ClearResourcesCallback(HWND aWnd, LPARAM aMsg)
 {
     nsWindow *window = WinUtils::GetNSWindowPtr(aWnd);
     if (window) {
         window->ClearCachedResources();
-    }  
+    }
     return TRUE;
 }
 
 void
 nsWindow::ClearCachedResources()
 {
     if (mLayerManager &&
         mLayerManager->GetBackendType() == LayersBackend::LAYERS_BASIC) {