bug 106966 more table frames will now be able to clip the overflow r=karnaze sr=attinasi

This commit is contained in:
bernd.mielke%snafu.de 2001-12-09 05:39:45 +00:00
Родитель baa0b0869a
Коммит 98b8d75589
10 изменённых файлов: 78 добавлений и 28 удалений

Просмотреть файл

@ -473,17 +473,9 @@ nsTableCellFrame::Paint(nsIPresContext* aPresContext,
}
else{
if ((NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow) || HasPctOverHeight()) {
const nsStylePadding* myPadding =
(const nsStylePadding*)mStyleContext->GetStyleData(eStyleStruct_Padding);
nsMargin padding;
nsRect clipRect(0, 0, mRect.width, mRect.height);
if (myPadding->GetPadding(padding)) {
clipRect.Deflate(padding);
}
aRenderingContext.PushState();
aRenderingContext.SetClipRect(clipRect,nsClipCombine_kIntersect, clipState);
}
SetOverflowClipRect(aRenderingContext);
}
}
PaintChildren(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
if ((0 != offset.x) || (0 != offset.y)) {

Просмотреть файл

@ -1501,8 +1501,22 @@ nsTableFrame::Paint(nsIPresContext* aPresContext,
aRenderingContext.DrawRect(0, 0, mRect.width, mRect.height);
}
#endif
const nsStyleDisplay* disp = (const nsStyleDisplay*)
mStyleContext->GetStyleData(eStyleStruct_Display);
// If overflow is hidden then set the clip rect so that children don't
// leak out of us. Note that because overflow'-clip' only applies to
// the content area we do this after painting the border and background
if (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow) {
aRenderingContext.PushState();
SetOverflowClipRect(aRenderingContext);
}
PaintChildren(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
if (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow) {
PRBool clipState;
aRenderingContext.PopState(clipState);
}
DO_GLOBAL_REFLOW_COUNT_DSP_J("nsTableFrame", &aRenderingContext, NS_RGB(255,128,255));
return NS_OK;
/*nsFrame::Paint(aPresContext,

Просмотреть файл

@ -357,14 +357,12 @@ nsTableOuterFrame::Paint(nsIPresContext* aPresContext,
// Child elements have the opportunity to override the visibility property
// of their parent and display even if the parent is hidden
PRBool clipState;
// If overflow is hidden then set the clip rect so that children
// don't leak out of us
if (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow) {
aRenderingContext.PushState();
aRenderingContext.SetClipRect(nsRect(0, 0, mRect.width, mRect.height),
nsClipCombine_kIntersect, clipState);
SetOverflowClipRect(aRenderingContext);
}
if (mCaptionFrame) {
@ -377,6 +375,7 @@ nsTableOuterFrame::Paint(nsIPresContext* aPresContext,
}
if (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow) {
PRBool clipState;
aRenderingContext.PopState(clipState);
}

Просмотреть файл

@ -606,7 +606,17 @@ NS_METHOD nsTableRowFrame::Paint(nsIPresContext* aPresContext,
#endif
if (!(aFlags && (NS_ROW_FRAME_PAINT_SKIP_CELLS == aFlags))) {
const nsStyleDisplay* disp = (const nsStyleDisplay*)
mStyleContext->GetStyleData(eStyleStruct_Display);
if (disp && (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow)) {
aRenderingContext.PushState();
SetOverflowClipRect(aRenderingContext);
}
PaintChildren(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
if (disp && (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow)) {
PRBool clipState;
aRenderingContext.PopState(clipState);
}
}
return NS_OK;

Просмотреть файл

@ -262,7 +262,17 @@ NS_METHOD nsTableRowGroupFrame::Paint(nsIPresContext* aPresContext,
}
}
else {
const nsStyleDisplay* disp = (const nsStyleDisplay*)
mStyleContext->GetStyleData(eStyleStruct_Display);
if (disp && (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow)) {
aRenderingContext.PushState();
SetOverflowClipRect(aRenderingContext);
}
PaintChildren(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
if (disp && (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow)) {
PRBool clipState;
aRenderingContext.PopState(clipState);
}
}
return NS_OK;
/*nsFrame::Paint(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);*/

Просмотреть файл

@ -473,17 +473,9 @@ nsTableCellFrame::Paint(nsIPresContext* aPresContext,
}
else{
if ((NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow) || HasPctOverHeight()) {
const nsStylePadding* myPadding =
(const nsStylePadding*)mStyleContext->GetStyleData(eStyleStruct_Padding);
nsMargin padding;
nsRect clipRect(0, 0, mRect.width, mRect.height);
if (myPadding->GetPadding(padding)) {
clipRect.Deflate(padding);
}
aRenderingContext.PushState();
aRenderingContext.SetClipRect(clipRect,nsClipCombine_kIntersect, clipState);
}
SetOverflowClipRect(aRenderingContext);
}
}
PaintChildren(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
if ((0 != offset.x) || (0 != offset.y)) {

Просмотреть файл

@ -1501,8 +1501,22 @@ nsTableFrame::Paint(nsIPresContext* aPresContext,
aRenderingContext.DrawRect(0, 0, mRect.width, mRect.height);
}
#endif
const nsStyleDisplay* disp = (const nsStyleDisplay*)
mStyleContext->GetStyleData(eStyleStruct_Display);
// If overflow is hidden then set the clip rect so that children don't
// leak out of us. Note that because overflow'-clip' only applies to
// the content area we do this after painting the border and background
if (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow) {
aRenderingContext.PushState();
SetOverflowClipRect(aRenderingContext);
}
PaintChildren(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
if (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow) {
PRBool clipState;
aRenderingContext.PopState(clipState);
}
DO_GLOBAL_REFLOW_COUNT_DSP_J("nsTableFrame", &aRenderingContext, NS_RGB(255,128,255));
return NS_OK;
/*nsFrame::Paint(aPresContext,

Просмотреть файл

@ -357,14 +357,12 @@ nsTableOuterFrame::Paint(nsIPresContext* aPresContext,
// Child elements have the opportunity to override the visibility property
// of their parent and display even if the parent is hidden
PRBool clipState;
// If overflow is hidden then set the clip rect so that children
// don't leak out of us
if (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow) {
aRenderingContext.PushState();
aRenderingContext.SetClipRect(nsRect(0, 0, mRect.width, mRect.height),
nsClipCombine_kIntersect, clipState);
SetOverflowClipRect(aRenderingContext);
}
if (mCaptionFrame) {
@ -377,6 +375,7 @@ nsTableOuterFrame::Paint(nsIPresContext* aPresContext,
}
if (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow) {
PRBool clipState;
aRenderingContext.PopState(clipState);
}

Просмотреть файл

@ -606,7 +606,17 @@ NS_METHOD nsTableRowFrame::Paint(nsIPresContext* aPresContext,
#endif
if (!(aFlags && (NS_ROW_FRAME_PAINT_SKIP_CELLS == aFlags))) {
const nsStyleDisplay* disp = (const nsStyleDisplay*)
mStyleContext->GetStyleData(eStyleStruct_Display);
if (disp && (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow)) {
aRenderingContext.PushState();
SetOverflowClipRect(aRenderingContext);
}
PaintChildren(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
if (disp && (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow)) {
PRBool clipState;
aRenderingContext.PopState(clipState);
}
}
return NS_OK;

Просмотреть файл

@ -262,7 +262,17 @@ NS_METHOD nsTableRowGroupFrame::Paint(nsIPresContext* aPresContext,
}
}
else {
const nsStyleDisplay* disp = (const nsStyleDisplay*)
mStyleContext->GetStyleData(eStyleStruct_Display);
if (disp && (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow)) {
aRenderingContext.PushState();
SetOverflowClipRect(aRenderingContext);
}
PaintChildren(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
if (disp && (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow)) {
PRBool clipState;
aRenderingContext.PopState(clipState);
}
}
return NS_OK;
/*nsFrame::Paint(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);*/