зеркало из 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{
|
else{
|
||||||
if ((NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow) || HasPctOverHeight()) {
|
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.PushState();
|
||||||
aRenderingContext.SetClipRect(clipRect,nsClipCombine_kIntersect, clipState);
|
SetOverflowClipRect(aRenderingContext);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PaintChildren(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
PaintChildren(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
||||||
|
|
|
@ -1501,8 +1501,22 @@ nsTableFrame::Paint(nsIPresContext* aPresContext,
|
||||||
aRenderingContext.DrawRect(0, 0, mRect.width, mRect.height);
|
aRenderingContext.DrawRect(0, 0, mRect.width, mRect.height);
|
||||||
}
|
}
|
||||||
#endif
|
#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);
|
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));
|
DO_GLOBAL_REFLOW_COUNT_DSP_J("nsTableFrame", &aRenderingContext, NS_RGB(255,128,255));
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
/*nsFrame::Paint(aPresContext,
|
/*nsFrame::Paint(aPresContext,
|
||||||
|
|
|
@ -357,14 +357,12 @@ nsTableOuterFrame::Paint(nsIPresContext* aPresContext,
|
||||||
|
|
||||||
// Child elements have the opportunity to override the visibility property
|
// Child elements have the opportunity to override the visibility property
|
||||||
// of their parent and display even if the parent is hidden
|
// 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
|
// If overflow is hidden then set the clip rect so that children
|
||||||
// don't leak out of us
|
// don't leak out of us
|
||||||
if (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow) {
|
if (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow) {
|
||||||
aRenderingContext.PushState();
|
aRenderingContext.PushState();
|
||||||
aRenderingContext.SetClipRect(nsRect(0, 0, mRect.width, mRect.height),
|
SetOverflowClipRect(aRenderingContext);
|
||||||
nsClipCombine_kIntersect, clipState);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mCaptionFrame) {
|
if (mCaptionFrame) {
|
||||||
|
@ -377,6 +375,7 @@ nsTableOuterFrame::Paint(nsIPresContext* aPresContext,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow) {
|
if (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow) {
|
||||||
|
PRBool clipState;
|
||||||
aRenderingContext.PopState(clipState);
|
aRenderingContext.PopState(clipState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -606,7 +606,17 @@ NS_METHOD nsTableRowFrame::Paint(nsIPresContext* aPresContext,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!(aFlags && (NS_ROW_FRAME_PAINT_SKIP_CELLS == aFlags))) {
|
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);
|
PaintChildren(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
||||||
|
if (disp && (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow)) {
|
||||||
|
PRBool clipState;
|
||||||
|
aRenderingContext.PopState(clipState);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
||||||
|
|
|
@ -262,7 +262,17 @@ NS_METHOD nsTableRowGroupFrame::Paint(nsIPresContext* aPresContext,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
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);
|
PaintChildren(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
||||||
|
if (disp && (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow)) {
|
||||||
|
PRBool clipState;
|
||||||
|
aRenderingContext.PopState(clipState);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
/*nsFrame::Paint(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);*/
|
/*nsFrame::Paint(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);*/
|
||||||
|
|
|
@ -473,16 +473,8 @@ nsTableCellFrame::Paint(nsIPresContext* aPresContext,
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
if ((NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow) || HasPctOverHeight()) {
|
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.PushState();
|
||||||
aRenderingContext.SetClipRect(clipRect,nsClipCombine_kIntersect, clipState);
|
SetOverflowClipRect(aRenderingContext);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PaintChildren(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
PaintChildren(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
||||||
|
|
|
@ -1501,8 +1501,22 @@ nsTableFrame::Paint(nsIPresContext* aPresContext,
|
||||||
aRenderingContext.DrawRect(0, 0, mRect.width, mRect.height);
|
aRenderingContext.DrawRect(0, 0, mRect.width, mRect.height);
|
||||||
}
|
}
|
||||||
#endif
|
#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);
|
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));
|
DO_GLOBAL_REFLOW_COUNT_DSP_J("nsTableFrame", &aRenderingContext, NS_RGB(255,128,255));
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
/*nsFrame::Paint(aPresContext,
|
/*nsFrame::Paint(aPresContext,
|
||||||
|
|
|
@ -357,14 +357,12 @@ nsTableOuterFrame::Paint(nsIPresContext* aPresContext,
|
||||||
|
|
||||||
// Child elements have the opportunity to override the visibility property
|
// Child elements have the opportunity to override the visibility property
|
||||||
// of their parent and display even if the parent is hidden
|
// 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
|
// If overflow is hidden then set the clip rect so that children
|
||||||
// don't leak out of us
|
// don't leak out of us
|
||||||
if (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow) {
|
if (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow) {
|
||||||
aRenderingContext.PushState();
|
aRenderingContext.PushState();
|
||||||
aRenderingContext.SetClipRect(nsRect(0, 0, mRect.width, mRect.height),
|
SetOverflowClipRect(aRenderingContext);
|
||||||
nsClipCombine_kIntersect, clipState);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mCaptionFrame) {
|
if (mCaptionFrame) {
|
||||||
|
@ -377,6 +375,7 @@ nsTableOuterFrame::Paint(nsIPresContext* aPresContext,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow) {
|
if (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow) {
|
||||||
|
PRBool clipState;
|
||||||
aRenderingContext.PopState(clipState);
|
aRenderingContext.PopState(clipState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -606,7 +606,17 @@ NS_METHOD nsTableRowFrame::Paint(nsIPresContext* aPresContext,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!(aFlags && (NS_ROW_FRAME_PAINT_SKIP_CELLS == aFlags))) {
|
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);
|
PaintChildren(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
||||||
|
if (disp && (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow)) {
|
||||||
|
PRBool clipState;
|
||||||
|
aRenderingContext.PopState(clipState);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
||||||
|
|
|
@ -262,7 +262,17 @@ NS_METHOD nsTableRowGroupFrame::Paint(nsIPresContext* aPresContext,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
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);
|
PaintChildren(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
||||||
|
if (disp && (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow)) {
|
||||||
|
PRBool clipState;
|
||||||
|
aRenderingContext.PopState(clipState);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
/*nsFrame::Paint(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);*/
|
/*nsFrame::Paint(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);*/
|
||||||
|
|
Загрузка…
Ссылка в новой задаче