Bug 872254. Clear line/row cursors when overflow areas of lines or table rows change. r=bz

--HG--
extra : rebase_source : 81c1c4269e22ffad98433669ef152002b9d63533
This commit is contained in:
Robert O'Callahan 2013-05-30 16:44:37 +12:00
parent 072bee6956
commit c74c28560e
5 changed files with 107 additions and 0 deletions

View File

@ -1502,6 +1502,10 @@ nsBlockFrame::UpdateOverflow()
line->SetOverflowAreas(lineAreas);
}
// Line cursor invariants depend on the overflow areas of the lines, so
// we must clear the line cursor since those areas may have changed.
ClearLineCursor();
return nsBlockFrameSuper::UpdateOverflow();
}

View File

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<body>
<style>
body { height:5000px; overflow:hidden; }
div {
position:relative;
top:500px;
width:300px;
height:300px;
background-color:red;
}
</style>
<script>
window.scrollTo(0,500);
</script>
<table>
<tr><td><div></div></td></tr>
</table>
</body>
</html>

View File

@ -0,0 +1,71 @@
<!DOCTYPE html>
<html class="reftest-wait">
<body>
<style>
body { height:5000px; overflow:hidden; }
div {
position:relative;
width:300px;
height:300px;
background-color:red;
}
</style>
<script>
window.scrollTo(0,0);
window.addEventListener("MozReftestInvalidate", function() {
document.getElementsByTagName("div")[0].style.top = '500px';
window.scrollTo(0,500);
document.documentElement.removeAttribute("class");
}, false);
</script>
<table>
<tr><td><div></div></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
</table>
</body>
</html>

View File

@ -1325,6 +1325,15 @@ nsTableRowGroupFrame::Reflow(nsPresContext* aPresContext,
return rv;
}
bool
nsTableRowGroupFrame::UpdateOverflow()
{
// Row cursor invariants depend on the visual overflow area of the rows,
// which may have changed, so we need to clear the cursor now.
ClearRowCursor();
return nsContainerFrame::UpdateOverflow();
}
/* virtual */ void
nsTableRowGroupFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext)
{

View File

@ -111,6 +111,8 @@ public:
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus) MOZ_OVERRIDE;
virtual bool UpdateOverflow() MOZ_OVERRIDE;
/**
* Get the "type" of the frame
*