Bug 1403433 - Add another variant of SchedulePaint that does not call InvalidateRenderingObservers for PendingAnimationTracker. r=birtles
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Fri, 29 Sep 2017 19:42:13 +0900
changeset 383731 ce2c129f0a87a4c0fe53063b8e45566484f4b938
parent 383730 24771058db08572666cd5f2790aca4c74f0bad60
child 383732 e1c1ebf60808e5e94b9a03d8cb577990ac0b9ca1
push id52346
push userhikezoe@mozilla.com
push dateFri, 29 Sep 2017 10:44:52 +0000
treeherderautoland@ce2c129f0a87 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles
bugs1403433, 1284053
milestone58.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
Bug 1403433 - Add another variant of SchedulePaint that does not call InvalidateRenderingObservers for PendingAnimationTracker. r=birtles nsFrame::SchedulePaint() invokes InvalidateRenderingObservers, and InvalidateRenderingObservers ends up posting change hints during we are processing sequential tasks for animations, but we don't allow posting any change hints while we are in the middle of restyling process. Though the change hints posted by InvalidateRenderingObservers are not harmful in this case since the change hints will be processed in a second post traversal without problems. That's said, InvalidateRenderingObservers stuff should be processed in display list based invalidation anyway (bug 1284053). MozReview-Commit-ID: GKVRZ98lvEN
dom/animation/PendingAnimationTracker.cpp
layout/generic/nsFrame.cpp
layout/generic/nsIFrame.h
layout/style/crashtests/1403433.html
layout/style/crashtests/crashtests.list
--- a/dom/animation/PendingAnimationTracker.cpp
+++ b/dom/animation/PendingAnimationTracker.cpp
@@ -168,12 +168,12 @@ PendingAnimationTracker::EnsurePaintIsSc
     return;
   }
 
   nsIFrame* rootFrame = presShell->GetRootFrame();
   if (!rootFrame) {
     return;
   }
 
-  rootFrame->SchedulePaint();
+  rootFrame->SchedulePaintWithoutInvalidatingObservers();
 }
 
 } // namespace mozilla
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -6682,16 +6682,23 @@ nsIFrame::IsInvalid(nsRect& aRect)
 void
 nsIFrame::SchedulePaint(PaintType aType)
 {
   nsIFrame* displayRoot = nsLayoutUtils::GetDisplayRootFrame(this);
   InvalidateRenderingObservers(displayRoot, this);
   SchedulePaintInternal(displayRoot, this, aType);
 }
 
+void
+nsIFrame::SchedulePaintWithoutInvalidatingObservers(PaintType aType)
+{
+  nsIFrame* displayRoot = nsLayoutUtils::GetDisplayRootFrame(this);
+  SchedulePaintInternal(displayRoot, this, aType);
+}
+
 Layer*
 nsIFrame::InvalidateLayer(DisplayItemType aDisplayItemKey,
                           const nsIntRect* aDamageRect,
                           const nsRect* aFrameDamageRect,
                           uint32_t aFlags /* = 0 */)
 {
   NS_ASSERTION(aDisplayItemKey > DisplayItemType::TYPE_ZERO, "Need a key");
 
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -3027,16 +3027,21 @@ public:
    */
   enum PaintType {
     PAINT_DEFAULT = 0,
     PAINT_COMPOSITE_ONLY,
     PAINT_DELAYED_COMPRESS
   };
   void SchedulePaint(PaintType aType = PAINT_DEFAULT);
 
+  // Similar to SchedulePaint() but without calling
+  // InvalidateRenderingObservers() for SVG.
+  void SchedulePaintWithoutInvalidatingObservers(
+    PaintType aType = PAINT_DEFAULT);
+
   /**
    * Checks if the layer tree includes a dedicated layer for this
    * frame/display item key pair, and invalidates at least aDamageRect
    * area within that layer.
    *
    * If no layer is found, calls InvalidateFrame() instead.
    *
    * @param aDamageRect Area of the layer to invalidate.
new file mode 100644
--- /dev/null
+++ b/layout/style/crashtests/1403433.html
@@ -0,0 +1,6 @@
+<style>
+#b { -webkit-filter: url(#a); }
+</style>
+<iframe id="a" height="0" src="data:v;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAAA5NtZGF0AAACrgYF//+q3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE0OCByMjY0MyA1YzY1NzA0IC0gSC4yN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scgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAAtaWxzdAAAACWpdG9vAAAAHWRhdGEAAAABAAAAAExhdmY1Ni40MC4xMDEnow">
+</iframe>
+<table id="b">
--- a/layout/style/crashtests/crashtests.list
+++ b/layout/style/crashtests/crashtests.list
@@ -224,17 +224,18 @@ load 1400035.html
 load 1400325.html
 load 1400926.html
 load 1400936-1.html
 load 1400936-2.html
 load 1401256.html
 load 1401692.html
 load 1401706.html
 load 1401801.html
+load 1402218-1.html
 load 1402366.html
 load 1402419.html
 load 1402472.html
 load 1403028.html
-load 1402218-1.html
-load 1403615.html
+load 1403433.html
+load 1403465.html
 load 1403592.html
+load 1403615.html
 load 1403712.html
-load 1403465.html