Bug 650228. Invalidate ThebesLayers when a linebox is moved. r=dbaron

This commit is contained in:
Robert O'Callahan 2011-05-13 02:59:15 +12:00
parent e8bdea28a0
commit 1037e78cf0
4 changed files with 42 additions and 7 deletions

View File

@ -2474,6 +2474,18 @@ nsBlockFrame::DeleteLine(nsBlockReflowState& aState,
}
}
static void
InvalidateThebesLayersInLineBox(nsIFrame* aBlock, nsLineBox* aLine)
{
if (aBlock->GetStateBits() & NS_FRAME_HAS_CONTAINER_LAYER_DESCENDANT) {
PRInt32 childCount = aLine->GetChildCount();
for (nsIFrame* f = aLine->mFirstChild; childCount;
--childCount, f = f->GetNextSibling()) {
FrameLayerBuilder::InvalidateThebesLayersInSubtree(f);
}
}
}
/**
* Reflow a line. The line will either contain a single block frame
* or contain 1 or more inline frames. aKeepReflowGoing indicates
@ -2567,13 +2579,7 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState,
printf(" dirty line is %p\n", static_cast<void*>(aLine.get()));
#endif
Invalidate(dirtyRect);
if (GetStateBits() & NS_FRAME_HAS_CONTAINER_LAYER_DESCENDANT) {
PRInt32 childCount = aLine->GetChildCount();
for (nsIFrame* f = aLine->mFirstChild; childCount;
--childCount, f = f->GetNextSibling()) {
FrameLayerBuilder::InvalidateThebesLayersInSubtree(f);
}
}
InvalidateThebesLayersInLineBox(this, aLine);
}
return rv;
@ -2732,6 +2738,7 @@ nsBlockFrame::SlideLine(nsBlockReflowState& aState,
// Adjust line state
aLine->SlideBy(aDY);
Invalidate(aLine->GetVisualOverflowArea());
InvalidateThebesLayersInLineBox(this, aLine);
// Adjust the frames in the line
nsIFrame* kid = aLine->mFirstChild;

View File

@ -0,0 +1,7 @@
<!DOCTYPE HTML>
<html>
<body>
<div id="d1" style="width:100px; height:200px; background:lime;"></div>
<div id="d2" style="width:100px; height:100px; background:cyan; opacity:0.4;">Hello Kitty</div>
</body>
</html>

View File

@ -0,0 +1,20 @@
<!DOCTYPE HTML>
<html class="reftest-wait">
<body>
<div id="d1" style="width:100px; height:100px; background:lime;"></div>
<div id="d2" style="width:100px; height:100px; background:cyan; opacity:0.8;">Hello Kitty</div>
<script>
var d1 = document.getElementById("d1");
var d2 = document.getElementById("d2");
document.body.offsetTop;
d1.style.height = "150px";
d2.style.opacity = "0.6";
function doTest() {
d1.style.height = "200px";
d2.style.opacity = 0.4;
document.documentElement.removeAttribute("class");
}
window.addEventListener("MozReftestInvalidate", doTest, false);
</script>
</body>
</html>

View File

@ -1631,5 +1631,6 @@ HTTP(..) == 635639-2.html 635639-2-ref.html
== 641770-1.html 641770-1-ref.html
== 641856-1.html 641856-1-ref.html
== 645491-1.html 645491-1-ref.html
fails-if(layersGPUAccelerated&&cocoaWidget) == 650228-1.html 650228-1-ref.html # Quartz alpha blending doesn't match GL alpha blending
HTTP(..) == 654057-1.html 654057-1-ref.html
== 652775-1.html 652775-1-ref.html