Bug 423823. Clip overflowing background when tbody is scrollable. r=fantasai,sr=dbaron,a=ss

git-svn-id: svn://10.0.0.236/trunk@253802 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
roc+%cs.cmu.edu 2008-08-25 09:37:50 +00:00
parent ce96395fa3
commit 008a922699
6 changed files with 36 additions and 2 deletions

View File

@ -0,0 +1,10 @@
<!DOCTYPE HTML>
<html>
<body>
<div style="width:200px; height:100px; background:yellow;"></div>
<br>
<div style="width:200px; height:100px; background:yellow; overflow:scroll;">
<div style="height:200px; width:200px;"></div>
</div>
</body>
</html>

View File

@ -0,0 +1,16 @@
<!DOCTYPE HTML>
<html>
<body>
<table cellspacing="0" cellpadding="0" style="width:200px;">
<tbody style="height:100px; overflow:hidden;">
<tr style="background:yellow;"><td><div style="height:200px;"></div>
</tbody>
</table>
<br>
<table cellspacing="0" cellpadding="0" style="width:200px;">
<tbody style="height:100px; overflow:scroll;">
<tr style="background:yellow;"><td><div style="height:200px;"></div>
</tbody>
</table>
</body>
</html>

View File

@ -793,6 +793,7 @@ skip-if(MOZ_WIDGET_TOOLKIT=="cocoa") == 413292-1.html 413292-1-ref.html # disabl
== 423385-1.html 423385-1-ref.html == 423385-1.html 423385-1-ref.html
== 423599-1.html 423599-1-ref.html == 423599-1.html 423599-1-ref.html
== 423676-1.html 423676-1-ref.html == 423676-1.html 423676-1-ref.html
== 423823-1.html 423823-1-ref.html
== 424074-1.xul 424074-1-ref.xul == 424074-1.xul 424074-1-ref.xul
!= 424074-1.xul 424074-1-ref2.xul != 424074-1.xul 424074-1-ref2.xul
fails-if(MOZ_WIDGET_TOOLKIT=="gtk2") == 424074-1-ref2.xul 424074-1-ref3.xul fails-if(MOZ_WIDGET_TOOLKIT=="gtk2") == 424074-1-ref2.xul 424074-1-ref3.xul

View File

@ -443,7 +443,8 @@ TableBackgroundPainter::PaintTable(nsTableFrame* aTableFrame,
// group may not be a child of the table. // group may not be a child of the table.
mRowGroup.mRect.MoveTo(rg->GetOffsetTo(aTableFrame)); mRowGroup.mRect.MoveTo(rg->GetOffsetTo(aTableFrame));
if (mRowGroup.mRect.Intersects(mDirtyRect - mRenderPt)) { if (mRowGroup.mRect.Intersects(mDirtyRect - mRenderPt)) {
nsresult rv = PaintRowGroup(rg, rg->IsPseudoStackingContextFromStyle()); nsresult rv = PaintRowGroup(rg,
rg->IsPseudoStackingContextFromStyle() || rg->IsScrolled());
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
} }
} }

View File

@ -287,7 +287,7 @@ nsTableRowGroupFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (!IsVisibleInSelection(aBuilder)) if (!IsVisibleInSelection(aBuilder))
return NS_OK; return NS_OK;
PRBool isRoot = aBuilder->IsAtRootOfPseudoStackingContext(); PRBool isRoot = aBuilder->IsAtRootOfPseudoStackingContext() || IsScrolled();
nsDisplayTableItem* item = nsnull; nsDisplayTableItem* item = nsnull;
if (isRoot) { if (isRoot) {
// This background is created regardless of whether this frame is // This background is created regardless of whether this frame is

View File

@ -43,6 +43,7 @@
#include "nsILineIterator.h" #include "nsILineIterator.h"
#include "nsTablePainter.h" #include "nsTablePainter.h"
#include "nsTArray.h" #include "nsTArray.h"
#include "nsCSSAnonBoxes.h"
class nsTableFrame; class nsTableFrame;
class nsTableRowFrame; class nsTableRowFrame;
@ -361,6 +362,11 @@ public:
*/ */
FrameCursorData* SetupRowCursor(); FrameCursorData* SetupRowCursor();
PRBool IsScrolled() {
return GetStyleContext()->GetPseudoType() == nsCSSAnonBoxes::scrolledContent ||
GetStyleDisplay()->mOverflowX == NS_STYLE_OVERFLOW_CLIP;
}
protected: protected:
nsTableRowGroupFrame(nsStyleContext* aContext); nsTableRowGroupFrame(nsStyleContext* aContext);