Bug 1295094 - Part 12. nsDisplayFilter creation flow. r=mstange
authorcku <cku@mozilla.com>
Thu, 01 Sep 2016 11:11:54 +0800
changeset 312500 b8ad986793c2fe97ecf7704d2f9349b41fd5f5eb
parent 312499 102ceafb7343492a87b720971886d5abfaaacade
child 312501 2ab1fbc147e6f2ce9bab278a59331391aef507e3
push id30645
push userryanvm@gmail.com
push dateSat, 03 Sep 2016 15:18:20 +0000
treeherdermozilla-central@c6906f5fc278 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1295094
milestone51.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 1295094 - Part 12. nsDisplayFilter creation flow. r=mstange MozReview-Commit-ID: 3Ts8GqYyNej
layout/generic/nsFrame.cpp
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -2436,22 +2436,31 @@ nsIFrame::BuildDisplayListForStackingCon
   }
 
   /* If there are any SVG effects, wrap the list up in an SVG effects item
    * (which also handles CSS group opacity). Note that we create an SVG effects
    * item even if resultList is empty, since a filter can produce graphical
    * output even if the element being filtered wouldn't otherwise do so.
    */
   if (usingSVGEffects) {
+    MOZ_ASSERT(StyleEffects()->HasFilters() ||
+               nsSVGIntegrationUtils::UsingMaskOrClipPathForFrame(this));
+
     if (clipCapturedBy == ContainerItemType::eSVGEffects) {
       clipState.ExitStackingContextContents(&containerItemScrollClip);
     }
     // Revert to the post-filter dirty rect.
     buildingDisplayList.SetDirtyRect(dirtyRectOutsideSVGEffects);
 
+    if (StyleEffects()->HasFilters()) {
+      /* List now emptied, so add the new list to the top. */
+      resultList.AppendNewToTop(
+          new (aBuilder) nsDisplayFilter(aBuilder, this, &resultList, useOpacity));
+    }
+
     if (nsSVGIntegrationUtils::UsingMaskOrClipPathForFrame(this)) {
       /* List now emptied, so add the new list to the top. */
       resultList.AppendNewToTop(
           new (aBuilder) nsDisplayMask(aBuilder, this, &resultList, useOpacity));
     }
 
     // Also add the hoisted scroll info items. We need those for APZ scrolling
     // because nsDisplayMask items can't build active layers.