Bug 1535040 - Exclude some SVG frames from DL building fast-path r=jwatt

Differential Revision: https://phabricator.services.mozilla.com/D23810

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Miko Mynttinen 2019-03-21 14:48:54 +00:00
parent d735d8aa70
commit c33cbad71c
4 changed files with 29 additions and 1 deletions

View File

@ -3853,7 +3853,10 @@ void nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* 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);
}

View File

@ -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>

View File

@ -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>

View File

@ -2104,3 +2104,4 @@ 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