Bug 1013054. Don't propagate non-repaint change hints to the canvas frame. r=mattwoodrow

--HG--
extra : rebase_source : 73b2b8a7d276d2e2064c9d16235b233e76fc7ee1
This commit is contained in:
Robert O'Callahan 2014-07-22 01:57:52 +12:00
parent 826c40d461
commit 65bec47d5e
4 changed files with 36 additions and 12 deletions

View File

@ -278,7 +278,7 @@ ApplyRenderingChangeToTree(nsPresContext* aPresContext,
nsIFrame* aFrame,
nsChangeHint aChange)
{
// We check StyleDisplay()->HasTransform() in addition to checking
// We check StyleDisplay()->HasTransformStyle() in addition to checking
// IsTransformed() since we can get here for some frames that don't support
// CSS transforms.
NS_ASSERTION(!(aChange & nsChangeHint_UpdateTransformLayer) ||
@ -295,22 +295,29 @@ ApplyRenderingChangeToTree(nsPresContext* aPresContext,
}
}
// If the frame's background is propagated to an ancestor, walk up to
// that ancestor.
nsStyleContext *bgSC;
while (!nsCSSRendering::FindBackground(aFrame, &bgSC)) {
aFrame = aFrame->GetParent();
NS_ASSERTION(aFrame, "root frame must paint");
}
// Trigger rendering updates by damaging this frame and any
// continuations of this frame.
// XXX this needs to detect the need for a view due to an opacity change and deal with it...
#ifdef DEBUG
gInApplyRenderingChangeToTree = true;
#endif
if (aChange & nsChangeHint_RepaintFrame) {
// If the frame's background is propagated to an ancestor, walk up to
// that ancestor and apply the RepaintFrame change hint to it.
nsStyleContext *bgSC;
nsIFrame* propagatedFrame = aFrame;
while (!nsCSSRendering::FindBackground(propagatedFrame, &bgSC)) {
propagatedFrame = propagatedFrame->GetParent();
NS_ASSERTION(aFrame, "root frame must paint");
}
if (propagatedFrame != aFrame) {
DoApplyRenderingChangeToTree(propagatedFrame, nsChangeHint_RepaintFrame);
aChange = NS_SubtractHint(aChange, nsChangeHint_RepaintFrame);
if (!aChange) {
return;
}
}
}
DoApplyRenderingChangeToTree(aFrame, aChange);
#ifdef DEBUG
gInApplyRenderingChangeToTree = false;

View File

@ -0,0 +1,3 @@
<!DOCTYPE HTML>
<html>
<body style="transform:translateY(10px)">Hello

View File

@ -0,0 +1,13 @@
<!DOCTYPE HTML>
<html class="reftest-wait">
<body style="transform:translateY(50px)">Hello
<script>
document.body.getBoundingClientRect();
document.body.style.transform = "translateY(30px)";
function doTest() {
document.body.style.transform = "translateY(10px)";
document.documentElement.removeAttribute("class");
}
// Using MozReftestInvalidate here does not work; unclear why.
setTimeout(doTest, 250);
</script>

View File

@ -1811,6 +1811,7 @@ skip-if(Android) == 966510-2.html 966510-2-ref.html # same as above
fuzzy-if(/^Windows\x20NT\x206\.2/.test(http.oscpu),1,24) == 991046-1.html 991046-1-ref.html
pref(layout.css.overflow-clip-box.enabled,true) == 992447.html 992447-ref.html
pref(layout.css.sticky.enabled,true) == 1005405-1.html 1005405-1-ref.html
== 1013054-1.html 1013054-1-ref.html
pref(layout.css.will-change.enabled,true) == 1018522-1.html 1018522-1-ref.html
pref(browser.display.use_document_fonts,0) == 1022481-1.html 1022481-1-ref.html
== 1022612-1.html 1022612-1-ref.html