Commit 440c1ec8 authored by Boris Zbarsky's avatar Boris Zbarsky
Browse files

Back out rev 2a35bcdd7c1e (bug 716793) to fix orange tests

parent d73c472d
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -5255,8 +5255,7 @@ void PresShell::SynthesizeMouseMove(bool aFromScroll)
    nsRefPtr<nsSynthMouseMoveEvent> ev =
        new nsSynthMouseMoveEvent(this, aFromScroll);

    if (!GetPresContext()->RefreshDriver()->AddRefreshObserver(ev,
                                                               Flush_Display)) {
    if (NS_FAILED(NS_DispatchToCurrentThread(ev))) {
      NS_WARNING("failed to dispatch nsSynthMouseMoveEvent");
      return;
    }
+4 −15
Original line number Diff line number Diff line
@@ -852,28 +852,17 @@ private:
  // over our window or there is no last observed mouse location for some
  // reason.
  nsPoint mMouseLocation;
  class nsSynthMouseMoveEvent : public nsARefreshObserver {
  class nsSynthMouseMoveEvent : public nsRunnable {
  public:
    nsSynthMouseMoveEvent(PresShell* aPresShell, bool aFromScroll)
      : mPresShell(aPresShell), mFromScroll(aFromScroll) {
      NS_ASSERTION(mPresShell, "null parameter");
    }
    ~nsSynthMouseMoveEvent() {
      Revoke();
    }

    NS_INLINE_DECL_REFCOUNTING(nsSynthMouseMoveEvent)
    
    void Revoke() {
      if (mPresShell) {
        mPresShell->GetPresContext()->RefreshDriver()->
          RemoveRefreshObserver(this, Flush_Display);
        mPresShell = nsnull;
      }
    }
    virtual void WillRefresh(mozilla::TimeStamp aTime) {
    void Revoke() { mPresShell = nsnull; }
    NS_IMETHOD Run() {
      if (mPresShell)
        mPresShell->ProcessSynthMouseMoveEvent(mFromScroll);
      return NS_OK;
    }
  private:
    PresShell* mPresShell;