Bug 151375. Implement css2 outline (still called -moz-outline for now). Makes -moz-outline draw outside of the current frame. Improves appearance of focus outline. Lots of help from roc. r+sr=dbaron
git-svn-id: svn://10.0.0.236/trunk@159196 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
fe80e9ca1c
commit
c361ea9f16
@ -455,6 +455,7 @@ nsStyleContext::CalcStyleDifference(nsStyleContext* aOther)
|
|||||||
DO_STRUCT_DIFFERENCE(Content);
|
DO_STRUCT_DIFFERENCE(Content);
|
||||||
DO_STRUCT_DIFFERENCE(UserInterface);
|
DO_STRUCT_DIFFERENCE(UserInterface);
|
||||||
DO_STRUCT_DIFFERENCE(Visibility);
|
DO_STRUCT_DIFFERENCE(Visibility);
|
||||||
|
DO_STRUCT_DIFFERENCE(Outline);
|
||||||
#ifdef MOZ_SVG
|
#ifdef MOZ_SVG
|
||||||
DO_STRUCT_DIFFERENCE(SVG);
|
DO_STRUCT_DIFFERENCE(SVG);
|
||||||
#endif
|
#endif
|
||||||
@ -489,7 +490,6 @@ nsStyleContext::CalcStyleDifference(nsStyleContext* aOther)
|
|||||||
// UIReset
|
// UIReset
|
||||||
DO_STRUCT_DIFFERENCE(Color);
|
DO_STRUCT_DIFFERENCE(Color);
|
||||||
DO_STRUCT_DIFFERENCE(Background);
|
DO_STRUCT_DIFFERENCE(Background);
|
||||||
DO_STRUCT_DIFFERENCE(Outline);
|
|
||||||
DO_STRUCT_DIFFERENCE(UIReset);
|
DO_STRUCT_DIFFERENCE(UIReset);
|
||||||
|
|
||||||
#undef DO_STRUCT_DIFFERENCE
|
#undef DO_STRUCT_DIFFERENCE
|
||||||
|
|||||||
@ -640,11 +640,18 @@ nsStyleOutline::RecalcData(void)
|
|||||||
|
|
||||||
nsChangeHint nsStyleOutline::CalcDifference(const nsStyleOutline& aOther) const
|
nsChangeHint nsStyleOutline::CalcDifference(const nsStyleOutline& aOther) const
|
||||||
{
|
{
|
||||||
if ((mOutlineWidth != aOther.mOutlineWidth) ||
|
PRBool outlineWasVisible =
|
||||||
(mOutlineStyle != aOther.mOutlineStyle) ||
|
mCachedOutlineWidth > 0 && mOutlineStyle != NS_STYLE_BORDER_STYLE_NONE;
|
||||||
|
PRBool outlineIsVisible =
|
||||||
|
aOther.mCachedOutlineWidth > 0 && aOther.mOutlineStyle != NS_STYLE_BORDER_STYLE_NONE;
|
||||||
|
if (outlineWasVisible != outlineIsVisible ||
|
||||||
|
mOutlineWidth != aOther.mOutlineWidth) {
|
||||||
|
return NS_CombineHint(nsChangeHint_ReflowFrame, nsChangeHint_RepaintFrame);
|
||||||
|
}
|
||||||
|
if ((mOutlineStyle != aOther.mOutlineStyle) ||
|
||||||
(mOutlineColor != aOther.mOutlineColor) ||
|
(mOutlineColor != aOther.mOutlineColor) ||
|
||||||
(mOutlineRadius != aOther.mOutlineRadius)) {
|
(mOutlineRadius != aOther.mOutlineRadius)) {
|
||||||
return NS_STYLE_HINT_VISUAL; // XXX: should be VISUAL: see bugs 9809 and 9816
|
return nsChangeHint_RepaintFrame;
|
||||||
}
|
}
|
||||||
return NS_STYLE_HINT_NONE;
|
return NS_STYLE_HINT_NONE;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2093,39 +2093,17 @@ nscoord width;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// This if control whether the outline paints on the inside
|
|
||||||
// or outside of the frame
|
|
||||||
// XXX This is temporary fix for nsbeta3+ Bug 48973
|
|
||||||
// so we can use "mozoutline
|
|
||||||
#if 0 // outside
|
|
||||||
nsRect inside(aBorderArea);
|
nsRect inside(aBorderArea);
|
||||||
nsRect outside(inside);
|
nsRect outside(inside);
|
||||||
inside.Inflate(width, width);
|
outside.Inflate(width, width);
|
||||||
|
|
||||||
nsRect clipRect(aBorderArea);
|
nsRect clipRect(aBorderArea);
|
||||||
clipRect.Inflate(width, width); // make clip extra big for now
|
clipRect.Inflate(width, width); // make clip extra big for now
|
||||||
|
|
||||||
#else // inside
|
|
||||||
nsMargin borderWidth;
|
|
||||||
aBorderStyle.GetBorder(borderWidth);
|
|
||||||
|
|
||||||
nsRect outside(aBorderArea);
|
|
||||||
outside.Deflate(borderWidth);
|
|
||||||
nsRect inside(outside);
|
|
||||||
inside.Deflate(width, width);
|
|
||||||
|
|
||||||
nsRect clipRect(outside);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
aRenderingContext.PushState();
|
|
||||||
aRenderingContext.SetClipRect(clipRect, nsClipCombine_kReplace);
|
|
||||||
|
|
||||||
// rounded version of the border
|
// rounded version of the border
|
||||||
for(i=0;i<4;i++){
|
for(i=0;i<4;i++){
|
||||||
if(borderRadii[i] > 0){
|
if(borderRadii[i] > 0){
|
||||||
PaintRoundedBorder(aPresContext,aRenderingContext,aForFrame,aDirtyRect,aBorderArea,nsnull,&aOutlineStyle,aStyleContext,aSkipSides,borderRadii,aGap,PR_TRUE);
|
PaintRoundedBorder(aPresContext,aRenderingContext,aForFrame,aDirtyRect,aBorderArea,nsnull,&aOutlineStyle,aStyleContext,aSkipSides,borderRadii,aGap,PR_TRUE);
|
||||||
aRenderingContext.PopState();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2137,7 +2115,6 @@ nscoord width;
|
|||||||
(outlineStyle == NS_STYLE_BORDER_STYLE_DASHED)) {
|
(outlineStyle == NS_STYLE_BORDER_STYLE_DASHED)) {
|
||||||
DrawDashedSides(0, aRenderingContext, aDirtyRect, ourColor, nsnull, &aOutlineStyle, PR_TRUE,
|
DrawDashedSides(0, aRenderingContext, aDirtyRect, ourColor, nsnull, &aOutlineStyle, PR_TRUE,
|
||||||
outside, inside, aSkipSides, aGap);
|
outside, inside, aSkipSides, aGap);
|
||||||
aRenderingContext.PopState();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2192,8 +2169,6 @@ nscoord width;
|
|||||||
aRenderingContext.SetPenMode(nsPenMode_kNone);
|
aRenderingContext.SetPenMode(nsPenMode_kNone);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Restore clipping
|
|
||||||
aRenderingContext.PopState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* draw the edges of the border described in aBorderEdges one segment at a time.
|
/* draw the edges of the border described in aBorderEdges one segment at a time.
|
||||||
|
|||||||
@ -908,7 +908,8 @@ IncrementalReflow::Dispatch(nsIPresContext *aPresContext,
|
|||||||
|
|
||||||
first->SetSize(nsSize(aDesiredSize.width, aDesiredSize.height));
|
first->SetSize(nsSize(aDesiredSize.width, aDesiredSize.height));
|
||||||
|
|
||||||
nsContainerFrame::SyncFrameViewAfterReflow(aPresContext, first, first->GetView(), nsnull);
|
nsContainerFrame::SyncFrameViewAfterReflow(aPresContext, first, first->GetView(),
|
||||||
|
&aDesiredSize.mOverflowArea);
|
||||||
|
|
||||||
first->DidReflow(aPresContext, nsnull, NS_FRAME_REFLOW_FINISHED);
|
first->DidReflow(aPresContext, nsnull, NS_FRAME_REFLOW_FINISHED);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -49,6 +49,7 @@
|
|||||||
#include "nsStyleStruct.h"
|
#include "nsStyleStruct.h"
|
||||||
#include "nsStyleContext.h"
|
#include "nsStyleContext.h"
|
||||||
#include "nsIContent.h"
|
#include "nsIContent.h"
|
||||||
|
#include "nsHTMLReflowMetrics.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* New rules of reflow:
|
* New rules of reflow:
|
||||||
@ -69,7 +70,6 @@
|
|||||||
|
|
||||||
struct nsHTMLReflowState;
|
struct nsHTMLReflowState;
|
||||||
class nsHTMLReflowCommand;
|
class nsHTMLReflowCommand;
|
||||||
struct nsHTMLReflowMetrics;
|
|
||||||
|
|
||||||
class nsIAtom;
|
class nsIAtom;
|
||||||
class nsIPresContext;
|
class nsIPresContext;
|
||||||
@ -1029,7 +1029,18 @@ public:
|
|||||||
* @param if nonnull, we record whether this rect is bigger than the frame's bounds
|
* @param if nonnull, we record whether this rect is bigger than the frame's bounds
|
||||||
* @return the rect relative to this frame's origin
|
* @return the rect relative to this frame's origin
|
||||||
*/
|
*/
|
||||||
nsRect GetOutlineRect(PRBool* aAnyOutline = nsnull) const;
|
nsRect GetOutlineRect(PRBool* aAnyOutline = nsnull, nsSize *aUseSize = nsnull) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set/unset the NS_FRAME_OUTSIDE_CHILDREN flag and store the overflow area
|
||||||
|
* as a frame property in the frame manager so that it can be retrieved
|
||||||
|
* later without reflowing the frame.
|
||||||
|
*/
|
||||||
|
void FinishAndStoreOverflow(nsRect* aOverflowArea, nsSize aNewSize);
|
||||||
|
|
||||||
|
void FinishAndStoreOverflow(nsHTMLReflowMetrics* aMetrics) {
|
||||||
|
FinishAndStoreOverflow(&aMetrics->mOverflowArea, nsSize(aMetrics->width, aMetrics->height));
|
||||||
|
}
|
||||||
|
|
||||||
/** Selection related calls
|
/** Selection related calls
|
||||||
*/
|
*/
|
||||||
@ -1207,8 +1218,7 @@ NS_PTR_TO_INT32(frame->GetProperty(nsLayoutAtoms::embeddingLevel))
|
|||||||
* @param aCreateIfNecessary create a new nsRect for the overflow area
|
* @param aCreateIfNecessary create a new nsRect for the overflow area
|
||||||
* @return pointer to the overflow area rectangle
|
* @return pointer to the overflow area rectangle
|
||||||
*/
|
*/
|
||||||
virtual nsRect* GetOverflowAreaProperty(nsIPresContext* aPresContext,
|
nsRect* GetOverflowAreaProperty(PRBool aCreateIfNecessary = PR_FALSE);
|
||||||
PRBool aCreateIfNecessary = PR_FALSE) = 0;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return PR_TRUE if and only if this frame obeys visibility:hidden.
|
* Return PR_TRUE if and only if this frame obeys visibility:hidden.
|
||||||
|
|||||||
@ -601,7 +601,8 @@ nsFieldSetFrame::Reflow(nsIPresContext* aPresContext,
|
|||||||
ConsiderChildOverflow(aPresContext, aDesiredSize.mOverflowArea, mLegendFrame);
|
ConsiderChildOverflow(aPresContext, aDesiredSize.mOverflowArea, mLegendFrame);
|
||||||
if (mContentFrame)
|
if (mContentFrame)
|
||||||
ConsiderChildOverflow(aPresContext, aDesiredSize.mOverflowArea, mContentFrame);
|
ConsiderChildOverflow(aPresContext, aDesiredSize.mOverflowArea, mContentFrame);
|
||||||
StoreOverflow(aPresContext, aDesiredSize);
|
FinishAndStoreOverflow(&aDesiredSize);
|
||||||
|
|
||||||
#ifdef NOISY_REFLOW
|
#ifdef NOISY_REFLOW
|
||||||
printf("FIELDSET: w=%d, maxWidth=%d, MEW=%d\n",
|
printf("FIELDSET: w=%d, maxWidth=%d, MEW=%d\n",
|
||||||
aDesiredSize.width, aDesiredSize.mMaximumWidth,
|
aDesiredSize.width, aDesiredSize.mMaximumWidth,
|
||||||
|
|||||||
@ -206,7 +206,7 @@ nsAbsoluteContainingBlock::Reflow(nsIFrame* aDelegatingFrame,
|
|||||||
// If the frame has visible overflow, then take it into account, too.
|
// If the frame has visible overflow, then take it into account, too.
|
||||||
if (kidFrame->GetStateBits() & NS_FRAME_OUTSIDE_CHILDREN) {
|
if (kidFrame->GetStateBits() & NS_FRAME_OUTSIDE_CHILDREN) {
|
||||||
// Get the property
|
// Get the property
|
||||||
nsRect* overflowArea = kidFrame->GetOverflowAreaProperty(aPresContext);
|
nsRect* overflowArea = kidFrame->GetOverflowAreaProperty();
|
||||||
|
|
||||||
if (overflowArea) {
|
if (overflowArea) {
|
||||||
// The overflow area is in the child's coordinate space, so translate
|
// The overflow area is in the child's coordinate space, so translate
|
||||||
@ -237,7 +237,7 @@ nsAbsoluteContainingBlock::CalculateChildBounds(nsIPresContext* aPresContext,
|
|||||||
// If the frame has visible overflow, then take it into account, too.
|
// If the frame has visible overflow, then take it into account, too.
|
||||||
if (f->GetStateBits() & NS_FRAME_OUTSIDE_CHILDREN) {
|
if (f->GetStateBits() & NS_FRAME_OUTSIDE_CHILDREN) {
|
||||||
// Get the property
|
// Get the property
|
||||||
nsRect* overflowArea = f->GetOverflowAreaProperty(aPresContext);
|
nsRect* overflowArea = f->GetOverflowAreaProperty();
|
||||||
|
|
||||||
if (overflowArea) {
|
if (overflowArea) {
|
||||||
// The overflow area is in the child's coordinate space, so translate
|
// The overflow area is in the child's coordinate space, so translate
|
||||||
@ -489,7 +489,7 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat
|
|||||||
// the frame
|
// the frame
|
||||||
if (aKidFrame->GetStateBits() & NS_FRAME_OUTSIDE_CHILDREN) {
|
if (aKidFrame->GetStateBits() & NS_FRAME_OUTSIDE_CHILDREN) {
|
||||||
// Get the property (creating a rect struct if necessary)
|
// Get the property (creating a rect struct if necessary)
|
||||||
nsRect* overflowArea = aKidFrame->GetOverflowAreaProperty(aPresContext, PR_TRUE);
|
nsRect* overflowArea = aKidFrame->GetOverflowAreaProperty(PR_TRUE);
|
||||||
|
|
||||||
NS_ASSERTION(overflowArea, "should have created rect");
|
NS_ASSERTION(overflowArea, "should have created rect");
|
||||||
if (overflowArea) {
|
if (overflowArea) {
|
||||||
|
|||||||
@ -651,7 +651,7 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext,
|
|||||||
mAbsoluteContainer.CalculateChildBounds(aPresContext, childBounds);
|
mAbsoluteContainer.CalculateChildBounds(aPresContext, childBounds);
|
||||||
aMetrics.mOverflowArea.UnionRect(aMetrics.mOverflowArea, childBounds);
|
aMetrics.mOverflowArea.UnionRect(aMetrics.mOverflowArea, childBounds);
|
||||||
|
|
||||||
StoreOverflow(aPresContext, aMetrics);
|
FinishAndStoreOverflow(&aMetrics);
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
@ -911,7 +911,7 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
// Compute our final size
|
// Compute our final size
|
||||||
ComputeFinalSize(aReflowState, state, aMetrics);
|
ComputeFinalSize(aReflowState, state, aMetrics);
|
||||||
StoreOverflow(aPresContext, aMetrics);
|
FinishAndStoreOverflow(&aMetrics);
|
||||||
|
|
||||||
// see if verifyReflow is enabled, and if so store off the space manager pointer
|
// see if verifyReflow is enabled, and if so store off the space manager pointer
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
@ -967,7 +967,7 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext,
|
|||||||
// Factor the absolutely positioned child bounds into the overflow area
|
// Factor the absolutely positioned child bounds into the overflow area
|
||||||
aMetrics.mOverflowArea.UnionRect(aMetrics.mOverflowArea, childBounds);
|
aMetrics.mOverflowArea.UnionRect(aMetrics.mOverflowArea, childBounds);
|
||||||
|
|
||||||
StoreOverflow(aPresContext, aMetrics);
|
FinishAndStoreOverflow(&aMetrics);
|
||||||
}
|
}
|
||||||
// Clear the space manager pointer in the block reflow state so we
|
// Clear the space manager pointer in the block reflow state so we
|
||||||
// don't waste time translating the coordinate system back on a dead
|
// don't waste time translating the coordinate system back on a dead
|
||||||
|
|||||||
@ -772,6 +772,7 @@ nsFrame::SetOverflowClipRect(nsIRenderingContext& aRenderingContext)
|
|||||||
static void RefreshAllContentFrames(nsIFrame* aFrame, nsIContent* aContent)
|
static void RefreshAllContentFrames(nsIFrame* aFrame, nsIContent* aContent)
|
||||||
{
|
{
|
||||||
if (aFrame->GetContent() == aContent) {
|
if (aFrame->GetContent() == aContent) {
|
||||||
|
// XXX is this necessary?
|
||||||
aFrame->Invalidate(aFrame->GetOutlineRect(), PR_FALSE);
|
aFrame->Invalidate(aFrame->GetOutlineRect(), PR_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2506,11 +2507,15 @@ nsIFrame::Invalidate(const nsRect& aDamageRect,
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsRect
|
nsRect
|
||||||
nsIFrame::GetOutlineRect(PRBool* aAnyOutline) const
|
nsIFrame::GetOutlineRect(PRBool* aAnyOutline, nsSize *aUseSize) const
|
||||||
{
|
{
|
||||||
const nsStyleOutline* outline = GetStyleOutline();
|
const nsStyleOutline* outline = GetStyleOutline();
|
||||||
PRUint8 outlineStyle = outline->GetOutlineStyle();
|
PRUint8 outlineStyle = outline->GetOutlineStyle();
|
||||||
nsRect r(0, 0, mRect.width, mRect.height);
|
nsRect r(0, 0, mRect.width, mRect.height);
|
||||||
|
if (aUseSize) {
|
||||||
|
r.width = aUseSize->width;
|
||||||
|
r.height = aUseSize->height;
|
||||||
|
}
|
||||||
PRBool anyOutline = PR_FALSE;
|
PRBool anyOutline = PR_FALSE;
|
||||||
if (outlineStyle != NS_STYLE_BORDER_STYLE_NONE) {
|
if (outlineStyle != NS_STYLE_BORDER_STYLE_NONE) {
|
||||||
nscoord width;
|
nscoord width;
|
||||||
@ -2550,11 +2555,6 @@ nsFrame::CheckInvalidateSizeChange(nsIPresContext* aPresContext,
|
|||||||
// invalidated)
|
// invalidated)
|
||||||
|
|
||||||
// Invalidate the entire old frame+outline if the frame has an outline
|
// Invalidate the entire old frame+outline if the frame has an outline
|
||||||
|
|
||||||
// This assumes 'outline' is painted outside the element, as CSS2 requires.
|
|
||||||
// Currently we actually paint 'outline' inside the element so this code
|
|
||||||
// isn't strictly necessary. But we're trying to get ready to switch to
|
|
||||||
// CSS2 compliance.
|
|
||||||
PRBool anyOutline;
|
PRBool anyOutline;
|
||||||
nsRect r = GetOutlineRect(&anyOutline);
|
nsRect r = GetOutlineRect(&anyOutline);
|
||||||
if (anyOutline) {
|
if (anyOutline) {
|
||||||
@ -4219,14 +4219,13 @@ DestroyRectFunc(nsIPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsRect*
|
nsRect*
|
||||||
nsFrame::GetOverflowAreaProperty(nsIPresContext* aPresContext,
|
nsIFrame::GetOverflowAreaProperty(PRBool aCreateIfNecessary)
|
||||||
PRBool aCreateIfNecessary)
|
|
||||||
{
|
{
|
||||||
if (!((GetStateBits() & NS_FRAME_OUTSIDE_CHILDREN) || aCreateIfNecessary)) {
|
if (!((GetStateBits() & NS_FRAME_OUTSIDE_CHILDREN) || aCreateIfNecessary)) {
|
||||||
return nsnull;
|
return nsnull;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsFrameManager *frameManager = aPresContext->FrameManager();
|
nsFrameManager *frameManager = GetPresContext()->FrameManager();
|
||||||
|
|
||||||
void *value =
|
void *value =
|
||||||
frameManager->GetFrameProperty(this, nsLayoutAtoms::overflowAreaProperty,
|
frameManager->GetFrameProperty(this, nsLayoutAtoms::overflowAreaProperty,
|
||||||
@ -4248,24 +4247,32 @@ nsFrame::GetOverflowAreaProperty(nsIPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsFrame::StoreOverflow(nsIPresContext* aPresContext,
|
nsIFrame::FinishAndStoreOverflow(nsRect* aOverflowArea, nsSize aNewSize)
|
||||||
nsHTMLReflowMetrics& aMetrics)
|
|
||||||
{
|
{
|
||||||
if ((aMetrics.mOverflowArea.x < 0) ||
|
// This is now called FinishAndStoreOverflow() instead of
|
||||||
(aMetrics.mOverflowArea.y < 0) ||
|
// StoreOverflow() because frame-generic ways of adding overflow
|
||||||
(aMetrics.mOverflowArea.XMost() > aMetrics.width) ||
|
// can happen here, e.g. CSS2 outline.
|
||||||
(aMetrics.mOverflowArea.YMost() > aMetrics.height)) {
|
// If we find more things other than outline that need to be added,
|
||||||
|
// we should think about starting a new method like GetAdditionalOverflow()
|
||||||
|
|
||||||
|
PRBool hasOutline;
|
||||||
|
nsRect outlineRect(GetOutlineRect(&hasOutline, &aNewSize));
|
||||||
|
|
||||||
|
if (hasOutline ||
|
||||||
|
(aOverflowArea->x < 0) ||
|
||||||
|
(aOverflowArea->y < 0) ||
|
||||||
|
(aOverflowArea->XMost() > aNewSize.width) ||
|
||||||
|
(aOverflowArea->YMost() > aNewSize.height)) {
|
||||||
mState |= NS_FRAME_OUTSIDE_CHILDREN;
|
mState |= NS_FRAME_OUTSIDE_CHILDREN;
|
||||||
nsRect* overflowArea = GetOverflowAreaProperty(aPresContext, PR_TRUE);
|
nsRect* overflowArea = GetOverflowAreaProperty(PR_TRUE);
|
||||||
NS_ASSERTION(overflowArea, "should have created rect");
|
NS_ASSERTION(overflowArea, "should have created rect");
|
||||||
if (overflowArea) {
|
aOverflowArea->UnionRect(outlineRect, *aOverflowArea);
|
||||||
*overflowArea = aMetrics.mOverflowArea;
|
*overflowArea = *aOverflowArea;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (mState & NS_FRAME_OUTSIDE_CHILDREN) {
|
if (mState & NS_FRAME_OUTSIDE_CHILDREN) {
|
||||||
// remove the previously stored overflow area
|
// remove the previously stored overflow area
|
||||||
aPresContext->FrameManager()->
|
GetPresContext()->FrameManager()->
|
||||||
RemoveFrameProperty(this, nsLayoutAtoms::overflowAreaProperty);
|
RemoveFrameProperty(this, nsLayoutAtoms::overflowAreaProperty);
|
||||||
}
|
}
|
||||||
mState &= ~NS_FRAME_OUTSIDE_CHILDREN;
|
mState &= ~NS_FRAME_OUTSIDE_CHILDREN;
|
||||||
@ -4282,7 +4289,7 @@ nsFrame::ConsiderChildOverflow(nsIPresContext* aPresContext,
|
|||||||
// don't wrap their content into a scrollable frame if overflow is specified
|
// don't wrap their content into a scrollable frame if overflow is specified
|
||||||
if (NS_STYLE_OVERFLOW_HIDDEN != disp->mOverflow &&
|
if (NS_STYLE_OVERFLOW_HIDDEN != disp->mOverflow &&
|
||||||
NS_STYLE_OVERFLOW_SCROLLBARS_NONE != disp->mOverflow) {
|
NS_STYLE_OVERFLOW_SCROLLBARS_NONE != disp->mOverflow) {
|
||||||
nsRect* overflowArea = aChildFrame->GetOverflowAreaProperty(aPresContext);
|
nsRect* overflowArea = aChildFrame->GetOverflowAreaProperty();
|
||||||
if (overflowArea) {
|
if (overflowArea) {
|
||||||
nsRect childOverflow(*overflowArea);
|
nsRect childOverflow(*overflowArea);
|
||||||
childOverflow.MoveBy(aChildFrame->GetPosition());
|
childOverflow.MoveBy(aChildFrame->GetPosition());
|
||||||
@ -5336,7 +5343,7 @@ void nsFrame::DisplayReflowExit(nsIPresContext* aPresContext,
|
|||||||
DR_state->PrettyUC(aMetrics.mOverflowArea.width, width);
|
DR_state->PrettyUC(aMetrics.mOverflowArea.width, width);
|
||||||
DR_state->PrettyUC(aMetrics.mOverflowArea.height, height);
|
DR_state->PrettyUC(aMetrics.mOverflowArea.height, height);
|
||||||
printf("o=(%s,%s) %s x %s", x, y, width, height);
|
printf("o=(%s,%s) %s x %s", x, y, width, height);
|
||||||
nsRect* storedOverflow = aFrame->GetOverflowAreaProperty(aPresContext);
|
nsRect* storedOverflow = aFrame->GetOverflowAreaProperty();
|
||||||
if (storedOverflow) {
|
if (storedOverflow) {
|
||||||
if (aMetrics.mOverflowArea != *storedOverflow) {
|
if (aMetrics.mOverflowArea != *storedOverflow) {
|
||||||
DR_state->PrettyUC(storedOverflow->x, x);
|
DR_state->PrettyUC(storedOverflow->x, x);
|
||||||
|
|||||||
@ -366,17 +366,6 @@ public:
|
|||||||
nsIFrame** aProviderFrame,
|
nsIFrame** aProviderFrame,
|
||||||
PRBool* aIsChild);
|
PRBool* aIsChild);
|
||||||
|
|
||||||
// Return the previously stored overflow area, if the frame does not
|
|
||||||
// overflow and a creation is not requested it will return nsnull
|
|
||||||
virtual nsRect* GetOverflowAreaProperty(nsIPresContext* aPresContext,
|
|
||||||
PRBool aCreateIfNecessary = PR_FALSE);
|
|
||||||
|
|
||||||
// Set/unset the NS_FRAME_OUTSIDE_CHILDREN flag and store the overflow area
|
|
||||||
// as a frame property in the frame manager so that it can be retrieved
|
|
||||||
// later without reflowing the frame.
|
|
||||||
void StoreOverflow(nsIPresContext* aPresContext,
|
|
||||||
nsHTMLReflowMetrics& aMetrics);
|
|
||||||
|
|
||||||
// incorporate the child overflow area into the parent overflow area
|
// incorporate the child overflow area into the parent overflow area
|
||||||
// if the child does not have a overflow use the child area
|
// if the child does not have a overflow use the child area
|
||||||
void ConsiderChildOverflow(nsIPresContext* aPresContext,
|
void ConsiderChildOverflow(nsIPresContext* aPresContext,
|
||||||
|
|||||||
@ -49,6 +49,7 @@
|
|||||||
#include "nsStyleStruct.h"
|
#include "nsStyleStruct.h"
|
||||||
#include "nsStyleContext.h"
|
#include "nsStyleContext.h"
|
||||||
#include "nsIContent.h"
|
#include "nsIContent.h"
|
||||||
|
#include "nsHTMLReflowMetrics.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* New rules of reflow:
|
* New rules of reflow:
|
||||||
@ -69,7 +70,6 @@
|
|||||||
|
|
||||||
struct nsHTMLReflowState;
|
struct nsHTMLReflowState;
|
||||||
class nsHTMLReflowCommand;
|
class nsHTMLReflowCommand;
|
||||||
struct nsHTMLReflowMetrics;
|
|
||||||
|
|
||||||
class nsIAtom;
|
class nsIAtom;
|
||||||
class nsIPresContext;
|
class nsIPresContext;
|
||||||
@ -1029,7 +1029,18 @@ public:
|
|||||||
* @param if nonnull, we record whether this rect is bigger than the frame's bounds
|
* @param if nonnull, we record whether this rect is bigger than the frame's bounds
|
||||||
* @return the rect relative to this frame's origin
|
* @return the rect relative to this frame's origin
|
||||||
*/
|
*/
|
||||||
nsRect GetOutlineRect(PRBool* aAnyOutline = nsnull) const;
|
nsRect GetOutlineRect(PRBool* aAnyOutline = nsnull, nsSize *aUseSize = nsnull) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set/unset the NS_FRAME_OUTSIDE_CHILDREN flag and store the overflow area
|
||||||
|
* as a frame property in the frame manager so that it can be retrieved
|
||||||
|
* later without reflowing the frame.
|
||||||
|
*/
|
||||||
|
void FinishAndStoreOverflow(nsRect* aOverflowArea, nsSize aNewSize);
|
||||||
|
|
||||||
|
void FinishAndStoreOverflow(nsHTMLReflowMetrics* aMetrics) {
|
||||||
|
FinishAndStoreOverflow(&aMetrics->mOverflowArea, nsSize(aMetrics->width, aMetrics->height));
|
||||||
|
}
|
||||||
|
|
||||||
/** Selection related calls
|
/** Selection related calls
|
||||||
*/
|
*/
|
||||||
@ -1207,8 +1218,7 @@ NS_PTR_TO_INT32(frame->GetProperty(nsLayoutAtoms::embeddingLevel))
|
|||||||
* @param aCreateIfNecessary create a new nsRect for the overflow area
|
* @param aCreateIfNecessary create a new nsRect for the overflow area
|
||||||
* @return pointer to the overflow area rectangle
|
* @return pointer to the overflow area rectangle
|
||||||
*/
|
*/
|
||||||
virtual nsRect* GetOverflowAreaProperty(nsIPresContext* aPresContext,
|
nsRect* GetOverflowAreaProperty(PRBool aCreateIfNecessary = PR_FALSE);
|
||||||
PRBool aCreateIfNecessary = PR_FALSE) = 0;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return PR_TRUE if and only if this frame obeys visibility:hidden.
|
* Return PR_TRUE if and only if this frame obeys visibility:hidden.
|
||||||
|
|||||||
@ -1012,6 +1012,7 @@ nsImageFrame::Reflow(nsIPresContext* aPresContext,
|
|||||||
if (aMetrics.mFlags & NS_REFLOW_CALC_MAX_WIDTH) {
|
if (aMetrics.mFlags & NS_REFLOW_CALC_MAX_WIDTH) {
|
||||||
aMetrics.mMaximumWidth = aMetrics.width;
|
aMetrics.mMaximumWidth = aMetrics.width;
|
||||||
}
|
}
|
||||||
|
FinishAndStoreOverflow(&aMetrics);
|
||||||
|
|
||||||
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
||||||
("exit nsImageFrame::Reflow: size=%d,%d",
|
("exit nsImageFrame::Reflow: size=%d,%d",
|
||||||
@ -1331,7 +1332,6 @@ nsImageFrame::Paint(nsIPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
PRBool paintOutline = PR_FALSE;
|
|
||||||
if (NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer && imgCon) {
|
if (NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer && imgCon) {
|
||||||
// Render the image into our content area (the area inside
|
// Render the image into our content area (the area inside
|
||||||
// the borders and padding)
|
// the borders and padding)
|
||||||
@ -1383,7 +1383,6 @@ nsImageFrame::Paint(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
aRenderingContext.DrawImage(imgCon, r, paintArea);
|
aRenderingContext.DrawImage(imgCon, r, paintArea);
|
||||||
}
|
}
|
||||||
paintOutline = PR_TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nsImageMap* map = GetImageMap(aPresContext);
|
nsImageMap* map = GetImageMap(aPresContext);
|
||||||
@ -1396,18 +1395,6 @@ nsImageFrame::Paint(nsIPresContext* aPresContext,
|
|||||||
aRenderingContext.Translate(inner.x, inner.y);
|
aRenderingContext.Translate(inner.x, inner.y);
|
||||||
map->Draw(aPresContext, aRenderingContext);
|
map->Draw(aPresContext, aRenderingContext);
|
||||||
aRenderingContext.PopState();
|
aRenderingContext.PopState();
|
||||||
paintOutline = PR_TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
// paint the outline in the overlay layer (or if there is an image map) until the
|
|
||||||
// general problem of painting it outside the border box is solved.
|
|
||||||
if (paintOutline) {
|
|
||||||
const nsStyleBorder* myBorder = GetStyleBorder();
|
|
||||||
const nsStyleOutline* myOutline = GetStyleOutline();
|
|
||||||
nsRect rect(0, 0, mRect.width, mRect.height);
|
|
||||||
nsCSSRendering::PaintOutline(aPresContext, aRenderingContext, this,
|
|
||||||
aDirtyRect, rect, *myBorder,
|
|
||||||
*myOutline, mStyleContext, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|||||||
@ -1256,15 +1256,7 @@ nsPositionedInlineFrame::Reflow(nsIPresContext* aPresContext,
|
|||||||
mAbsoluteContainer.CalculateChildBounds(aPresContext, childBounds);
|
mAbsoluteContainer.CalculateChildBounds(aPresContext, childBounds);
|
||||||
aDesiredSize.mOverflowArea.UnionRect(aDesiredSize.mOverflowArea, childBounds);
|
aDesiredSize.mOverflowArea.UnionRect(aDesiredSize.mOverflowArea, childBounds);
|
||||||
|
|
||||||
// Make sure the NS_FRAME_OUTSIDE_CHILDREN flag is set correctly
|
FinishAndStoreOverflow(&aDesiredSize);
|
||||||
if ((aDesiredSize.mOverflowArea.x < 0) ||
|
|
||||||
(aDesiredSize.mOverflowArea.y < 0) ||
|
|
||||||
(aDesiredSize.mOverflowArea.XMost() > aDesiredSize.width) ||
|
|
||||||
(aDesiredSize.mOverflowArea.YMost() > aDesiredSize.height)) {
|
|
||||||
mState |= NS_FRAME_OUTSIDE_CHILDREN;
|
|
||||||
} else {
|
|
||||||
mState &= ~NS_FRAME_OUTSIDE_CHILDREN;
|
|
||||||
}
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1302,15 +1294,7 @@ nsPositionedInlineFrame::Reflow(nsIPresContext* aPresContext,
|
|||||||
// Factor the absolutely positioned child bounds into the overflow area
|
// Factor the absolutely positioned child bounds into the overflow area
|
||||||
aDesiredSize.mOverflowArea.UnionRect(aDesiredSize.mOverflowArea, childBounds);
|
aDesiredSize.mOverflowArea.UnionRect(aDesiredSize.mOverflowArea, childBounds);
|
||||||
|
|
||||||
// Make sure the NS_FRAME_OUTSIDE_CHILDREN flag is set correctly
|
FinishAndStoreOverflow(&aDesiredSize);
|
||||||
if ((aDesiredSize.mOverflowArea.x < 0) ||
|
|
||||||
(aDesiredSize.mOverflowArea.y < 0) ||
|
|
||||||
(aDesiredSize.mOverflowArea.XMost() > aDesiredSize.width) ||
|
|
||||||
(aDesiredSize.mOverflowArea.YMost() > aDesiredSize.height)) {
|
|
||||||
mState |= NS_FRAME_OUTSIDE_CHILDREN;
|
|
||||||
} else {
|
|
||||||
mState &= ~NS_FRAME_OUTSIDE_CHILDREN;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
|
|||||||
@ -3005,21 +3005,14 @@ nsLineLayout::RelativePositionFrames(PerSpanData* psd, nsRect& aCombinedArea)
|
|||||||
combinedAreaResult.UnionRect(combinedAreaResult, *r + origin);
|
combinedAreaResult.UnionRect(combinedAreaResult, *r + origin);
|
||||||
}
|
}
|
||||||
|
|
||||||
aCombinedArea = combinedAreaResult;
|
|
||||||
|
|
||||||
// If we just computed a spans combined area, we need to update its
|
// If we just computed a spans combined area, we need to update its
|
||||||
// NS_FRAME_OUTSIDE_CHILDREN bit..
|
// NS_FRAME_OUTSIDE_CHILDREN bit..
|
||||||
if (psd->mFrame) {
|
if (psd->mFrame) {
|
||||||
PerFrameData* spanPFD = psd->mFrame;
|
PerFrameData* spanPFD = psd->mFrame;
|
||||||
nsIFrame* frame = spanPFD->mFrame;
|
nsIFrame* frame = spanPFD->mFrame;
|
||||||
if ((combinedAreaResult.x < 0) || (combinedAreaResult.y < 0) ||
|
frame->FinishAndStoreOverflow(&combinedAreaResult, frame->GetSize());
|
||||||
(combinedAreaResult.XMost() > spanPFD->mBounds.width) ||
|
|
||||||
(combinedAreaResult.YMost() > spanPFD->mBounds.height)) {
|
|
||||||
frame->AddStateBits(NS_FRAME_OUTSIDE_CHILDREN);
|
|
||||||
} else {
|
|
||||||
frame->RemoveStateBits(NS_FRAME_OUTSIDE_CHILDREN);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
aCombinedArea = combinedAreaResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@ -206,7 +206,7 @@ nsAbsoluteContainingBlock::Reflow(nsIFrame* aDelegatingFrame,
|
|||||||
// If the frame has visible overflow, then take it into account, too.
|
// If the frame has visible overflow, then take it into account, too.
|
||||||
if (kidFrame->GetStateBits() & NS_FRAME_OUTSIDE_CHILDREN) {
|
if (kidFrame->GetStateBits() & NS_FRAME_OUTSIDE_CHILDREN) {
|
||||||
// Get the property
|
// Get the property
|
||||||
nsRect* overflowArea = kidFrame->GetOverflowAreaProperty(aPresContext);
|
nsRect* overflowArea = kidFrame->GetOverflowAreaProperty();
|
||||||
|
|
||||||
if (overflowArea) {
|
if (overflowArea) {
|
||||||
// The overflow area is in the child's coordinate space, so translate
|
// The overflow area is in the child's coordinate space, so translate
|
||||||
@ -237,7 +237,7 @@ nsAbsoluteContainingBlock::CalculateChildBounds(nsIPresContext* aPresContext,
|
|||||||
// If the frame has visible overflow, then take it into account, too.
|
// If the frame has visible overflow, then take it into account, too.
|
||||||
if (f->GetStateBits() & NS_FRAME_OUTSIDE_CHILDREN) {
|
if (f->GetStateBits() & NS_FRAME_OUTSIDE_CHILDREN) {
|
||||||
// Get the property
|
// Get the property
|
||||||
nsRect* overflowArea = f->GetOverflowAreaProperty(aPresContext);
|
nsRect* overflowArea = f->GetOverflowAreaProperty();
|
||||||
|
|
||||||
if (overflowArea) {
|
if (overflowArea) {
|
||||||
// The overflow area is in the child's coordinate space, so translate
|
// The overflow area is in the child's coordinate space, so translate
|
||||||
@ -489,7 +489,7 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat
|
|||||||
// the frame
|
// the frame
|
||||||
if (aKidFrame->GetStateBits() & NS_FRAME_OUTSIDE_CHILDREN) {
|
if (aKidFrame->GetStateBits() & NS_FRAME_OUTSIDE_CHILDREN) {
|
||||||
// Get the property (creating a rect struct if necessary)
|
// Get the property (creating a rect struct if necessary)
|
||||||
nsRect* overflowArea = aKidFrame->GetOverflowAreaProperty(aPresContext, PR_TRUE);
|
nsRect* overflowArea = aKidFrame->GetOverflowAreaProperty(PR_TRUE);
|
||||||
|
|
||||||
NS_ASSERTION(overflowArea, "should have created rect");
|
NS_ASSERTION(overflowArea, "should have created rect");
|
||||||
if (overflowArea) {
|
if (overflowArea) {
|
||||||
|
|||||||
@ -651,7 +651,7 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext,
|
|||||||
mAbsoluteContainer.CalculateChildBounds(aPresContext, childBounds);
|
mAbsoluteContainer.CalculateChildBounds(aPresContext, childBounds);
|
||||||
aMetrics.mOverflowArea.UnionRect(aMetrics.mOverflowArea, childBounds);
|
aMetrics.mOverflowArea.UnionRect(aMetrics.mOverflowArea, childBounds);
|
||||||
|
|
||||||
StoreOverflow(aPresContext, aMetrics);
|
FinishAndStoreOverflow(&aMetrics);
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
@ -911,7 +911,7 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
// Compute our final size
|
// Compute our final size
|
||||||
ComputeFinalSize(aReflowState, state, aMetrics);
|
ComputeFinalSize(aReflowState, state, aMetrics);
|
||||||
StoreOverflow(aPresContext, aMetrics);
|
FinishAndStoreOverflow(&aMetrics);
|
||||||
|
|
||||||
// see if verifyReflow is enabled, and if so store off the space manager pointer
|
// see if verifyReflow is enabled, and if so store off the space manager pointer
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
@ -967,7 +967,7 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext,
|
|||||||
// Factor the absolutely positioned child bounds into the overflow area
|
// Factor the absolutely positioned child bounds into the overflow area
|
||||||
aMetrics.mOverflowArea.UnionRect(aMetrics.mOverflowArea, childBounds);
|
aMetrics.mOverflowArea.UnionRect(aMetrics.mOverflowArea, childBounds);
|
||||||
|
|
||||||
StoreOverflow(aPresContext, aMetrics);
|
FinishAndStoreOverflow(&aMetrics);
|
||||||
}
|
}
|
||||||
// Clear the space manager pointer in the block reflow state so we
|
// Clear the space manager pointer in the block reflow state so we
|
||||||
// don't waste time translating the coordinate system back on a dead
|
// don't waste time translating the coordinate system back on a dead
|
||||||
|
|||||||
@ -772,6 +772,7 @@ nsFrame::SetOverflowClipRect(nsIRenderingContext& aRenderingContext)
|
|||||||
static void RefreshAllContentFrames(nsIFrame* aFrame, nsIContent* aContent)
|
static void RefreshAllContentFrames(nsIFrame* aFrame, nsIContent* aContent)
|
||||||
{
|
{
|
||||||
if (aFrame->GetContent() == aContent) {
|
if (aFrame->GetContent() == aContent) {
|
||||||
|
// XXX is this necessary?
|
||||||
aFrame->Invalidate(aFrame->GetOutlineRect(), PR_FALSE);
|
aFrame->Invalidate(aFrame->GetOutlineRect(), PR_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2506,11 +2507,15 @@ nsIFrame::Invalidate(const nsRect& aDamageRect,
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsRect
|
nsRect
|
||||||
nsIFrame::GetOutlineRect(PRBool* aAnyOutline) const
|
nsIFrame::GetOutlineRect(PRBool* aAnyOutline, nsSize *aUseSize) const
|
||||||
{
|
{
|
||||||
const nsStyleOutline* outline = GetStyleOutline();
|
const nsStyleOutline* outline = GetStyleOutline();
|
||||||
PRUint8 outlineStyle = outline->GetOutlineStyle();
|
PRUint8 outlineStyle = outline->GetOutlineStyle();
|
||||||
nsRect r(0, 0, mRect.width, mRect.height);
|
nsRect r(0, 0, mRect.width, mRect.height);
|
||||||
|
if (aUseSize) {
|
||||||
|
r.width = aUseSize->width;
|
||||||
|
r.height = aUseSize->height;
|
||||||
|
}
|
||||||
PRBool anyOutline = PR_FALSE;
|
PRBool anyOutline = PR_FALSE;
|
||||||
if (outlineStyle != NS_STYLE_BORDER_STYLE_NONE) {
|
if (outlineStyle != NS_STYLE_BORDER_STYLE_NONE) {
|
||||||
nscoord width;
|
nscoord width;
|
||||||
@ -2550,11 +2555,6 @@ nsFrame::CheckInvalidateSizeChange(nsIPresContext* aPresContext,
|
|||||||
// invalidated)
|
// invalidated)
|
||||||
|
|
||||||
// Invalidate the entire old frame+outline if the frame has an outline
|
// Invalidate the entire old frame+outline if the frame has an outline
|
||||||
|
|
||||||
// This assumes 'outline' is painted outside the element, as CSS2 requires.
|
|
||||||
// Currently we actually paint 'outline' inside the element so this code
|
|
||||||
// isn't strictly necessary. But we're trying to get ready to switch to
|
|
||||||
// CSS2 compliance.
|
|
||||||
PRBool anyOutline;
|
PRBool anyOutline;
|
||||||
nsRect r = GetOutlineRect(&anyOutline);
|
nsRect r = GetOutlineRect(&anyOutline);
|
||||||
if (anyOutline) {
|
if (anyOutline) {
|
||||||
@ -4219,14 +4219,13 @@ DestroyRectFunc(nsIPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsRect*
|
nsRect*
|
||||||
nsFrame::GetOverflowAreaProperty(nsIPresContext* aPresContext,
|
nsIFrame::GetOverflowAreaProperty(PRBool aCreateIfNecessary)
|
||||||
PRBool aCreateIfNecessary)
|
|
||||||
{
|
{
|
||||||
if (!((GetStateBits() & NS_FRAME_OUTSIDE_CHILDREN) || aCreateIfNecessary)) {
|
if (!((GetStateBits() & NS_FRAME_OUTSIDE_CHILDREN) || aCreateIfNecessary)) {
|
||||||
return nsnull;
|
return nsnull;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsFrameManager *frameManager = aPresContext->FrameManager();
|
nsFrameManager *frameManager = GetPresContext()->FrameManager();
|
||||||
|
|
||||||
void *value =
|
void *value =
|
||||||
frameManager->GetFrameProperty(this, nsLayoutAtoms::overflowAreaProperty,
|
frameManager->GetFrameProperty(this, nsLayoutAtoms::overflowAreaProperty,
|
||||||
@ -4248,24 +4247,32 @@ nsFrame::GetOverflowAreaProperty(nsIPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsFrame::StoreOverflow(nsIPresContext* aPresContext,
|
nsIFrame::FinishAndStoreOverflow(nsRect* aOverflowArea, nsSize aNewSize)
|
||||||
nsHTMLReflowMetrics& aMetrics)
|
|
||||||
{
|
{
|
||||||
if ((aMetrics.mOverflowArea.x < 0) ||
|
// This is now called FinishAndStoreOverflow() instead of
|
||||||
(aMetrics.mOverflowArea.y < 0) ||
|
// StoreOverflow() because frame-generic ways of adding overflow
|
||||||
(aMetrics.mOverflowArea.XMost() > aMetrics.width) ||
|
// can happen here, e.g. CSS2 outline.
|
||||||
(aMetrics.mOverflowArea.YMost() > aMetrics.height)) {
|
// If we find more things other than outline that need to be added,
|
||||||
|
// we should think about starting a new method like GetAdditionalOverflow()
|
||||||
|
|
||||||
|
PRBool hasOutline;
|
||||||
|
nsRect outlineRect(GetOutlineRect(&hasOutline, &aNewSize));
|
||||||
|
|
||||||
|
if (hasOutline ||
|
||||||
|
(aOverflowArea->x < 0) ||
|
||||||
|
(aOverflowArea->y < 0) ||
|
||||||
|
(aOverflowArea->XMost() > aNewSize.width) ||
|
||||||
|
(aOverflowArea->YMost() > aNewSize.height)) {
|
||||||
mState |= NS_FRAME_OUTSIDE_CHILDREN;
|
mState |= NS_FRAME_OUTSIDE_CHILDREN;
|
||||||
nsRect* overflowArea = GetOverflowAreaProperty(aPresContext, PR_TRUE);
|
nsRect* overflowArea = GetOverflowAreaProperty(PR_TRUE);
|
||||||
NS_ASSERTION(overflowArea, "should have created rect");
|
NS_ASSERTION(overflowArea, "should have created rect");
|
||||||
if (overflowArea) {
|
aOverflowArea->UnionRect(outlineRect, *aOverflowArea);
|
||||||
*overflowArea = aMetrics.mOverflowArea;
|
*overflowArea = *aOverflowArea;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (mState & NS_FRAME_OUTSIDE_CHILDREN) {
|
if (mState & NS_FRAME_OUTSIDE_CHILDREN) {
|
||||||
// remove the previously stored overflow area
|
// remove the previously stored overflow area
|
||||||
aPresContext->FrameManager()->
|
GetPresContext()->FrameManager()->
|
||||||
RemoveFrameProperty(this, nsLayoutAtoms::overflowAreaProperty);
|
RemoveFrameProperty(this, nsLayoutAtoms::overflowAreaProperty);
|
||||||
}
|
}
|
||||||
mState &= ~NS_FRAME_OUTSIDE_CHILDREN;
|
mState &= ~NS_FRAME_OUTSIDE_CHILDREN;
|
||||||
@ -4282,7 +4289,7 @@ nsFrame::ConsiderChildOverflow(nsIPresContext* aPresContext,
|
|||||||
// don't wrap their content into a scrollable frame if overflow is specified
|
// don't wrap their content into a scrollable frame if overflow is specified
|
||||||
if (NS_STYLE_OVERFLOW_HIDDEN != disp->mOverflow &&
|
if (NS_STYLE_OVERFLOW_HIDDEN != disp->mOverflow &&
|
||||||
NS_STYLE_OVERFLOW_SCROLLBARS_NONE != disp->mOverflow) {
|
NS_STYLE_OVERFLOW_SCROLLBARS_NONE != disp->mOverflow) {
|
||||||
nsRect* overflowArea = aChildFrame->GetOverflowAreaProperty(aPresContext);
|
nsRect* overflowArea = aChildFrame->GetOverflowAreaProperty();
|
||||||
if (overflowArea) {
|
if (overflowArea) {
|
||||||
nsRect childOverflow(*overflowArea);
|
nsRect childOverflow(*overflowArea);
|
||||||
childOverflow.MoveBy(aChildFrame->GetPosition());
|
childOverflow.MoveBy(aChildFrame->GetPosition());
|
||||||
@ -5336,7 +5343,7 @@ void nsFrame::DisplayReflowExit(nsIPresContext* aPresContext,
|
|||||||
DR_state->PrettyUC(aMetrics.mOverflowArea.width, width);
|
DR_state->PrettyUC(aMetrics.mOverflowArea.width, width);
|
||||||
DR_state->PrettyUC(aMetrics.mOverflowArea.height, height);
|
DR_state->PrettyUC(aMetrics.mOverflowArea.height, height);
|
||||||
printf("o=(%s,%s) %s x %s", x, y, width, height);
|
printf("o=(%s,%s) %s x %s", x, y, width, height);
|
||||||
nsRect* storedOverflow = aFrame->GetOverflowAreaProperty(aPresContext);
|
nsRect* storedOverflow = aFrame->GetOverflowAreaProperty();
|
||||||
if (storedOverflow) {
|
if (storedOverflow) {
|
||||||
if (aMetrics.mOverflowArea != *storedOverflow) {
|
if (aMetrics.mOverflowArea != *storedOverflow) {
|
||||||
DR_state->PrettyUC(storedOverflow->x, x);
|
DR_state->PrettyUC(storedOverflow->x, x);
|
||||||
|
|||||||
@ -366,17 +366,6 @@ public:
|
|||||||
nsIFrame** aProviderFrame,
|
nsIFrame** aProviderFrame,
|
||||||
PRBool* aIsChild);
|
PRBool* aIsChild);
|
||||||
|
|
||||||
// Return the previously stored overflow area, if the frame does not
|
|
||||||
// overflow and a creation is not requested it will return nsnull
|
|
||||||
virtual nsRect* GetOverflowAreaProperty(nsIPresContext* aPresContext,
|
|
||||||
PRBool aCreateIfNecessary = PR_FALSE);
|
|
||||||
|
|
||||||
// Set/unset the NS_FRAME_OUTSIDE_CHILDREN flag and store the overflow area
|
|
||||||
// as a frame property in the frame manager so that it can be retrieved
|
|
||||||
// later without reflowing the frame.
|
|
||||||
void StoreOverflow(nsIPresContext* aPresContext,
|
|
||||||
nsHTMLReflowMetrics& aMetrics);
|
|
||||||
|
|
||||||
// incorporate the child overflow area into the parent overflow area
|
// incorporate the child overflow area into the parent overflow area
|
||||||
// if the child does not have a overflow use the child area
|
// if the child does not have a overflow use the child area
|
||||||
void ConsiderChildOverflow(nsIPresContext* aPresContext,
|
void ConsiderChildOverflow(nsIPresContext* aPresContext,
|
||||||
|
|||||||
@ -1012,6 +1012,7 @@ nsImageFrame::Reflow(nsIPresContext* aPresContext,
|
|||||||
if (aMetrics.mFlags & NS_REFLOW_CALC_MAX_WIDTH) {
|
if (aMetrics.mFlags & NS_REFLOW_CALC_MAX_WIDTH) {
|
||||||
aMetrics.mMaximumWidth = aMetrics.width;
|
aMetrics.mMaximumWidth = aMetrics.width;
|
||||||
}
|
}
|
||||||
|
FinishAndStoreOverflow(&aMetrics);
|
||||||
|
|
||||||
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
||||||
("exit nsImageFrame::Reflow: size=%d,%d",
|
("exit nsImageFrame::Reflow: size=%d,%d",
|
||||||
@ -1331,7 +1332,6 @@ nsImageFrame::Paint(nsIPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
PRBool paintOutline = PR_FALSE;
|
|
||||||
if (NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer && imgCon) {
|
if (NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer && imgCon) {
|
||||||
// Render the image into our content area (the area inside
|
// Render the image into our content area (the area inside
|
||||||
// the borders and padding)
|
// the borders and padding)
|
||||||
@ -1383,7 +1383,6 @@ nsImageFrame::Paint(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
aRenderingContext.DrawImage(imgCon, r, paintArea);
|
aRenderingContext.DrawImage(imgCon, r, paintArea);
|
||||||
}
|
}
|
||||||
paintOutline = PR_TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nsImageMap* map = GetImageMap(aPresContext);
|
nsImageMap* map = GetImageMap(aPresContext);
|
||||||
@ -1396,18 +1395,6 @@ nsImageFrame::Paint(nsIPresContext* aPresContext,
|
|||||||
aRenderingContext.Translate(inner.x, inner.y);
|
aRenderingContext.Translate(inner.x, inner.y);
|
||||||
map->Draw(aPresContext, aRenderingContext);
|
map->Draw(aPresContext, aRenderingContext);
|
||||||
aRenderingContext.PopState();
|
aRenderingContext.PopState();
|
||||||
paintOutline = PR_TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
// paint the outline in the overlay layer (or if there is an image map) until the
|
|
||||||
// general problem of painting it outside the border box is solved.
|
|
||||||
if (paintOutline) {
|
|
||||||
const nsStyleBorder* myBorder = GetStyleBorder();
|
|
||||||
const nsStyleOutline* myOutline = GetStyleOutline();
|
|
||||||
nsRect rect(0, 0, mRect.width, mRect.height);
|
|
||||||
nsCSSRendering::PaintOutline(aPresContext, aRenderingContext, this,
|
|
||||||
aDirtyRect, rect, *myBorder,
|
|
||||||
*myOutline, mStyleContext, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|||||||
@ -1256,15 +1256,7 @@ nsPositionedInlineFrame::Reflow(nsIPresContext* aPresContext,
|
|||||||
mAbsoluteContainer.CalculateChildBounds(aPresContext, childBounds);
|
mAbsoluteContainer.CalculateChildBounds(aPresContext, childBounds);
|
||||||
aDesiredSize.mOverflowArea.UnionRect(aDesiredSize.mOverflowArea, childBounds);
|
aDesiredSize.mOverflowArea.UnionRect(aDesiredSize.mOverflowArea, childBounds);
|
||||||
|
|
||||||
// Make sure the NS_FRAME_OUTSIDE_CHILDREN flag is set correctly
|
FinishAndStoreOverflow(&aDesiredSize);
|
||||||
if ((aDesiredSize.mOverflowArea.x < 0) ||
|
|
||||||
(aDesiredSize.mOverflowArea.y < 0) ||
|
|
||||||
(aDesiredSize.mOverflowArea.XMost() > aDesiredSize.width) ||
|
|
||||||
(aDesiredSize.mOverflowArea.YMost() > aDesiredSize.height)) {
|
|
||||||
mState |= NS_FRAME_OUTSIDE_CHILDREN;
|
|
||||||
} else {
|
|
||||||
mState &= ~NS_FRAME_OUTSIDE_CHILDREN;
|
|
||||||
}
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1302,15 +1294,7 @@ nsPositionedInlineFrame::Reflow(nsIPresContext* aPresContext,
|
|||||||
// Factor the absolutely positioned child bounds into the overflow area
|
// Factor the absolutely positioned child bounds into the overflow area
|
||||||
aDesiredSize.mOverflowArea.UnionRect(aDesiredSize.mOverflowArea, childBounds);
|
aDesiredSize.mOverflowArea.UnionRect(aDesiredSize.mOverflowArea, childBounds);
|
||||||
|
|
||||||
// Make sure the NS_FRAME_OUTSIDE_CHILDREN flag is set correctly
|
FinishAndStoreOverflow(&aDesiredSize);
|
||||||
if ((aDesiredSize.mOverflowArea.x < 0) ||
|
|
||||||
(aDesiredSize.mOverflowArea.y < 0) ||
|
|
||||||
(aDesiredSize.mOverflowArea.XMost() > aDesiredSize.width) ||
|
|
||||||
(aDesiredSize.mOverflowArea.YMost() > aDesiredSize.height)) {
|
|
||||||
mState |= NS_FRAME_OUTSIDE_CHILDREN;
|
|
||||||
} else {
|
|
||||||
mState &= ~NS_FRAME_OUTSIDE_CHILDREN;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
|
|||||||
@ -3005,21 +3005,14 @@ nsLineLayout::RelativePositionFrames(PerSpanData* psd, nsRect& aCombinedArea)
|
|||||||
combinedAreaResult.UnionRect(combinedAreaResult, *r + origin);
|
combinedAreaResult.UnionRect(combinedAreaResult, *r + origin);
|
||||||
}
|
}
|
||||||
|
|
||||||
aCombinedArea = combinedAreaResult;
|
|
||||||
|
|
||||||
// If we just computed a spans combined area, we need to update its
|
// If we just computed a spans combined area, we need to update its
|
||||||
// NS_FRAME_OUTSIDE_CHILDREN bit..
|
// NS_FRAME_OUTSIDE_CHILDREN bit..
|
||||||
if (psd->mFrame) {
|
if (psd->mFrame) {
|
||||||
PerFrameData* spanPFD = psd->mFrame;
|
PerFrameData* spanPFD = psd->mFrame;
|
||||||
nsIFrame* frame = spanPFD->mFrame;
|
nsIFrame* frame = spanPFD->mFrame;
|
||||||
if ((combinedAreaResult.x < 0) || (combinedAreaResult.y < 0) ||
|
frame->FinishAndStoreOverflow(&combinedAreaResult, frame->GetSize());
|
||||||
(combinedAreaResult.XMost() > spanPFD->mBounds.width) ||
|
|
||||||
(combinedAreaResult.YMost() > spanPFD->mBounds.height)) {
|
|
||||||
frame->AddStateBits(NS_FRAME_OUTSIDE_CHILDREN);
|
|
||||||
} else {
|
|
||||||
frame->RemoveStateBits(NS_FRAME_OUTSIDE_CHILDREN);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
aCombinedArea = combinedAreaResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@ -908,7 +908,8 @@ IncrementalReflow::Dispatch(nsIPresContext *aPresContext,
|
|||||||
|
|
||||||
first->SetSize(nsSize(aDesiredSize.width, aDesiredSize.height));
|
first->SetSize(nsSize(aDesiredSize.width, aDesiredSize.height));
|
||||||
|
|
||||||
nsContainerFrame::SyncFrameViewAfterReflow(aPresContext, first, first->GetView(), nsnull);
|
nsContainerFrame::SyncFrameViewAfterReflow(aPresContext, first, first->GetView(),
|
||||||
|
&aDesiredSize.mOverflowArea);
|
||||||
|
|
||||||
first->DidReflow(aPresContext, nsnull, NS_FRAME_REFLOW_FINISHED);
|
first->DidReflow(aPresContext, nsnull, NS_FRAME_REFLOW_FINISHED);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -601,7 +601,8 @@ nsFieldSetFrame::Reflow(nsIPresContext* aPresContext,
|
|||||||
ConsiderChildOverflow(aPresContext, aDesiredSize.mOverflowArea, mLegendFrame);
|
ConsiderChildOverflow(aPresContext, aDesiredSize.mOverflowArea, mLegendFrame);
|
||||||
if (mContentFrame)
|
if (mContentFrame)
|
||||||
ConsiderChildOverflow(aPresContext, aDesiredSize.mOverflowArea, mContentFrame);
|
ConsiderChildOverflow(aPresContext, aDesiredSize.mOverflowArea, mContentFrame);
|
||||||
StoreOverflow(aPresContext, aDesiredSize);
|
FinishAndStoreOverflow(&aDesiredSize);
|
||||||
|
|
||||||
#ifdef NOISY_REFLOW
|
#ifdef NOISY_REFLOW
|
||||||
printf("FIELDSET: w=%d, maxWidth=%d, MEW=%d\n",
|
printf("FIELDSET: w=%d, maxWidth=%d, MEW=%d\n",
|
||||||
aDesiredSize.width, aDesiredSize.mMaximumWidth,
|
aDesiredSize.width, aDesiredSize.mMaximumWidth,
|
||||||
|
|||||||
@ -2093,39 +2093,17 @@ nscoord width;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// This if control whether the outline paints on the inside
|
|
||||||
// or outside of the frame
|
|
||||||
// XXX This is temporary fix for nsbeta3+ Bug 48973
|
|
||||||
// so we can use "mozoutline
|
|
||||||
#if 0 // outside
|
|
||||||
nsRect inside(aBorderArea);
|
nsRect inside(aBorderArea);
|
||||||
nsRect outside(inside);
|
nsRect outside(inside);
|
||||||
inside.Inflate(width, width);
|
outside.Inflate(width, width);
|
||||||
|
|
||||||
nsRect clipRect(aBorderArea);
|
nsRect clipRect(aBorderArea);
|
||||||
clipRect.Inflate(width, width); // make clip extra big for now
|
clipRect.Inflate(width, width); // make clip extra big for now
|
||||||
|
|
||||||
#else // inside
|
|
||||||
nsMargin borderWidth;
|
|
||||||
aBorderStyle.GetBorder(borderWidth);
|
|
||||||
|
|
||||||
nsRect outside(aBorderArea);
|
|
||||||
outside.Deflate(borderWidth);
|
|
||||||
nsRect inside(outside);
|
|
||||||
inside.Deflate(width, width);
|
|
||||||
|
|
||||||
nsRect clipRect(outside);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
aRenderingContext.PushState();
|
|
||||||
aRenderingContext.SetClipRect(clipRect, nsClipCombine_kReplace);
|
|
||||||
|
|
||||||
// rounded version of the border
|
// rounded version of the border
|
||||||
for(i=0;i<4;i++){
|
for(i=0;i<4;i++){
|
||||||
if(borderRadii[i] > 0){
|
if(borderRadii[i] > 0){
|
||||||
PaintRoundedBorder(aPresContext,aRenderingContext,aForFrame,aDirtyRect,aBorderArea,nsnull,&aOutlineStyle,aStyleContext,aSkipSides,borderRadii,aGap,PR_TRUE);
|
PaintRoundedBorder(aPresContext,aRenderingContext,aForFrame,aDirtyRect,aBorderArea,nsnull,&aOutlineStyle,aStyleContext,aSkipSides,borderRadii,aGap,PR_TRUE);
|
||||||
aRenderingContext.PopState();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2137,7 +2115,6 @@ nscoord width;
|
|||||||
(outlineStyle == NS_STYLE_BORDER_STYLE_DASHED)) {
|
(outlineStyle == NS_STYLE_BORDER_STYLE_DASHED)) {
|
||||||
DrawDashedSides(0, aRenderingContext, aDirtyRect, ourColor, nsnull, &aOutlineStyle, PR_TRUE,
|
DrawDashedSides(0, aRenderingContext, aDirtyRect, ourColor, nsnull, &aOutlineStyle, PR_TRUE,
|
||||||
outside, inside, aSkipSides, aGap);
|
outside, inside, aSkipSides, aGap);
|
||||||
aRenderingContext.PopState();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2192,8 +2169,6 @@ nscoord width;
|
|||||||
aRenderingContext.SetPenMode(nsPenMode_kNone);
|
aRenderingContext.SetPenMode(nsPenMode_kNone);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Restore clipping
|
|
||||||
aRenderingContext.PopState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* draw the edges of the border described in aBorderEdges one segment at a time.
|
/* draw the edges of the border described in aBorderEdges one segment at a time.
|
||||||
|
|||||||
@ -598,7 +598,7 @@ void nsTableCellFrame::VerticallyAlignChild(nsIPresContext* aPresContex
|
|||||||
desiredSize.height = mRect.height;
|
desiredSize.height = mRect.height;
|
||||||
desiredSize.mOverflowArea = nsRect(0, 0, mRect.width, mRect.height);
|
desiredSize.mOverflowArea = nsRect(0, 0, mRect.width, mRect.height);
|
||||||
ConsiderChildOverflow(aPresContext, desiredSize.mOverflowArea, firstKid);
|
ConsiderChildOverflow(aPresContext, desiredSize.mOverflowArea, firstKid);
|
||||||
StoreOverflow(aPresContext, desiredSize);
|
FinishAndStoreOverflow(&desiredSize);
|
||||||
if (kidYTop != kidRect.y) {
|
if (kidYTop != kidRect.y) {
|
||||||
// Make sure any child views are correctly positioned. We know the inner table
|
// Make sure any child views are correctly positioned. We know the inner table
|
||||||
// cell won't have a view
|
// cell won't have a view
|
||||||
|
|||||||
@ -2098,20 +2098,20 @@ NS_METHOD nsTableFrame::Reflow(nsIPresContext* aPresContext,
|
|||||||
nsRect damage(0, 0, PR_MAX(mRect.width, aDesiredSize.width),
|
nsRect damage(0, 0, PR_MAX(mRect.width, aDesiredSize.width),
|
||||||
PR_MAX(mRect.height, aDesiredSize.height));
|
PR_MAX(mRect.height, aDesiredSize.height));
|
||||||
damage.UnionRect(damage, aDesiredSize.mOverflowArea);
|
damage.UnionRect(damage, aDesiredSize.mOverflowArea);
|
||||||
nsRect* oldOverflowArea = GetOverflowAreaProperty(aPresContext);
|
nsRect* oldOverflowArea = GetOverflowAreaProperty();
|
||||||
if (oldOverflowArea) {
|
if (oldOverflowArea) {
|
||||||
damage.UnionRect(damage, *oldOverflowArea);
|
damage.UnionRect(damage, *oldOverflowArea);
|
||||||
}
|
}
|
||||||
Invalidate(damage);
|
Invalidate(damage);
|
||||||
} else {
|
} else {
|
||||||
// use the old overflow area
|
// use the old overflow area
|
||||||
nsRect* oldOverflowArea = GetOverflowAreaProperty(aPresContext);
|
nsRect* oldOverflowArea = GetOverflowAreaProperty();
|
||||||
if (oldOverflowArea) {
|
if (oldOverflowArea) {
|
||||||
aDesiredSize.mOverflowArea.UnionRect(aDesiredSize.mOverflowArea, *oldOverflowArea);
|
aDesiredSize.mOverflowArea.UnionRect(aDesiredSize.mOverflowArea, *oldOverflowArea);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
StoreOverflow(aPresContext, aDesiredSize);
|
FinishAndStoreOverflow(&aDesiredSize);
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
@ -3007,7 +3007,8 @@ nsTableFrame::IR_TargetIsChild(nsIPresContext* aPresContext,
|
|||||||
for (nsIFrame* kidFrame = mFrames.FirstChild(); kidFrame; kidFrame = kidFrame->GetNextSibling()) {
|
for (nsIFrame* kidFrame = mFrames.FirstChild(); kidFrame; kidFrame = kidFrame->GetNextSibling()) {
|
||||||
ConsiderChildOverflow(aPresContext, desiredSize.mOverflowArea, kidFrame);
|
ConsiderChildOverflow(aPresContext, desiredSize.mOverflowArea, kidFrame);
|
||||||
}
|
}
|
||||||
StoreOverflow(aPresContext, desiredSize);
|
FinishAndStoreOverflow(&desiredSize.mOverflowArea,
|
||||||
|
nsSize(desiredSize.width, desiredSize.height));
|
||||||
}
|
}
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
@ -3489,13 +3490,15 @@ void ResizeCells(nsTableFrame& aTableFrame,
|
|||||||
rgFrame->ConsiderChildOverflow(aPresContext, groupDesiredSize.mOverflowArea, rowFrame);
|
rgFrame->ConsiderChildOverflow(aPresContext, groupDesiredSize.mOverflowArea, rowFrame);
|
||||||
rowFrame = rowFrame->GetNextRow();
|
rowFrame = rowFrame->GetNextRow();
|
||||||
}
|
}
|
||||||
rgFrame->StoreOverflow(aPresContext, groupDesiredSize);
|
rgFrame->FinishAndStoreOverflow(&groupDesiredSize.mOverflowArea,
|
||||||
|
nsSize(groupDesiredSize.width, groupDesiredSize.height));
|
||||||
// make the coordinates of |desiredSize.mOverflowArea| incorrect
|
// make the coordinates of |desiredSize.mOverflowArea| incorrect
|
||||||
// since it's about to go away:
|
// since it's about to go away:
|
||||||
groupDesiredSize.mOverflowArea.MoveBy(rgFrame->GetPosition());
|
groupDesiredSize.mOverflowArea.MoveBy(rgFrame->GetPosition());
|
||||||
tableDesiredSize.mOverflowArea.UnionRect(tableDesiredSize.mOverflowArea, groupDesiredSize.mOverflowArea);
|
tableDesiredSize.mOverflowArea.UnionRect(tableDesiredSize.mOverflowArea, groupDesiredSize.mOverflowArea);
|
||||||
}
|
}
|
||||||
aTableFrame.StoreOverflow(aPresContext, tableDesiredSize);
|
aTableFrame.FinishAndStoreOverflow(&tableDesiredSize.mOverflowArea,
|
||||||
|
nsSize(tableDesiredSize.width, tableDesiredSize.height));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@ -556,7 +556,7 @@ nsTableOuterFrame::InvalidateDamage(nsIPresContext* aPresContext,
|
|||||||
if (aOldOverflowArea) {
|
if (aOldOverflowArea) {
|
||||||
damage.UnionRect(damage, *aOldOverflowArea);
|
damage.UnionRect(damage, *aOldOverflowArea);
|
||||||
}
|
}
|
||||||
nsRect* overflowArea = GetOverflowAreaProperty(aPresContext);
|
nsRect* overflowArea = GetOverflowAreaProperty();
|
||||||
if (overflowArea) {
|
if (overflowArea) {
|
||||||
damage.UnionRect(damage, *overflowArea);
|
damage.UnionRect(damage, *overflowArea);
|
||||||
}
|
}
|
||||||
@ -1370,7 +1370,7 @@ nsTableOuterFrame::UpdateReflowMetrics(nsIPresContext* aPresContext,
|
|||||||
if (mCaptionFrame) {
|
if (mCaptionFrame) {
|
||||||
ConsiderChildOverflow(aPresContext, aMet.mOverflowArea, mCaptionFrame);
|
ConsiderChildOverflow(aPresContext, aMet.mOverflowArea, mCaptionFrame);
|
||||||
}
|
}
|
||||||
StoreOverflow(aPresContext, aMet);
|
FinishAndStoreOverflow(&aMet);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
@ -1541,7 +1541,7 @@ nsTableOuterFrame::IR_TargetIsCaptionFrame(nsIPresContext* aPresContex
|
|||||||
|
|
||||||
rv = FinishReflowChild(mCaptionFrame, aPresContext, nsnull, captionMet,
|
rv = FinishReflowChild(mCaptionFrame, aPresContext, nsnull, captionMet,
|
||||||
captionOrigin.x, captionOrigin.y, 0);
|
captionOrigin.x, captionOrigin.y, 0);
|
||||||
nsRect* oldOverflowArea = GetOverflowAreaProperty(aPresContext);
|
nsRect* oldOverflowArea = GetOverflowAreaProperty();
|
||||||
nsRect* overflowStorage = nsnull;
|
nsRect* overflowStorage = nsnull;
|
||||||
nsRect overflow;
|
nsRect overflow;
|
||||||
if (oldOverflowArea) {
|
if (oldOverflowArea) {
|
||||||
@ -1599,7 +1599,7 @@ nsTableOuterFrame::IR_ReflowDirty(nsIPresContext* aPresContext,
|
|||||||
aDesiredSize.height = innerRect.YMost() + innerMargin.bottom;
|
aDesiredSize.height = innerRect.YMost() + innerMargin.bottom;
|
||||||
sizeSet = PR_TRUE;
|
sizeSet = PR_TRUE;
|
||||||
// Repaint the inner's entire bounds if it moved
|
// Repaint the inner's entire bounds if it moved
|
||||||
nsRect* oldOverflowArea = GetOverflowAreaProperty(aPresContext);
|
nsRect* oldOverflowArea = GetOverflowAreaProperty();
|
||||||
PRBool innerMoved = (innerRect.x != innerOrigin.x) ||
|
PRBool innerMoved = (innerRect.x != innerOrigin.x) ||
|
||||||
(innerRect.y != innerOrigin.y);
|
(innerRect.y != innerOrigin.y);
|
||||||
nsSize desSize(aDesiredSize.width, aDesiredSize.height);
|
nsSize desSize(aDesiredSize.width, aDesiredSize.height);
|
||||||
@ -1763,7 +1763,7 @@ nsTableOuterFrame::IR_InnerTableReflow(nsIPresContext* aPresContext,
|
|||||||
if (aOuterMet.mComputeMEW) {
|
if (aOuterMet.mComputeMEW) {
|
||||||
aOuterMet.mMaxElementWidth = innerMet.mMaxElementWidth;
|
aOuterMet.mMaxElementWidth = innerMet.mMaxElementWidth;
|
||||||
}
|
}
|
||||||
nsRect* oldOverflowArea = GetOverflowAreaProperty(aPresContext);
|
nsRect* oldOverflowArea = GetOverflowAreaProperty();
|
||||||
nsRect* overflowStorage = nsnull;
|
nsRect* overflowStorage = nsnull;
|
||||||
nsRect overflow;
|
nsRect overflow;
|
||||||
if (oldOverflowArea) {
|
if (oldOverflowArea) {
|
||||||
@ -1854,7 +1854,7 @@ nsTableOuterFrame::IR_CaptionInserted(nsIPresContext* aPresContext,
|
|||||||
rv = FinishReflowChild(mCaptionFrame, aPresContext, nsnull, captionMet,
|
rv = FinishReflowChild(mCaptionFrame, aPresContext, nsnull, captionMet,
|
||||||
captionOrigin.x, captionOrigin.y, 0);
|
captionOrigin.x, captionOrigin.y, 0);
|
||||||
|
|
||||||
nsRect* oldOverflowArea = GetOverflowAreaProperty(aPresContext);
|
nsRect* oldOverflowArea = GetOverflowAreaProperty();
|
||||||
nsRect* overflowStorage = nsnull;
|
nsRect* overflowStorage = nsnull;
|
||||||
nsRect overflow;
|
nsRect overflow;
|
||||||
if (oldOverflowArea) {
|
if (oldOverflowArea) {
|
||||||
|
|||||||
@ -398,7 +398,7 @@ nsTableRowFrame::DidResize(nsIPresContext* aPresContext,
|
|||||||
// Get the next child
|
// Get the next child
|
||||||
childFrame = iter.Next();
|
childFrame = iter.Next();
|
||||||
}
|
}
|
||||||
StoreOverflow(aPresContext, desiredSize);
|
FinishAndStoreOverflow(&desiredSize);
|
||||||
if (HasView()) {
|
if (HasView()) {
|
||||||
nsContainerFrame::SyncFrameViewAfterReflow(aPresContext, this, GetView(), &desiredSize.mOverflowArea, 0);
|
nsContainerFrame::SyncFrameViewAfterReflow(aPresContext, this, GetView(), &desiredSize.mOverflowArea, 0);
|
||||||
}
|
}
|
||||||
@ -985,7 +985,7 @@ nsTableRowFrame::ReflowChildren(nsIPresContext* aPresContext,
|
|||||||
desiredSize.width = cellDesiredSize.width;
|
desiredSize.width = cellDesiredSize.width;
|
||||||
desiredSize.height = cellDesiredSize.height;
|
desiredSize.height = cellDesiredSize.height;
|
||||||
nsRect *overflowArea =
|
nsRect *overflowArea =
|
||||||
cellFrame->GetOverflowAreaProperty(aPresContext);
|
cellFrame->GetOverflowAreaProperty();
|
||||||
if (overflowArea)
|
if (overflowArea)
|
||||||
desiredSize.mOverflowArea = *overflowArea;
|
desiredSize.mOverflowArea = *overflowArea;
|
||||||
else
|
else
|
||||||
@ -1084,7 +1084,7 @@ nsTableRowFrame::ReflowChildren(nsIPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
nsRect rowRect(0, 0, aDesiredSize.width, aDesiredSize.height);
|
nsRect rowRect(0, 0, aDesiredSize.width, aDesiredSize.height);
|
||||||
aDesiredSize.mOverflowArea.UnionRect(aDesiredSize.mOverflowArea, rowRect);
|
aDesiredSize.mOverflowArea.UnionRect(aDesiredSize.mOverflowArea, rowRect);
|
||||||
StoreOverflow(aPresContext, aDesiredSize);
|
FinishAndStoreOverflow(&aDesiredSize);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1318,7 +1318,7 @@ nsTableRowFrame::IR_TargetIsChild(nsIPresContext* aPresContext,
|
|||||||
nsIFrame* cellKidFrame = cellFrame->GetFirstChild(nsnull);
|
nsIFrame* cellKidFrame = cellFrame->GetFirstChild(nsnull);
|
||||||
if (cellKidFrame) {
|
if (cellKidFrame) {
|
||||||
cellFrame->ConsiderChildOverflow(aPresContext, cellMet.mOverflowArea, cellKidFrame);
|
cellFrame->ConsiderChildOverflow(aPresContext, cellMet.mOverflowArea, cellKidFrame);
|
||||||
cellFrame->StoreOverflow(aPresContext, cellMet);
|
cellFrame->FinishAndStoreOverflow(&cellMet);
|
||||||
if (cellFrame->HasView()) {
|
if (cellFrame->HasView()) {
|
||||||
nsContainerFrame::SyncFrameViewAfterReflow(aPresContext, cellFrame, cellFrame->GetView(), &cellMet.mOverflowArea, 0);
|
nsContainerFrame::SyncFrameViewAfterReflow(aPresContext, cellFrame, cellFrame->GetView(), &cellMet.mOverflowArea, 0);
|
||||||
}
|
}
|
||||||
@ -1335,7 +1335,7 @@ nsTableRowFrame::IR_TargetIsChild(nsIPresContext* aPresContext,
|
|||||||
for (nsIFrame* cell = mFrames.FirstChild(); cell; cell = cell->GetNextSibling()) {
|
for (nsIFrame* cell = mFrames.FirstChild(); cell; cell = cell->GetNextSibling()) {
|
||||||
ConsiderChildOverflow(aPresContext, aDesiredSize.mOverflowArea, cell);
|
ConsiderChildOverflow(aPresContext, aDesiredSize.mOverflowArea, cell);
|
||||||
}
|
}
|
||||||
StoreOverflow(aPresContext, aDesiredSize);
|
FinishAndStoreOverflow(&aDesiredSize);
|
||||||
// When returning whether we're complete we need to look at each of our cell
|
// When returning whether we're complete we need to look at each of our cell
|
||||||
// frames. If any of them has a continuing frame, then we're not complete. We
|
// frames. If any of them has a continuing frame, then we're not complete. We
|
||||||
// can't just return the status of the cell frame we just reflowed...
|
// can't just return the status of the cell frame we just reflowed...
|
||||||
|
|||||||
@ -1273,7 +1273,7 @@ nsTableRowGroupFrame::Reflow(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
aDesiredSize.mOverflowArea.UnionRect(aDesiredSize.mOverflowArea, nsRect(0, 0, aDesiredSize.width,
|
aDesiredSize.mOverflowArea.UnionRect(aDesiredSize.mOverflowArea, nsRect(0, 0, aDesiredSize.width,
|
||||||
aDesiredSize.height));
|
aDesiredSize.height));
|
||||||
StoreOverflow(aPresContext, aDesiredSize);
|
FinishAndStoreOverflow(&aDesiredSize);
|
||||||
#if defined DEBUG_TABLE_REFLOW_TIMING
|
#if defined DEBUG_TABLE_REFLOW_TIMING
|
||||||
nsTableFrame::DebugReflow(this, (nsHTMLReflowState&)aReflowState, &aDesiredSize, aStatus);
|
nsTableFrame::DebugReflow(this, (nsHTMLReflowState&)aReflowState, &aDesiredSize, aStatus);
|
||||||
#endif
|
#endif
|
||||||
@ -1698,7 +1698,7 @@ nsTableRowGroupFrame::IR_TargetIsChild(nsIPresContext* aPresContext,
|
|||||||
for (nsTableRowFrame* rowFrame = GetFirstRow(); rowFrame; rowFrame = rowFrame->GetNextRow()) {
|
for (nsTableRowFrame* rowFrame = GetFirstRow(); rowFrame; rowFrame = rowFrame->GetNextRow()) {
|
||||||
ConsiderChildOverflow(aPresContext, aDesiredSize.mOverflowArea, rowFrame);
|
ConsiderChildOverflow(aPresContext, aDesiredSize.mOverflowArea, rowFrame);
|
||||||
}
|
}
|
||||||
StoreOverflow(aPresContext, aDesiredSize);
|
FinishAndStoreOverflow(&aDesiredSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -176,6 +176,15 @@ printf("\n");
|
|||||||
aDesiredSize.mMaxElementWidth = childDesiredSize.mMaxElementWidth;
|
aDesiredSize.mMaxElementWidth = childDesiredSize.mMaxElementWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FinishAndStoreOverflow(&aDesiredSize);
|
||||||
|
// Act as if there is overflow no matter what. This is a
|
||||||
|
// safety measure to cater for math fonts with metrics that sometimes
|
||||||
|
// cause glyphs in the text frames to protrude outside. Without this,
|
||||||
|
// such glyphs may be clipped at the painting stage
|
||||||
|
// This flag has already been set on the children as well in
|
||||||
|
// SetInitialChildList()
|
||||||
|
mState |= NS_FRAME_OUTSIDE_CHILDREN;
|
||||||
|
|
||||||
// cache the frame's mBoundingMetrics
|
// cache the frame's mBoundingMetrics
|
||||||
mBoundingMetrics = aDesiredSize.mBoundingMetrics;
|
mBoundingMetrics = aDesiredSize.mBoundingMetrics;
|
||||||
|
|
||||||
|
|||||||
@ -471,15 +471,7 @@ nsMathMLmpaddedFrame::Reflow(nsIPresContext* aPresContext,
|
|||||||
mReference.x = 0;
|
mReference.x = 0;
|
||||||
mReference.y = aDesiredSize.ascent;
|
mReference.y = aDesiredSize.ascent;
|
||||||
|
|
||||||
// If we have tweaked things so that our children now stick outside,
|
FinishAndStoreOverflow(&aDesiredSize);
|
||||||
// we need to update our NS_FRAME_OUTSIDE_CHILDREN bit
|
|
||||||
if (aDesiredSize.mOverflowArea.x < 0 ||
|
|
||||||
aDesiredSize.mOverflowArea.y < 0 ||
|
|
||||||
aDesiredSize.mOverflowArea.XMost() > aDesiredSize.width ||
|
|
||||||
aDesiredSize.mOverflowArea.YMost() > aDesiredSize.height)
|
|
||||||
mState |= NS_FRAME_OUTSIDE_CHILDREN;
|
|
||||||
else
|
|
||||||
mState &= ~NS_FRAME_OUTSIDE_CHILDREN;
|
|
||||||
|
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|||||||
@ -455,6 +455,7 @@ nsStyleContext::CalcStyleDifference(nsStyleContext* aOther)
|
|||||||
DO_STRUCT_DIFFERENCE(Content);
|
DO_STRUCT_DIFFERENCE(Content);
|
||||||
DO_STRUCT_DIFFERENCE(UserInterface);
|
DO_STRUCT_DIFFERENCE(UserInterface);
|
||||||
DO_STRUCT_DIFFERENCE(Visibility);
|
DO_STRUCT_DIFFERENCE(Visibility);
|
||||||
|
DO_STRUCT_DIFFERENCE(Outline);
|
||||||
#ifdef MOZ_SVG
|
#ifdef MOZ_SVG
|
||||||
DO_STRUCT_DIFFERENCE(SVG);
|
DO_STRUCT_DIFFERENCE(SVG);
|
||||||
#endif
|
#endif
|
||||||
@ -489,7 +490,6 @@ nsStyleContext::CalcStyleDifference(nsStyleContext* aOther)
|
|||||||
// UIReset
|
// UIReset
|
||||||
DO_STRUCT_DIFFERENCE(Color);
|
DO_STRUCT_DIFFERENCE(Color);
|
||||||
DO_STRUCT_DIFFERENCE(Background);
|
DO_STRUCT_DIFFERENCE(Background);
|
||||||
DO_STRUCT_DIFFERENCE(Outline);
|
|
||||||
DO_STRUCT_DIFFERENCE(UIReset);
|
DO_STRUCT_DIFFERENCE(UIReset);
|
||||||
|
|
||||||
#undef DO_STRUCT_DIFFERENCE
|
#undef DO_STRUCT_DIFFERENCE
|
||||||
|
|||||||
@ -640,11 +640,18 @@ nsStyleOutline::RecalcData(void)
|
|||||||
|
|
||||||
nsChangeHint nsStyleOutline::CalcDifference(const nsStyleOutline& aOther) const
|
nsChangeHint nsStyleOutline::CalcDifference(const nsStyleOutline& aOther) const
|
||||||
{
|
{
|
||||||
if ((mOutlineWidth != aOther.mOutlineWidth) ||
|
PRBool outlineWasVisible =
|
||||||
(mOutlineStyle != aOther.mOutlineStyle) ||
|
mCachedOutlineWidth > 0 && mOutlineStyle != NS_STYLE_BORDER_STYLE_NONE;
|
||||||
|
PRBool outlineIsVisible =
|
||||||
|
aOther.mCachedOutlineWidth > 0 && aOther.mOutlineStyle != NS_STYLE_BORDER_STYLE_NONE;
|
||||||
|
if (outlineWasVisible != outlineIsVisible ||
|
||||||
|
mOutlineWidth != aOther.mOutlineWidth) {
|
||||||
|
return NS_CombineHint(nsChangeHint_ReflowFrame, nsChangeHint_RepaintFrame);
|
||||||
|
}
|
||||||
|
if ((mOutlineStyle != aOther.mOutlineStyle) ||
|
||||||
(mOutlineColor != aOther.mOutlineColor) ||
|
(mOutlineColor != aOther.mOutlineColor) ||
|
||||||
(mOutlineRadius != aOther.mOutlineRadius)) {
|
(mOutlineRadius != aOther.mOutlineRadius)) {
|
||||||
return NS_STYLE_HINT_VISUAL; // XXX: should be VISUAL: see bugs 9809 and 9816
|
return nsChangeHint_RepaintFrame;
|
||||||
}
|
}
|
||||||
return NS_STYLE_HINT_NONE;
|
return NS_STYLE_HINT_NONE;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -598,7 +598,7 @@ void nsTableCellFrame::VerticallyAlignChild(nsIPresContext* aPresContex
|
|||||||
desiredSize.height = mRect.height;
|
desiredSize.height = mRect.height;
|
||||||
desiredSize.mOverflowArea = nsRect(0, 0, mRect.width, mRect.height);
|
desiredSize.mOverflowArea = nsRect(0, 0, mRect.width, mRect.height);
|
||||||
ConsiderChildOverflow(aPresContext, desiredSize.mOverflowArea, firstKid);
|
ConsiderChildOverflow(aPresContext, desiredSize.mOverflowArea, firstKid);
|
||||||
StoreOverflow(aPresContext, desiredSize);
|
FinishAndStoreOverflow(&desiredSize);
|
||||||
if (kidYTop != kidRect.y) {
|
if (kidYTop != kidRect.y) {
|
||||||
// Make sure any child views are correctly positioned. We know the inner table
|
// Make sure any child views are correctly positioned. We know the inner table
|
||||||
// cell won't have a view
|
// cell won't have a view
|
||||||
|
|||||||
@ -2098,20 +2098,20 @@ NS_METHOD nsTableFrame::Reflow(nsIPresContext* aPresContext,
|
|||||||
nsRect damage(0, 0, PR_MAX(mRect.width, aDesiredSize.width),
|
nsRect damage(0, 0, PR_MAX(mRect.width, aDesiredSize.width),
|
||||||
PR_MAX(mRect.height, aDesiredSize.height));
|
PR_MAX(mRect.height, aDesiredSize.height));
|
||||||
damage.UnionRect(damage, aDesiredSize.mOverflowArea);
|
damage.UnionRect(damage, aDesiredSize.mOverflowArea);
|
||||||
nsRect* oldOverflowArea = GetOverflowAreaProperty(aPresContext);
|
nsRect* oldOverflowArea = GetOverflowAreaProperty();
|
||||||
if (oldOverflowArea) {
|
if (oldOverflowArea) {
|
||||||
damage.UnionRect(damage, *oldOverflowArea);
|
damage.UnionRect(damage, *oldOverflowArea);
|
||||||
}
|
}
|
||||||
Invalidate(damage);
|
Invalidate(damage);
|
||||||
} else {
|
} else {
|
||||||
// use the old overflow area
|
// use the old overflow area
|
||||||
nsRect* oldOverflowArea = GetOverflowAreaProperty(aPresContext);
|
nsRect* oldOverflowArea = GetOverflowAreaProperty();
|
||||||
if (oldOverflowArea) {
|
if (oldOverflowArea) {
|
||||||
aDesiredSize.mOverflowArea.UnionRect(aDesiredSize.mOverflowArea, *oldOverflowArea);
|
aDesiredSize.mOverflowArea.UnionRect(aDesiredSize.mOverflowArea, *oldOverflowArea);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
StoreOverflow(aPresContext, aDesiredSize);
|
FinishAndStoreOverflow(&aDesiredSize);
|
||||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
@ -3007,7 +3007,8 @@ nsTableFrame::IR_TargetIsChild(nsIPresContext* aPresContext,
|
|||||||
for (nsIFrame* kidFrame = mFrames.FirstChild(); kidFrame; kidFrame = kidFrame->GetNextSibling()) {
|
for (nsIFrame* kidFrame = mFrames.FirstChild(); kidFrame; kidFrame = kidFrame->GetNextSibling()) {
|
||||||
ConsiderChildOverflow(aPresContext, desiredSize.mOverflowArea, kidFrame);
|
ConsiderChildOverflow(aPresContext, desiredSize.mOverflowArea, kidFrame);
|
||||||
}
|
}
|
||||||
StoreOverflow(aPresContext, desiredSize);
|
FinishAndStoreOverflow(&desiredSize.mOverflowArea,
|
||||||
|
nsSize(desiredSize.width, desiredSize.height));
|
||||||
}
|
}
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
@ -3489,13 +3490,15 @@ void ResizeCells(nsTableFrame& aTableFrame,
|
|||||||
rgFrame->ConsiderChildOverflow(aPresContext, groupDesiredSize.mOverflowArea, rowFrame);
|
rgFrame->ConsiderChildOverflow(aPresContext, groupDesiredSize.mOverflowArea, rowFrame);
|
||||||
rowFrame = rowFrame->GetNextRow();
|
rowFrame = rowFrame->GetNextRow();
|
||||||
}
|
}
|
||||||
rgFrame->StoreOverflow(aPresContext, groupDesiredSize);
|
rgFrame->FinishAndStoreOverflow(&groupDesiredSize.mOverflowArea,
|
||||||
|
nsSize(groupDesiredSize.width, groupDesiredSize.height));
|
||||||
// make the coordinates of |desiredSize.mOverflowArea| incorrect
|
// make the coordinates of |desiredSize.mOverflowArea| incorrect
|
||||||
// since it's about to go away:
|
// since it's about to go away:
|
||||||
groupDesiredSize.mOverflowArea.MoveBy(rgFrame->GetPosition());
|
groupDesiredSize.mOverflowArea.MoveBy(rgFrame->GetPosition());
|
||||||
tableDesiredSize.mOverflowArea.UnionRect(tableDesiredSize.mOverflowArea, groupDesiredSize.mOverflowArea);
|
tableDesiredSize.mOverflowArea.UnionRect(tableDesiredSize.mOverflowArea, groupDesiredSize.mOverflowArea);
|
||||||
}
|
}
|
||||||
aTableFrame.StoreOverflow(aPresContext, tableDesiredSize);
|
aTableFrame.FinishAndStoreOverflow(&tableDesiredSize.mOverflowArea,
|
||||||
|
nsSize(tableDesiredSize.width, tableDesiredSize.height));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@ -556,7 +556,7 @@ nsTableOuterFrame::InvalidateDamage(nsIPresContext* aPresContext,
|
|||||||
if (aOldOverflowArea) {
|
if (aOldOverflowArea) {
|
||||||
damage.UnionRect(damage, *aOldOverflowArea);
|
damage.UnionRect(damage, *aOldOverflowArea);
|
||||||
}
|
}
|
||||||
nsRect* overflowArea = GetOverflowAreaProperty(aPresContext);
|
nsRect* overflowArea = GetOverflowAreaProperty();
|
||||||
if (overflowArea) {
|
if (overflowArea) {
|
||||||
damage.UnionRect(damage, *overflowArea);
|
damage.UnionRect(damage, *overflowArea);
|
||||||
}
|
}
|
||||||
@ -1370,7 +1370,7 @@ nsTableOuterFrame::UpdateReflowMetrics(nsIPresContext* aPresContext,
|
|||||||
if (mCaptionFrame) {
|
if (mCaptionFrame) {
|
||||||
ConsiderChildOverflow(aPresContext, aMet.mOverflowArea, mCaptionFrame);
|
ConsiderChildOverflow(aPresContext, aMet.mOverflowArea, mCaptionFrame);
|
||||||
}
|
}
|
||||||
StoreOverflow(aPresContext, aMet);
|
FinishAndStoreOverflow(&aMet);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
@ -1541,7 +1541,7 @@ nsTableOuterFrame::IR_TargetIsCaptionFrame(nsIPresContext* aPresContex
|
|||||||
|
|
||||||
rv = FinishReflowChild(mCaptionFrame, aPresContext, nsnull, captionMet,
|
rv = FinishReflowChild(mCaptionFrame, aPresContext, nsnull, captionMet,
|
||||||
captionOrigin.x, captionOrigin.y, 0);
|
captionOrigin.x, captionOrigin.y, 0);
|
||||||
nsRect* oldOverflowArea = GetOverflowAreaProperty(aPresContext);
|
nsRect* oldOverflowArea = GetOverflowAreaProperty();
|
||||||
nsRect* overflowStorage = nsnull;
|
nsRect* overflowStorage = nsnull;
|
||||||
nsRect overflow;
|
nsRect overflow;
|
||||||
if (oldOverflowArea) {
|
if (oldOverflowArea) {
|
||||||
@ -1599,7 +1599,7 @@ nsTableOuterFrame::IR_ReflowDirty(nsIPresContext* aPresContext,
|
|||||||
aDesiredSize.height = innerRect.YMost() + innerMargin.bottom;
|
aDesiredSize.height = innerRect.YMost() + innerMargin.bottom;
|
||||||
sizeSet = PR_TRUE;
|
sizeSet = PR_TRUE;
|
||||||
// Repaint the inner's entire bounds if it moved
|
// Repaint the inner's entire bounds if it moved
|
||||||
nsRect* oldOverflowArea = GetOverflowAreaProperty(aPresContext);
|
nsRect* oldOverflowArea = GetOverflowAreaProperty();
|
||||||
PRBool innerMoved = (innerRect.x != innerOrigin.x) ||
|
PRBool innerMoved = (innerRect.x != innerOrigin.x) ||
|
||||||
(innerRect.y != innerOrigin.y);
|
(innerRect.y != innerOrigin.y);
|
||||||
nsSize desSize(aDesiredSize.width, aDesiredSize.height);
|
nsSize desSize(aDesiredSize.width, aDesiredSize.height);
|
||||||
@ -1763,7 +1763,7 @@ nsTableOuterFrame::IR_InnerTableReflow(nsIPresContext* aPresContext,
|
|||||||
if (aOuterMet.mComputeMEW) {
|
if (aOuterMet.mComputeMEW) {
|
||||||
aOuterMet.mMaxElementWidth = innerMet.mMaxElementWidth;
|
aOuterMet.mMaxElementWidth = innerMet.mMaxElementWidth;
|
||||||
}
|
}
|
||||||
nsRect* oldOverflowArea = GetOverflowAreaProperty(aPresContext);
|
nsRect* oldOverflowArea = GetOverflowAreaProperty();
|
||||||
nsRect* overflowStorage = nsnull;
|
nsRect* overflowStorage = nsnull;
|
||||||
nsRect overflow;
|
nsRect overflow;
|
||||||
if (oldOverflowArea) {
|
if (oldOverflowArea) {
|
||||||
@ -1854,7 +1854,7 @@ nsTableOuterFrame::IR_CaptionInserted(nsIPresContext* aPresContext,
|
|||||||
rv = FinishReflowChild(mCaptionFrame, aPresContext, nsnull, captionMet,
|
rv = FinishReflowChild(mCaptionFrame, aPresContext, nsnull, captionMet,
|
||||||
captionOrigin.x, captionOrigin.y, 0);
|
captionOrigin.x, captionOrigin.y, 0);
|
||||||
|
|
||||||
nsRect* oldOverflowArea = GetOverflowAreaProperty(aPresContext);
|
nsRect* oldOverflowArea = GetOverflowAreaProperty();
|
||||||
nsRect* overflowStorage = nsnull;
|
nsRect* overflowStorage = nsnull;
|
||||||
nsRect overflow;
|
nsRect overflow;
|
||||||
if (oldOverflowArea) {
|
if (oldOverflowArea) {
|
||||||
|
|||||||
@ -398,7 +398,7 @@ nsTableRowFrame::DidResize(nsIPresContext* aPresContext,
|
|||||||
// Get the next child
|
// Get the next child
|
||||||
childFrame = iter.Next();
|
childFrame = iter.Next();
|
||||||
}
|
}
|
||||||
StoreOverflow(aPresContext, desiredSize);
|
FinishAndStoreOverflow(&desiredSize);
|
||||||
if (HasView()) {
|
if (HasView()) {
|
||||||
nsContainerFrame::SyncFrameViewAfterReflow(aPresContext, this, GetView(), &desiredSize.mOverflowArea, 0);
|
nsContainerFrame::SyncFrameViewAfterReflow(aPresContext, this, GetView(), &desiredSize.mOverflowArea, 0);
|
||||||
}
|
}
|
||||||
@ -985,7 +985,7 @@ nsTableRowFrame::ReflowChildren(nsIPresContext* aPresContext,
|
|||||||
desiredSize.width = cellDesiredSize.width;
|
desiredSize.width = cellDesiredSize.width;
|
||||||
desiredSize.height = cellDesiredSize.height;
|
desiredSize.height = cellDesiredSize.height;
|
||||||
nsRect *overflowArea =
|
nsRect *overflowArea =
|
||||||
cellFrame->GetOverflowAreaProperty(aPresContext);
|
cellFrame->GetOverflowAreaProperty();
|
||||||
if (overflowArea)
|
if (overflowArea)
|
||||||
desiredSize.mOverflowArea = *overflowArea;
|
desiredSize.mOverflowArea = *overflowArea;
|
||||||
else
|
else
|
||||||
@ -1084,7 +1084,7 @@ nsTableRowFrame::ReflowChildren(nsIPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
nsRect rowRect(0, 0, aDesiredSize.width, aDesiredSize.height);
|
nsRect rowRect(0, 0, aDesiredSize.width, aDesiredSize.height);
|
||||||
aDesiredSize.mOverflowArea.UnionRect(aDesiredSize.mOverflowArea, rowRect);
|
aDesiredSize.mOverflowArea.UnionRect(aDesiredSize.mOverflowArea, rowRect);
|
||||||
StoreOverflow(aPresContext, aDesiredSize);
|
FinishAndStoreOverflow(&aDesiredSize);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1318,7 +1318,7 @@ nsTableRowFrame::IR_TargetIsChild(nsIPresContext* aPresContext,
|
|||||||
nsIFrame* cellKidFrame = cellFrame->GetFirstChild(nsnull);
|
nsIFrame* cellKidFrame = cellFrame->GetFirstChild(nsnull);
|
||||||
if (cellKidFrame) {
|
if (cellKidFrame) {
|
||||||
cellFrame->ConsiderChildOverflow(aPresContext, cellMet.mOverflowArea, cellKidFrame);
|
cellFrame->ConsiderChildOverflow(aPresContext, cellMet.mOverflowArea, cellKidFrame);
|
||||||
cellFrame->StoreOverflow(aPresContext, cellMet);
|
cellFrame->FinishAndStoreOverflow(&cellMet);
|
||||||
if (cellFrame->HasView()) {
|
if (cellFrame->HasView()) {
|
||||||
nsContainerFrame::SyncFrameViewAfterReflow(aPresContext, cellFrame, cellFrame->GetView(), &cellMet.mOverflowArea, 0);
|
nsContainerFrame::SyncFrameViewAfterReflow(aPresContext, cellFrame, cellFrame->GetView(), &cellMet.mOverflowArea, 0);
|
||||||
}
|
}
|
||||||
@ -1335,7 +1335,7 @@ nsTableRowFrame::IR_TargetIsChild(nsIPresContext* aPresContext,
|
|||||||
for (nsIFrame* cell = mFrames.FirstChild(); cell; cell = cell->GetNextSibling()) {
|
for (nsIFrame* cell = mFrames.FirstChild(); cell; cell = cell->GetNextSibling()) {
|
||||||
ConsiderChildOverflow(aPresContext, aDesiredSize.mOverflowArea, cell);
|
ConsiderChildOverflow(aPresContext, aDesiredSize.mOverflowArea, cell);
|
||||||
}
|
}
|
||||||
StoreOverflow(aPresContext, aDesiredSize);
|
FinishAndStoreOverflow(&aDesiredSize);
|
||||||
// When returning whether we're complete we need to look at each of our cell
|
// When returning whether we're complete we need to look at each of our cell
|
||||||
// frames. If any of them has a continuing frame, then we're not complete. We
|
// frames. If any of them has a continuing frame, then we're not complete. We
|
||||||
// can't just return the status of the cell frame we just reflowed...
|
// can't just return the status of the cell frame we just reflowed...
|
||||||
|
|||||||
@ -1273,7 +1273,7 @@ nsTableRowGroupFrame::Reflow(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
aDesiredSize.mOverflowArea.UnionRect(aDesiredSize.mOverflowArea, nsRect(0, 0, aDesiredSize.width,
|
aDesiredSize.mOverflowArea.UnionRect(aDesiredSize.mOverflowArea, nsRect(0, 0, aDesiredSize.width,
|
||||||
aDesiredSize.height));
|
aDesiredSize.height));
|
||||||
StoreOverflow(aPresContext, aDesiredSize);
|
FinishAndStoreOverflow(&aDesiredSize);
|
||||||
#if defined DEBUG_TABLE_REFLOW_TIMING
|
#if defined DEBUG_TABLE_REFLOW_TIMING
|
||||||
nsTableFrame::DebugReflow(this, (nsHTMLReflowState&)aReflowState, &aDesiredSize, aStatus);
|
nsTableFrame::DebugReflow(this, (nsHTMLReflowState&)aReflowState, &aDesiredSize, aStatus);
|
||||||
#endif
|
#endif
|
||||||
@ -1698,7 +1698,7 @@ nsTableRowGroupFrame::IR_TargetIsChild(nsIPresContext* aPresContext,
|
|||||||
for (nsTableRowFrame* rowFrame = GetFirstRow(); rowFrame; rowFrame = rowFrame->GetNextRow()) {
|
for (nsTableRowFrame* rowFrame = GetFirstRow(); rowFrame; rowFrame = rowFrame->GetNextRow()) {
|
||||||
ConsiderChildOverflow(aPresContext, aDesiredSize.mOverflowArea, rowFrame);
|
ConsiderChildOverflow(aPresContext, aDesiredSize.mOverflowArea, rowFrame);
|
||||||
}
|
}
|
||||||
StoreOverflow(aPresContext, aDesiredSize);
|
FinishAndStoreOverflow(&aDesiredSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -564,6 +564,8 @@ nsBox::SetBounds(nsBoxLayoutState& aState, const nsRect& aRect)
|
|||||||
else
|
else
|
||||||
frame->SetRect(aRect);
|
frame->SetRect(aRect);
|
||||||
|
|
||||||
|
nsRect r(0, 0, aRect.width, aRect.height);
|
||||||
|
frame->FinishAndStoreOverflow(&r, nsSize(aRect.width, aRect.height));
|
||||||
|
|
||||||
if (!(flags & NS_FRAME_NO_MOVE_VIEW))
|
if (!(flags & NS_FRAME_NO_MOVE_VIEW))
|
||||||
{
|
{
|
||||||
@ -1025,8 +1027,6 @@ nsBox::SyncLayout(nsBoxLayoutState& aState)
|
|||||||
| NS_FRAME_FIRST_REFLOW | NS_FRAME_IN_REFLOW);
|
| NS_FRAME_FIRST_REFLOW | NS_FRAME_IN_REFLOW);
|
||||||
|
|
||||||
nsIPresContext* presContext = aState.PresContext();
|
nsIPresContext* presContext = aState.PresContext();
|
||||||
nsRect rect(0,0,0,0);
|
|
||||||
GetBounds(rect);
|
|
||||||
|
|
||||||
PRUint32 flags = 0;
|
PRUint32 flags = 0;
|
||||||
GetLayoutFlags(flags);
|
GetLayoutFlags(flags);
|
||||||
@ -1035,21 +1035,40 @@ nsBox::SyncLayout(nsBoxLayoutState& aState)
|
|||||||
|
|
||||||
flags |= stateFlags;
|
flags |= stateFlags;
|
||||||
|
|
||||||
nsIView* view = frame->GetView();
|
nsRect rect(nsPoint(0, 0), frame->GetSize());
|
||||||
|
|
||||||
/*
|
if (!DoesClipChildren()) {
|
||||||
// only if the origin changed
|
// See if our child frames caused us to overflow after being laid
|
||||||
if ((mX != rect.x) || (mY != rect.y)) {
|
// out. If so, store the overflow area. This normally can't happen
|
||||||
if (view) {
|
// in XUL, but it can happen with the CSS 'outline' property and
|
||||||
nsContainerFrame::PositionFrameView(presContext, frame, view);
|
// possibly with other exotic stuff (e.g. relatively positioned
|
||||||
} else
|
// frames in HTML inside XUL).
|
||||||
nsContainerFrame::PositionChildViews(presContext, frame);
|
nsIBox* box;
|
||||||
|
GetChildBox(&box);
|
||||||
|
while (box)
|
||||||
|
{
|
||||||
|
nsIFrame* f = nsnull;
|
||||||
|
box->GetFrame(&f);
|
||||||
|
|
||||||
mX = rect.x;
|
if (f) {
|
||||||
mY = rect.y;
|
nsRect bounds;
|
||||||
|
if (f->GetStateBits() & NS_FRAME_OUTSIDE_CHILDREN) {
|
||||||
|
nsRect* overflowArea = f->GetOverflowAreaProperty();
|
||||||
|
NS_ASSERTION(overflowArea, "Should have created property for overflowing frame");
|
||||||
|
bounds = *overflowArea + f->GetPosition();
|
||||||
|
} else {
|
||||||
|
bounds = f->GetRect();
|
||||||
|
}
|
||||||
|
rect.UnionRect(rect, bounds);
|
||||||
|
}
|
||||||
|
|
||||||
|
box->GetNextBox(&box);
|
||||||
}
|
}
|
||||||
*/
|
}
|
||||||
|
|
||||||
|
frame->FinishAndStoreOverflow(&rect, frame->GetSize());
|
||||||
|
|
||||||
|
nsIView* view = frame->GetView();
|
||||||
if (view) {
|
if (view) {
|
||||||
// Make sure the frame's view is properly sized and positioned and has
|
// Make sure the frame's view is properly sized and positioned and has
|
||||||
// things like opacity correct
|
// things like opacity correct
|
||||||
@ -1057,7 +1076,7 @@ nsBox::SyncLayout(nsBoxLayoutState& aState)
|
|||||||
presContext,
|
presContext,
|
||||||
frame,
|
frame,
|
||||||
view,
|
view,
|
||||||
nsnull,
|
&rect,
|
||||||
flags);
|
flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1086,17 +1105,7 @@ nsBox::Redraw(nsBoxLayoutState& aState,
|
|||||||
if (aDamageRect)
|
if (aDamageRect)
|
||||||
damageRect = *aDamageRect;
|
damageRect = *aDamageRect;
|
||||||
else
|
else
|
||||||
GetContentRect(damageRect);
|
damageRect = frame->GetOutlineRect();
|
||||||
|
|
||||||
// Checks to see if the damaged rect should be infalted
|
|
||||||
// to include the outline
|
|
||||||
// XXX This makes NO SENSE. if the damage rect is just a small part of
|
|
||||||
// this frame's rect then adding the outline width doesn't make any sense.
|
|
||||||
nscoord width;
|
|
||||||
frame->GetStyleOutline()->GetOutlineWidth(width);
|
|
||||||
if (width > 0) {
|
|
||||||
damageRect.Inflate(width, width);
|
|
||||||
}
|
|
||||||
|
|
||||||
frame->Invalidate(damageRect, aImmediate);
|
frame->Invalidate(damageRect, aImmediate);
|
||||||
|
|
||||||
|
|||||||
@ -111,6 +111,11 @@ public:
|
|||||||
nsBox(nsIPresShell* aShell);
|
nsBox(nsIPresShell* aShell);
|
||||||
virtual ~nsBox();
|
virtual ~nsBox();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns PR_TRUE if this box clips its children, e.g., if this box is an scrollbox.
|
||||||
|
*/
|
||||||
|
virtual PRBool DoesClipChildren() { return PR_FALSE; }
|
||||||
|
|
||||||
virtual nsresult SyncLayout(nsBoxLayoutState& aBoxLayoutState);
|
virtual nsresult SyncLayout(nsBoxLayoutState& aBoxLayoutState);
|
||||||
|
|
||||||
virtual PRBool DoesNeedRecalc(const nsSize& aSize);
|
virtual PRBool DoesNeedRecalc(const nsSize& aSize);
|
||||||
|
|||||||
@ -895,6 +895,13 @@ nsBoxFrame::Reflow(nsIPresContext* aPresContext,
|
|||||||
aDesiredSize.ascent = ascent;
|
aDesiredSize.ascent = ascent;
|
||||||
aDesiredSize.descent = r.height - ascent;
|
aDesiredSize.descent = r.height - ascent;
|
||||||
|
|
||||||
|
// NS_FRAME_OUTSIDE_CHILDREN is set in SetBounds() above
|
||||||
|
if (mState & NS_FRAME_OUTSIDE_CHILDREN) {
|
||||||
|
nsRect* overflowArea = GetOverflowAreaProperty();
|
||||||
|
NS_ASSERTION(overflowArea, "Failed to set overflow area property");
|
||||||
|
aDesiredSize.mOverflowArea = *overflowArea;
|
||||||
|
}
|
||||||
|
|
||||||
// max sure the max element size reflects
|
// max sure the max element size reflects
|
||||||
// our min width
|
// our min width
|
||||||
nscoord* maxElementWidth = state.GetMaxElementWidth();
|
nscoord* maxElementWidth = state.GetMaxElementWidth();
|
||||||
|
|||||||
@ -335,6 +335,13 @@ nsLeafBoxFrame::Reflow(nsIPresContext* aPresContext,
|
|||||||
aDesiredSize.ascent = ascent;
|
aDesiredSize.ascent = ascent;
|
||||||
aDesiredSize.descent = 0;
|
aDesiredSize.descent = 0;
|
||||||
|
|
||||||
|
// NS_FRAME_OUTSIDE_CHILDREN is set in SetBounds() above
|
||||||
|
if (mState & NS_FRAME_OUTSIDE_CHILDREN) {
|
||||||
|
nsRect* overflowArea = GetOverflowAreaProperty();
|
||||||
|
NS_ASSERTION(overflowArea, "Failed to set overflow area property");
|
||||||
|
aDesiredSize.mOverflowArea = *overflowArea;
|
||||||
|
}
|
||||||
|
|
||||||
// max sure the max element size reflects
|
// max sure the max element size reflects
|
||||||
// our min width
|
// our min width
|
||||||
nscoord* maxElementWidth = state.GetMaxElementWidth();
|
nscoord* maxElementWidth = state.GetMaxElementWidth();
|
||||||
|
|||||||
@ -99,6 +99,11 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual nsIAtom* GetType() const;
|
virtual nsIAtom* GetType() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This frame does clip its child (the scrolled frame).
|
||||||
|
*/
|
||||||
|
virtual PRBool DoesClipChildren() { return PR_TRUE; }
|
||||||
|
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
NS_IMETHOD GetFrameName(nsAString& aResult) const;
|
NS_IMETHOD GetFrameName(nsAString& aResult) const;
|
||||||
#endif
|
#endif
|
||||||
@ -117,7 +122,6 @@ public:
|
|||||||
|
|
||||||
virtual nsresult GetContentOf(nsIContent** aContent);
|
virtual nsresult GetContentOf(nsIContent** aContent);
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
nsScrollBoxFrame(nsIPresShell* aShell);
|
nsScrollBoxFrame(nsIPresShell* aShell);
|
||||||
|
|
||||||
|
|||||||
@ -106,6 +106,16 @@ public:
|
|||||||
NS_IMETHOD SetScrollbarMediator(nsIScrollbarMediator* aMediator) { mScrollbarMediator = aMediator; return NS_OK; };
|
NS_IMETHOD SetScrollbarMediator(nsIScrollbarMediator* aMediator) { mScrollbarMediator = aMediator; return NS_OK; };
|
||||||
NS_IMETHOD GetScrollbarMediator(nsIScrollbarMediator** aResult) { *aResult = mScrollbarMediator; return NS_OK; };
|
NS_IMETHOD GetScrollbarMediator(nsIScrollbarMediator** aResult) { *aResult = mScrollbarMediator; return NS_OK; };
|
||||||
|
|
||||||
|
// nsBox methods
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Treat scrollbars as clipping their children; overflowing children
|
||||||
|
* will not be allowed to make NS_FRAME_OUTSIDE_CHILDREN on this
|
||||||
|
* frame. This means that when the scroll code decides to hide a
|
||||||
|
* scrollframe by setting its height or width to zero, that will
|
||||||
|
* hide the children too.
|
||||||
|
*/
|
||||||
|
virtual PRBool DoesClipChildren() { return PR_TRUE; }
|
||||||
private:
|
private:
|
||||||
nsIScrollbarMediator* mScrollbarMediator;
|
nsIScrollbarMediator* mScrollbarMediator;
|
||||||
}; // class nsScrollbarFrame
|
}; // class nsScrollbarFrame
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user