зеркало из https://github.com/mozilla/gecko-dev.git
bug 106966 more table frames will now be able to clip the overflow r=karnaze sr=attinasi
This commit is contained in:
Родитель
baa0b0869a
Коммит
98b8d75589
|
@ -473,16 +473,8 @@ 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);
|
||||
|
|
|
@ -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,16 +473,8 @@ 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);
|
||||
|
|
|
@ -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);*/
|
||||
|
|
Загрузка…
Ссылка в новой задаче