remove XP_MAC usage. b=281889 r=cbarrett sr=roc a=roc
authorjoshmoz@gmail.com
Mon, 01 Oct 2007 16:20:37 -0700
changeset 6499 88d02466421cb21c6d0b079c05e5395d5baf1390
parent 6498 66ac25d260e6c7c59a80c702f6262b4eadb34b83
child 6500 72b77a89d56885694fa9f3a5484cb81b3bf4f043
push id1
push userbsmedberg@mozilla.com
push dateThu, 20 Mar 2008 16:49:24 +0000
treeherdermozilla-central@61007906a1f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscbarrett, roc, roc
bugs281889
milestone1.9a9pre
remove XP_MAC usage. b=281889 r=cbarrett sr=roc a=roc
content/events/src/nsEventStateManager.h
embedding/browser/webBrowser/nsWebBrowser.cpp
embedding/browser/webBrowser/nsWebBrowser.h
layout/base/nsCaret.cpp
layout/generic/nsFrame.cpp
layout/generic/nsSelection.cpp
layout/printing/nsPrintEngine.cpp
layout/xul/base/src/nsMenuBarListener.cpp
layout/xul/base/src/nsMenuFrame.cpp
layout/xul/base/src/nsRepeatService.cpp
layout/xul/base/src/nsXULPopupManager.cpp
layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp
--- a/content/events/src/nsEventStateManager.h
+++ b/content/events/src/nsEventStateManager.h
@@ -56,17 +56,17 @@ class nsIScrollableView;
 class nsIPresShell;
 class nsIDocShell;
 class nsIDocShellTreeNode;
 class nsIDocShellTreeItem;
 class nsIFocusController;
 class imgIContainer;
 
 // mac uses click-hold context menus, a holdover from 4.x
-#if defined(XP_MAC) || defined(XP_MACOSX)
+#ifdef XP_MACOSX
 #define CLICK_HOLD_CONTEXT_MENUS 1
 #endif
 
 
 /*
  * Event listener manager
  */
 
--- a/embedding/browser/webBrowser/nsWebBrowser.cpp
+++ b/embedding/browser/webBrowser/nsWebBrowser.cpp
@@ -83,22 +83,16 @@
 #ifdef NS_PRINTING
 #include "nsIWebBrowserPrint.h"
 #include "nsIContentViewer.h"
 #endif
 
 // PSM2 includes
 #include "nsISecureBrowserUI.h"
 
-#if (defined(XP_MAC) || defined(XP_MACOSX)) && !defined(MOZ_WIDGET_COCOA)
-#include <MacWindows.h>
-#include "nsWidgetSupport.h"
-#include "nsIEventSink.h"
-#endif
-
 static NS_DEFINE_IID(kWindowCID, NS_WINDOW_CID);
 static NS_DEFINE_CID(kChildCID, NS_CHILD_CID);
 static NS_DEFINE_CID(kLookAndFeelCID, NS_LOOKANDFEEL_CID);
 
 
 //*****************************************************************************
 //***    nsWebBrowser: Object Management
 //*****************************************************************************
@@ -112,19 +106,16 @@ nsWebBrowser::nsWebBrowser() : mDocShell
    mProgressListener(nsnull),
    mBackgroundColor(0),
    mPersistCurrentState(nsIWebBrowserPersist::PERSIST_STATE_READY),
    mPersistResult(NS_OK),
    mPersistFlags(nsIWebBrowserPersist::PERSIST_FLAGS_NONE),
    mStream(nsnull),
    mParentWidget(nsnull),
    mListenerArray(nsnull)
-#if (defined(XP_MAC) || defined(XP_MACOSX)) && !defined(MOZ_WIDGET_COCOA)
-   , mTopLevelWidget(nsnull)
-#endif
 {
     mInitInfo = new nsWebBrowserInitInfo();
     mWWatch = do_GetService(NS_WINDOWWATCHER_CONTRACTID);
     NS_ASSERTION(mWWatch, "failed to get WindowWatcher");
 }
 
 nsWebBrowser::~nsWebBrowser()
 {
@@ -157,20 +148,16 @@ NS_IMETHODIMP nsWebBrowser::InternalDest
       }
 
    if (mListenerArray) {
       (void)mListenerArray->EnumerateForwards(deleteListener, nsnull);
       delete mListenerArray;
       mListenerArray = nsnull;
    }
 
-#if (defined(XP_MAC) || defined(XP_MACOSX)) && !defined(MOZ_WIDGET_COCOA)   
-   NS_IF_RELEASE(mTopLevelWidget);
-#endif
-
    return NS_OK;
 }
 
 
 //*****************************************************************************
 // nsWebBrowser::nsISupports
 //*****************************************************************************   
 
@@ -201,21 +188,16 @@ NS_INTERFACE_MAP_END
 
 NS_IMETHODIMP nsWebBrowser::GetInterface(const nsIID& aIID, void** aSink)
 {
    NS_ENSURE_ARG_POINTER(aSink);
 
    if(NS_SUCCEEDED(QueryInterface(aIID, aSink)))
       return NS_OK;
 
-#if (defined(XP_MAC) || defined(XP_MACOSX)) && !defined(MOZ_WIDGET_COCOA)
-   if (aIID.Equals(NS_GET_IID(nsIEventSink)) && mTopLevelWidget)
-      return mTopLevelWidget->QueryInterface(NS_GET_IID(nsIEventSink), aSink);
-#endif
-
    if (mDocShell) {
 #ifdef NS_PRINTING
        if (aIID.Equals(NS_GET_IID(nsIWebBrowserPrint))) {
            nsCOMPtr<nsIContentViewer> viewer;
            mDocShell->GetContentViewer(getter_AddRefs(viewer));
            if (!viewer)
                return NS_NOINTERFACE;
 
@@ -371,50 +353,16 @@ NS_IMETHODIMP nsWebBrowser::EnableGlobal
     }
     else {
         rv = dsHistory->SetUseGlobalHistory(PR_FALSE);
     }
        
     return rv;
 }
 
-#if (defined(XP_MAC) || defined(XP_MACOSX)) && !defined(MOZ_WIDGET_COCOA)
-NS_IMETHODIMP nsWebBrowser::EnsureTopLevelWidget(nativeWindow aWindow)
-{
-    WindowPtr macWindow = static_cast<WindowPtr>(aWindow);
-    nsIWidget *widget = nsnull;
-    nsCOMPtr<nsIWidget> newWidget;
-    nsresult rv = NS_ERROR_FAILURE;
-
-    ::GetWindowProperty(macWindow, kTopLevelWidgetPropertyCreator,
-        kTopLevelWidgetRefPropertyTag, sizeof(nsIWidget*), nsnull, (void*)&widget);
-    if (!widget) {
-      newWidget = do_CreateInstance(kWindowCID, &rv);
-      if (NS_SUCCEEDED(rv)) {
-        
-        // Create it with huge bounds. The actual bounds that matters is that of the
-        // nsIBaseWindow. The bounds of the top level widget clips its children so
-        // we just have to make sure it is big enough to always contain the children.
-
-        nsRect r(0, 0, 32000, 32000);
-        rv = newWidget->Create(macWindow, r, nsnull, nsnull, nsnull, nsnull, nsnull);
-        if (NS_SUCCEEDED(rv))
-          widget = newWidget;
-      }
-    }
-    NS_ASSERTION(widget, "Failed to get or create a toplevel widget!!");
-    if (widget) {
-      mTopLevelWidget = widget;
-      NS_ADDREF(mTopLevelWidget); // Allows multiple nsWebBrowsers to be in 1 window.
-      rv = NS_OK;
-    }
-    return rv;
-}
-#endif
-
 NS_IMETHODIMP nsWebBrowser::GetContainerWindow(nsIWebBrowserChrome** aTopWindow)
 {
    NS_ENSURE_ARG_POINTER(aTopWindow);
 
    if(mDocShellTreeOwner) {
       *aTopWindow = mDocShellTreeOwner->GetWebBrowserChrome().get();
    } else {
       *aTopWindow = nsnull;
@@ -1420,24 +1368,18 @@ NS_IMETHODIMP nsWebBrowser::GetParentNat
    *aParentNativeWindow = mParentNativeWindow;
 
    return NS_OK;
 }
 
 NS_IMETHODIMP nsWebBrowser::SetParentNativeWindow(nativeWindow aParentNativeWindow)
 {
    NS_ENSURE_STATE(!mDocShell);
-   
-#if (defined(XP_MAC) || defined(XP_MACOSX)) && !defined(MOZ_WIDGET_COCOA)
-   nsresult rv = EnsureTopLevelWidget(aParentNativeWindow);
-   NS_ENSURE_SUCCESS(rv, rv);
-   mParentNativeWindow = mTopLevelWidget->GetNativeData(NS_NATIVE_WINDOW);
-#else
+
    mParentNativeWindow = aParentNativeWindow;
-#endif
 
    return NS_OK;
 }
 
 NS_IMETHODIMP nsWebBrowser::GetVisibility(PRBool* visibility)
 {
    NS_ENSURE_ARG_POINTER(visibility);
 
--- a/embedding/browser/webBrowser/nsWebBrowser.h
+++ b/embedding/browser/webBrowser/nsWebBrowser.h
@@ -185,20 +185,13 @@ protected:
 
    // stream
    nsEmbedStream                 *mStream;
    nsCOMPtr<nsISupports>          mStreamGuard;
 
    //Weak Reference interfaces...
    nsIWidget*                 mParentWidget;
    nsVoidArray *              mListenerArray;
-   
-#if (defined(XP_MAC) || defined(XP_MACOSX)) && !defined(MOZ_WIDGET_COCOA)
-   NS_IMETHOD EnsureTopLevelWidget(nativeWindow aWindow);
-
-   nsIWidget*                 mTopLevelWidget;
-#endif
-
 };
 
 #endif /* nsWebBrowser_h__ */
 
 
--- a/layout/base/nsCaret.cpp
+++ b/layout/base/nsCaret.cpp
@@ -445,19 +445,16 @@ void nsCaret::PaintCaret(nsDisplayListBu
   NS_ASSERTION(mDrawn, "The caret shouldn't be drawing");
 
   aCtx->SetColor(aColor);
   aCtx->FillRect(mCaretRect + aOffset);
   if (!GetHookRect().IsEmpty())
     aCtx->FillRect(GetHookRect() + aOffset);
 }
 
-#ifdef XP_MAC
-#pragma mark -
-#endif
 
 //-----------------------------------------------------------------------------
 NS_IMETHODIMP nsCaret::NotifySelectionChanged(nsIDOMDocument *, nsISelection *aDomSel, PRInt16 aReason)
 {
   if (aReason & nsISelectionListener::MOUSEUP_REASON)//this wont do
     return NS_OK;
 
   nsCOMPtr<nsISelection> domSel(do_QueryReferent(mDomSelectionWeak));
@@ -480,19 +477,16 @@ NS_IMETHODIMP nsCaret::NotifySelectionCh
 
     // Start the caret blinking in the new location.
     StartBlinking();
   }
 
   return NS_OK;
 }
 
-#ifdef XP_MAC
-#pragma mark -
-#endif
 
 //-----------------------------------------------------------------------------
 void nsCaret::KillTimer()
 {
   if (mBlinkTimer)
   {
     mBlinkTimer->Cancel();
   }
@@ -791,17 +785,17 @@ void nsCaret::GetViewForRendering(nsIFra
   if (!caretFrame || !outRenderingView)
     return;
 
   // XXX by Masayuki Nakano:
   // This code is not good. This is adhoc approach.
   // Our best approach is to use the event fired widget related view.
   // But if we do so, we need large change for editor and this.
   if (coordType == eIMECoordinates) {
-#if defined(XP_MAC) || defined(XP_MACOSX) || defined(XP_WIN)
+#if defined(XP_MACOSX) || defined(XP_WIN)
    // #59405 and #313918, on Mac and Windows, the coordinate for IME need to be
    // root view related.
    coordType = eTopLevelWindowCoordinates; 
 #else
    // #59405, on unix, the coordinate for IME need to be view
    // (nearest native window) related.
    coordType = eRenderingViewCoordinates; 
 #endif
@@ -1121,20 +1115,16 @@ void nsCaret::InvalidateRects(const nsRe
                               nsIFrame *aFrame)
 {
   NS_ASSERTION(aFrame, "Must have a frame to invalidate");
   nsRect rect;
   rect.UnionRect(aRect, aHook);
   aFrame->Invalidate(rect, PR_FALSE);
 }
 
-#ifdef XP_MAC
-#pragma mark -
-#endif
-
 //-----------------------------------------------------------------------------
 /* static */
 void nsCaret::CaretBlinkCallback(nsITimer *aTimer, void *aClosure)
 {
   nsCaret   *theCaret = reinterpret_cast<nsCaret*>(aClosure);
   if (!theCaret) return;
   
   theCaret->DrawCaret(PR_TRUE);
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -1545,17 +1545,17 @@ nsFrame::GetDataForTableSelection(nsFram
       (aMouseEvent->message == NS_MOUSE_BUTTON_UP &&
        aMouseEvent->button == nsMouseEvent::eLeftButton) ||
       aMouseEvent->isShift);
 
   if (!doTableSelection)
   {  
     // In Browser, special 'table selection' key must be pressed for table selection
     // or when just Shift is pressed and we're already in table/cell selection mode
-#if defined(XP_MAC) || defined(XP_MACOSX)
+#ifdef XP_MACOSX
     doTableSelection = aMouseEvent->isMeta || (aMouseEvent->isShift && selectingTableCells);
 #else
     doTableSelection = aMouseEvent->isControl || (aMouseEvent->isShift && selectingTableCells);
 #endif
   }
   if (!doTableSelection) 
     return NS_OK;
 
@@ -1781,17 +1781,17 @@ nsFrame::HandlePress(nsPresContext* aPre
   else
     frameselection = shell->FrameSelection();
 
   if (frameselection->GetDisplaySelection() == nsISelectionController::SELECTION_OFF)
     return NS_OK;//nothing to do we cannot affect selection from here
 
   nsMouseEvent *me = (nsMouseEvent *)aEvent;
 
-#if defined(XP_MAC) || defined(XP_MACOSX)
+#ifdef XP_MACOSX
   if (me->isControl)
     return NS_OK;//short ciruit. hard coded for mac due to time restraints.
 #endif
     
   if (me->clickCount >1 )
   {
     frameselection->SetMouseDownState(PR_TRUE);
     frameselection->SetMouseDoubleDown(PR_TRUE);
@@ -1861,17 +1861,17 @@ nsFrame::HandlePress(nsPresContext* aPre
       }
 
       delete details;
     }
   }
 
   frameselection->SetMouseDownState(PR_TRUE);
 
-#if defined(XP_MAC) || defined(XP_MACOSX)
+#ifdef XP_MACOSX
   PRBool control = me->isMeta;
 #else
   PRBool control = me->isControl;
 #endif
 
   rv = frameselection->HandleClick(offsets.content, offsets.StartOffset(),
                                    offsets.EndOffset(), me->isShift, control,
                                    offsets.associateWithNext);
--- a/layout/generic/nsSelection.cpp
+++ b/layout/generic/nsSelection.cpp
@@ -804,19 +804,16 @@ nsSelectionIterator::IsDone()
     return NS_ENUMERATOR_FALSE;
   }
   return NS_OK;
 }
 
 
 ////////////END nsSelectionIterator methods
 
-#ifdef XP_MAC
-#pragma mark -
-#endif
 
 ////////////BEGIN nsFrameSelection methods
 
 nsFrameSelection::nsFrameSelection()
   : mScrollableViewProvider(nsnull),
     mDelayedMouseEvent(PR_FALSE, 0, nsnull, nsMouseEvent::eReal)
 {
   PRInt32 i;
@@ -1119,19 +1116,16 @@ nsFrameSelection::GetCaretBidiLevel()
 
 void
 nsFrameSelection::UndefineCaretBidiLevel()
 {
   mCaretBidiLevel |= BIDI_LEVEL_UNDEFINED;
 }
 #endif
 
-#ifdef XP_MAC
-#pragma mark -
-#endif
 
 #ifdef PRINT_RANGE
 void printRange(nsIDOMRange *aDomRange)
 {
   if (!aDomRange)
   {
     printf("NULL nsIDOMRange\n");
   }
@@ -3151,17 +3145,17 @@ printf("HandleTableSelection: Mouse UP e
         
       mDragSelectingCells = PR_FALSE;
       mStartSelectedCell = nsnull;
       mEndSelectedCell = nsnull;
 
       // Any other mouseup actions require that Ctrl or Cmd key is pressed
       //  else stop table selection mode
       PRBool doMouseUpAction = PR_FALSE;
-#if defined(XP_MAC) || defined(XP_MACOSX)
+#ifdef XP_MACOSX
       doMouseUpAction = aMouseEvent->isMeta;
 #else
       doMouseUpAction = aMouseEvent->isControl;
 #endif
       if (!doMouseUpAction)
       {
 #ifdef DEBUG_TABLE_SELECTION
 printf("HandleTableSelection: Ending cell selection on mouseup: mAppendStartSelectedCell=%d\n", mAppendStartSelectedCell);
@@ -3875,20 +3869,16 @@ nsFrameSelection::SetAncestorLimiter(nsI
       }
     }
   }
 }
 
 //END nsFrameSelection methods
 
 
-#ifdef XP_MAC
-#pragma mark -
-#endif
-
 //BEGIN nsISelection interface implementations
 
 
 
 nsresult
 nsFrameSelection::DeleteFromDocument()
 {
   nsresult res;
--- a/layout/printing/nsPrintEngine.cpp
+++ b/layout/printing/nsPrintEngine.cpp
@@ -899,17 +899,17 @@ nsPrintEngine::GetCurrentPrintSettings(n
 
 //---------------------------------------------------------------------
 // This method checks to see if there is at least one printer defined
 // and if so, it sets the first printer in the list as the default name
 // in the PrintSettings which is then used for Printer Preview
 nsresult
 nsPrintEngine::CheckForPrinters(nsIPrintSettings* aPrintSettings)
 {
-#if defined(XP_MAC) || defined(XP_MACOSX)
+#ifdef XP_MACOSX
   // Mac doesn't support retrieving a printer list.
   return NS_OK;
 #else
   NS_ENSURE_ARG_POINTER(aPrintSettings);
 
   // See if aPrintSettings already has a printer
   nsXPIDLString printerName;
   nsresult rv = aPrintSettings->GetPrinterName(getter_Copies(printerName));
--- a/layout/xul/base/src/nsMenuBarListener.cpp
+++ b/layout/xul/base/src/nsMenuBarListener.cpp
@@ -104,22 +104,22 @@ nsMenuBarListener::GetMenuAccessKey(PRIn
 
 void nsMenuBarListener::InitAccessKey()
 {
   if (mAccessKey >= 0)
     return;
 
   // Compiled-in defaults, in case we can't get LookAndFeel --
   // mac doesn't have menu shortcuts, other platforms use alt.
-#if !(defined(XP_MAC) || defined(XP_MACOSX))
+#ifdef XP_MACOSX
+  mAccessKey = 0;
+  mAccessKeyMask = 0;
+#else
   mAccessKey = nsIDOMKeyEvent::DOM_VK_ALT;
   mAccessKeyMask = MODIFIER_ALT;
-#else
-  mAccessKey = 0;
-  mAccessKeyMask = 0;
 #endif
 
   // Get the menu access key value from prefs, overriding the default:
   mAccessKey = nsContentUtils::GetIntPref("ui.key.menuAccessKey", mAccessKey);
   if (mAccessKey == nsIDOMKeyEvent::DOM_VK_SHIFT)
     mAccessKeyMask = MODIFIER_SHIFT;
   else if (mAccessKey == nsIDOMKeyEvent::DOM_VK_CONTROL)
     mAccessKeyMask = MODIFIER_CONTROL;
@@ -244,30 +244,30 @@ nsMenuBarListener::KeyPress(nsIDOMEvent*
         if (result) {
           mMenuBarFrame->SetActive(PR_TRUE);
           result->OpenMenu(PR_TRUE);
           aKeyEvent->StopPropagation();
           aKeyEvent->PreventDefault();
           retVal = NS_OK;       // I am consuming event
         }
       }    
-#if !defined(XP_MAC) && !defined(XP_MACOSX)
+#ifndef XP_MACOSX
       // Also need to handle F10 specially on Non-Mac platform.
       else if (keyCode == NS_VK_F10) {
         if ((GetModifiers(keyEvent) & ~MODIFIER_CONTROL) == 0) {
           // The F10 key just went down by itself or with ctrl pressed.
           // In Windows, both of these activate the menu bar.
           ToggleMenuActiveState();
 
           aKeyEvent->StopPropagation();
           aKeyEvent->PreventDefault();
           return NS_OK; // consume the event
         }
       }
-#endif   // !XP_MAC && !XP_MACOSX
+#endif // !XP_MACOSX
     } 
   }
 
   return retVal;
 }
 
 PRBool
 nsMenuBarListener::IsAccessKeyPressed(nsIDOMKeyEvent* aKeyEvent)
--- a/layout/xul/base/src/nsMenuFrame.cpp
+++ b/layout/xul/base/src/nsMenuFrame.cpp
@@ -1070,17 +1070,17 @@ nsMenuFrame::BuildAcceleratorText()
   }
 
   static PRInt32 accelKey = 0;
 
   if (!accelKey)
   {
     // Compiled-in defaults, in case we can't get LookAndFeel --
     // command for mac, control for all other platforms.
-#if defined(XP_MAC) || defined(XP_MACOSX)
+#ifdef XP_MACOSX
     accelKey = nsIDOMKeyEvent::DOM_VK_META;
 #else
     accelKey = nsIDOMKeyEvent::DOM_VK_CONTROL;
 #endif
 
     // Get the accelerator key value from prefs, overriding the default:
     accelKey = nsContentUtils::GetIntPref("ui.key.accelKey", accelKey);
   }
--- a/layout/xul/base/src/nsRepeatService.cpp
+++ b/layout/xul/base/src/nsRepeatService.cpp
@@ -40,17 +40,17 @@
 // Netscape Communications
 //
 // See documentation in associated header file
 //
 
 #include "nsRepeatService.h"
 #include "nsIServiceManager.h"
 
-#if defined(XP_MAC) || defined(XP_MACOSX)
+#ifdef XP_MACOSX
 #define INITAL_REPEAT_DELAY 250
 #define REPEAT_DELAY        25
 #else
 #define INITAL_REPEAT_DELAY 250
 #define REPEAT_DELAY        50
 #endif
 
 nsRepeatService* nsRepeatService::gInstance = nsnull;
--- a/layout/xul/base/src/nsXULPopupManager.cpp
+++ b/layout/xul/base/src/nsXULPopupManager.cpp
@@ -1754,23 +1754,23 @@ nsXULPopupManager::KeyPress(nsIDOMEvent*
       menuToOpen = item->Frame()->Enter();
     else if (mActiveMenuBar)
       menuToOpen = mActiveMenuBar->Enter();
     if (menuToOpen) {
       nsCOMPtr<nsIContent> content = menuToOpen->GetContent();
       ShowMenu(content, PR_TRUE, PR_FALSE);
     }
   }
-#if !defined(XP_MAC) && !defined(XP_MACOSX)
+#ifndef XP_MACOSX
   else if (theChar == NS_VK_F10) {
     // doesn't matter what modifier keys are down in Non-Mac platform
     // if the menu bar is active and F10 is pressed - deactivate it
     Rollup();
   }
-#endif // !XP_MAC && !XP_MACOSX
+#endif // !XP_MACOSX
   else {
     HandleShortcutNavigation(keyEvent, nsnull);
   }
 
   if (mCurrentMenu) {
     // if a menu is open, it consumes the key event
     aKeyEvent->StopPropagation();
     aKeyEvent->PreventDefault();
--- a/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp
+++ b/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp
@@ -667,17 +667,17 @@ nsTreeBodyFrame::InvalidateRow(PRInt32 a
   if (mUpdateBatchNest)
     return NS_OK;
 
   aIndex -= mTopRowIndex;
   if (aIndex < 0 || aIndex > mPageLength)
     return NS_OK;
 
   nsRect rowRect(mInnerBox.x, mInnerBox.y+mRowHeight*aIndex, mInnerBox.width, mRowHeight);
-#if defined(XP_MAC) || defined(XP_MACOSX)
+#ifdef XP_MACOSX
   // Mac can't process the event loop during a drag, so if we're dragging,
   // invalidate synchronously.
   nsLeafBoxFrame::Invalidate(rowRect, mSlots && mSlots->mDragSession ? PR_TRUE : PR_FALSE);
 #else
   nsLeafBoxFrame::Invalidate(rowRect, PR_FALSE);
 #endif
 
   return NS_OK;
@@ -2560,31 +2560,31 @@ nsTreeBodyFrame::HandleEvent(nsPresConte
 
     // While we're here, handle tracking of scrolling during a drag.
     if (mSlots->mScrollLines) {
       if (mSlots->mDropAllowed) {
         // Invalidate primary cell at old location.
         mSlots->mDropAllowed = PR_FALSE;
         InvalidateDropFeedback(lastDropRow, lastDropOrient);
       }
-#if !defined(XP_MACOSX)
+#ifdef XP_MACOSX
+      ScrollByLines(mSlots->mScrollLines);
+#else
       if (!lastScrollLines) {
         // Cancel any previously initialized timer.
         if (mSlots->mTimer) {
           mSlots->mTimer->Cancel();
           mSlots->mTimer = nsnull;
         }
 
         // Set a timer to trigger the tree scrolling.
         CreateTimer(nsILookAndFeel::eMetric_TreeLazyScrollDelay,
                     LazyScrollCallback, nsITimer::TYPE_ONE_SHOT,
                     getter_AddRefs(mSlots->mTimer));
        }
-#else
-      ScrollByLines(mSlots->mScrollLines);
 #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, 
     // invalidate primary cell at the new location. If nothing changed, just bail.
     if (mSlots->mDropRow != lastDropRow ||
@@ -3875,17 +3875,17 @@ NS_IMETHODIMP nsTreeBodyFrame::ScrollToR
   UpdateScrollbars(parts);
   return rv;
 }
 
 nsresult nsTreeBodyFrame::ScrollToRowInternal(const ScrollParts& aParts, PRInt32 aRow)
 {
   ScrollInternal(aParts, aRow);
 
-#if defined(XP_MAC) || defined(XP_MACOSX)
+#ifdef XP_MACOSX
   // mac can't process the event loop during a drag, so if we're dragging,
   // grab the scroll widget and make it paint synchronously. This is
   // sorta slow (having to paint the entire tree), but it works.
   if (mSlots && mSlots->mDragSession && aParts.mVScrollbar) {
     nsIFrame* frame;
     CallQueryInterface(aParts.mVScrollbar, &frame);
     nsIWidget* scrollWidget = frame->GetWindow();
     if (scrollWidget)