Bug 1535040 - Exclude some SVG frames from DL building fast-path r=jwatt
authorMiko Mynttinen <mikokm@gmail.com>
Thu, 21 Mar 2019 14:48:54 +0000
changeset 465439 dc8c94d906a60c6bd5b76d729ac0ccf2006a1a9a
parent 465438 becf3a27c2bb39c1250a8d51c4875edeacf46025
child 465440 f3f1a5f9f4030683c42c62011dfef7dc6c7e8a43
push id35738
push userccoroiu@mozilla.com
push dateThu, 21 Mar 2019 21:59:09 +0000
treeherdermozilla-central@7eb8e627961c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwatt
bugs1535040
milestone68.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 1535040 - Exclude some SVG frames from DL building fast-path r=jwatt Differential Revision: https://phabricator.services.mozilla.com/D23810
layout/generic/nsFrame.cpp
layout/reftests/bugs/1535040-1-ref.html
layout/reftests/bugs/1535040-1.html
layout/reftests/bugs/reftest.list
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -3848,17 +3848,20 @@ void nsIFrame::BuildDisplayListForChild(
                                        aBuilder->ToReferenceFrame(child));
       awayFromCommonPath = true;
     }
 
     child->MarkAbsoluteFramesForDisplayList(aBuilder);
 
     const bool differentAGR = buildingForChild.IsAnimatedGeometryRoot();
 
-    if (!awayFromCommonPath) {
+    if (!awayFromCommonPath &&
+        // Some SVG frames might change opacity without invalidating the frame,
+        // so exclude them from the fast-path.
+        !child->IsFrameOfType(nsIFrame::eSVG)) {
       // The shortcut is available for the child for next time.
       child->AddStateBits(NS_FRAME_SIMPLE_DISPLAYLIST);
     }
 
     if (!pseudoStackingContext) {
       // THIS IS THE COMMON CASE.
       // Not a pseudo or real stacking context. Do the simple thing and
       // return early.
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/1535040-1-ref.html
@@ -0,0 +1,5 @@
+<html>
+  <svg width="400" height="300">
+    <rect id="rect" width="100" height="100" fill="green" x="0" y="0"/>
+  </svg>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/1535040-1.html
@@ -0,0 +1,19 @@
+<html class="reftest-wait">
+  <svg width="400" height="300">
+    <text id="text" opacity="1" x="0" y="150" fill="black">
+      This text should disappear
+    </text>
+    <rect id="rect" width="100" height="100" fill="green" x="0" y="0"/>
+  </svg>
+
+  <script>
+  function doTest() {
+    var elt = document.getElementById("text");
+    elt.setAttribute("opacity", 0);
+    document.documentElement.removeAttribute("class");
+  }
+
+  window.addEventListener("MozReftestInvalidate", doTest, false);
+  setTimeout(doTest, 5000);
+  </script>
+</html>
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -2099,8 +2099,9 @@ fuzzy(0-1,0-625) == 1466638-1.html 14666
 == 1483649-1.xul 1483649-1-ref.xul
 test-pref(layout.css.contain.enabled,true) == 1483946.html 1483946-ref.html
 test-pref(layout.css.visited_links_enabled,false) == 1488155.html 1488155-ref.html
 == 1492660-1.html 1492660-1-ref.html
 pref(layout.css.supports-selector.enabled,true) == 1499386.html 1499386-ref.html
 pref(layout.css.supports-selector.enabled,false) != 1499386.html 1499386-ref.html
 == 1509425-1.html 1509425-1-ref.html
 == 1511570.html 1511570-ref.html
+== 1535040-1.html 1535040-1-ref.html