mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-13 18:27:35 +00:00
Land bug 72747 in pieces: use new functions for common overflow tests. b=72747 r+sr=roc
This commit is contained in:
parent
d8f8c8bde9
commit
01f5e54ff0
@ -4230,8 +4230,7 @@ nsFrame::ConsiderChildOverflow(nsPresContext* aPresContext,
|
||||
const nsStyleDisplay* disp = GetStyleDisplay();
|
||||
// check here also for hidden as table frames (table, tr and td) currently
|
||||
// don't wrap their content into a scrollable frame if overflow is specified
|
||||
if (NS_STYLE_OVERFLOW_CLIP != disp->mOverflow &&
|
||||
NS_STYLE_OVERFLOW_HIDDEN != disp->mOverflow) {
|
||||
if (!disp->IsTableClip()) {
|
||||
nsRect* overflowArea = aChildFrame->GetOverflowAreaProperty();
|
||||
if (overflowArea) {
|
||||
nsRect childOverflow(*overflowArea);
|
||||
|
@ -4230,8 +4230,7 @@ nsFrame::ConsiderChildOverflow(nsPresContext* aPresContext,
|
||||
const nsStyleDisplay* disp = GetStyleDisplay();
|
||||
// check here also for hidden as table frames (table, tr and td) currently
|
||||
// don't wrap their content into a scrollable frame if overflow is specified
|
||||
if (NS_STYLE_OVERFLOW_CLIP != disp->mOverflow &&
|
||||
NS_STYLE_OVERFLOW_HIDDEN != disp->mOverflow) {
|
||||
if (!disp->IsTableClip()) {
|
||||
nsRect* overflowArea = aChildFrame->GetOverflowAreaProperty();
|
||||
if (overflowArea) {
|
||||
nsRect childOverflow(*overflowArea);
|
||||
|
@ -431,10 +431,9 @@ nsTableCellFrame::Paint(nsPresContext* aPresContext,
|
||||
nsClipCombine_kIntersect);
|
||||
}
|
||||
else {
|
||||
if (NS_STYLE_OVERFLOW_CLIP == disp->mOverflow ||
|
||||
// XXXldb HIDDEN should really create a scrollframe,
|
||||
// but test here since it doesn't.
|
||||
NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow ||
|
||||
// but use |IsTableClip| here since it doesn't.
|
||||
if (disp->IsTableClip() ||
|
||||
HasPctOverHeight()) {
|
||||
aRenderingContext.PushState();
|
||||
pushed = PR_TRUE;
|
||||
|
@ -1360,11 +1360,8 @@ nsTableFrame::PaintChildren(nsPresContext* aPresContext,
|
||||
const nsRect& aDirtyRect,
|
||||
nsFramePaintLayer aWhichLayer,
|
||||
PRUint32 aFlags)
|
||||
|
||||
{
|
||||
PRUint8 overflow = GetStyleDisplay()->mOverflow;
|
||||
PRBool clip = overflow == NS_STYLE_OVERFLOW_CLIP ||
|
||||
overflow == NS_STYLE_OVERFLOW_HIDDEN;
|
||||
PRBool clip = GetStyleDisplay()->IsTableClip();
|
||||
// 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
|
||||
@ -2076,7 +2073,7 @@ NS_METHOD nsTableFrame::Reflow(nsPresContext* aPresContext,
|
||||
if (aDesiredSize.mFlags & NS_REFLOW_CALC_MAX_WIDTH) {
|
||||
aDesiredSize.mMaximumWidth = GetPreferredWidth();
|
||||
}
|
||||
if (NS_STYLE_OVERFLOW_CLIP != aReflowState.mStyleDisplay->mOverflow) {
|
||||
if (!aReflowState.mStyleDisplay->IsTableClip()) {
|
||||
// collapsed border may leak out
|
||||
nsMargin bcMargin = GetBCMargin(aPresContext);
|
||||
nsRect tableRect(0, 0, aDesiredSize.width, aDesiredSize.height) ;
|
||||
|
@ -333,9 +333,7 @@ nsTableOuterFrame::Paint(nsPresContext* aPresContext,
|
||||
|
||||
// If overflow is hidden then set the clip rect so that children
|
||||
// don't leak out of us
|
||||
PRUint8 overflow = GetStyleDisplay()->mOverflow;
|
||||
PRBool clip = overflow == NS_STYLE_OVERFLOW_CLIP ||
|
||||
overflow == NS_STYLE_OVERFLOW_HIDDEN;
|
||||
PRBool clip = GetStyleDisplay()->IsTableClip();
|
||||
if (clip) {
|
||||
aRenderingContext.PushState();
|
||||
SetOverflowClipRect(aRenderingContext);
|
||||
|
@ -555,9 +555,7 @@ NS_METHOD nsTableRowFrame::Paint(nsPresContext* aPresContext,
|
||||
aFlags |= NS_PAINT_FLAG_TABLE_BG_PAINT;
|
||||
}
|
||||
|
||||
PRUint8 overflow = GetStyleDisplay()->mOverflow;
|
||||
PRBool clip = overflow == NS_STYLE_OVERFLOW_CLIP ||
|
||||
overflow == NS_STYLE_OVERFLOW_HIDDEN;
|
||||
PRBool clip = GetStyleDisplay()->IsTableClip();
|
||||
if (clip) {
|
||||
aRenderingContext.PushState();
|
||||
SetOverflowClipRect(aRenderingContext);
|
||||
|
@ -431,10 +431,9 @@ nsTableCellFrame::Paint(nsPresContext* aPresContext,
|
||||
nsClipCombine_kIntersect);
|
||||
}
|
||||
else {
|
||||
if (NS_STYLE_OVERFLOW_CLIP == disp->mOverflow ||
|
||||
// XXXldb HIDDEN should really create a scrollframe,
|
||||
// but test here since it doesn't.
|
||||
NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow ||
|
||||
// but use |IsTableClip| here since it doesn't.
|
||||
if (disp->IsTableClip() ||
|
||||
HasPctOverHeight()) {
|
||||
aRenderingContext.PushState();
|
||||
pushed = PR_TRUE;
|
||||
|
@ -1360,11 +1360,8 @@ nsTableFrame::PaintChildren(nsPresContext* aPresContext,
|
||||
const nsRect& aDirtyRect,
|
||||
nsFramePaintLayer aWhichLayer,
|
||||
PRUint32 aFlags)
|
||||
|
||||
{
|
||||
PRUint8 overflow = GetStyleDisplay()->mOverflow;
|
||||
PRBool clip = overflow == NS_STYLE_OVERFLOW_CLIP ||
|
||||
overflow == NS_STYLE_OVERFLOW_HIDDEN;
|
||||
PRBool clip = GetStyleDisplay()->IsTableClip();
|
||||
// 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
|
||||
@ -2076,7 +2073,7 @@ NS_METHOD nsTableFrame::Reflow(nsPresContext* aPresContext,
|
||||
if (aDesiredSize.mFlags & NS_REFLOW_CALC_MAX_WIDTH) {
|
||||
aDesiredSize.mMaximumWidth = GetPreferredWidth();
|
||||
}
|
||||
if (NS_STYLE_OVERFLOW_CLIP != aReflowState.mStyleDisplay->mOverflow) {
|
||||
if (!aReflowState.mStyleDisplay->IsTableClip()) {
|
||||
// collapsed border may leak out
|
||||
nsMargin bcMargin = GetBCMargin(aPresContext);
|
||||
nsRect tableRect(0, 0, aDesiredSize.width, aDesiredSize.height) ;
|
||||
|
@ -333,9 +333,7 @@ nsTableOuterFrame::Paint(nsPresContext* aPresContext,
|
||||
|
||||
// If overflow is hidden then set the clip rect so that children
|
||||
// don't leak out of us
|
||||
PRUint8 overflow = GetStyleDisplay()->mOverflow;
|
||||
PRBool clip = overflow == NS_STYLE_OVERFLOW_CLIP ||
|
||||
overflow == NS_STYLE_OVERFLOW_HIDDEN;
|
||||
PRBool clip = GetStyleDisplay()->IsTableClip();
|
||||
if (clip) {
|
||||
aRenderingContext.PushState();
|
||||
SetOverflowClipRect(aRenderingContext);
|
||||
|
@ -555,9 +555,7 @@ NS_METHOD nsTableRowFrame::Paint(nsPresContext* aPresContext,
|
||||
aFlags |= NS_PAINT_FLAG_TABLE_BG_PAINT;
|
||||
}
|
||||
|
||||
PRUint8 overflow = GetStyleDisplay()->mOverflow;
|
||||
PRBool clip = overflow == NS_STYLE_OVERFLOW_CLIP ||
|
||||
overflow == NS_STYLE_OVERFLOW_HIDDEN;
|
||||
PRBool clip = GetStyleDisplay()->IsTableClip();
|
||||
if (clip) {
|
||||
aRenderingContext.PushState();
|
||||
SetOverflowClipRect(aRenderingContext);
|
||||
|
Loading…
Reference in New Issue
Block a user