Bug 543681. Update the dirty region of view properly when scrolling. r=roc

--HG--
extra : rebase_source : b2c66757fb896a7f075eb059c85db42bb2fd3f45
This commit is contained in:
Timothy Nikkel 2010-02-02 19:55:29 -06:00
parent 6710bd9634
commit 9d1ebd2487
4 changed files with 44 additions and 5 deletions

View File

@ -0,0 +1,18 @@
<html class="reftest-wait">
<head>
<script>
document.addEventListener("MozReftestInvalidate", doTest, false);
function doTest() {
window.location.href = "#two";
document.documentElement.className = "";
}
</script>
</head>
<body>
<div style="height: 200px;">spacer</div>
<div id="one" style="background: blue; width: 200px; height: 200px; display: none;">div one</div>
<div id="two" style="background: red; width: 200px; height: 200px;">div two</div>
<div style="height: 10000px;">spacer</div>
</body>
</html>

View File

@ -0,0 +1,22 @@
<html class="reftest-wait">
<head>
<script>
document.addEventListener("MozReftestInvalidate", doTest, false);
function doTest() {
var one = document.getElementById("one");
var two = document.getElementById("two");
one.style.display = "none";
two.style.display = "";
window.location.href = "#two";
document.documentElement.className = "";
}
</script>
</head>
<body>
<div style="height: 200px;">spacer</div>
<div id="one" style="background: blue; width: 200px; height: 200px;">div one</div>
<div id="two" style="background: red; width: 200px; height: 200px; display: none;">div two</div>
<div style="height: 10000px;">spacer</div>
</body>
</html>

View File

@ -3,3 +3,4 @@
== table-repaint-c.html table-repaint-c-ref.html == table-repaint-c.html table-repaint-c-ref.html
== table-repaint-d.html table-repaint-d-ref.html == table-repaint-d.html table-repaint-d-ref.html
== 540247-1.xul 540247-1-ref.xul == 540247-1.xul 540247-1-ref.xul
== 543681-1.html 543681-1-ref.html

View File

@ -582,13 +582,11 @@ nsViewManager::WillBitBlit(nsIView* aView, const nsRect& aRect,
++mScrollCnt; ++mScrollCnt;
nsView* v = static_cast<nsView*>(aView); nsView* v = static_cast<nsView*>(aView);
// Since the view is actually moving the widget by -aScrollAmount, that's the
// offset we want to use when accumulating dirty rects.
if (v->HasNonEmptyDirtyRegion()) { if (v->HasNonEmptyDirtyRegion()) {
nsRegion* dirty = v->GetDirtyRegion(); nsRegion* dirty = v->GetDirtyRegion();
nsRegion intersection; nsRegion intersection = *dirty;
intersection.And(*dirty, aRect); intersection.MoveBy(-aCopyDelta);
intersection.And(intersection, aRect);
if (!intersection.IsEmpty()) { if (!intersection.IsEmpty()) {
dirty->Or(*dirty, intersection); dirty->Or(*dirty, intersection);
// Random simplification number... // Random simplification number...