Attachment #365464: fix v1 for bug #481359

View | Details | Raw Unified | Return to bug 481359
Collapse All | Expand All

(-)a/content/events/src/nsEventStateManager.cpp (-16 lines)
Line     Link Here 
 Lines 3429-3460   nsEventStateManager::UpdateCursor(nsPres Link Here 
3429
        return;  // don't update the cursor if we failed to get it from the frame see bug 118877
3429
        return;  // don't update the cursor if we failed to get it from the frame see bug 118877
3430
      cursor = framecursor.mCursor;
3430
      cursor = framecursor.mCursor;
3431
      container = framecursor.mContainer;
3431
      container = framecursor.mContainer;
3432
      haveHotspot = framecursor.mHaveHotspot;
3432
      haveHotspot = framecursor.mHaveHotspot;
3433
      hotspotX = framecursor.mHotspotX;
3433
      hotspotX = framecursor.mHotspotX;
3434
      hotspotY = framecursor.mHotspotY;
3434
      hotspotY = framecursor.mHotspotY;
3435
  }
3435
  }
3436
3436
3437
  // Check whether or not to show the busy cursor
3438
  nsCOMPtr<nsISupports> pcContainer = aPresContext->GetContainer();
3439
  nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(pcContainer));
3440
  if (!docShell) return;
3441
  PRUint32 busyFlags = nsIDocShell::BUSY_FLAGS_NONE;
3442
  docShell->GetBusyFlags(&busyFlags);
3443
3444
  // Show busy cursor everywhere before page loads
3445
  // and just replace the arrow cursor after page starts loading
3446
  if (busyFlags & nsIDocShell::BUSY_FLAGS_BUSY &&
3447
        (cursor == NS_STYLE_CURSOR_AUTO || cursor == NS_STYLE_CURSOR_DEFAULT))
3448
  {
3449
    cursor = NS_STYLE_CURSOR_SPINNING;
3450
    container = nsnull;
3451
  }
3452
3453
  if (aTargetFrame) {
3437
  if (aTargetFrame) {
3454
    SetCursor(cursor, container, haveHotspot, hotspotX, hotspotY,
3438
    SetCursor(cursor, container, haveHotspot, hotspotX, hotspotY,
3455
              aTargetFrame->GetWindow(), PR_FALSE);
3439
              aTargetFrame->GetWindow(), PR_FALSE);
3456
  }
3440
  }
3457
3441
3458
  if (mLockCursor || NS_STYLE_CURSOR_AUTO != cursor) {
3442
  if (mLockCursor || NS_STYLE_CURSOR_AUTO != cursor) {
3459
    *aStatus = nsEventStatus_eConsumeDoDefault;
3443
    *aStatus = nsEventStatus_eConsumeDoDefault;
3460
  }
3444
  }
(-)a/docshell/base/nsDocShell.cpp (-10 lines)
Line     Link Here 
 Lines 5106-5139   nsDocShell::OnStateChange(nsIWebProgress Link Here 
5106
                // We'll never get an Embed() for this load, so just go ahead
5106
                // We'll never get an Embed() for this load, so just go ahead
5107
                // and SetHistoryEntry now.
5107
                // and SetHistoryEntry now.
5108
                SetHistoryEntry(&mOSHE, mLSHE);
5108
                SetHistoryEntry(&mOSHE, mLSHE);
5109
            }
5109
            }
5110
        
5110
        
5111
        }
5111
        }
5112
        // Page has begun to load
5112
        // Page has begun to load
5113
        mBusyFlags = BUSY_FLAGS_BUSY | BUSY_FLAGS_BEFORE_PAGE_LOAD;
5113
        mBusyFlags = BUSY_FLAGS_BUSY | BUSY_FLAGS_BEFORE_PAGE_LOAD;
5114
        nsCOMPtr<nsIWidget> mainWidget;
5115
        GetMainWidget(getter_AddRefs(mainWidget));
5116
        if (mainWidget) {
5117
            mainWidget->SetCursor(eCursor_spinning);
5118
        }
5119
    }
5114
    }
5120
    else if ((~aStateFlags & (STATE_TRANSFERRING | STATE_IS_DOCUMENT)) == 0) {
5115
    else if ((~aStateFlags & (STATE_TRANSFERRING | STATE_IS_DOCUMENT)) == 0) {
5121
        // Page is loading
5116
        // Page is loading
5122
        mBusyFlags = BUSY_FLAGS_BUSY | BUSY_FLAGS_PAGE_LOADING;
5117
        mBusyFlags = BUSY_FLAGS_BUSY | BUSY_FLAGS_PAGE_LOADING;
5123
    }
5118
    }
5124
    else if ((aStateFlags & STATE_STOP) && (aStateFlags & STATE_IS_NETWORK)) {
5119
    else if ((aStateFlags & STATE_STOP) && (aStateFlags & STATE_IS_NETWORK)) {
5125
        // Page has finished loading
5120
        // Page has finished loading
5126
        mBusyFlags = BUSY_FLAGS_NONE;
5121
        mBusyFlags = BUSY_FLAGS_NONE;
5127
        nsCOMPtr<nsIWidget> mainWidget;
5128
        GetMainWidget(getter_AddRefs(mainWidget));
5129
        if (mainWidget) {
5130
            mainWidget->SetCursor(eCursor_standard);
5131
        }
5132
    }
5122
    }
5133
    if ((~aStateFlags & (STATE_IS_DOCUMENT | STATE_STOP)) == 0) {
5123
    if ((~aStateFlags & (STATE_IS_DOCUMENT | STATE_STOP)) == 0) {
5134
        nsCOMPtr<nsIWebProgress> webProgress =
5124
        nsCOMPtr<nsIWebProgress> webProgress =
5135
            do_QueryInterface(GetAsSupports(this));
5125
            do_QueryInterface(GetAsSupports(this));
5136
        // Is the document stop notification for this document?
5126
        // Is the document stop notification for this document?
5137
        if (aProgress == webProgress.get()) {
5127
        if (aProgress == webProgress.get()) {
5138
            nsCOMPtr<nsIChannel> channel(do_QueryInterface(aRequest));
5128
            nsCOMPtr<nsIChannel> channel(do_QueryInterface(aRequest));
5139
            EndPageLoad(aProgress, channel, aStatus);
5129
            EndPageLoad(aProgress, channel, aStatus);

Return to bug 481359