Backout c5aae1b3dc3f (bug 1002632) for breaking animations in SVG-in-opentype fonts.
authorDaniel Holbert <dholbert@cs.stanford.edu>
Fri, 29 Aug 2014 12:09:51 -0700
changeset 202389 b88f451d3ecc23458b45db408d94bdd9032e84de
parent 202388 713e1d6f09c48f73f6ef66c6d88076530656ddae
child 202390 6a6b450605c5268397f712d686815f48be46f5e5
push id48416
push userdholbert@mozilla.com
push dateFri, 29 Aug 2014 19:10:21 +0000
treeherdermozilla-inbound@b88f451d3ecc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1002632
milestone34.0a1
backs outc5aae1b3dc3fadfdd5914fabf1a17c4f91452223
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
Backout c5aae1b3dc3f (bug 1002632) for breaking animations in SVG-in-opentype fonts.
image/src/SVGDocumentWrapper.cpp
image/src/SVGDocumentWrapper.h
image/src/VectorImage.cpp
layout/base/nsRefreshDriver.cpp
--- a/image/src/SVGDocumentWrapper.cpp
+++ b/image/src/SVGDocumentWrapper.cpp
@@ -213,29 +213,16 @@ void
 SVGDocumentWrapper::SetCurrentTime(float aTime)
 {
   SVGSVGElement* svgElem = GetRootSVGElem();
   if (svgElem && svgElem->GetCurrentTime() != aTime) {
     svgElem->SetCurrentTime(aTime);
   }
 }
 
-void
-SVGDocumentWrapper::TickRefreshDriver()
-{
-  nsCOMPtr<nsIPresShell> presShell;
-  mViewer->GetPresShell(getter_AddRefs(presShell));
-  if (presShell) {
-    nsPresContext* presContext = presShell->GetPresContext();
-    if (presContext) {
-      presContext->RefreshDriver()->DoTick();
-    }
-  }
-}
-
 /** nsIStreamListener methods **/
 
 /* void onDataAvailable (in nsIRequest request, in nsISupports ctxt,
                          in nsIInputStream inStr, in unsigned long sourceOffset,
                          in unsigned long count); */
 NS_IMETHODIMP
 SVGDocumentWrapper::OnDataAvailable(nsIRequest* aRequest, nsISupports* ctxt,
                                     nsIInputStream* inStr,
--- a/image/src/SVGDocumentWrapper.h
+++ b/image/src/SVGDocumentWrapper.h
@@ -132,17 +132,16 @@ public:
   /**
    * Methods to control animation.
    */
   void StartAnimation();
   void StopAnimation();
   void ResetAnimation();
   float GetCurrentTime();
   void SetCurrentTime(float aTime);
-  void TickRefreshDriver();
 
   /**
    * Force a layout flush of the underlying SVG document.
    */
   void FlushLayout();
 
 private:
   ~SVGDocumentWrapper();
--- a/image/src/VectorImage.cpp
+++ b/image/src/VectorImage.cpp
@@ -535,20 +535,19 @@ VectorImage::GetWidth(int32_t* aWidth)
 /* [notxpcom] void requestRefresh ([const] in TimeStamp aTime); */
 NS_IMETHODIMP_(void)
 VectorImage::RequestRefresh(const TimeStamp& aTime)
 {
   if (HadRecentRefresh(aTime)) {
     return;
   }
 
+  // TODO: Implement for b666446.
   EvaluateAnimation();
 
-  mSVGDocumentWrapper->TickRefreshDriver();
-
   if (mHasPendingInvalidation) {
     SendInvalidationNotifications();
     mHasPendingInvalidation = false;
   }
 }
 
 void
 VectorImage::SendInvalidationNotifications()
--- a/layout/base/nsRefreshDriver.cpp
+++ b/layout/base/nsRefreshDriver.cpp
@@ -851,23 +851,16 @@ nsRefreshDriver::EnsureTimerStarted(bool
     return;
 
   if (IsFrozen() || !mPresContext) {
     // If we don't want to start it now, or we've been disconnected.
     StopTimer();
     return;
   }
 
-  if (mPresContext->Document()->IsBeingUsedAsImage()) {
-    // Image documents receive ticks from clients' refresh drivers.
-    MOZ_ASSERT(!mActiveTimer,
-               "image document refresh driver should never have its own timer");
-    return;
-  }
-
   // We got here because we're either adjusting the time *or* we're
   // starting it for the first time.  Add to the right timer,
   // prehaps removing it from a previously-set one.
   RefreshDriverTimer *newTimer = ChooseTimer();
   if (newTimer != mActiveTimer) {
     if (mActiveTimer)
       mActiveTimer->RemoveRefreshDriver(this);
     mActiveTimer = newTimer;