mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 12:35:58 +00:00
Bug 334571 strip trailing whitespace. r=zwol
This commit is contained in:
parent
fdd42ea0c2
commit
aa22afa674
@ -68,12 +68,12 @@ struct nsMargin {
|
||||
nscoord& side(PRUint8 aSide) {
|
||||
NS_PRECONDITION(aSide <= NS_SIDE_LEFT, "Out of range side");
|
||||
return *(&top + aSide);
|
||||
}
|
||||
}
|
||||
|
||||
nscoord side(PRUint8 aSide) const {
|
||||
NS_PRECONDITION(aSide <= NS_SIDE_LEFT, "Out of range side");
|
||||
return *(&top + aSide);
|
||||
}
|
||||
}
|
||||
#else
|
||||
#error "Somebody changed the side constants."
|
||||
#endif
|
||||
|
@ -49,7 +49,7 @@ PRBool nsRect::Contains(nscoord aX, nscoord aY) const
|
||||
//Also Returns true if aRect is Empty
|
||||
PRBool nsRect::Contains(const nsRect &aRect) const
|
||||
{
|
||||
return aRect.IsEmpty() ||
|
||||
return aRect.IsEmpty() ||
|
||||
((PRBool) ((aRect.x >= x) && (aRect.y >= y) &&
|
||||
(aRect.XMost() <= XMost()) && (aRect.YMost() <= YMost())));
|
||||
}
|
||||
@ -185,7 +185,7 @@ nsMargin nsRect::operator-(const nsRect& aRect) const
|
||||
}
|
||||
|
||||
// scale the rect but round to smallest containing rect
|
||||
nsRect& nsRect::ScaleRoundOut(float aScale)
|
||||
nsRect& nsRect::ScaleRoundOut(float aScale)
|
||||
{
|
||||
nscoord right = NSToCoordCeil(float(XMost()) * aScale);
|
||||
nscoord bottom = NSToCoordCeil(float(YMost()) * aScale);
|
||||
|
@ -149,7 +149,7 @@ struct THEBES_API gfxRect {
|
||||
// If you need similar method which is using NS_round(), you should create
|
||||
// new |RoundAwayFromZero()| method.
|
||||
void Round();
|
||||
|
||||
|
||||
// Snap the rectangle edges to integer coordinates, such that the
|
||||
// original rectangle contains the resulting rectangle.
|
||||
void RoundIn();
|
||||
@ -190,7 +190,7 @@ struct THEBES_API gfxRect {
|
||||
size.width *= k;
|
||||
size.height *= k;
|
||||
}
|
||||
|
||||
|
||||
void Scale(gfxFloat sx, gfxFloat sy) {
|
||||
NS_ASSERTION(sx >= 0.0, "Invalid (negative) scale factor");
|
||||
NS_ASSERTION(sy >= 0.0, "Invalid (negative) scale factor");
|
||||
|
@ -808,7 +808,7 @@ gfxContext::RoundedRectangle(const gfxRect& rect,
|
||||
{
|
||||
//
|
||||
// For CW drawing, this looks like:
|
||||
//
|
||||
//
|
||||
// ...******0** 1 C
|
||||
// ****
|
||||
// *** 2
|
||||
|
@ -161,15 +161,15 @@ struct InlineBackgroundData
|
||||
x = mLineContinuationPoint;
|
||||
|
||||
// Scan continuations on the same line as aFrame and accumulate the widths
|
||||
// of frames that are to the left (if this is an LTR block) or right
|
||||
// of frames that are to the left (if this is an LTR block) or right
|
||||
// (if it's RTL) of the current one.
|
||||
PRBool isRtlBlock = (mBlockFrame->GetStyleVisibility()->mDirection ==
|
||||
NS_STYLE_DIRECTION_RTL);
|
||||
NS_STYLE_DIRECTION_RTL);
|
||||
nscoord curOffset = aFrame->GetOffsetTo(mBlockFrame).x;
|
||||
|
||||
// No need to use our GetPrevContinuation/GetNextContinuation methods
|
||||
// here, since ib special siblings are certainly not on the same line.
|
||||
|
||||
|
||||
nsIFrame* inlineFrame = aFrame->GetPrevContinuation();
|
||||
// If the continuation is fluid we know inlineFrame is not on the same line.
|
||||
// If it's not fluid, we need to test further to be sure.
|
||||
@ -233,7 +233,7 @@ protected:
|
||||
nscoord mUnbrokenWidth;
|
||||
nscoord mLineContinuationPoint;
|
||||
PRBool mBidiEnabled;
|
||||
|
||||
|
||||
void SetFrame(nsIFrame* aFrame)
|
||||
{
|
||||
NS_PRECONDITION(aFrame, "Need a frame");
|
||||
@ -256,7 +256,7 @@ protected:
|
||||
(aFrame->GetPrevInFlow() || !AreOnSameLine(mFrame, aFrame))) {
|
||||
mLineContinuationPoint = mContinuationPoint;
|
||||
}
|
||||
|
||||
|
||||
mFrame = aFrame;
|
||||
}
|
||||
|
||||
@ -296,7 +296,7 @@ protected:
|
||||
}
|
||||
|
||||
void Init(nsIFrame* aFrame)
|
||||
{
|
||||
{
|
||||
// Start with the previous flow frame as our continuation point
|
||||
// is the total of the widths of the previous frames.
|
||||
nsIFrame* inlineFrame = GetPrevContinuation(aFrame);
|
||||
@ -336,7 +336,7 @@ protected:
|
||||
mLineContinuationPoint = mContinuationPoint;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PRBool AreOnSameLine(nsIFrame* aFrame1, nsIFrame* aFrame2) {
|
||||
// Assumes that aFrame1 and aFrame2 are both decsendants of mBlockFrame.
|
||||
PRBool isValid1, isValid2;
|
||||
@ -384,7 +384,7 @@ static InlineBackgroundData* gInlineBGData = nsnull;
|
||||
|
||||
// Initialize any static variables used by nsCSSRendering.
|
||||
nsresult nsCSSRendering::Init()
|
||||
{
|
||||
{
|
||||
NS_ASSERTION(!gInlineBGData, "Init called twice");
|
||||
gInlineBGData = new InlineBackgroundData();
|
||||
if (!gInlineBGData)
|
||||
@ -414,7 +414,7 @@ MakeBevelColor(PRIntn whichSide, PRUint8 style,
|
||||
// Given a background color and a border color
|
||||
// calculate the color used for the shading
|
||||
NS_GetSpecial3DColors(colors, aBackgroundColor, aBorderColor);
|
||||
|
||||
|
||||
if ((style == NS_STYLE_BORDER_STYLE_OUTSET) ||
|
||||
(style == NS_STYLE_BORDER_STYLE_RIDGE)) {
|
||||
// Flip colors for these two border styles
|
||||
@ -599,7 +599,7 @@ nsCSSRendering::PaintBorderWithStyleBorder(nsPresContext* aPresContext,
|
||||
aBorderArea, aStyleBorder, aDirtyRect);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Get our style context's color struct.
|
||||
const nsStyleColor* ourColor = aStyleContext->GetStyleColor();
|
||||
|
||||
@ -915,7 +915,7 @@ nsCSSRendering::PaintFocus(nsPresContext* aPresContext,
|
||||
* specifies a percentage (including 'right' or 'bottom'), in which case
|
||||
* it's that percentage within of aOriginBounds. So 'right' would set
|
||||
* aAnchorPoint.x to aOriginBounds.XMost().
|
||||
*
|
||||
*
|
||||
* Points are returned relative to aOriginBounds.
|
||||
*/
|
||||
static void
|
||||
@ -1134,7 +1134,7 @@ nsCSSRendering::GetBorderRadiusTwips(const nsStyleCorners& aBorderRadius,
|
||||
nscoord aRadii[8])
|
||||
{
|
||||
PRBool result = PR_FALSE;
|
||||
|
||||
|
||||
// Convert percentage values
|
||||
NS_FOR_CSS_HALF_CORNERS(i) {
|
||||
const nsStyleCoord c = aBorderRadius.Get(i);
|
||||
@ -2147,7 +2147,7 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
|
||||
displayData->mAppearance)) {
|
||||
nsRect dirty;
|
||||
dirty.IntersectRect(aDirtyRect, aBorderArea);
|
||||
theme->DrawWidgetBackground(&aRenderingContext, aForFrame,
|
||||
theme->DrawWidgetBackground(&aRenderingContext, aForFrame,
|
||||
displayData->mAppearance, aBorderArea, dirty);
|
||||
return;
|
||||
}
|
||||
@ -2192,7 +2192,7 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
|
||||
ComputePixelRadii(radii, aBorderArea, aForFrame->GetSkipSides(),
|
||||
appUnitsPerPixel, &bgRadii);
|
||||
}
|
||||
|
||||
|
||||
// The 'bgClipArea' (used only by the image tiling logic, far below)
|
||||
// is the caller-provided aBGClipRect if any, or else the area
|
||||
// determined by the value of 'background-clip' in
|
||||
@ -2493,7 +2493,7 @@ PaintBackgroundLayer(nsPresContext* aPresContext,
|
||||
nsSize imageSize = imageRenderer.ComputeSize(bgPositioningArea.Size());
|
||||
if (imageSize.width <= 0 || imageSize.height <= 0)
|
||||
return;
|
||||
|
||||
|
||||
// Scale the image as specified for background-size and as required for
|
||||
// proper background positioning when background-position is defined with
|
||||
// percentages.
|
||||
@ -2869,14 +2869,14 @@ DrawBorderImageComponent(nsIRenderingContext& aRenderingContext,
|
||||
// At some point, all functions should be unified to include the additional functionality that these provide
|
||||
|
||||
static nscoord
|
||||
RoundIntToPixel(nscoord aValue,
|
||||
RoundIntToPixel(nscoord aValue,
|
||||
nscoord aTwipsPerPixel,
|
||||
PRBool aRoundDown = PR_FALSE)
|
||||
{
|
||||
if (aTwipsPerPixel <= 0)
|
||||
// We must be rendering to a device that has a resolution greater than Twips!
|
||||
if (aTwipsPerPixel <= 0)
|
||||
// We must be rendering to a device that has a resolution greater than Twips!
|
||||
// In that case, aValue is as accurate as it's going to get.
|
||||
return aValue;
|
||||
return aValue;
|
||||
|
||||
nscoord halfPixel = NSToCoordRound(aTwipsPerPixel / 2.0f);
|
||||
nscoord extra = aValue % aTwipsPerPixel;
|
||||
@ -2885,7 +2885,7 @@ RoundIntToPixel(nscoord aValue,
|
||||
}
|
||||
|
||||
static nscoord
|
||||
RoundFloatToPixel(float aValue,
|
||||
RoundFloatToPixel(float aValue,
|
||||
nscoord aTwipsPerPixel,
|
||||
PRBool aRoundDown = PR_FALSE)
|
||||
{
|
||||
@ -2907,8 +2907,8 @@ SetPoly(const nsRect& aRect,
|
||||
poly[4].x = aRect.x;
|
||||
poly[4].y = aRect.y;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
static void
|
||||
DrawSolidBorderSegment(nsIRenderingContext& aContext,
|
||||
nsRect aRect,
|
||||
nscoord aTwipsPerPixel,
|
||||
@ -2922,15 +2922,15 @@ DrawSolidBorderSegment(nsIRenderingContext& aContext,
|
||||
((0 == aStartBevelOffset) && (0 == aEndBevelOffset))) {
|
||||
// simple line or rectangle
|
||||
if ((NS_SIDE_TOP == aStartBevelSide) || (NS_SIDE_BOTTOM == aStartBevelSide)) {
|
||||
if (1 == aRect.height)
|
||||
aContext.DrawLine(aRect.x, aRect.y, aRect.x, aRect.y + aRect.height);
|
||||
else
|
||||
if (1 == aRect.height)
|
||||
aContext.DrawLine(aRect.x, aRect.y, aRect.x, aRect.y + aRect.height);
|
||||
else
|
||||
aContext.FillRect(aRect);
|
||||
}
|
||||
else {
|
||||
if (1 == aRect.width)
|
||||
aContext.DrawLine(aRect.x, aRect.y, aRect.x + aRect.width, aRect.y);
|
||||
else
|
||||
if (1 == aRect.width)
|
||||
aContext.DrawLine(aRect.x, aRect.y, aRect.x + aRect.width, aRect.y);
|
||||
else
|
||||
aContext.FillRect(aRect);
|
||||
}
|
||||
}
|
||||
@ -2998,9 +2998,9 @@ GetDashInfo(nscoord aBorderLength,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
nsCSSRendering::DrawTableBorderSegment(nsIRenderingContext& aContext,
|
||||
PRUint8 aBorderStyle,
|
||||
PRUint8 aBorderStyle,
|
||||
nscolor aBorderColor,
|
||||
const nsStyleBackground* aBGColor,
|
||||
const nsRect& aBorder,
|
||||
@ -3010,7 +3010,7 @@ nsCSSRendering::DrawTableBorderSegment(nsIRenderingContext& aContext,
|
||||
PRUint8 aEndBevelSide,
|
||||
nscoord aEndBevelOffset)
|
||||
{
|
||||
aContext.SetColor (aBorderColor);
|
||||
aContext.SetColor (aBorderColor);
|
||||
|
||||
PRBool horizontal = ((NS_SIDE_TOP == aStartBevelSide) || (NS_SIDE_BOTTOM == aStartBevelSide));
|
||||
nscoord twipsPerPixel = NSIntPixelsToAppUnits(1, aAppUnitsPerCSSPixel);
|
||||
@ -3033,13 +3033,13 @@ nsCSSRendering::DrawTableBorderSegment(nsIRenderingContext& aContext,
|
||||
//NS_ASSERTION(PR_FALSE, "style of none or hidden");
|
||||
break;
|
||||
case NS_STYLE_BORDER_STYLE_DOTTED:
|
||||
case NS_STYLE_BORDER_STYLE_DASHED:
|
||||
case NS_STYLE_BORDER_STYLE_DASHED:
|
||||
{
|
||||
nscoord dashLength = (NS_STYLE_BORDER_STYLE_DASHED == aBorderStyle) ? DASH_LENGTH : DOT_LENGTH;
|
||||
// make the dash length proportional to the border thickness
|
||||
dashLength *= (horizontal) ? aBorder.height : aBorder.width;
|
||||
// make the min dash length for the ends 1/2 the dash length
|
||||
nscoord minDashLength = (NS_STYLE_BORDER_STYLE_DASHED == aBorderStyle)
|
||||
nscoord minDashLength = (NS_STYLE_BORDER_STYLE_DASHED == aBorderStyle)
|
||||
? RoundFloatToPixel(((float)dashLength) / 2.0f, twipsPerPixel) : dashLength;
|
||||
minDashLength = NS_MAX(minDashLength, twipsPerPixel);
|
||||
nscoord numDashSpaces = 0;
|
||||
@ -3066,7 +3066,7 @@ nsCSSRendering::DrawTableBorderSegment(nsIRenderingContext& aContext,
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case NS_STYLE_BORDER_STYLE_GROOVE:
|
||||
ridgeGroove = NS_STYLE_BORDER_STYLE_GROOVE; // and fall through to ridge
|
||||
case NS_STYLE_BORDER_STYLE_RIDGE:
|
||||
@ -3077,14 +3077,14 @@ nsCSSRendering::DrawTableBorderSegment(nsIRenderingContext& aContext,
|
||||
aEndBevelSide, aEndBevelOffset);
|
||||
}
|
||||
else {
|
||||
nscoord startBevel = (aStartBevelOffset > 0)
|
||||
nscoord startBevel = (aStartBevelOffset > 0)
|
||||
? RoundFloatToPixel(0.5f * (float)aStartBevelOffset, twipsPerPixel, PR_TRUE) : 0;
|
||||
nscoord endBevel = (aEndBevelOffset > 0)
|
||||
nscoord endBevel = (aEndBevelOffset > 0)
|
||||
? RoundFloatToPixel(0.5f * (float)aEndBevelOffset, twipsPerPixel, PR_TRUE) : 0;
|
||||
PRUint8 ridgeGrooveSide = (horizontal) ? NS_SIDE_TOP : NS_SIDE_LEFT;
|
||||
// FIXME: In theory, this should use the visited-dependent
|
||||
// background color, but I don't care.
|
||||
aContext.SetColor (
|
||||
aContext.SetColor (
|
||||
MakeBevelColor(ridgeGrooveSide, ridgeGroove, aBGColor->mBackgroundColor, aBorderColor));
|
||||
nsRect rect(aBorder);
|
||||
nscoord half;
|
||||
@ -3098,7 +3098,7 @@ nsCSSRendering::DrawTableBorderSegment(nsIRenderingContext& aContext,
|
||||
if (NS_SIDE_TOP == aEndBevelSide) {
|
||||
rect.width -= endBevel;
|
||||
}
|
||||
DrawSolidBorderSegment(aContext, rect, twipsPerPixel, aStartBevelSide,
|
||||
DrawSolidBorderSegment(aContext, rect, twipsPerPixel, aStartBevelSide,
|
||||
startBevel, aEndBevelSide, endBevel);
|
||||
}
|
||||
else { // left, right
|
||||
@ -3111,7 +3111,7 @@ nsCSSRendering::DrawTableBorderSegment(nsIRenderingContext& aContext,
|
||||
if (NS_SIDE_LEFT == aEndBevelSide) {
|
||||
rect.height -= endBevel;
|
||||
}
|
||||
DrawSolidBorderSegment(aContext, rect, twipsPerPixel, aStartBevelSide,
|
||||
DrawSolidBorderSegment(aContext, rect, twipsPerPixel, aStartBevelSide,
|
||||
startBevel, aEndBevelSide, endBevel);
|
||||
}
|
||||
|
||||
@ -3119,7 +3119,7 @@ nsCSSRendering::DrawTableBorderSegment(nsIRenderingContext& aContext,
|
||||
ridgeGrooveSide = (NS_SIDE_TOP == ridgeGrooveSide) ? NS_SIDE_BOTTOM : NS_SIDE_RIGHT;
|
||||
// FIXME: In theory, this should use the visited-dependent
|
||||
// background color, but I don't care.
|
||||
aContext.SetColor (
|
||||
aContext.SetColor (
|
||||
MakeBevelColor(ridgeGrooveSide, ridgeGroove, aBGColor->mBackgroundColor, aBorderColor));
|
||||
if (horizontal) {
|
||||
rect.y = rect.y + half;
|
||||
@ -3131,7 +3131,7 @@ nsCSSRendering::DrawTableBorderSegment(nsIRenderingContext& aContext,
|
||||
if (NS_SIDE_BOTTOM == aEndBevelSide) {
|
||||
rect.width -= endBevel;
|
||||
}
|
||||
DrawSolidBorderSegment(aContext, rect, twipsPerPixel, aStartBevelSide,
|
||||
DrawSolidBorderSegment(aContext, rect, twipsPerPixel, aStartBevelSide,
|
||||
startBevel, aEndBevelSide, endBevel);
|
||||
}
|
||||
else {
|
||||
@ -3144,16 +3144,16 @@ nsCSSRendering::DrawTableBorderSegment(nsIRenderingContext& aContext,
|
||||
if (NS_SIDE_RIGHT == aEndBevelSide) {
|
||||
rect.height -= endBevel;
|
||||
}
|
||||
DrawSolidBorderSegment(aContext, rect, twipsPerPixel, aStartBevelSide,
|
||||
DrawSolidBorderSegment(aContext, rect, twipsPerPixel, aStartBevelSide,
|
||||
startBevel, aEndBevelSide, endBevel);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case NS_STYLE_BORDER_STYLE_DOUBLE:
|
||||
if ((aBorder.width > 2) && (aBorder.height > 2)) {
|
||||
nscoord startBevel = (aStartBevelOffset > 0)
|
||||
nscoord startBevel = (aStartBevelOffset > 0)
|
||||
? RoundFloatToPixel(0.333333f * (float)aStartBevelOffset, twipsPerPixel) : 0;
|
||||
nscoord endBevel = (aEndBevelOffset > 0)
|
||||
nscoord endBevel = (aEndBevelOffset > 0)
|
||||
? RoundFloatToPixel(0.333333f * (float)aEndBevelOffset, twipsPerPixel) : 0;
|
||||
if (horizontal) { // top, bottom
|
||||
nscoord thirdHeight = RoundFloatToPixel(0.333333f * (float)aBorder.height, twipsPerPixel);
|
||||
@ -3167,11 +3167,11 @@ nsCSSRendering::DrawTableBorderSegment(nsIRenderingContext& aContext,
|
||||
if (NS_SIDE_TOP == aEndBevelSide) {
|
||||
topRect.width -= aEndBevelOffset - endBevel;
|
||||
}
|
||||
DrawSolidBorderSegment(aContext, topRect, twipsPerPixel, aStartBevelSide,
|
||||
DrawSolidBorderSegment(aContext, topRect, twipsPerPixel, aStartBevelSide,
|
||||
startBevel, aEndBevelSide, endBevel);
|
||||
|
||||
// draw the botom line or rect
|
||||
nscoord heightOffset = aBorder.height - thirdHeight;
|
||||
nscoord heightOffset = aBorder.height - thirdHeight;
|
||||
nsRect bottomRect(aBorder.x, aBorder.y + heightOffset, aBorder.width, aBorder.height - heightOffset);
|
||||
if (NS_SIDE_BOTTOM == aStartBevelSide) {
|
||||
bottomRect.x += aStartBevelOffset - startBevel;
|
||||
@ -3180,13 +3180,13 @@ nsCSSRendering::DrawTableBorderSegment(nsIRenderingContext& aContext,
|
||||
if (NS_SIDE_BOTTOM == aEndBevelSide) {
|
||||
bottomRect.width -= aEndBevelOffset - endBevel;
|
||||
}
|
||||
DrawSolidBorderSegment(aContext, bottomRect, twipsPerPixel, aStartBevelSide,
|
||||
DrawSolidBorderSegment(aContext, bottomRect, twipsPerPixel, aStartBevelSide,
|
||||
startBevel, aEndBevelSide, endBevel);
|
||||
}
|
||||
else { // left, right
|
||||
nscoord thirdWidth = RoundFloatToPixel(0.333333f * (float)aBorder.width, twipsPerPixel);
|
||||
|
||||
nsRect leftRect(aBorder.x, aBorder.y, thirdWidth, aBorder.height);
|
||||
nsRect leftRect(aBorder.x, aBorder.y, thirdWidth, aBorder.height);
|
||||
if (NS_SIDE_LEFT == aStartBevelSide) {
|
||||
leftRect.y += aStartBevelOffset - startBevel;
|
||||
leftRect.height -= aStartBevelOffset - startBevel;
|
||||
@ -3197,7 +3197,7 @@ nsCSSRendering::DrawTableBorderSegment(nsIRenderingContext& aContext,
|
||||
DrawSolidBorderSegment(aContext, leftRect, twipsPerPixel, aStartBevelSide,
|
||||
startBevel, aEndBevelSide, endBevel);
|
||||
|
||||
nscoord widthOffset = aBorder.width - thirdWidth;
|
||||
nscoord widthOffset = aBorder.width - thirdWidth;
|
||||
nsRect rightRect(aBorder.x + widthOffset, aBorder.y, aBorder.width - widthOffset, aBorder.height);
|
||||
if (NS_SIDE_RIGHT == aStartBevelSide) {
|
||||
rightRect.y += aStartBevelOffset - startBevel;
|
||||
@ -3213,7 +3213,7 @@ nsCSSRendering::DrawTableBorderSegment(nsIRenderingContext& aContext,
|
||||
}
|
||||
// else fall through to solid
|
||||
case NS_STYLE_BORDER_STYLE_SOLID:
|
||||
DrawSolidBorderSegment(aContext, aBorder, twipsPerPixel, aStartBevelSide,
|
||||
DrawSolidBorderSegment(aContext, aBorder, twipsPerPixel, aStartBevelSide,
|
||||
aStartBevelOffset, aEndBevelSide, aEndBevelOffset);
|
||||
break;
|
||||
case NS_STYLE_BORDER_STYLE_OUTSET:
|
||||
@ -3598,7 +3598,7 @@ ImageRenderer::PrepareImage()
|
||||
mImage.RequestDecode();
|
||||
|
||||
// We can not prepare the image for rendering if it is not fully loaded.
|
||||
//
|
||||
//
|
||||
// Special case: If we requested a sync decode and we have an image, push
|
||||
// on through
|
||||
nsCOMPtr<imgIContainer> img;
|
||||
|
@ -70,7 +70,7 @@
|
||||
* appUnitsPerPixel -- current value of AUPP
|
||||
* destContext -- the gfxContext to which the border should be rendered
|
||||
* outsideRect -- the rectangle on the outer edge of the border
|
||||
*
|
||||
*
|
||||
* For any parameter where an array of side values is passed in,
|
||||
* they are in top, right, bottom, left order.
|
||||
*
|
||||
|
@ -126,7 +126,7 @@ nsLayoutUtils::GetLastContinuationWithChild(nsIFrame* aFrame)
|
||||
/**
|
||||
* GetFirstChildFrame returns the first "real" child frame of a
|
||||
* given frame. It will descend down into pseudo-frames (unless the
|
||||
* pseudo-frame is the :before generated frame).
|
||||
* pseudo-frame is the :before generated frame).
|
||||
* @param aFrame the frame
|
||||
* @param aFrame the frame's content node
|
||||
*/
|
||||
@ -154,7 +154,7 @@ GetFirstChildFrame(nsIFrame* aFrame,
|
||||
/**
|
||||
* GetLastChildFrame returns the last "real" child frame of a
|
||||
* given frame. It will descend down into pseudo-frames (unless the
|
||||
* pseudo-frame is the :after generated frame).
|
||||
* pseudo-frame is the :after generated frame).
|
||||
* @param aFrame the frame
|
||||
* @param aFrame the frame's content node
|
||||
*/
|
||||
@ -172,7 +172,7 @@ GetLastChildFrame(nsIFrame* aFrame,
|
||||
// Get the frame's first continuation. This matters in case the frame has
|
||||
// been continued across multiple lines or split by BiDi resolution.
|
||||
lastChildFrame = lastChildFrame->GetFirstContinuation();
|
||||
|
||||
|
||||
// If the last child frame is a pseudo-frame, then return its last child.
|
||||
// Note that the frame we create for the generated content is also a
|
||||
// pseudo-frame and so don't drill down in that case
|
||||
@ -287,7 +287,7 @@ nsLayoutUtils::GetBeforeFrame(nsIFrame* aFrame)
|
||||
NS_PRECONDITION(aFrame, "NULL frame pointer");
|
||||
NS_ASSERTION(!aFrame->GetPrevContinuation(),
|
||||
"aFrame must be first continuation");
|
||||
|
||||
|
||||
nsIFrame* firstFrame = GetFirstChildFrame(aFrame, aFrame->GetContent());
|
||||
|
||||
if (firstFrame && IsGeneratedContentFor(nsnull, firstFrame,
|
||||
@ -372,7 +372,7 @@ nsLayoutUtils::IsGeneratedContentFor(nsIContent* aContent,
|
||||
// Not the root of the generated content
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
|
||||
if (aContent && parent->GetContent() != aContent) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
@ -412,7 +412,7 @@ nsLayoutUtils::IsProperAncestorFrameCrossDoc(nsIFrame* aAncestorFrame, nsIFrame*
|
||||
{
|
||||
if (aFrame == aCommonAncestor)
|
||||
return PR_FALSE;
|
||||
|
||||
|
||||
nsIFrame* parentFrame = GetCrossDocParentFrame(aFrame);
|
||||
|
||||
while (parentFrame != aCommonAncestor) {
|
||||
@ -443,7 +443,7 @@ nsLayoutUtils::IsProperAncestorFrame(nsIFrame* aAncestorFrame, nsIFrame* aFrame,
|
||||
if (aFrame == aCommonAncestor) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
|
||||
nsIFrame* parentFrame = aFrame->GetParent();
|
||||
|
||||
while (parentFrame != aCommonAncestor) {
|
||||
@ -490,7 +490,7 @@ nsLayoutUtils::DoCompareTreePosition(nsIContent* aContent1,
|
||||
return DoCompareTreePosition(aContent1, aContent2,
|
||||
aIf1Ancestor, aIf2Ancestor, nsnull);
|
||||
}
|
||||
|
||||
|
||||
int last1 = content1Ancestors.Length() - 1;
|
||||
int last2 = content2Ancestors.Length() - 1;
|
||||
nsINode* content1Ancestor = nsnull;
|
||||
@ -737,7 +737,7 @@ nsLayoutUtils::GetDOMEventCoordinatesRelativeTo(nsIDOMEvent* aDOMEvent, nsIFrame
|
||||
nsPoint
|
||||
nsLayoutUtils::GetEventCoordinatesRelativeTo(const nsEvent* aEvent, nsIFrame* aFrame)
|
||||
{
|
||||
if (!aEvent || (aEvent->eventStructType != NS_MOUSE_EVENT &&
|
||||
if (!aEvent || (aEvent->eventStructType != NS_MOUSE_EVENT &&
|
||||
aEvent->eventStructType != NS_MOUSE_SCROLL_EVENT &&
|
||||
aEvent->eventStructType != NS_DRAG_EVENT &&
|
||||
aEvent->eventStructType != NS_SIMPLE_GESTURE_EVENT &&
|
||||
@ -779,7 +779,7 @@ nsLayoutUtils::GetEventCoordinatesRelativeTo(const nsEvent* aEvent, nsIFrame* aF
|
||||
*/
|
||||
if (transformFound)
|
||||
return InvertTransformsToRoot(aFrame, widgetToView);
|
||||
|
||||
|
||||
/* Otherwise, all coordinate systems are translations of one another,
|
||||
* so we can just subtract out the different.
|
||||
*/
|
||||
@ -842,12 +842,12 @@ static void ConstrainToCoordValues(gfxFloat &aVal)
|
||||
|
||||
nsRect
|
||||
nsLayoutUtils::RoundGfxRectToAppRect(const gfxRect &aRect, float aFactor)
|
||||
{
|
||||
/* Get a new gfxRect whose units are app units by scaling by the specified factor. */
|
||||
{
|
||||
/* Get a new gfxRect whose units are app units by scaling by the specified factor. */
|
||||
gfxRect scaledRect(aRect.pos.x * aFactor, aRect.pos.y * aFactor,
|
||||
aRect.size.width * aFactor,
|
||||
aRect.size.height * aFactor);
|
||||
|
||||
|
||||
/* Round outward. */
|
||||
scaledRect.RoundOut();
|
||||
|
||||
@ -856,7 +856,7 @@ nsLayoutUtils::RoundGfxRectToAppRect(const gfxRect &aRect, float aFactor)
|
||||
ConstrainToCoordValues(scaledRect.pos.y);
|
||||
ConstrainToCoordValues(scaledRect.size.width);
|
||||
ConstrainToCoordValues(scaledRect.size.height);
|
||||
|
||||
|
||||
/* Now typecast everything back. This is guaranteed to be safe. */
|
||||
return nsRect(nscoord(scaledRect.pos.x), nscoord(scaledRect.pos.y),
|
||||
nscoord(scaledRect.size.width), nscoord(scaledRect.size.height));
|
||||
@ -870,7 +870,7 @@ nsLayoutUtils::MatrixTransformRect(const nsRect &aBounds,
|
||||
NSAppUnitsToFloatPixels(aBounds.y, aFactor),
|
||||
NSAppUnitsToFloatPixels(aBounds.width, aFactor),
|
||||
NSAppUnitsToFloatPixels(aBounds.height, aFactor)));
|
||||
|
||||
|
||||
return RoundGfxRectToAppRect(image, aFactor);
|
||||
}
|
||||
|
||||
@ -948,7 +948,7 @@ static nsIntPoint GetWidgetOffset(nsIWidget* aWidget, nsIWidget*& aRootWidget) {
|
||||
}
|
||||
|
||||
nsPoint
|
||||
nsLayoutUtils::TranslateWidgetToView(nsPresContext* aPresContext,
|
||||
nsLayoutUtils::TranslateWidgetToView(nsPresContext* aPresContext,
|
||||
nsIWidget* aWidget, nsIntPoint aPt,
|
||||
nsIView* aView)
|
||||
{
|
||||
@ -1098,7 +1098,7 @@ PruneDisplayListForExtraPage(nsDisplayListBuilder* aBuilder,
|
||||
// property with a negative top.
|
||||
// The clip area needs to be moved because the frame geometry doesn't
|
||||
// put page content frames for adjacent pages vertically adjacent,
|
||||
// there are page margins and dead space between them in print
|
||||
// there are page margins and dead space between them in print
|
||||
// preview, and in printing all pages are at (0,0)...
|
||||
// XXX we have no way to test this right now that I know of;
|
||||
// the 'clip' property requires an abs-pos element and we never
|
||||
@ -1516,7 +1516,7 @@ nsLayoutUtils::GetZIndex(nsIFrame* aFrame) {
|
||||
* It also keeps track of the part of the string that has already been measured
|
||||
* so it doesn't have to keep measuring the same text over and over
|
||||
*
|
||||
* @param "aBaseWidth" contains the width in twips of the portion
|
||||
* @param "aBaseWidth" contains the width in twips of the portion
|
||||
* of the text that has already been measured, and aBaseInx contains
|
||||
* the index of the text that has already been measured.
|
||||
*
|
||||
@ -1524,13 +1524,13 @@ nsLayoutUtils::GetZIndex(nsIFrame* aFrame) {
|
||||
* before the cursor aIndex contains the index of the text where the cursor falls
|
||||
*/
|
||||
PRBool
|
||||
nsLayoutUtils::BinarySearchForPosition(nsIRenderingContext* aRendContext,
|
||||
nsLayoutUtils::BinarySearchForPosition(nsIRenderingContext* aRendContext,
|
||||
const PRUnichar* aText,
|
||||
PRInt32 aBaseWidth,
|
||||
PRInt32 aBaseInx,
|
||||
PRInt32 aStartInx,
|
||||
PRInt32 aEndInx,
|
||||
PRInt32 aCursorPos,
|
||||
PRInt32 aStartInx,
|
||||
PRInt32 aEndInx,
|
||||
PRInt32 aCursorPos,
|
||||
PRInt32& aIndex,
|
||||
PRInt32& aTextWidth)
|
||||
{
|
||||
@ -1707,7 +1707,7 @@ nsLayoutUtils::GetFontMetricsForStyleContext(nsStyleContext* aStyleContext,
|
||||
{
|
||||
// pass the user font set object into the device context to pass along to CreateFontGroup
|
||||
gfxUserFontSet* fs = aStyleContext->PresContext()->GetUserFontSet();
|
||||
|
||||
|
||||
return aStyleContext->PresContext()->DeviceContext()->GetMetricsFor(
|
||||
aStyleContext->GetStyleFont()->mFont,
|
||||
aStyleContext->GetStyleVisibility()->mLanguage,
|
||||
@ -1854,7 +1854,7 @@ static PRBool GetAbsoluteCoord(const nsStyleCoord& aStyle, nscoord& aResult)
|
||||
{
|
||||
if (eStyleUnit_Coord != aStyle.GetUnit())
|
||||
return PR_FALSE;
|
||||
|
||||
|
||||
aResult = aStyle.GetCoordValue();
|
||||
return PR_TRUE;
|
||||
}
|
||||
@ -2070,7 +2070,7 @@ nsLayoutUtils::IntrinsicForContainer(nsIRenderingContext *aRenderingContext,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (aFrame->GetType() == nsGkAtoms::tableFrame) {
|
||||
// Tables can't shrink smaller than their intrinsic minimum width,
|
||||
// no matter what.
|
||||
@ -2302,7 +2302,7 @@ IsAutoHeight(const nsStyleCoord &aCoord, nscoord aCBHeight)
|
||||
nsStyleUnit unit = aCoord.GetUnit();
|
||||
return unit == eStyleUnit_Auto || // only for 'height'
|
||||
unit == eStyleUnit_None || // only for 'max-height'
|
||||
(unit == eStyleUnit_Percent &&
|
||||
(unit == eStyleUnit_Percent &&
|
||||
aCBHeight == NS_AUTOHEIGHT);
|
||||
}
|
||||
|
||||
@ -2509,7 +2509,7 @@ nsLayoutUtils::ComputeSizeWithIntrinsicDimensions(
|
||||
}
|
||||
} else if (tentWidth < minWidth) {
|
||||
if (tentHeight < minHeight) {
|
||||
if (PRInt64(minWidth) * PRInt64(tentHeight) <=
|
||||
if (PRInt64(minWidth) * PRInt64(tentHeight) <=
|
||||
PRInt64(minHeight) * PRInt64(tentWidth)) {
|
||||
width = widthAtMinHeight;
|
||||
height = minHeight;
|
||||
@ -2627,7 +2627,7 @@ nsLayoutUtils::DrawString(const nsIFrame* aFrame,
|
||||
}
|
||||
if (NS_FAILED(rv))
|
||||
#endif // IBMBIDI
|
||||
{
|
||||
{
|
||||
aContext->SetTextRunRTL(PR_FALSE);
|
||||
aContext->DrawString(aString, aLength, aPoint.x, aPoint.y);
|
||||
}
|
||||
@ -3055,7 +3055,7 @@ nsLayoutUtils::DrawSingleUnscaledImage(nsIRenderingContext* aRenderingContext,
|
||||
return DrawImageInternal(aRenderingContext, aImage, gfxPattern::FILTER_NEAREST,
|
||||
dest, fill, aDest, aDirty, imageSize, aImageFlags);
|
||||
}
|
||||
|
||||
|
||||
/* static */ nsresult
|
||||
nsLayoutUtils::DrawSingleImage(nsIRenderingContext* aRenderingContext,
|
||||
imgIContainer* aImage,
|
||||
@ -3127,7 +3127,7 @@ nsLayoutUtils::GetWholeImageDestination(const nsIntSize& aWholeImageSize,
|
||||
}
|
||||
|
||||
void
|
||||
nsLayoutUtils::SetFontFromStyle(nsIRenderingContext* aRC, nsStyleContext* aSC)
|
||||
nsLayoutUtils::SetFontFromStyle(nsIRenderingContext* aRC, nsStyleContext* aSC)
|
||||
{
|
||||
const nsStyleFont* font = aSC->GetStyleFont();
|
||||
const nsStyleVisibility* visibility = aSC->GetStyleVisibility();
|
||||
@ -3241,7 +3241,7 @@ nsLayoutUtils::IsPopup(nsIFrame* aFrame)
|
||||
// We're a popup if we're the list control frame dropdown for a combobox.
|
||||
if (frameType == nsGkAtoms::listControlFrame) {
|
||||
nsListControlFrame* listControlFrame = static_cast<nsListControlFrame*>(aFrame);
|
||||
|
||||
|
||||
if (listControlFrame) {
|
||||
return listControlFrame->IsInDropDownMode();
|
||||
}
|
||||
@ -3405,7 +3405,7 @@ nsLayoutUtils::SurfaceFromElement(nsIDOMElement *aElement,
|
||||
} else {
|
||||
surf = gfxPlatform::GetPlatform()->CreateOffscreenSurface(gfxIntSize(w, h), gfxASurface::ImageFormatARGB32);
|
||||
}
|
||||
|
||||
|
||||
nsRefPtr<gfxContext> ctx = new gfxContext(surf);
|
||||
rv = canvas->RenderContexts(ctx, gfxPattern::FILTER_NEAREST);
|
||||
if (NS_FAILED(rv))
|
||||
@ -3494,7 +3494,7 @@ nsLayoutUtils::SurfaceFromElement(nsIDOMElement *aElement,
|
||||
rv = uri->SchemeIs("data", &isDataURI);
|
||||
if (NS_FAILED(rv))
|
||||
return result;
|
||||
|
||||
|
||||
// Data URIs are always OK; set the principal
|
||||
// to null to indicate that.
|
||||
nsCOMPtr<nsIPrincipal> principal;
|
||||
|
@ -85,7 +85,7 @@ public:
|
||||
/**
|
||||
* GetBeforeFrame returns the outermost :before frame of the given frame, if
|
||||
* one exists. This is typically O(1). The frame passed in must be
|
||||
* the first-in-flow.
|
||||
* the first-in-flow.
|
||||
*
|
||||
* @param aFrame the frame whose :before is wanted
|
||||
* @return the :before frame or nsnull if there isn't one
|
||||
@ -103,7 +103,7 @@ public:
|
||||
*/
|
||||
static nsIFrame* GetAfterFrame(nsIFrame* aFrame);
|
||||
|
||||
/**
|
||||
/**
|
||||
* Given a frame, search up the frame tree until we find an
|
||||
* ancestor that (or the frame itself) is of type aFrameType, if any.
|
||||
*
|
||||
@ -114,7 +114,7 @@ public:
|
||||
*/
|
||||
static nsIFrame* GetClosestFrameOfType(nsIFrame* aFrame, nsIAtom* aFrameType);
|
||||
|
||||
/**
|
||||
/**
|
||||
* Given a frame, search up the frame tree until we find an
|
||||
* ancestor that (or the frame itself) is a "Page" frame, if any.
|
||||
*
|
||||
@ -155,7 +155,7 @@ public:
|
||||
/**
|
||||
* CompareTreePosition determines whether aContent1 comes before or
|
||||
* after aContent2 in a preorder traversal of the content tree.
|
||||
*
|
||||
*
|
||||
* @param aCommonAncestor either null, or a common ancestor of
|
||||
* aContent1 and aContent2. Actually this is
|
||||
* only a hint; if it's not an ancestor of
|
||||
@ -193,7 +193,7 @@ public:
|
||||
* basically the same ordering as DoCompareTreePosition(nsIContent*) except
|
||||
* that it handles anonymous content properly and there are subtleties with
|
||||
* continuations.
|
||||
*
|
||||
*
|
||||
* @param aCommonAncestor either null, or a common ancestor of
|
||||
* aContent1 and aContent2. Actually this is
|
||||
* only a hint; if it's not an ancestor of
|
||||
@ -254,7 +254,7 @@ public:
|
||||
*/
|
||||
static nsIFrame* GetCrossDocParentFrame(const nsIFrame* aFrame,
|
||||
nsPoint* aCrossDocOffset = nsnull);
|
||||
|
||||
|
||||
/**
|
||||
* IsProperAncestorFrame checks whether aAncestorFrame is an ancestor
|
||||
* of aFrame and not equal to aFrame.
|
||||
@ -294,7 +294,7 @@ public:
|
||||
*/
|
||||
static nsIFrame* GetFrameFor(nsIView *aView)
|
||||
{ return static_cast<nsIFrame*>(aView->GetClientData()); }
|
||||
|
||||
|
||||
/**
|
||||
* GetScrollableFrameFor returns the scrollable frame for a scrolled frame
|
||||
*/
|
||||
@ -403,7 +403,7 @@ public:
|
||||
* @param aView view to which returned coordinates are relative
|
||||
* @return the point in the view's coordinates
|
||||
*/
|
||||
static nsPoint TranslateWidgetToView(nsPresContext* aPresContext,
|
||||
static nsPoint TranslateWidgetToView(nsPresContext* aPresContext,
|
||||
nsIWidget* aWidget, nsIntPoint aPt,
|
||||
nsIView* aView);
|
||||
|
||||
@ -513,7 +513,7 @@ public:
|
||||
|
||||
/**
|
||||
* Given aFrame, the root frame of a stacking context, paint it and its
|
||||
* descendants to aRenderingContext.
|
||||
* descendants to aRenderingContext.
|
||||
* @param aRenderingContext a rendering context translated so that (0,0)
|
||||
* is the origin of aFrame; for best results, (0,0) should transform
|
||||
* to pixel-aligned coordinates. This can be null, in which case
|
||||
@ -532,7 +532,7 @@ public:
|
||||
* even if aRenderingContext is non-null. This is useful if you want
|
||||
* to force rendering to use the widget's layer manager for testing
|
||||
* or speed. PAINT_WIDGET_LAYERS must be set if aRenderingContext is null.
|
||||
*
|
||||
*
|
||||
* So there are three possible behaviours:
|
||||
* 1) PAINT_WIDGET_LAYERS is set and aRenderingContext is null; we paint
|
||||
* by calling BeginTransaction on the widget's layer manager
|
||||
@ -560,22 +560,22 @@ public:
|
||||
* repainted after doing the blit
|
||||
* @param aBlitRegion output: a subregion of aUpdateRect that should
|
||||
* be repainted by blitting
|
||||
*
|
||||
*
|
||||
* If the caller does a bitblt copy of aBlitRegion-aPt to aBlitRegion,
|
||||
* and then repaints aRepaintRegion, then the area aUpdateRect will be
|
||||
* correctly up to date. aBlitRegion and aRepaintRegion do not intersect
|
||||
* and are both contained within aUpdateRect.
|
||||
*
|
||||
*
|
||||
* Frame geometry must have already been adjusted for the scroll/copy
|
||||
* operation before this function is called.
|
||||
*
|
||||
*
|
||||
* Conceptually it works by computing a display list in the before-state
|
||||
* and a display list in the after-state and analyzing them to find the
|
||||
* differences. In practice it is only feasible to build a display list
|
||||
* in the after-state (plus building two display lists would be less
|
||||
* efficient), so we use some unfortunately tricky techniques to get by
|
||||
* with just the after-list.
|
||||
*
|
||||
*
|
||||
* We compute the "visible moving area", a region that contains all
|
||||
* moving content that is visible, either before or after scrolling,
|
||||
* intersected with aUpdateRect.
|
||||
@ -588,9 +588,9 @@ public:
|
||||
* frames that will not move (translated by aDelta)
|
||||
* c) any visible areas of the after-move display list corresponding to
|
||||
* frames that did not move
|
||||
*
|
||||
*
|
||||
* aBlitRegion is the visible moving area minus aRepaintRegion.
|
||||
*
|
||||
*
|
||||
* We may return a larger region for aRepaintRegion and/or aBlitRegion
|
||||
* if computing the above regions precisely is too expensive. (However,
|
||||
* they will never intersect, since the regions that may be computed
|
||||
@ -614,7 +614,7 @@ public:
|
||||
* It also keeps track of the part of the string that has already been measured
|
||||
* so it doesn't have to keep measuring the same text over and over
|
||||
*
|
||||
* @param "aBaseWidth" contains the width in twips of the portion
|
||||
* @param "aBaseWidth" contains the width in twips of the portion
|
||||
* of the text that has already been measured, and aBaseInx contains
|
||||
* the index of the text that has already been measured.
|
||||
*
|
||||
@ -622,13 +622,13 @@ public:
|
||||
* before the cursor aIndex contains the index of the text where the cursor falls
|
||||
*/
|
||||
static PRBool
|
||||
BinarySearchForPosition(nsIRenderingContext* acx,
|
||||
BinarySearchForPosition(nsIRenderingContext* acx,
|
||||
const PRUnichar* aText,
|
||||
PRInt32 aBaseWidth,
|
||||
PRInt32 aBaseInx,
|
||||
PRInt32 aStartInx,
|
||||
PRInt32 aEndInx,
|
||||
PRInt32 aCursorPos,
|
||||
PRInt32 aStartInx,
|
||||
PRInt32 aEndInx,
|
||||
PRInt32 aCursorPos,
|
||||
PRInt32& aIndex,
|
||||
PRInt32& aTextWidth);
|
||||
|
||||
@ -720,7 +720,7 @@ public:
|
||||
* of aParent.
|
||||
*/
|
||||
static nsIFrame* FindChildContainingDescendant(nsIFrame* aParent, nsIFrame* aDescendantFrame);
|
||||
|
||||
|
||||
/**
|
||||
* Find the nearest ancestor that's a block
|
||||
*/
|
||||
@ -737,7 +737,7 @@ public:
|
||||
* an nsBlockFrame.
|
||||
*/
|
||||
static nsBlockFrame* GetAsBlock(nsIFrame* aFrame);
|
||||
|
||||
|
||||
/**
|
||||
* If aFrame is an out of flow frame, return its placeholder, otherwise
|
||||
* return its parent.
|
||||
@ -757,7 +757,7 @@ public:
|
||||
*/
|
||||
static nsIFrame*
|
||||
GetFirstContinuationOrSpecialSibling(nsIFrame *aFrame);
|
||||
|
||||
|
||||
/**
|
||||
* Check whether aFrame is a part of the scrollbar or scrollcorner of
|
||||
* the root content.
|
||||
|
@ -198,19 +198,19 @@
|
||||
#define NS_STYLE_SPEAK_NORMAL 1
|
||||
#define NS_STYLE_SPEAK_SPELL_OUT 2
|
||||
|
||||
// See nsStyleAural
|
||||
// See nsStyleAural
|
||||
#define NS_STYLE_SPEAK_HEADER_ONCE 0
|
||||
#define NS_STYLE_SPEAK_HEADER_ALWAYS 1
|
||||
|
||||
// See nsStyleAural
|
||||
// See nsStyleAural
|
||||
#define NS_STYLE_SPEAK_NUMERAL_DIGITS 0
|
||||
#define NS_STYLE_SPEAK_NUMERAL_CONTINUOUS 1
|
||||
|
||||
// See nsStyleAural
|
||||
// See nsStyleAural
|
||||
#define NS_STYLE_SPEAK_PUNCTUATION_NONE 0
|
||||
#define NS_STYLE_SPEAK_PUNCTUATION_CODE 1
|
||||
|
||||
// See nsStyleAural
|
||||
// See nsStyleAural
|
||||
#define NS_STYLE_SPEECH_RATE_X_SLOW 0
|
||||
#define NS_STYLE_SPEECH_RATE_SLOW 1
|
||||
#define NS_STYLE_SPEECH_RATE_MEDIUM 2
|
||||
@ -219,7 +219,7 @@
|
||||
#define NS_STYLE_SPEECH_RATE_FASTER 10
|
||||
#define NS_STYLE_SPEECH_RATE_SLOWER 11
|
||||
|
||||
// See nsStyleAural
|
||||
// See nsStyleAural
|
||||
#define NS_STYLE_VOLUME_SILENT 0
|
||||
#define NS_STYLE_VOLUME_X_SOFT 1
|
||||
#define NS_STYLE_VOLUME_SOFT 2
|
||||
@ -331,15 +331,15 @@
|
||||
#define NS_STYLE_CURSOR_CROSSHAIR 2
|
||||
#define NS_STYLE_CURSOR_DEFAULT 3 // ie: an arrow
|
||||
#define NS_STYLE_CURSOR_POINTER 4 // for links
|
||||
#define NS_STYLE_CURSOR_MOVE 5
|
||||
#define NS_STYLE_CURSOR_E_RESIZE 6
|
||||
#define NS_STYLE_CURSOR_NE_RESIZE 7
|
||||
#define NS_STYLE_CURSOR_NW_RESIZE 8
|
||||
#define NS_STYLE_CURSOR_N_RESIZE 9
|
||||
#define NS_STYLE_CURSOR_SE_RESIZE 10
|
||||
#define NS_STYLE_CURSOR_SW_RESIZE 11
|
||||
#define NS_STYLE_CURSOR_S_RESIZE 12
|
||||
#define NS_STYLE_CURSOR_W_RESIZE 13
|
||||
#define NS_STYLE_CURSOR_MOVE 5
|
||||
#define NS_STYLE_CURSOR_E_RESIZE 6
|
||||
#define NS_STYLE_CURSOR_NE_RESIZE 7
|
||||
#define NS_STYLE_CURSOR_NW_RESIZE 8
|
||||
#define NS_STYLE_CURSOR_N_RESIZE 9
|
||||
#define NS_STYLE_CURSOR_SE_RESIZE 10
|
||||
#define NS_STYLE_CURSOR_SW_RESIZE 11
|
||||
#define NS_STYLE_CURSOR_S_RESIZE 12
|
||||
#define NS_STYLE_CURSOR_W_RESIZE 13
|
||||
#define NS_STYLE_CURSOR_TEXT 14 // ie: i-beam
|
||||
#define NS_STYLE_CURSOR_WAIT 15
|
||||
#define NS_STYLE_CURSOR_HELP 16
|
||||
@ -495,7 +495,7 @@
|
||||
#define NS_STYLE_CLIP_BOTTOM_AUTO 0x80
|
||||
|
||||
// FRAME/FRAMESET/IFRAME specific values including backward compatibility. Boolean values with
|
||||
// the same meaning (e.g. 1 & yes) may need to be distinguished for correct mode processing
|
||||
// the same meaning (e.g. 1 & yes) may need to be distinguished for correct mode processing
|
||||
#define NS_STYLE_FRAME_YES 0
|
||||
#define NS_STYLE_FRAME_NO 1
|
||||
#define NS_STYLE_FRAME_0 2
|
||||
@ -552,7 +552,7 @@
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_JAPANESE_FORMAL 31
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_ARABIC_INDIC 32
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_PERSIAN 33
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_URDU 34
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_URDU 34
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_DEVANAGARI 35
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_GURMUKHI 36
|
||||
#define NS_STYLE_LIST_STYLE_MOZ_GUJARATI 37
|
||||
@ -804,9 +804,9 @@
|
||||
#define NS_STYLE_STROKE_LINEJOIN_BEVEL 2
|
||||
|
||||
// text-anchor
|
||||
#define NS_STYLE_TEXT_ANCHOR_START 0
|
||||
#define NS_STYLE_TEXT_ANCHOR_MIDDLE 1
|
||||
#define NS_STYLE_TEXT_ANCHOR_END 2
|
||||
#define NS_STYLE_TEXT_ANCHOR_START 0
|
||||
#define NS_STYLE_TEXT_ANCHOR_MIDDLE 1
|
||||
#define NS_STYLE_TEXT_ANCHOR_END 2
|
||||
|
||||
// text-rendering
|
||||
#define NS_STYLE_TEXT_RENDERING_AUTO 0
|
||||
|
@ -453,7 +453,7 @@ IsTopLevelWidget(nsIWidget* aWidget)
|
||||
nsWindowType windowType;
|
||||
aWidget->GetWindowType(windowType);
|
||||
return windowType == eWindowType_toplevel ||
|
||||
windowType == eWindowType_dialog ||
|
||||
windowType == eWindowType_dialog ||
|
||||
windowType == eWindowType_sheet;
|
||||
// popups aren't toplevel so they're not handled here
|
||||
}
|
||||
@ -549,7 +549,7 @@ nsContainerFrame::SyncFrameViewProperties(nsPresContext* aPresContext,
|
||||
}
|
||||
|
||||
nsIViewManager* vm = aView->GetViewManager();
|
||||
|
||||
|
||||
if (nsnull == aStyleContext) {
|
||||
aStyleContext = aFrame->GetStyleContext();
|
||||
}
|
||||
@ -622,7 +622,7 @@ nsContainerFrame::DoInlineIntrinsicWidth(nsIRenderingContext *aRenderingContext,
|
||||
// (implemented in bug 328168), the startSide border is always on the
|
||||
// first line.
|
||||
// This frame is a first-in-flow, but it might have a previous bidi
|
||||
// continuation, in which case that continuation should handle the startSide
|
||||
// continuation, in which case that continuation should handle the startSide
|
||||
// border.
|
||||
if (!GetPrevContinuation()) {
|
||||
aData->currentLine +=
|
||||
@ -646,7 +646,7 @@ nsContainerFrame::DoInlineIntrinsicWidth(nsIRenderingContext *aRenderingContext,
|
||||
kid->AddInlinePrefWidth(aRenderingContext,
|
||||
static_cast<InlinePrefWidthData*>(aData));
|
||||
}
|
||||
|
||||
|
||||
// After we advance to our next-in-flow, the stored line and line container
|
||||
// may no longer be correct. Just forget them.
|
||||
aData->line = nsnull;
|
||||
@ -654,7 +654,7 @@ nsContainerFrame::DoInlineIntrinsicWidth(nsIRenderingContext *aRenderingContext,
|
||||
|
||||
lastInFlow = nif;
|
||||
}
|
||||
|
||||
|
||||
aData->line = savedLine;
|
||||
aData->lineContainer = savedLineContainer;
|
||||
|
||||
@ -663,7 +663,7 @@ nsContainerFrame::DoInlineIntrinsicWidth(nsIRenderingContext *aRenderingContext,
|
||||
// (implemented in bug 328168), the endSide border is always on the
|
||||
// last line.
|
||||
// We reached the last-in-flow, but it might have a next bidi
|
||||
// continuation, in which case that continuation should handle
|
||||
// continuation, in which case that continuation should handle
|
||||
// the endSide border.
|
||||
if (!lastInFlow->GetNextContinuation()) {
|
||||
aData->currentLine +=
|
||||
@ -846,7 +846,7 @@ nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
|
||||
// invalidate the overflow area too.
|
||||
aKidFrame->Invalidate(aDesiredSize.mOverflowArea);
|
||||
}
|
||||
|
||||
|
||||
return aKidFrame->DidReflow(aPresContext, aReflowState, NS_FRAME_REFLOW_FINISHED);
|
||||
}
|
||||
|
||||
@ -1124,7 +1124,7 @@ nsContainerFrame::DeleteNextInFlowChild(nsPresContext* aPresContext,
|
||||
|
||||
// Take the next-in-flow out of the parent's child list
|
||||
#ifdef DEBUG
|
||||
nsresult rv =
|
||||
nsresult rv =
|
||||
#endif
|
||||
StealFrame(aPresContext, aNextInFlow);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "StealFrame failure");
|
||||
|
@ -94,7 +94,7 @@ nsCSSValueList::Equal(nsCSSValueList* aList1, nsCSSValueList* aList2)
|
||||
{
|
||||
if (aList1 == aList2)
|
||||
return PR_TRUE;
|
||||
|
||||
|
||||
nsCSSValueList *p1 = aList1, *p2 = aList2;
|
||||
for ( ; p1 && p2; p1 = p1->mNext, p2 = p2->mNext) {
|
||||
if (p1->mValue != p2->mValue)
|
||||
|
@ -118,7 +118,7 @@ NS_NewComputedDOMStyle(nsIDOMElement *aElement, const nsAString &aPseudoElt,
|
||||
|
||||
*aComputedStyle = nsnull;
|
||||
computedStyle.swap(*aComputedStyle);
|
||||
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -436,7 +436,7 @@ nsComputedDOMStyle::GetPropertyCSSValue(const nsAString& aPropertyName,
|
||||
}
|
||||
if (!propEntry) {
|
||||
#ifdef DEBUG_ComputedDOMStyle
|
||||
NS_WARNING(PromiseFlatCString(NS_ConvertUTF16toUTF8(aPropertyName) +
|
||||
NS_WARNING(PromiseFlatCString(NS_ConvertUTF16toUTF8(aPropertyName) +
|
||||
NS_LITERAL_CSTRING(" is not queryable!")).get());
|
||||
#endif
|
||||
|
||||
@ -768,7 +768,7 @@ nsComputedDOMStyle::GetColumnRuleStyle(nsIDOMCSSValue** aValue)
|
||||
nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
|
||||
if (!val)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
|
||||
val->SetIdent(
|
||||
nsCSSProps::ValueToKeywordEnum(GetStyleColumn()->mColumnRuleStyle,
|
||||
nsCSSProps::kBorderStyleKTable));
|
||||
@ -934,7 +934,7 @@ nsComputedDOMStyle::GetCounterIncrement(nsIDOMCSSValue** aValue)
|
||||
delete name;
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
|
||||
nsROCSSPrimitiveValue* value = GetROCSSPrimitiveValue();
|
||||
if (!value || !valueList->AppendCSSValue(value)) {
|
||||
delete valueList;
|
||||
@ -996,10 +996,10 @@ nsresult nsComputedDOMStyle::GetMozTransformOrigin(nsIDOMCSSValue **aValue)
|
||||
nsresult nsComputedDOMStyle::GetMozTransform(nsIDOMCSSValue **aValue)
|
||||
{
|
||||
static const PRInt32 NUM_FLOATS = 4;
|
||||
|
||||
|
||||
/* First, get the display data. We'll need it. */
|
||||
const nsStyleDisplay* display = GetStyleDisplay();
|
||||
|
||||
|
||||
/* If the "no transforms" flag is set, then we should construct a
|
||||
* single-element entry and hand it back.
|
||||
*/
|
||||
@ -1007,17 +1007,17 @@ nsresult nsComputedDOMStyle::GetMozTransform(nsIDOMCSSValue **aValue)
|
||||
nsROCSSPrimitiveValue *val(GetROCSSPrimitiveValue());
|
||||
if (!val)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
|
||||
/* Set it to "none." */
|
||||
val->SetIdent(eCSSKeyword_none);
|
||||
return CallQueryInterface(val, aValue);
|
||||
}
|
||||
|
||||
|
||||
/* Otherwise, we need to compute the current value of the transform matrix,
|
||||
* store it in a string, and hand it back to the caller.
|
||||
*/
|
||||
nsAutoString resultString(NS_LITERAL_STRING("matrix("));
|
||||
|
||||
|
||||
/* Now, we need to convert the matrix into a string. We'll start by taking
|
||||
* the first four entries and converting them directly to floating-point
|
||||
* values.
|
||||
@ -1043,12 +1043,12 @@ nsresult nsComputedDOMStyle::GetMozTransform(nsIDOMCSSValue **aValue)
|
||||
/* Now, compute the dX and dY components by adding the stored coord value
|
||||
* (in CSS pixels) to the translate values.
|
||||
*/
|
||||
|
||||
|
||||
float deltaX = nsPresContext::AppUnitsToFloatCSSPixels
|
||||
(display->mTransform.GetXTranslation(bounds));
|
||||
float deltaY = nsPresContext::AppUnitsToFloatCSSPixels
|
||||
(display->mTransform.GetYTranslation(bounds));
|
||||
|
||||
|
||||
|
||||
/* Append these values! */
|
||||
resultString.AppendFloat(deltaX);
|
||||
@ -1088,7 +1088,7 @@ nsComputedDOMStyle::GetCounterReset(nsIDOMCSSValue** aValue)
|
||||
delete name;
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
|
||||
nsROCSSPrimitiveValue* value = GetROCSSPrimitiveValue();
|
||||
if (!value || !valueList->AppendCSSValue(value)) {
|
||||
delete valueList;
|
||||
@ -1128,7 +1128,7 @@ nsComputedDOMStyle::GetQuotes(nsIDOMCSSValue** aValue)
|
||||
delete openVal;
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
|
||||
nsROCSSPrimitiveValue* closeVal = GetROCSSPrimitiveValue();
|
||||
if (!closeVal || !valueList->AppendCSSValue(closeVal)) {
|
||||
delete valueList;
|
||||
@ -1163,7 +1163,7 @@ nsComputedDOMStyle::GetFontFamily(nsIDOMCSSValue** aValue)
|
||||
NS_ASSERTION(presContext, "pres context is required");
|
||||
|
||||
const nsString& fontName = font->mFont.name;
|
||||
if (font->mGenericID == kGenericFont_NONE && !font->mFont.systemFont) {
|
||||
if (font->mGenericID == kGenericFont_NONE && !font->mFont.systemFont) {
|
||||
const nsFont* defaultFont =
|
||||
presContext->GetDefaultFont(kPresContext_DefaultVariableFont_ID);
|
||||
|
||||
@ -1571,7 +1571,7 @@ nsComputedDOMStyle::GetBackgroundInlinePolicy(nsIDOMCSSValue** aValue)
|
||||
GetStyleBackground()->mBackgroundInlinePolicy,
|
||||
nsCSSProps::kBackgroundInlinePolicyKTable));
|
||||
|
||||
return CallQueryInterface(val, aValue);
|
||||
return CallQueryInterface(val, aValue);
|
||||
}
|
||||
|
||||
nsresult
|
||||
@ -1628,7 +1628,7 @@ nsComputedDOMStyle::GetBackgroundPosition(nsIDOMCSSValue** aValue)
|
||||
}
|
||||
}
|
||||
|
||||
return CallQueryInterface(valueList, aValue);
|
||||
return CallQueryInterface(valueList, aValue);
|
||||
}
|
||||
|
||||
nsresult
|
||||
@ -1778,7 +1778,7 @@ nsComputedDOMStyle::GetBorderSpacing(nsIDOMCSSValue** aValue)
|
||||
delete xSpacing;
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
|
||||
nsROCSSPrimitiveValue* ySpacing = GetROCSSPrimitiveValue();
|
||||
if (!ySpacing) {
|
||||
delete valueList;
|
||||
@ -2140,7 +2140,7 @@ nsComputedDOMStyle::GetEllipseRadii(const nsStyleCorners& aRadius,
|
||||
= aRadius.Get(NS_FULL_TO_HALF_CORNER(aFullCorner, PR_FALSE));
|
||||
const nsStyleCoord& radiusY
|
||||
= aRadius.Get(NS_FULL_TO_HALF_CORNER(aFullCorner, PR_TRUE));
|
||||
|
||||
|
||||
// for compatibility, return a single value if X and Y are equal
|
||||
if (radiusX == radiusY) {
|
||||
nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
|
||||
@ -2284,7 +2284,7 @@ nsComputedDOMStyle::GetZIndex(nsIDOMCSSValue** aValue)
|
||||
NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
SetValueToCoord(val, GetStylePosition()->mZIndex);
|
||||
|
||||
|
||||
return CallQueryInterface(val, aValue);
|
||||
}
|
||||
|
||||
@ -2305,7 +2305,7 @@ nsComputedDOMStyle::GetListStyleImage(nsIDOMCSSValue** aValue)
|
||||
}
|
||||
val->SetURI(uri);
|
||||
}
|
||||
|
||||
|
||||
return CallQueryInterface(val, aValue);
|
||||
}
|
||||
|
||||
@ -2382,7 +2382,7 @@ nsComputedDOMStyle::GetImageRegion(nsIDOMCSSValue** aValue)
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
return CallQueryInterface(val, aValue);
|
||||
}
|
||||
|
||||
@ -2495,7 +2495,7 @@ nsComputedDOMStyle::GetMozTabSize(nsIDOMCSSValue** aValue)
|
||||
NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
val->SetNumber(GetStyleText()->mTabSize);
|
||||
|
||||
|
||||
return CallQueryInterface(val, aValue);
|
||||
}
|
||||
|
||||
@ -2566,7 +2566,7 @@ nsComputedDOMStyle::GetPointerEvents(nsIDOMCSSValue** aValue)
|
||||
{
|
||||
nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
|
||||
NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
|
||||
val->SetIdent(
|
||||
nsCSSProps::ValueToKeywordEnum(GetStyleVisibility()->mPointerEvents,
|
||||
nsCSSProps::kPointerEventsKTable));
|
||||
@ -2778,7 +2778,7 @@ nsresult
|
||||
nsComputedDOMStyle::GetBorderImage(nsIDOMCSSValue** aValue)
|
||||
{
|
||||
const nsStyleBorder* border = GetStyleBorder();
|
||||
|
||||
|
||||
// none
|
||||
if (!border->GetBorderImage()) {
|
||||
nsROCSSPrimitiveValue *valNone = GetROCSSPrimitiveValue();
|
||||
@ -2786,10 +2786,10 @@ nsComputedDOMStyle::GetBorderImage(nsIDOMCSSValue** aValue)
|
||||
valNone->SetIdent(eCSSKeyword_none);
|
||||
return CallQueryInterface(valNone, aValue);
|
||||
}
|
||||
|
||||
|
||||
nsDOMCSSValueList *valueList = GetROCSSValueList(PR_FALSE);
|
||||
NS_ENSURE_TRUE(valueList, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
|
||||
// uri
|
||||
nsROCSSPrimitiveValue *valURI = GetROCSSPrimitiveValue();
|
||||
if (!valURI || !valueList->AppendCSSValue(valURI)) {
|
||||
@ -2800,7 +2800,7 @@ nsComputedDOMStyle::GetBorderImage(nsIDOMCSSValue** aValue)
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
border->GetBorderImage()->GetURI(getter_AddRefs(uri));
|
||||
valURI->SetURI(uri);
|
||||
|
||||
|
||||
// four split numbers
|
||||
NS_FOR_CSS_SIDES(side) {
|
||||
nsROCSSPrimitiveValue *valSplit = GetROCSSPrimitiveValue();
|
||||
@ -2812,7 +2812,7 @@ nsComputedDOMStyle::GetBorderImage(nsIDOMCSSValue** aValue)
|
||||
SetValueToCoord(valSplit, border->mBorderImageSplit.Get(side), nsnull,
|
||||
nsnull);
|
||||
}
|
||||
|
||||
|
||||
// copy of border-width
|
||||
if (border->mHaveBorderImageWidth) {
|
||||
nsROCSSPrimitiveValue *slash = GetROCSSPrimitiveValue();
|
||||
@ -2833,7 +2833,7 @@ nsComputedDOMStyle::GetBorderImage(nsIDOMCSSValue** aValue)
|
||||
borderWidth->SetAppUnits(width);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// first keyword
|
||||
nsROCSSPrimitiveValue *keyword = GetROCSSPrimitiveValue();
|
||||
if (!keyword || !valueList->AppendCSSValue(keyword)) {
|
||||
@ -2844,7 +2844,7 @@ nsComputedDOMStyle::GetBorderImage(nsIDOMCSSValue** aValue)
|
||||
keyword->SetIdent(
|
||||
nsCSSProps::ValueToKeywordEnum(GetStyleBorder()->mBorderImageHFill,
|
||||
nsCSSProps::kBorderImageKTable));
|
||||
|
||||
|
||||
// second keyword
|
||||
nsROCSSPrimitiveValue *keyword2 = GetROCSSPrimitiveValue();
|
||||
if (!keyword2 || !valueList->AppendCSSValue(keyword2)) {
|
||||
@ -2855,7 +2855,7 @@ nsComputedDOMStyle::GetBorderImage(nsIDOMCSSValue** aValue)
|
||||
keyword2->SetIdent(
|
||||
nsCSSProps::ValueToKeywordEnum(GetStyleBorder()->mBorderImageVFill,
|
||||
nsCSSProps::kBorderImageKTable));
|
||||
|
||||
|
||||
return CallQueryInterface(valueList, aValue);
|
||||
}
|
||||
|
||||
@ -3002,19 +3002,19 @@ nsComputedDOMStyle::GetClip(nsIDOMCSSValue** aValue)
|
||||
} else {
|
||||
topVal->SetAppUnits(display->mClip.y);
|
||||
}
|
||||
|
||||
|
||||
if (display->mClipFlags & NS_STYLE_CLIP_RIGHT_AUTO) {
|
||||
rightVal->SetIdent(eCSSKeyword_auto);
|
||||
} else {
|
||||
rightVal->SetAppUnits(display->mClip.width + display->mClip.x);
|
||||
}
|
||||
|
||||
|
||||
if (display->mClipFlags & NS_STYLE_CLIP_BOTTOM_AUTO) {
|
||||
bottomVal->SetIdent(eCSSKeyword_auto);
|
||||
} else {
|
||||
bottomVal->SetAppUnits(display->mClip.height + display->mClip.y);
|
||||
}
|
||||
|
||||
|
||||
if (display->mClipFlags & NS_STYLE_CLIP_LEFT_AUTO) {
|
||||
leftVal->SetIdent(eCSSKeyword_auto);
|
||||
} else {
|
||||
@ -3039,7 +3039,7 @@ nsComputedDOMStyle::GetClip(nsIDOMCSSValue** aValue)
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
return CallQueryInterface(val, aValue);
|
||||
}
|
||||
|
||||
@ -3054,7 +3054,7 @@ nsComputedDOMStyle::GetOverflow(nsIDOMCSSValue** aValue)
|
||||
*aValue = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
|
||||
NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
@ -3144,7 +3144,7 @@ nsComputedDOMStyle::GetHeight(nsIDOMCSSValue** aValue)
|
||||
NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
PRBool calcHeight = PR_FALSE;
|
||||
|
||||
|
||||
if (mInnerFrame) {
|
||||
calcHeight = PR_TRUE;
|
||||
|
||||
@ -3157,7 +3157,7 @@ nsComputedDOMStyle::GetHeight(nsIDOMCSSValue** aValue)
|
||||
|
||||
if (calcHeight) {
|
||||
AssertFlushedPendingReflows();
|
||||
|
||||
|
||||
val->SetAppUnits(mInnerFrame->GetContentRect().height);
|
||||
} else {
|
||||
const nsStylePosition *positionData = GetStylePosition();
|
||||
@ -3170,11 +3170,11 @@ nsComputedDOMStyle::GetHeight(nsIDOMCSSValue** aValue)
|
||||
StyleCoordToNSCoord(positionData->mMaxHeight,
|
||||
&nsComputedDOMStyle::GetCBContentHeight,
|
||||
nscoord_MAX);
|
||||
|
||||
|
||||
SetValueToCoord(val, positionData->mHeight, nsnull, nsnull,
|
||||
minHeight, maxHeight);
|
||||
}
|
||||
|
||||
|
||||
return CallQueryInterface(val, aValue);
|
||||
}
|
||||
|
||||
@ -3211,7 +3211,7 @@ nsComputedDOMStyle::GetWidth(nsIDOMCSSValue** aValue)
|
||||
StyleCoordToNSCoord(positionData->mMaxWidth,
|
||||
&nsComputedDOMStyle::GetCBContentWidth,
|
||||
nscoord_MAX);
|
||||
|
||||
|
||||
SetValueToCoord(val, positionData->mWidth, nsnull,
|
||||
nsCSSProps::kWidthKTable, minWidth, maxWidth);
|
||||
}
|
||||
@ -3347,7 +3347,7 @@ nsComputedDOMStyle::GetAbsoluteOffset(PRUint8 aSide, nsIDOMCSSValue** aValue)
|
||||
nsMargin scrollbarSizes(0, 0, 0, 0);
|
||||
nsRect rect = mOuterFrame->GetRect();
|
||||
nsRect containerRect = container->GetRect();
|
||||
|
||||
|
||||
if (container->GetType() == nsGkAtoms::viewportFrame) {
|
||||
// For absolutely positioned frames scrollbars are taken into
|
||||
// account by virtue of getting a containing block that does
|
||||
@ -3416,7 +3416,7 @@ nsComputedDOMStyle::GetRelativeOffset(PRUint8 aSide, nsIDOMCSSValue** aValue)
|
||||
coord.GetUnit() == eStyleUnit_Percent ||
|
||||
coord.GetUnit() == eStyleUnit_Auto,
|
||||
"Unexpected unit");
|
||||
|
||||
|
||||
if (coord.GetUnit() == eStyleUnit_Auto) {
|
||||
coord = positionData->mOffset.Get(NS_OPPOSITE_SIDE(aSide));
|
||||
sign = -1;
|
||||
@ -3441,7 +3441,7 @@ nsComputedDOMStyle::GetStaticOffset(PRUint8 aSide, nsIDOMCSSValue** aValue)
|
||||
NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
SetValueToCoord(val, GetStylePosition()->mOffset.Get(aSide));
|
||||
|
||||
|
||||
return CallQueryInterface(val, aValue);
|
||||
}
|
||||
|
||||
@ -3455,7 +3455,7 @@ nsComputedDOMStyle::GetPaddingWidthFor(PRUint8 aSide, nsIDOMCSSValue** aValue)
|
||||
SetValueToCoord(val, GetStylePadding()->mPadding.Get(aSide));
|
||||
} else {
|
||||
AssertFlushedPendingReflows();
|
||||
|
||||
|
||||
val->SetAppUnits(mInnerFrame->GetUsedPadding().side(aSide));
|
||||
}
|
||||
|
||||
@ -3481,7 +3481,7 @@ nsComputedDOMStyle::GetLineHeightCoord(nscoord& aCoord)
|
||||
|
||||
aCoord = nsHTMLReflowState::CalcLineHeight(mStyleContextHolder,
|
||||
blockHeight);
|
||||
|
||||
|
||||
// CalcLineHeight uses font->mFont.size, but we want to use
|
||||
// font->mSize as the font size. Adjust for that. Also adjust for
|
||||
// the text zoom, if any.
|
||||
@ -3489,7 +3489,7 @@ nsComputedDOMStyle::GetLineHeightCoord(nscoord& aCoord)
|
||||
aCoord = NSToCoordRound((float(aCoord) *
|
||||
(float(font->mSize) / float(font->mFont.size))) /
|
||||
mPresShell->GetPresContext()->TextZoom());
|
||||
|
||||
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
@ -3564,7 +3564,7 @@ nsComputedDOMStyle::GetBorderColorFor(PRUint8 aSide, nsIDOMCSSValue** aValue)
|
||||
nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
|
||||
NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
nscolor color;
|
||||
nscolor color;
|
||||
PRBool foreground;
|
||||
GetStyleBorder()->GetBorderColor(aSide, color, foreground);
|
||||
if (foreground) {
|
||||
@ -3619,16 +3619,16 @@ nsComputedDOMStyle::SetValueToCoord(nsROCSSPrimitiveValue* aValue,
|
||||
nscoord aMaxAppUnits)
|
||||
{
|
||||
NS_PRECONDITION(aValue, "Must have a value to work with");
|
||||
|
||||
|
||||
switch (aCoord.GetUnit()) {
|
||||
case eStyleUnit_Normal:
|
||||
aValue->SetIdent(eCSSKeyword_normal);
|
||||
break;
|
||||
|
||||
|
||||
case eStyleUnit_Auto:
|
||||
aValue->SetIdent(eCSSKeyword_auto);
|
||||
break;
|
||||
|
||||
|
||||
case eStyleUnit_Percent:
|
||||
{
|
||||
nscoord percentageBase;
|
||||
@ -3641,32 +3641,32 @@ nsComputedDOMStyle::SetValueToCoord(nsROCSSPrimitiveValue* aValue,
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case eStyleUnit_Factor:
|
||||
aValue->SetNumber(aCoord.GetFactorValue());
|
||||
break;
|
||||
|
||||
|
||||
case eStyleUnit_Coord:
|
||||
{
|
||||
nscoord val = aCoord.GetCoordValue();
|
||||
aValue->SetAppUnits(NS_MAX(aMinAppUnits, NS_MIN(val, aMaxAppUnits)));
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case eStyleUnit_Integer:
|
||||
aValue->SetNumber(aCoord.GetIntValue());
|
||||
break;
|
||||
|
||||
|
||||
case eStyleUnit_Enumerated:
|
||||
NS_ASSERTION(aTable, "Must have table to handle this case");
|
||||
aValue->SetIdent(nsCSSProps::ValueToKeywordEnum(aCoord.GetIntValue(),
|
||||
aTable));
|
||||
break;
|
||||
|
||||
|
||||
case eStyleUnit_None:
|
||||
aValue->SetIdent(eCSSKeyword_none);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
NS_ERROR("Can't handle this unit");
|
||||
break;
|
||||
@ -3693,7 +3693,7 @@ nsComputedDOMStyle::StyleCoordToNSCoord(const nsStyleCoord& aCoord,
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return aDefaultValue;
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ private:
|
||||
NS_ASSERTION(mFlushedPendingReflows,
|
||||
"property getter should have been marked layout-dependent");
|
||||
}
|
||||
|
||||
|
||||
#define STYLE_STRUCT(name_, checkdata_cb_, ctor_args_) \
|
||||
const nsStyle##name_ * GetStyle##name_() { \
|
||||
return mStyleContextHolder->GetStyle##name_(); \
|
||||
@ -389,7 +389,7 @@ private:
|
||||
nsresult SetToRGBAColor(nsROCSSPrimitiveValue* aValue, nscolor aColor);
|
||||
nsresult SetValueToStyleImage(const nsStyleImage& aStyleImage,
|
||||
nsROCSSPrimitiveValue* aValue);
|
||||
|
||||
|
||||
/**
|
||||
* A method to get a percentage base for a percentage value. Returns PR_TRUE
|
||||
* if a percentage base value was determined, PR_FALSE otherwise.
|
||||
@ -486,7 +486,7 @@ private:
|
||||
#endif
|
||||
};
|
||||
|
||||
nsresult
|
||||
nsresult
|
||||
NS_NewComputedDOMStyle(nsIDOMElement *aElement, const nsAString &aPseudoElt,
|
||||
nsIPresShell *aPresShell,
|
||||
nsComputedDOMStyle **aComputedStyle);
|
||||
|
@ -445,12 +445,12 @@ protected:
|
||||
void DestroyInternal(nsRuleNode ***aDestroyQueueTail);
|
||||
void PropagateDependentBit(PRUint32 aBit, nsRuleNode* aHighestNode);
|
||||
void PropagateNoneBit(PRUint32 aBit, nsRuleNode* aHighestNode);
|
||||
|
||||
|
||||
const void* SetDefaultOnRoot(const nsStyleStructID aSID,
|
||||
nsStyleContext* aContext);
|
||||
|
||||
const void*
|
||||
WalkRuleTree(const nsStyleStructID aSID, nsStyleContext* aContext,
|
||||
WalkRuleTree(const nsStyleStructID aSID, nsStyleContext* aContext,
|
||||
nsRuleData* aRuleData, nsRuleDataStruct* aSpecificData);
|
||||
|
||||
const void*
|
||||
@ -483,35 +483,35 @@ protected:
|
||||
|
||||
const void*
|
||||
ComputeBackgroundData(void* aStartStruct,
|
||||
const nsRuleDataStruct& aData,
|
||||
const nsRuleDataStruct& aData,
|
||||
nsStyleContext* aContext, nsRuleNode* aHighestNode,
|
||||
RuleDetail aRuleDetail,
|
||||
const PRBool aCanStoreInRuleTree);
|
||||
|
||||
const void*
|
||||
ComputeMarginData(void* aStartStruct,
|
||||
const nsRuleDataStruct& aData,
|
||||
const nsRuleDataStruct& aData,
|
||||
nsStyleContext* aContext, nsRuleNode* aHighestNode,
|
||||
RuleDetail aRuleDetail,
|
||||
const PRBool aCanStoreInRuleTree);
|
||||
|
||||
const void*
|
||||
ComputeBorderData(void* aStartStruct,
|
||||
const nsRuleDataStruct& aData,
|
||||
const nsRuleDataStruct& aData,
|
||||
nsStyleContext* aContext, nsRuleNode* aHighestNode,
|
||||
RuleDetail aRuleDetail,
|
||||
const PRBool aCanStoreInRuleTree);
|
||||
|
||||
const void*
|
||||
ComputePaddingData(void* aStartStruct,
|
||||
const nsRuleDataStruct& aData,
|
||||
const nsRuleDataStruct& aData,
|
||||
nsStyleContext* aContext, nsRuleNode* aHighestNode,
|
||||
RuleDetail aRuleDetail,
|
||||
const PRBool aCanStoreInRuleTree);
|
||||
|
||||
const void*
|
||||
ComputeOutlineData(void* aStartStruct,
|
||||
const nsRuleDataStruct& aData,
|
||||
const nsRuleDataStruct& aData,
|
||||
nsStyleContext* aContext, nsRuleNode* aHighestNode,
|
||||
RuleDetail aRuleDetail,
|
||||
const PRBool aCanStoreInRuleTree);
|
||||
@ -525,21 +525,21 @@ protected:
|
||||
|
||||
const void*
|
||||
ComputePositionData(void* aStartStruct,
|
||||
const nsRuleDataStruct& aData,
|
||||
const nsRuleDataStruct& aData,
|
||||
nsStyleContext* aContext, nsRuleNode* aHighestNode,
|
||||
RuleDetail aRuleDetail,
|
||||
const PRBool aCanStoreInRuleTree);
|
||||
|
||||
const void*
|
||||
ComputeTableData(void* aStartStruct,
|
||||
const nsRuleDataStruct& aData,
|
||||
const nsRuleDataStruct& aData,
|
||||
nsStyleContext* aContext, nsRuleNode* aHighestNode,
|
||||
RuleDetail aRuleDetail,
|
||||
const PRBool aCanStoreInRuleTree);
|
||||
|
||||
const void*
|
||||
ComputeTableBorderData(void* aStartStruct,
|
||||
const nsRuleDataStruct& aData,
|
||||
const nsRuleDataStruct& aData,
|
||||
nsStyleContext* aContext, nsRuleNode* aHighestNode,
|
||||
RuleDetail aRuleDetail,
|
||||
const PRBool aCanStoreInRuleTree);
|
||||
@ -553,14 +553,14 @@ protected:
|
||||
|
||||
const void*
|
||||
ComputeQuotesData(void* aStartStruct,
|
||||
const nsRuleDataStruct& aData,
|
||||
const nsRuleDataStruct& aData,
|
||||
nsStyleContext* aContext, nsRuleNode* aHighestNode,
|
||||
RuleDetail aRuleDetail,
|
||||
const PRBool aCanStoreInRuleTree);
|
||||
|
||||
const void*
|
||||
ComputeTextData(void* aStartStruct,
|
||||
const nsRuleDataStruct& aData,
|
||||
const nsRuleDataStruct& aData,
|
||||
nsStyleContext* aContext, nsRuleNode* aHighestNode,
|
||||
RuleDetail aRuleDetail,
|
||||
const PRBool aCanStoreInRuleTree);
|
||||
@ -574,7 +574,7 @@ protected:
|
||||
|
||||
const void*
|
||||
ComputeUserInterfaceData(void* aStartStruct,
|
||||
const nsRuleDataStruct& aData,
|
||||
const nsRuleDataStruct& aData,
|
||||
nsStyleContext* aContext,
|
||||
nsRuleNode* aHighestNode,
|
||||
RuleDetail aRuleDetail,
|
||||
@ -589,7 +589,7 @@ protected:
|
||||
|
||||
const void*
|
||||
ComputeXULData(void* aStartStruct,
|
||||
const nsRuleDataStruct& aData,
|
||||
const nsRuleDataStruct& aData,
|
||||
nsStyleContext* aContext, nsRuleNode* aHighestNode,
|
||||
RuleDetail aRuleDetail,
|
||||
const PRBool aCanStoreInRuleTree);
|
||||
@ -603,14 +603,14 @@ protected:
|
||||
|
||||
const void*
|
||||
ComputeSVGData(void* aStartStruct,
|
||||
const nsRuleDataStruct& aData,
|
||||
const nsRuleDataStruct& aData,
|
||||
nsStyleContext* aContext, nsRuleNode* aHighestNode,
|
||||
RuleDetail aRuleDetail,
|
||||
const PRBool aCanStoreInRuleTree);
|
||||
|
||||
const void*
|
||||
ComputeSVGResetData(void* aStartStruct,
|
||||
const nsRuleDataStruct& aData,
|
||||
const nsRuleDataStruct& aData,
|
||||
nsStyleContext* aContext, nsRuleNode* aHighestNode,
|
||||
RuleDetail aRuleDetail,
|
||||
const PRBool aCanStoreInRuleTree);
|
||||
@ -659,7 +659,7 @@ protected:
|
||||
#define STYLE_STRUCT(name_, checkdata_cb_, ctor_args_) \
|
||||
const nsStyle##name_* GetParent##name_();
|
||||
#include "nsStyleStructList.h"
|
||||
#undef STYLE_STRUCT
|
||||
#undef STYLE_STRUCT
|
||||
|
||||
const void* GetDisplayData(nsStyleContext* aContext);
|
||||
const void* GetVisibilityData(nsStyleContext* aContext);
|
||||
@ -708,7 +708,7 @@ public:
|
||||
PRBool IsRoot() const { return mParent == nsnull; }
|
||||
|
||||
// These PRUint8s are really nsStyleSet::sheetType values.
|
||||
PRUint8 GetLevel() const {
|
||||
PRUint8 GetLevel() const {
|
||||
NS_ASSERTION(!IsRoot(), "can't call on root");
|
||||
return (mDependentBits & NS_RULE_NODE_LEVEL_MASK) >>
|
||||
NS_RULE_NODE_LEVEL_SHIFT;
|
||||
@ -723,7 +723,7 @@ public:
|
||||
// NOTE: Does not |AddRef|.
|
||||
nsPresContext* GetPresContext() const { return mPresContext; }
|
||||
|
||||
const void* GetStyleData(nsStyleStructID aSID,
|
||||
const void* GetStyleData(nsStyleStructID aSID,
|
||||
nsStyleContext* aContext,
|
||||
PRBool aComputeData);
|
||||
|
||||
@ -731,7 +731,7 @@ public:
|
||||
const nsStyle##name_* GetStyle##name_(nsStyleContext* aContext, \
|
||||
PRBool aComputeData);
|
||||
#include "nsStyleStructList.h"
|
||||
#undef STYLE_STRUCT
|
||||
#undef STYLE_STRUCT
|
||||
|
||||
/*
|
||||
* Garbage collection. Mark walks up the tree, marking any unmarked
|
||||
|
@ -1200,7 +1200,7 @@ nsStyleAnimation::UncomputeValue(nsCSSProperty aProperty,
|
||||
case eCSSType_Rect:
|
||||
storage = ▭
|
||||
break;
|
||||
case eCSSType_ValuePair:
|
||||
case eCSSType_ValuePair:
|
||||
storage = &vp;
|
||||
break;
|
||||
case eCSSType_ValueList:
|
||||
@ -1238,7 +1238,7 @@ static void
|
||||
ExtractBorderColor(nsStyleContext* aStyleContext, const void* aStyleBorder,
|
||||
PRUint8 aSide, nsStyleAnimation::Value& aComputedValue)
|
||||
{
|
||||
nscolor color;
|
||||
nscolor color;
|
||||
PRBool foreground;
|
||||
static_cast<const nsStyleBorder*>(aStyleBorder)->
|
||||
GetBorderColor(aSide, color, foreground);
|
||||
@ -1320,7 +1320,7 @@ nsStyleAnimation::ExtractComputedValue(nsCSSProperty aProperty,
|
||||
// For border-width, ignore the border-image business (which
|
||||
// only exists until we update our implementation to the current
|
||||
// spec) and use GetComputedBorder
|
||||
|
||||
|
||||
#define BORDER_WIDTH_CASE(prop_, side_) \
|
||||
case prop_: \
|
||||
aComputedValue.SetCoordValue( \
|
||||
@ -1575,7 +1575,7 @@ nsStyleAnimation::ExtractComputedValue(nsCSSProperty aProperty,
|
||||
}
|
||||
*resultTail = item;
|
||||
resultTail = &item->mNext;
|
||||
|
||||
|
||||
const nsStyleBackground::Position &pos = bg->mLayers[i].mPosition;
|
||||
if (pos.mXIsPercent) {
|
||||
item->mXValue.SetPercentValue(pos.mXPosition.mFloat);
|
||||
@ -1607,7 +1607,7 @@ nsStyleAnimation::ExtractComputedValue(nsCSSProperty aProperty,
|
||||
}
|
||||
*resultTail = item;
|
||||
resultTail = &item->mNext;
|
||||
|
||||
|
||||
const nsStyleBackground::Size &size = bg->mLayers[i].mSize;
|
||||
switch (size.mWidthType) {
|
||||
case nsStyleBackground::Size::eContain:
|
||||
|
@ -171,7 +171,7 @@ public:
|
||||
nsStyleCorners(void);
|
||||
|
||||
// use compiler's version
|
||||
//nsStyleCorners& operator=(const nsStyleCorners& aCopy);
|
||||
//nsStyleCorners& operator=(const nsStyleCorners& aCopy);
|
||||
PRBool operator==(const nsStyleCorners& aOther) const;
|
||||
PRBool operator!=(const nsStyleCorners& aOther) const;
|
||||
|
||||
|
@ -297,7 +297,7 @@ struct nsStyleColor {
|
||||
static nsChangeHint MaxDifference();
|
||||
#endif
|
||||
static PRBool ForceCompare() { return PR_FALSE; }
|
||||
|
||||
|
||||
void* operator new(size_t sz, nsPresContext* aContext) CPP_THROW_NEW {
|
||||
return aContext->AllocateFromShell(sz);
|
||||
}
|
||||
@ -560,7 +560,7 @@ struct nsStylePadding {
|
||||
static nsChangeHint MaxDifference();
|
||||
#endif
|
||||
static PRBool ForceCompare() { return PR_TRUE; }
|
||||
|
||||
|
||||
nsStyleSides mPadding; // [reset] coord, percent
|
||||
|
||||
PRBool GetPadding(nsMargin& aPadding) const
|
||||
@ -717,7 +717,7 @@ struct nsStyleBorder {
|
||||
#endif
|
||||
static PRBool ForceCompare() { return PR_FALSE; }
|
||||
PRBool ImageBorderDiffers() const;
|
||||
|
||||
|
||||
nsStyleCorners mBorderRadius; // [reset] coord, percent
|
||||
nsStyleSides mBorderImageSplit; // [reset] integer, percent
|
||||
PRUint8 mFloatEdge; // [reset] see nsStyleConsts.h
|
||||
@ -727,7 +727,7 @@ struct nsStyleBorder {
|
||||
nsRefPtr<nsCSSShadowArray> mBoxShadow; // [reset] NULL for 'none'
|
||||
PRBool mHaveBorderImageWidth; // [reset]
|
||||
nsMargin mBorderImageWidth; // [reset]
|
||||
|
||||
|
||||
void EnsureBorderColors() {
|
||||
if (!mBorderColors) {
|
||||
mBorderColors = new nsBorderColors*[4];
|
||||
@ -776,7 +776,7 @@ struct nsStyleBorder {
|
||||
// present, and otherwise mBorder, which is GetComputedBorder without
|
||||
// considering border-style: none.)
|
||||
const nsMargin& GetActualBorder() const;
|
||||
|
||||
|
||||
// Get the computed border (plus rounding). This does consider the
|
||||
// effects of 'border-style: none', but does not consider
|
||||
// 'border-image'.
|
||||
@ -796,14 +796,14 @@ struct nsStyleBorder {
|
||||
|
||||
PRUint8 GetBorderStyle(PRUint8 aSide) const
|
||||
{
|
||||
NS_ASSERTION(aSide <= NS_SIDE_LEFT, "bad side");
|
||||
return (mBorderStyle[aSide] & BORDER_STYLE_MASK);
|
||||
NS_ASSERTION(aSide <= NS_SIDE_LEFT, "bad side");
|
||||
return (mBorderStyle[aSide] & BORDER_STYLE_MASK);
|
||||
}
|
||||
|
||||
void SetBorderStyle(PRUint8 aSide, PRUint8 aStyle)
|
||||
{
|
||||
NS_ASSERTION(aSide <= NS_SIDE_LEFT, "bad side");
|
||||
mBorderStyle[aSide] &= ~BORDER_STYLE_MASK;
|
||||
NS_ASSERTION(aSide <= NS_SIDE_LEFT, "bad side");
|
||||
mBorderStyle[aSide] &= ~BORDER_STYLE_MASK;
|
||||
mBorderStyle[aSide] |= (aStyle & BORDER_STYLE_MASK);
|
||||
mComputedBorder.side(aSide) =
|
||||
(HasVisibleStyle(aSide) ? mBorder.side(aSide) : 0);
|
||||
@ -817,19 +817,19 @@ struct nsStyleBorder {
|
||||
PRBool& aForeground) const
|
||||
{
|
||||
aForeground = PR_FALSE;
|
||||
NS_ASSERTION(aSide <= NS_SIDE_LEFT, "bad side");
|
||||
NS_ASSERTION(aSide <= NS_SIDE_LEFT, "bad side");
|
||||
if ((mBorderStyle[aSide] & BORDER_COLOR_SPECIAL) == 0)
|
||||
aColor = mBorderColor[aSide];
|
||||
aColor = mBorderColor[aSide];
|
||||
else if (mBorderStyle[aSide] & BORDER_COLOR_FOREGROUND)
|
||||
aForeground = PR_TRUE;
|
||||
else
|
||||
NS_NOTREACHED("OUTLINE_COLOR_INITIAL should not be set here");
|
||||
}
|
||||
|
||||
void SetBorderColor(PRUint8 aSide, nscolor aColor)
|
||||
void SetBorderColor(PRUint8 aSide, nscolor aColor)
|
||||
{
|
||||
NS_ASSERTION(aSide <= NS_SIDE_LEFT, "bad side");
|
||||
mBorderColor[aSide] = aColor;
|
||||
NS_ASSERTION(aSide <= NS_SIDE_LEFT, "bad side");
|
||||
mBorderColor[aSide] = aColor;
|
||||
mBorderStyle[aSide] &= ~BORDER_COLOR_SPECIAL;
|
||||
}
|
||||
|
||||
@ -867,9 +867,9 @@ struct nsStyleBorder {
|
||||
|
||||
void SetBorderToForeground(PRUint8 aSide)
|
||||
{
|
||||
NS_ASSERTION(aSide <= NS_SIDE_LEFT, "bad side");
|
||||
NS_ASSERTION(aSide <= NS_SIDE_LEFT, "bad side");
|
||||
mBorderStyle[aSide] &= ~BORDER_COLOR_SPECIAL;
|
||||
mBorderStyle[aSide] |= BORDER_COLOR_FOREGROUND;
|
||||
mBorderStyle[aSide] |= BORDER_COLOR_FOREGROUND;
|
||||
}
|
||||
|
||||
protected:
|
||||
@ -929,7 +929,7 @@ struct nsStyleOutline {
|
||||
static nsChangeHint MaxDifference();
|
||||
#endif
|
||||
static PRBool ForceCompare() { return PR_FALSE; }
|
||||
|
||||
|
||||
nsStyleCorners mOutlineRadius; // [reset] coord, percent
|
||||
|
||||
// Note that this is a specified value. You can get the actual values
|
||||
@ -988,7 +988,7 @@ protected:
|
||||
// pixel.
|
||||
nscoord mCachedOutlineWidth;
|
||||
|
||||
nscolor mOutlineColor; // [reset]
|
||||
nscolor mOutlineColor; // [reset]
|
||||
|
||||
PRPackedBool mHasCachedOutline;
|
||||
PRUint8 mOutlineStyle; // [reset] See nsStyleConsts.h
|
||||
@ -1015,7 +1015,7 @@ struct nsStyleList {
|
||||
static nsChangeHint MaxDifference();
|
||||
#endif
|
||||
static PRBool ForceCompare() { return PR_FALSE; }
|
||||
|
||||
|
||||
imgIRequest* GetListStyleImage() const { return mListStyleImage; }
|
||||
void SetListStyleImage(imgIRequest* aReq)
|
||||
{
|
||||
@ -1027,7 +1027,7 @@ struct nsStyleList {
|
||||
private:
|
||||
nsCOMPtr<imgIRequest> mListStyleImage; // [inherited]
|
||||
public:
|
||||
nsRect mImageRegion; // [inherited] the rect to use within an image
|
||||
nsRect mImageRegion; // [inherited] the rect to use within an image
|
||||
};
|
||||
|
||||
struct nsStylePosition {
|
||||
@ -1048,7 +1048,7 @@ struct nsStylePosition {
|
||||
static nsChangeHint MaxDifference();
|
||||
#endif
|
||||
static PRBool ForceCompare() { return PR_TRUE; }
|
||||
|
||||
|
||||
nsStyleSides mOffset; // [reset] coord, percent, auto
|
||||
nsStyleCoord mWidth; // [reset] coord, percent, auto, enum
|
||||
nsStyleCoord mMinWidth; // [reset] coord, percent, enum
|
||||
@ -1078,7 +1078,7 @@ struct nsStyleTextReset {
|
||||
static nsChangeHint MaxDifference();
|
||||
#endif
|
||||
static PRBool ForceCompare() { return PR_FALSE; }
|
||||
|
||||
|
||||
PRUint8 mTextDecoration; // [reset] see nsStyleConsts.h
|
||||
PRUint8 mUnicodeBidi; // [reset] see nsStyleConsts.h
|
||||
|
||||
@ -1116,7 +1116,7 @@ struct nsStyleText {
|
||||
nscoord mWordSpacing; // [inherited]
|
||||
|
||||
nsRefPtr<nsCSSShadowArray> mTextShadow; // [inherited] NULL in case of a zero-length
|
||||
|
||||
|
||||
PRBool WhiteSpaceIsSignificant() const {
|
||||
return mWhiteSpace == NS_STYLE_WHITESPACE_PRE ||
|
||||
mWhiteSpace == NS_STYLE_WHITESPACE_PRE_WRAP;
|
||||
@ -1159,7 +1159,7 @@ struct nsStyleVisibility {
|
||||
static nsChangeHint MaxDifference();
|
||||
#endif
|
||||
static PRBool ForceCompare() { return PR_FALSE; }
|
||||
|
||||
|
||||
PRUint8 mDirection; // [inherited] see nsStyleConsts.h NS_STYLE_DIRECTION_*
|
||||
PRUint8 mVisible; // [inherited]
|
||||
nsCOMPtr<nsIAtom> mLanguage; // [inherited]
|
||||
@ -1251,7 +1251,7 @@ private:
|
||||
|
||||
struct nsStyleDisplay {
|
||||
nsStyleDisplay();
|
||||
nsStyleDisplay(const nsStyleDisplay& aOther);
|
||||
nsStyleDisplay(const nsStyleDisplay& aOther);
|
||||
~nsStyleDisplay() {
|
||||
MOZ_COUNT_DTOR(nsStyleDisplay);
|
||||
}
|
||||
@ -1281,8 +1281,8 @@ struct nsStyleDisplay {
|
||||
PRUint8 mPosition; // [reset] see nsStyleConsts.h
|
||||
PRUint8 mFloats; // [reset] see nsStyleConsts.h NS_STYLE_FLOAT_*
|
||||
PRUint8 mBreakType; // [reset] see nsStyleConsts.h NS_STYLE_CLEAR_*
|
||||
PRPackedBool mBreakBefore; // [reset]
|
||||
PRPackedBool mBreakAfter; // [reset]
|
||||
PRPackedBool mBreakBefore; // [reset]
|
||||
PRPackedBool mBreakAfter; // [reset]
|
||||
PRUint8 mOverflowX; // [reset] see nsStyleConsts.h
|
||||
PRUint8 mOverflowY; // [reset] see nsStyleConsts.h
|
||||
PRUint8 mResize; // [reset] see nsStyleConsts.h
|
||||
@ -1374,7 +1374,7 @@ struct nsStyleTable {
|
||||
static nsChangeHint MaxDifference();
|
||||
#endif
|
||||
static PRBool ForceCompare() { return PR_FALSE; }
|
||||
|
||||
|
||||
PRUint8 mLayoutStrategy;// [reset] see nsStyleConsts.h NS_STYLE_TABLE_LAYOUT_*
|
||||
PRUint8 mFrame; // [reset] see nsStyleConsts.h NS_STYLE_TABLE_FRAME_*
|
||||
PRUint8 mRules; // [reset] see nsStyleConsts.h NS_STYLE_TABLE_RULES_*
|
||||
@ -1400,7 +1400,7 @@ struct nsStyleTableBorder {
|
||||
static nsChangeHint MaxDifference();
|
||||
#endif
|
||||
static PRBool ForceCompare() { return PR_FALSE; }
|
||||
|
||||
|
||||
nscoord mBorderSpacingX;// [inherited]
|
||||
nscoord mBorderSpacingY;// [inherited]
|
||||
PRUint8 mBorderCollapse;// [inherited]
|
||||
@ -1476,7 +1476,7 @@ struct nsStyleQuotes {
|
||||
static nsChangeHint MaxDifference();
|
||||
#endif
|
||||
static PRBool ForceCompare() { return PR_FALSE; }
|
||||
|
||||
|
||||
PRUint32 QuotesCount(void) const { return mQuotesCount; } // [inherited]
|
||||
|
||||
const nsString* OpenQuoteAt(PRUint32 aIndex) const
|
||||
@ -1689,7 +1689,7 @@ struct nsStyleUserInterface {
|
||||
PRUint8 mUserInput; // [inherited]
|
||||
PRUint8 mUserModify; // [inherited] (modify-content)
|
||||
PRUint8 mUserFocus; // [inherited] (auto-select)
|
||||
|
||||
|
||||
PRUint8 mCursor; // [inherited] See nsStyleConsts.h
|
||||
|
||||
PRUint32 mCursorArrayLength;
|
||||
@ -1721,7 +1721,7 @@ struct nsStyleXUL {
|
||||
static nsChangeHint MaxDifference();
|
||||
#endif
|
||||
static PRBool ForceCompare() { return PR_FALSE; }
|
||||
|
||||
|
||||
float mBoxFlex; // [reset] see nsStyleConsts.h
|
||||
PRUint32 mBoxOrdinal; // [reset] see nsStyleConsts.h
|
||||
PRUint8 mBoxAlign; // [reset] see nsStyleConsts.h
|
||||
@ -1792,7 +1792,7 @@ struct nsStyleSVGPaint
|
||||
~nsStyleSVGPaint();
|
||||
void SetType(nsStyleSVGPaintType aType);
|
||||
nsStyleSVGPaint& operator=(const nsStyleSVGPaint& aOther);
|
||||
PRBool operator==(const nsStyleSVGPaint& aOther) const;
|
||||
PRBool operator==(const nsStyleSVGPaint& aOther) const;
|
||||
|
||||
PRBool operator!=(const nsStyleSVGPaint& aOther) const {
|
||||
return !(*this == aOther);
|
||||
|
@ -48,15 +48,15 @@ class BCCellData;
|
||||
#define MAX_ROWSPAN 8190 // the cellmap can not handle more
|
||||
#define MAX_COLSPAN 1000 // limit as IE and opera do
|
||||
|
||||
/**
|
||||
/**
|
||||
* Data stored by nsCellMap to rationalize rowspan and colspan cells.
|
||||
*/
|
||||
class CellData
|
||||
{
|
||||
public:
|
||||
/** Initialize the mOrigCell pointer
|
||||
* @param aOrigCell the table cell frame which will be stored in mOrigCell.
|
||||
*/
|
||||
/** Initialize the mOrigCell pointer
|
||||
* @param aOrigCell the table cell frame which will be stored in mOrigCell.
|
||||
*/
|
||||
void Init(nsTableCellFrame* aCellFrame);
|
||||
|
||||
/** does a cell originate from here
|
||||
@ -65,7 +65,7 @@ public:
|
||||
PRBool IsOrig() const;
|
||||
|
||||
/** is the celldata valid
|
||||
* @return is true if no cell originates and the cell is not spanned by
|
||||
* @return is true if no cell originates and the cell is not spanned by
|
||||
* a row- or colspan. mBits are 0 in this case and mOrigCell is
|
||||
* nsnull
|
||||
*/
|
||||
@ -80,9 +80,9 @@ public:
|
||||
* @return is true if the entry is spanned by a rowspan
|
||||
*/
|
||||
PRBool IsRowSpan() const;
|
||||
|
||||
|
||||
/** is the entry spanned by a zero rowspan
|
||||
* zero rowspans span all cells starting from the originating cell down to
|
||||
* zero rowspans span all cells starting from the originating cell down to
|
||||
* the end of the rowgroup or a cell originating in the same column
|
||||
* @return is true if the entry is spanned by a zero rowspan
|
||||
*/
|
||||
@ -109,8 +109,8 @@ public:
|
||||
PRBool IsColSpan() const;
|
||||
|
||||
/** is the entry spanned by a zero colspan
|
||||
* zero colspans span all cells starting from the originating cell towards
|
||||
* the end of the colgroup or a cell originating in the same row
|
||||
* zero colspans span all cells starting from the originating cell towards
|
||||
* the end of the colgroup or a cell originating in the same row
|
||||
* or a rowspanned entry
|
||||
* @return is true if the entry is spanned by a zero colspan
|
||||
*/
|
||||
@ -130,7 +130,7 @@ public:
|
||||
* @param the distance in the column to the originating cell
|
||||
*/
|
||||
void SetColSpanOffset(PRUint32 aSpan);
|
||||
|
||||
|
||||
/** is the entry spanned by a row- and a colspan
|
||||
* @return is true if the entry is spanned by a row- and a colspan
|
||||
*/
|
||||
@ -140,9 +140,9 @@ public:
|
||||
* @param aOverlap if true mark the entry as covered by a row- and a colspan
|
||||
*/
|
||||
void SetOverlap(PRBool aOverlap);
|
||||
|
||||
/** get the table cell frame for this entry
|
||||
* @return a pointer to the cellframe, this will be nsnull when the entry
|
||||
|
||||
/** get the table cell frame for this entry
|
||||
* @return a pointer to the cellframe, this will be nsnull when the entry
|
||||
* is only a spanned entry
|
||||
*/
|
||||
nsTableCellFrame* GetCellFrame() const;
|
||||
@ -152,20 +152,20 @@ private:
|
||||
friend class BCCellData;
|
||||
|
||||
/** constructor.
|
||||
* @param aOrigCell the table cell frame which will be stored in mOrigCell.
|
||||
* @param aOrigCell the table cell frame which will be stored in mOrigCell.
|
||||
*/
|
||||
CellData(nsTableCellFrame* aOrigCell); // implemented in nsCellMap.cpp
|
||||
|
||||
/** destructor */
|
||||
~CellData(); // implemented in nsCellMap.cpp
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// this union relies on the assumption that an object (not primitive type) does
|
||||
// not start on an odd bit boundary. If mSpan is 0 then mOrigCell is in effect
|
||||
// not start on an odd bit boundary. If mSpan is 0 then mOrigCell is in effect
|
||||
// and the data does not represent a span. If mSpan is 1, then mBits is in
|
||||
// effect and the data represents a span.
|
||||
// mBits must be an unsigned long because it must match the size of
|
||||
// mBits must be an unsigned long because it must match the size of
|
||||
// mOrigCell on both 32- and 64-bit platforms.
|
||||
union {
|
||||
nsTableCellFrame* mOrigCell;
|
||||
@ -174,16 +174,16 @@ protected:
|
||||
};
|
||||
|
||||
// Border Collapsing Cell Data
|
||||
enum BCBorderOwner
|
||||
enum BCBorderOwner
|
||||
{
|
||||
eTableOwner = 0,
|
||||
eColGroupOwner = 1,
|
||||
eAjaColGroupOwner = 2, // col group to the left
|
||||
eColGroupOwner = 1,
|
||||
eAjaColGroupOwner = 2, // col group to the left
|
||||
eColOwner = 3,
|
||||
eAjaColOwner = 4, // col to the left
|
||||
eRowGroupOwner = 5,
|
||||
eRowGroupOwner = 5,
|
||||
eAjaRowGroupOwner = 6, // row group above
|
||||
eRowOwner = 7,
|
||||
eRowOwner = 7,
|
||||
eAjaRowOwner = 8, // row above
|
||||
eCellOwner = 9,
|
||||
eAjaCellOwner = 10 // cell to the top or to the left
|
||||
@ -242,7 +242,7 @@ public:
|
||||
|
||||
void SetTopStart(PRBool aValue);
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
BCPixelSize mLeftSize; // size in pixels of left border
|
||||
BCPixelSize mTopSize; // size in pixels of top border
|
||||
@ -251,8 +251,8 @@ protected:
|
||||
// owned by the segment to its top or bottom,
|
||||
// then the size is the max of the border
|
||||
// sizes of the segments to its left or right.
|
||||
unsigned mLeftOwner: 4; // owner of left border
|
||||
unsigned mTopOwner: 4; // owner of top border
|
||||
unsigned mLeftOwner: 4; // owner of left border
|
||||
unsigned mTopOwner: 4; // owner of top border
|
||||
unsigned mLeftStart: 1; // set if this is the start of a vertical border segment
|
||||
unsigned mTopStart: 1; // set if this is the start of a horizontal border segment
|
||||
unsigned mCornerSide: 2; // side of the owner of the upper left corner relative to the corner
|
||||
@ -260,7 +260,7 @@ protected:
|
||||
};
|
||||
|
||||
// BCCellData entries replace CellData entries in the cell map if the border collapsing model is in
|
||||
// effect. BCData for a row and col entry contains the left and top borders of cell at that row and
|
||||
// effect. BCData for a row and col entry contains the left and top borders of cell at that row and
|
||||
// col and the corner connecting the two. The right borders of the cells in the last col and the bottom
|
||||
// borders of the last row are stored in separate BCData entries in the cell map.
|
||||
class BCCellData : public CellData
|
||||
@ -273,7 +273,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
#define SPAN 0x00000001 // there a row or col span
|
||||
#define SPAN 0x00000001 // there a row or col span
|
||||
#define ROW_SPAN 0x00000002 // there is a row span
|
||||
#define ROW_SPAN_0 0x00000004 // the row span is 0
|
||||
#define ROW_SPAN_OFFSET 0x0000FFF8 // the row offset to the data containing the original cell
|
||||
@ -292,7 +292,7 @@ inline nsTableCellFrame* CellData::GetCellFrame() const
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
inline void CellData::Init(nsTableCellFrame* aCellFrame)
|
||||
inline void CellData::Init(nsTableCellFrame* aCellFrame)
|
||||
{
|
||||
mOrigCell = aCellFrame;
|
||||
}
|
||||
@ -314,13 +314,13 @@ inline PRBool CellData::IsSpan() const
|
||||
|
||||
inline PRBool CellData::IsRowSpan() const
|
||||
{
|
||||
return (SPAN == (SPAN & mBits)) &&
|
||||
return (SPAN == (SPAN & mBits)) &&
|
||||
(ROW_SPAN == (ROW_SPAN & mBits));
|
||||
}
|
||||
|
||||
inline PRBool CellData::IsZeroRowSpan() const
|
||||
{
|
||||
return (SPAN == (SPAN & mBits)) &&
|
||||
return (SPAN == (SPAN & mBits)) &&
|
||||
(ROW_SPAN == (ROW_SPAN & mBits)) &&
|
||||
(ROW_SPAN_0 == (ROW_SPAN_0 & mBits));
|
||||
}
|
||||
@ -345,7 +345,7 @@ inline PRUint32 CellData::GetRowSpanOffset() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline void CellData::SetRowSpanOffset(PRUint32 aSpan)
|
||||
inline void CellData::SetRowSpanOffset(PRUint32 aSpan)
|
||||
{
|
||||
mBits &= ~ROW_SPAN_OFFSET;
|
||||
mBits |= (aSpan << ROW_SPAN_SHIFT);
|
||||
@ -355,13 +355,13 @@ inline void CellData::SetRowSpanOffset(PRUint32 aSpan)
|
||||
|
||||
inline PRBool CellData::IsColSpan() const
|
||||
{
|
||||
return (SPAN == (SPAN & mBits)) &&
|
||||
return (SPAN == (SPAN & mBits)) &&
|
||||
(COL_SPAN == (COL_SPAN & mBits));
|
||||
}
|
||||
|
||||
inline PRBool CellData::IsZeroColSpan() const
|
||||
{
|
||||
return (SPAN == (SPAN & mBits)) &&
|
||||
return (SPAN == (SPAN & mBits)) &&
|
||||
(COL_SPAN == (COL_SPAN & mBits)) &&
|
||||
(COL_SPAN_0 == (COL_SPAN_0 & mBits));
|
||||
}
|
||||
@ -386,7 +386,7 @@ inline PRUint32 CellData::GetColSpanOffset() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline void CellData::SetColSpanOffset(PRUint32 aSpan)
|
||||
inline void CellData::SetColSpanOffset(PRUint32 aSpan)
|
||||
{
|
||||
mBits &= ~COL_SPAN_OFFSET;
|
||||
mBits |= (aSpan << COL_SPAN_SHIFT);
|
||||
@ -400,7 +400,7 @@ inline PRBool CellData::IsOverlap() const
|
||||
return (SPAN == (SPAN & mBits)) && (OVERLAP == (OVERLAP & mBits));
|
||||
}
|
||||
|
||||
inline void CellData::SetOverlap(PRBool aOverlap)
|
||||
inline void CellData::SetOverlap(PRBool aOverlap)
|
||||
{
|
||||
if (SPAN == (SPAN & mBits)) {
|
||||
if (aOverlap) {
|
||||
|
@ -44,7 +44,7 @@
|
||||
// Empty static array used for SafeElementAt() calls on mRows.
|
||||
static nsCellMap::CellDataArray * sEmptyRow;
|
||||
|
||||
// CellData
|
||||
// CellData
|
||||
|
||||
CellData::CellData(nsTableCellFrame* aOrigCell)
|
||||
{
|
||||
@ -140,7 +140,7 @@ nsTableCellMap::GetBottomMostBorder(PRInt32 aColIndex)
|
||||
}
|
||||
|
||||
// delete the borders corresponding to the right and bottom edges of the table
|
||||
void
|
||||
void
|
||||
nsTableCellMap::DeleteRightBottomBorders()
|
||||
{
|
||||
if (mBCInfo) {
|
||||
@ -148,8 +148,8 @@ nsTableCellMap::DeleteRightBottomBorders()
|
||||
mBCInfo->mRightBorders.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
void
|
||||
nsTableCellMap::InsertGroupCellMap(nsCellMap* aPrevMap,
|
||||
nsCellMap& aNewMap)
|
||||
{
|
||||
@ -231,7 +231,7 @@ FindMapFor(const nsTableRowGroupFrame* aRowGroup,
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
nsCellMap*
|
||||
nsCellMap*
|
||||
nsTableCellMap::GetMapFor(const nsTableRowGroupFrame* aRowGroup,
|
||||
nsCellMap* aStartHint) const
|
||||
{
|
||||
@ -248,15 +248,15 @@ nsTableCellMap::GetMapFor(const nsTableRowGroupFrame* aRowGroup,
|
||||
if (map) {
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
// if aRowGroup is a repeated header or footer find the header or footer it was repeated from
|
||||
if (aRowGroup->IsRepeatable()) {
|
||||
nsTableFrame* fifTable = static_cast<nsTableFrame*>(mTableFrame.GetFirstInFlow());
|
||||
|
||||
const nsStyleDisplay* display = aRowGroup->GetStyleDisplay();
|
||||
nsTableRowGroupFrame* rgOrig =
|
||||
nsTableRowGroupFrame* rgOrig =
|
||||
(NS_STYLE_DISPLAY_TABLE_HEADER_GROUP == display->mDisplay) ?
|
||||
fifTable->GetTHead() : fifTable->GetTFoot();
|
||||
fifTable->GetTHead() : fifTable->GetTFoot();
|
||||
// find the row group cell map using the original header/footer
|
||||
if (rgOrig && rgOrig != aRowGroup) {
|
||||
return GetMapFor(rgOrig, aStartHint);
|
||||
@ -280,7 +280,7 @@ nsTableCellMap::Synchronize(nsTableFrame* aTableFrame)
|
||||
// XXXbz this fails if orderedRowGroups is missing some row groups
|
||||
// (due to OOM when appending to the array, e.g. -- we leak maps in
|
||||
// that case).
|
||||
|
||||
|
||||
// Scope |map| outside the loop so we can use it as a hint.
|
||||
nsCellMap* map = nsnull;
|
||||
for (PRUint32 rgX = 0; rgX < orderedRowGroups.Length(); rgX++) {
|
||||
@ -336,7 +336,7 @@ nsTableCellMap::GetNumCellsOriginatingInRow(PRInt32 aRowIndex) const
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
PRInt32
|
||||
PRInt32
|
||||
nsTableCellMap::GetEffectiveRowSpan(PRInt32 aRowIndex,
|
||||
PRInt32 aColIndex) const
|
||||
{
|
||||
@ -353,7 +353,7 @@ nsTableCellMap::GetEffectiveRowSpan(PRInt32 aRowIndex,
|
||||
return 0;
|
||||
}
|
||||
|
||||
PRInt32
|
||||
PRInt32
|
||||
nsTableCellMap::GetEffectiveColSpan(PRInt32 aRowIndex,
|
||||
PRInt32 aColIndex) const
|
||||
{
|
||||
@ -371,7 +371,7 @@ nsTableCellMap::GetEffectiveColSpan(PRInt32 aRowIndex,
|
||||
return 0;
|
||||
}
|
||||
|
||||
nsTableCellFrame*
|
||||
nsTableCellFrame*
|
||||
nsTableCellMap::GetCellFrame(PRInt32 aRowIndex,
|
||||
PRInt32 aColIndex,
|
||||
CellData& aData,
|
||||
@ -389,7 +389,7 @@ nsTableCellMap::GetCellFrame(PRInt32 aRowIndex,
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
nsColInfo*
|
||||
nsColInfo*
|
||||
nsTableCellMap::GetColInfoAt(PRInt32 aColIndex)
|
||||
{
|
||||
PRInt32 numColsToAdd = aColIndex + 1 - mCols.Length();
|
||||
@ -399,7 +399,7 @@ nsTableCellMap::GetColInfoAt(PRInt32 aColIndex)
|
||||
return &mCols.ElementAt(aColIndex);
|
||||
}
|
||||
|
||||
PRInt32
|
||||
PRInt32
|
||||
nsTableCellMap::GetRowCount() const
|
||||
{
|
||||
PRInt32 numRows = 0;
|
||||
@ -411,8 +411,8 @@ nsTableCellMap::GetRowCount() const
|
||||
return numRows;
|
||||
}
|
||||
|
||||
CellData*
|
||||
nsTableCellMap::GetDataAt(PRInt32 aRowIndex,
|
||||
CellData*
|
||||
nsTableCellMap::GetDataAt(PRInt32 aRowIndex,
|
||||
PRInt32 aColIndex) const
|
||||
{
|
||||
PRInt32 rowIndex = aRowIndex;
|
||||
@ -427,7 +427,7 @@ nsTableCellMap::GetDataAt(PRInt32 aRowIndex,
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
nsTableCellMap::AddColsAtEnd(PRUint32 aNumCols)
|
||||
{
|
||||
if (!mCols.AppendElements(aNumCols)) {
|
||||
@ -440,11 +440,11 @@ nsTableCellMap::AddColsAtEnd(PRUint32 aNumCols)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
nsTableCellMap::RemoveColsAtEnd()
|
||||
{
|
||||
// Remove the cols at the end which don't have originating cells or cells spanning
|
||||
// into them. Only do this if the col was created as eColAnonymousCell
|
||||
// Remove the cols at the end which don't have originating cells or cells spanning
|
||||
// into them. Only do this if the col was created as eColAnonymousCell
|
||||
PRInt32 numCols = GetColCount();
|
||||
PRInt32 lastGoodColIndex = mTableFrame.GetIndexOfLastRealCol();
|
||||
for (PRInt32 colX = numCols - 1; (colX >= 0) && (colX > lastGoodColIndex); colX--) {
|
||||
@ -452,7 +452,7 @@ nsTableCellMap::RemoveColsAtEnd()
|
||||
if ((colInfo.mNumCellsOrig <= 0) && (colInfo.mNumCellsSpan <= 0)) {
|
||||
mCols.RemoveElementAt(colX);
|
||||
|
||||
if (mBCInfo) {
|
||||
if (mBCInfo) {
|
||||
PRInt32 count = mBCInfo->mBottomBorders.Length();
|
||||
if (colX < count) {
|
||||
mBCInfo->mBottomBorders.RemoveElementAt(colX);
|
||||
@ -463,7 +463,7 @@ nsTableCellMap::RemoveColsAtEnd()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
nsTableCellMap::ClearCols()
|
||||
{
|
||||
mCols.Clear();
|
||||
@ -478,7 +478,7 @@ nsTableCellMap::InsertRows(nsTableRowGroupFrame* aParent,
|
||||
nsRect& aDamageArea)
|
||||
{
|
||||
PRInt32 numNewRows = aRows.Length();
|
||||
if ((numNewRows <= 0) || (aFirstRowIndex < 0)) ABORT0();
|
||||
if ((numNewRows <= 0) || (aFirstRowIndex < 0)) ABORT0();
|
||||
|
||||
PRInt32 rowIndex = aFirstRowIndex;
|
||||
nsCellMap* cellMap = mFirstMap;
|
||||
@ -488,7 +488,7 @@ nsTableCellMap::InsertRows(nsTableRowGroupFrame* aParent,
|
||||
cellMap->InsertRows(*this, aRows, rowIndex, aConsiderSpans, aDamageArea);
|
||||
aDamageArea.y = NS_MIN(aFirstRowIndex, aDamageArea.y);
|
||||
aDamageArea.height = NS_MAX(0, GetRowCount() - aDamageArea.y);
|
||||
#ifdef DEBUG_TABLE_CELLMAP
|
||||
#ifdef DEBUG_TABLE_CELLMAP
|
||||
Dump("after InsertRows");
|
||||
#endif
|
||||
if (mBCInfo) {
|
||||
@ -549,7 +549,7 @@ nsTableCellMap::RemoveRows(PRInt32 aFirstRowIndex,
|
||||
|
||||
|
||||
|
||||
CellData*
|
||||
CellData*
|
||||
nsTableCellMap::AppendCell(nsTableCellFrame& aCellFrame,
|
||||
PRInt32 aRowIndex,
|
||||
PRBool aRebuildIfNecessary,
|
||||
@ -581,7 +581,7 @@ nsTableCellMap::AppendCell(nsTableCellFrame& aCellFrame,
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
void
|
||||
nsTableCellMap::InsertCells(nsTArray<nsTableCellFrame*>& aCellFrames,
|
||||
PRInt32 aRowIndex,
|
||||
PRInt32 aColIndexBefore,
|
||||
@ -606,7 +606,7 @@ nsTableCellMap::InsertCells(nsTArray<nsTableCellFrame*>& aCellFrames,
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
void
|
||||
nsTableCellMap::RemoveCell(nsTableCellFrame* aCellFrame,
|
||||
PRInt32 aRowIndex,
|
||||
nsRect& aDamageArea)
|
||||
@ -632,9 +632,9 @@ nsTableCellMap::RemoveCell(nsTableCellFrame* aCellFrame,
|
||||
rowIndex -= cellMap->GetRowCount();
|
||||
cellMap = cellMap->GetNextSibling();
|
||||
}
|
||||
// if we reach this point - the cell did not get removed, the caller of this routine
|
||||
// will delete the cell and the cellmap will probably hold a reference to
|
||||
// the deleted cell which will cause a subsequent crash when this cell is
|
||||
// if we reach this point - the cell did not get removed, the caller of this routine
|
||||
// will delete the cell and the cellmap will probably hold a reference to
|
||||
// the deleted cell which will cause a subsequent crash when this cell is
|
||||
// referenced later
|
||||
NS_ERROR("nsTableCellMap::RemoveCell - could not remove cell");
|
||||
}
|
||||
@ -652,7 +652,7 @@ SetDamageArea(PRInt32 aXOrigin,
|
||||
aDamageArea.height = NS_MAX(1, aHeight);
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
nsTableCellMap::RebuildConsideringCells(nsCellMap* aCellMap,
|
||||
nsTArray<nsTableCellFrame*>* aCellFrames,
|
||||
PRInt32 aRowIndex,
|
||||
@ -667,7 +667,7 @@ nsTableCellMap::RebuildConsideringCells(nsCellMap* aCellMap,
|
||||
while (cellMap) {
|
||||
if (cellMap == aCellMap) {
|
||||
cellMap->RebuildConsideringCells(*this, numOrigCols, aCellFrames, aRowIndex, aColIndex, aInsert, aDamageArea);
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
cellMap->RebuildConsideringCells(*this, numOrigCols, nsnull, -1, 0, PR_FALSE, aDamageArea);
|
||||
@ -678,7 +678,7 @@ nsTableCellMap::RebuildConsideringCells(nsCellMap* aCellMap,
|
||||
SetDamageArea(0, 0, GetColCount(), rowCount, aDamageArea);
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
nsTableCellMap::RebuildConsideringRows(nsCellMap* aCellMap,
|
||||
PRInt32 aStartRowIndex,
|
||||
nsTArray<nsTableRowFrame*>* aRowsToInsert,
|
||||
@ -687,7 +687,7 @@ nsTableCellMap::RebuildConsideringRows(nsCellMap* aCellMap,
|
||||
{
|
||||
NS_PRECONDITION(!aRowsToInsert || aNumRowsToRemove == 0,
|
||||
"Can't handle both removing and inserting rows at once");
|
||||
|
||||
|
||||
PRInt32 numOrigCols = GetColCount();
|
||||
ClearCols();
|
||||
nsCellMap* cellMap = mFirstMap;
|
||||
@ -705,7 +705,7 @@ nsTableCellMap::RebuildConsideringRows(nsCellMap* aCellMap,
|
||||
SetDamageArea(0, 0, GetColCount(), rowCount, aDamageArea);
|
||||
}
|
||||
|
||||
PRInt32
|
||||
PRInt32
|
||||
nsTableCellMap::GetNumCellsOriginatingInCol(PRInt32 aColIndex) const
|
||||
{
|
||||
PRInt32 colCount = mCols.Length();
|
||||
@ -719,10 +719,10 @@ nsTableCellMap::GetNumCellsOriginatingInCol(PRInt32 aColIndex) const
|
||||
}
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
void
|
||||
void
|
||||
nsTableCellMap::Dump(char* aString) const
|
||||
{
|
||||
if (aString)
|
||||
if (aString)
|
||||
printf("%s \n", aString);
|
||||
printf("***** START TABLE CELL MAP DUMP ***** %p\n", (void*)this);
|
||||
// output col info
|
||||
@ -744,11 +744,11 @@ nsTableCellMap::Dump(char* aString) const
|
||||
BCBorderOwner owner;
|
||||
PRUint8 side;
|
||||
PRBool segStart;
|
||||
PRPackedBool bevel;
|
||||
PRInt32 colIndex;
|
||||
PRPackedBool bevel;
|
||||
PRInt32 colIndex;
|
||||
PRInt32 numCols = mBCInfo->mBottomBorders.Length();
|
||||
for (PRInt32 i = 0; i <= 2; i++) {
|
||||
|
||||
|
||||
printf("\n ");
|
||||
for (colIndex = 0; colIndex < numCols; colIndex++) {
|
||||
BCData& cd = mBCInfo->mBottomBorders.ElementAt(colIndex);
|
||||
@ -785,10 +785,10 @@ nsTableCellMap::Dump(char* aString) const
|
||||
}
|
||||
#endif
|
||||
|
||||
nsTableCellFrame*
|
||||
nsTableCellMap::GetCellInfoAt(PRInt32 aRowIndex,
|
||||
PRInt32 aColIndex,
|
||||
PRBool* aOriginates,
|
||||
nsTableCellFrame*
|
||||
nsTableCellMap::GetCellInfoAt(PRInt32 aRowIndex,
|
||||
PRInt32 aColIndex,
|
||||
PRBool* aOriginates,
|
||||
PRInt32* aColSpan) const
|
||||
{
|
||||
PRInt32 rowIndex = aRowIndex;
|
||||
@ -978,14 +978,14 @@ nsTableCellMap::SetNotTopStart(PRUint8 aSide,
|
||||
}
|
||||
|
||||
// store the aSide border segment at coord = (aRowIndex, aColIndex). For top/left, store
|
||||
// the info at coord. For bottom/left store it at the adjacent location so that it is
|
||||
// top/left at that location. If the new location is at the right or bottom edge of the
|
||||
// table, then store it one of the special arrays (right most borders, bottom most borders).
|
||||
void
|
||||
nsTableCellMap::SetBCBorderEdge(PRUint8 aSide,
|
||||
// the info at coord. For bottom/left store it at the adjacent location so that it is
|
||||
// top/left at that location. If the new location is at the right or bottom edge of the
|
||||
// table, then store it one of the special arrays (right most borders, bottom most borders).
|
||||
void
|
||||
nsTableCellMap::SetBCBorderEdge(PRUint8 aSide,
|
||||
nsCellMap& aCellMap,
|
||||
PRUint32 aCellMapStart,
|
||||
PRUint32 aRowIndex,
|
||||
PRUint32 aRowIndex,
|
||||
PRUint32 aColIndex,
|
||||
PRUint32 aLength,
|
||||
BCBorderOwner aOwner,
|
||||
@ -993,7 +993,7 @@ nsTableCellMap::SetBCBorderEdge(PRUint8 aSide,
|
||||
PRBool aChanged)
|
||||
{
|
||||
if (!mBCInfo) ABORT0();
|
||||
|
||||
|
||||
BCCellData* cellData;
|
||||
PRInt32 lastIndex, xIndex, yIndex;
|
||||
PRInt32 xPos = aColIndex;
|
||||
@ -1028,7 +1028,7 @@ nsTableCellMap::SetBCBorderEdge(PRUint8 aSide,
|
||||
cellData = (BCCellData*)cellMap->GetDataAt(0, xIndex);
|
||||
if (!cellData) { // add a dead cell
|
||||
nsRect damageArea;
|
||||
cellData = (BCCellData*)cellMap->AppendCell(*this, nsnull, 0, PR_FALSE, damageArea);
|
||||
cellData = (BCCellData*)cellMap->AppendCell(*this, nsnull, 0, PR_FALSE, damageArea);
|
||||
}
|
||||
}
|
||||
else { // must be at the end of the table
|
||||
@ -1069,14 +1069,14 @@ nsTableCellMap::SetBCBorderEdge(PRUint8 aSide,
|
||||
}
|
||||
}
|
||||
|
||||
// store corner info (aOwner, aSubSize, aBevel). For aCorner = eTopLeft, store the info at
|
||||
// store corner info (aOwner, aSubSize, aBevel). For aCorner = eTopLeft, store the info at
|
||||
// (aRowIndex, aColIndex). For eTopRight, store it in the entry to the right where
|
||||
// it would be top left. For eBottomRight, store it in the entry to the bottom. etc.
|
||||
void
|
||||
// it would be top left. For eBottomRight, store it in the entry to the bottom. etc.
|
||||
void
|
||||
nsTableCellMap::SetBCBorderCorner(Corner aCorner,
|
||||
nsCellMap& aCellMap,
|
||||
PRUint32 aCellMapStart,
|
||||
PRUint32 aRowIndex,
|
||||
PRUint32 aRowIndex,
|
||||
PRUint32 aColIndex,
|
||||
PRUint8 aOwner,
|
||||
nscoord aSubSize,
|
||||
@ -1085,7 +1085,7 @@ nsTableCellMap::SetBCBorderCorner(Corner aCorner,
|
||||
{
|
||||
if (!mBCInfo) ABORT0();
|
||||
|
||||
if (aIsBottomRight) {
|
||||
if (aIsBottomRight) {
|
||||
mBCInfo->mLowerRightCorner.SetCorner(aSubSize, aOwner, aBevel);
|
||||
return;
|
||||
}
|
||||
@ -1121,7 +1121,7 @@ nsTableCellMap::SetBCBorderCorner(Corner aCorner,
|
||||
PRInt32 numRgRows = aCellMap.GetRowCount();
|
||||
if (yPos < numRgRows) { // add a dead cell data
|
||||
nsRect damageArea;
|
||||
cellData = (BCCellData*)aCellMap.AppendCell(*this, nsnull, rgYPos, PR_FALSE, damageArea);
|
||||
cellData = (BCCellData*)aCellMap.AppendCell(*this, nsnull, rgYPos, PR_FALSE, damageArea);
|
||||
}
|
||||
else {
|
||||
// try the next non empty row group
|
||||
@ -1133,7 +1133,7 @@ nsTableCellMap::SetBCBorderCorner(Corner aCorner,
|
||||
cellData = (BCCellData*)cellMap->GetDataAt(0, xPos);
|
||||
if (!cellData) { // add a dead cell
|
||||
nsRect damageArea;
|
||||
cellData = (BCCellData*)cellMap->AppendCell(*this, nsnull, 0, PR_FALSE, damageArea);
|
||||
cellData = (BCCellData*)cellMap->AppendCell(*this, nsnull, 0, PR_FALSE, damageArea);
|
||||
}
|
||||
}
|
||||
else { // must be a the bottom of the table
|
||||
@ -1163,7 +1163,7 @@ nsCellMap::nsCellMap(nsTableRowGroupFrame* aRowGroup, PRBool aIsBC)
|
||||
nsCellMap::~nsCellMap()
|
||||
{
|
||||
MOZ_COUNT_DTOR(nsCellMap);
|
||||
|
||||
|
||||
PRUint32 mapRowCount = mRows.Length();
|
||||
for (PRUint32 rowX = 0; rowX < mapRowCount; rowX++) {
|
||||
CellDataArray &row = mRows[rowX];
|
||||
@ -1193,7 +1193,7 @@ nsCellMap::Shutdown()
|
||||
sEmptyRow = nsnull;
|
||||
}
|
||||
|
||||
nsTableCellFrame*
|
||||
nsTableCellFrame*
|
||||
nsCellMap::GetCellFrame(PRInt32 aRowIndexIn,
|
||||
PRInt32 aColIndexIn,
|
||||
CellData& aData,
|
||||
@ -1225,7 +1225,7 @@ nsCellMap::GetHighestIndex(PRInt32 aColCount)
|
||||
PRInt32 rowCount = mRows.Length();
|
||||
for (PRInt32 rowIdx = 0; rowIdx < rowCount; rowIdx++) {
|
||||
const CellDataArray& row = mRows[rowIdx];
|
||||
|
||||
|
||||
for (PRInt32 colIdx = 0; colIdx < aColCount; colIdx++) {
|
||||
CellData* data = row.SafeElementAt(colIdx);
|
||||
// No data means row doesn't have more cells.
|
||||
@ -1329,7 +1329,7 @@ PRBool nsCellMap::Grow(nsTableCellMap& aMap,
|
||||
|
||||
void nsCellMap::GrowRow(CellDataArray& aRow,
|
||||
PRInt32 aNumCols)
|
||||
|
||||
|
||||
{
|
||||
// Have to have the cast to get the template to do the right thing.
|
||||
aRow.InsertElementsAt(aRow.Length(), aNumCols, (CellData*)nsnull);
|
||||
@ -1362,7 +1362,7 @@ nsCellMap::InsertRows(nsTableCellMap& aMap,
|
||||
// if any cells span into or out of the row being inserted, then rebuild
|
||||
PRBool spansCauseRebuild = CellsSpanInOrOut(aFirstRowIndex,
|
||||
aFirstRowIndex, 0, numCols - 1);
|
||||
|
||||
|
||||
// update mContentRowCount, since non-empty rows will be added
|
||||
mContentRowCount = NS_MAX(aFirstRowIndex, mContentRowCount);
|
||||
|
||||
@ -1420,9 +1420,9 @@ nsCellMap::RemoveRows(nsTableCellMap& aMap,
|
||||
|
||||
|
||||
|
||||
CellData*
|
||||
CellData*
|
||||
nsCellMap::AppendCell(nsTableCellMap& aMap,
|
||||
nsTableCellFrame* aCellFrame,
|
||||
nsTableCellFrame* aCellFrame,
|
||||
PRInt32 aRowIndex,
|
||||
PRBool aRebuildIfNecessary,
|
||||
nsRect& aDamageArea,
|
||||
@ -1448,13 +1448,13 @@ nsCellMap::AppendCell(nsTableCellMap& aMap,
|
||||
startColIndex = *aColToBeginSearch;
|
||||
for (; startColIndex < origNumCols; startColIndex++) {
|
||||
CellData* data = GetDataAt(aRowIndex, startColIndex);
|
||||
if (!data)
|
||||
if (!data)
|
||||
break;
|
||||
// The border collapse code relies on having multiple dead cell data entries
|
||||
// in a row.
|
||||
if (data->IsDead() && aCellFrame) {
|
||||
origData = data;
|
||||
break;
|
||||
break;
|
||||
}
|
||||
if (data->IsZeroColSpan() ) {
|
||||
// appending a cell collapses zerospans.
|
||||
@ -1466,12 +1466,12 @@ nsCellMap::AppendCell(nsTableCellMap& aMap,
|
||||
break;
|
||||
}
|
||||
}
|
||||
// We found the place to append the cell, when the next cell is appended
|
||||
// the next search does not need to duplicate the search but can start
|
||||
// We found the place to append the cell, when the next cell is appended
|
||||
// the next search does not need to duplicate the search but can start
|
||||
// just at the next cell.
|
||||
if (aColToBeginSearch)
|
||||
*aColToBeginSearch = startColIndex + 1;
|
||||
|
||||
*aColToBeginSearch = startColIndex + 1;
|
||||
|
||||
PRBool zeroColSpan = PR_FALSE;
|
||||
PRInt32 colSpan = (aCellFrame) ?
|
||||
GetColSpanForNewCell(*aCellFrame, zeroColSpan) : 1;
|
||||
@ -1480,7 +1480,7 @@ nsCellMap::AppendCell(nsTableCellMap& aMap,
|
||||
aMap.mTableFrame.SetNeedColSpanExpansion(PR_TRUE);
|
||||
}
|
||||
|
||||
// if the new cell could potentially span into other rows and collide with
|
||||
// if the new cell could potentially span into other rows and collide with
|
||||
// originating cells there, we will play it safe and just rebuild the map
|
||||
if (aRebuildIfNecessary && (aRowIndex < mContentRowCount - 1) && (rowSpan > 1)) {
|
||||
nsAutoTArray<nsTableCellFrame*, 1> newCellArray;
|
||||
@ -1502,11 +1502,11 @@ nsCellMap::AppendCell(nsTableCellMap& aMap,
|
||||
NS_ASSERTION(origData->IsDead(), "replacing a non dead cell is a memory leak");
|
||||
if (aCellFrame) { // do nothing to replace a dead cell with a dead cell
|
||||
origData->Init(aCellFrame);
|
||||
// we are replacing a dead cell, increase the number of cells
|
||||
// we are replacing a dead cell, increase the number of cells
|
||||
// originating at this column
|
||||
nsColInfo* colInfo = aMap.GetColInfoAt(startColIndex);
|
||||
NS_ASSERTION(colInfo, "access to a non existing column");
|
||||
if (colInfo) {
|
||||
if (colInfo) {
|
||||
colInfo->mNumCellsOrig++;
|
||||
}
|
||||
}
|
||||
@ -1517,7 +1517,7 @@ nsCellMap::AppendCell(nsTableCellMap& aMap,
|
||||
SetDataAt(aMap, *origData, aRowIndex, startColIndex);
|
||||
}
|
||||
|
||||
SetDamageArea(startColIndex, aRowIndex, 1 + endColIndex - startColIndex, 1 + endRowIndex - aRowIndex, aDamageArea);
|
||||
SetDamageArea(startColIndex, aRowIndex, 1 + endColIndex - startColIndex, 1 + endRowIndex - aRowIndex, aDamageArea);
|
||||
|
||||
if (!aCellFrame) {
|
||||
return origData;
|
||||
@ -1552,7 +1552,7 @@ nsCellMap::AppendCell(nsTableCellMap& aMap,
|
||||
}
|
||||
}
|
||||
if (colX > startColIndex) { // col spanning into cell
|
||||
if (!cellData->IsColSpan()) {
|
||||
if (!cellData->IsColSpan()) {
|
||||
if (cellData->IsRowSpan()) {
|
||||
cellData->SetOverlap(PR_TRUE);
|
||||
}
|
||||
@ -1560,13 +1560,13 @@ nsCellMap::AppendCell(nsTableCellMap& aMap,
|
||||
if (zeroColSpan) {
|
||||
cellData->SetZeroColSpan(PR_TRUE);
|
||||
}
|
||||
|
||||
|
||||
nsColInfo* colInfo = aMap.GetColInfoAt(colX);
|
||||
colInfo->mNumCellsSpan++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
else {
|
||||
cellData = AllocCellData(nsnull);
|
||||
if (!cellData) return origData;
|
||||
if (rowX > aRowIndex) {
|
||||
@ -1609,7 +1609,7 @@ void nsCellMap::CollapseZeroColSpan(nsTableCellMap& aMap,
|
||||
// find the originating cellframe
|
||||
nsTableCellFrame* cell = GetCellFrame(aRowIndex, aColIndex, *aOrigData, PR_TRUE);
|
||||
NS_ASSERTION(cell, "originating cell not found");
|
||||
|
||||
|
||||
// find the clearing region
|
||||
PRInt32 startRowIndex = aRowIndex - aOrigData->GetRowSpanOffset();
|
||||
PRBool zeroSpan;
|
||||
@ -1626,7 +1626,7 @@ void nsCellMap::CollapseZeroColSpan(nsTableCellMap& aMap,
|
||||
// has colspan="1".
|
||||
nsColInfo* colInfo = aMap.GetColInfoAt(colX);
|
||||
colInfo->mNumCellsSpan -= rowSpan;
|
||||
|
||||
|
||||
for (PRInt32 rowX = startRowIndex; rowX < endRowIndex; rowX++)
|
||||
{
|
||||
CellData* data = mRows[rowX][colX];
|
||||
@ -1638,7 +1638,7 @@ void nsCellMap::CollapseZeroColSpan(nsTableCellMap& aMap,
|
||||
}
|
||||
|
||||
PRBool nsCellMap::CellsSpanOut(nsTArray<nsTableRowFrame*>& aRows) const
|
||||
{
|
||||
{
|
||||
PRInt32 numNewRows = aRows.Length();
|
||||
for (PRInt32 rowX = 0; rowX < numNewRows; rowX++) {
|
||||
nsIFrame* rowFrame = (nsIFrame *) aRows.ElementAt(rowX);
|
||||
@ -1657,8 +1657,8 @@ PRBool nsCellMap::CellsSpanOut(nsTArray<nsTableRowFrame*>& aRows) const
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
// return PR_TRUE if any cells have rows spans into or out of the region
|
||||
|
||||
// return PR_TRUE if any cells have rows spans into or out of the region
|
||||
// defined by the row and col indices or any cells have colspans into the region
|
||||
PRBool nsCellMap::CellsSpanInOrOut(PRInt32 aStartRowIndex,
|
||||
PRInt32 aEndRowIndex,
|
||||
@ -1675,10 +1675,10 @@ PRBool nsCellMap::CellsSpanInOrOut(PRInt32 aStartRowIndex,
|
||||
* startrow r2c1 r2c2 *r2c3 *r2c4 *r2c5 *r2rc6 r2c7
|
||||
* endrow r3c1 r3c2 *r3c3 r3c4 r3c5 *r3rc6 r3c7
|
||||
* r4c1 r4c2 *r4c3 *r4c4 *r4c5 r4rc6 r4c7
|
||||
* r5c1 r5c2 r5c3 r5c4 r5c5 r5rc6 r5c7
|
||||
* r5c1 r5c2 r5c3 r5c4 r5c5 r5rc6 r5c7
|
||||
*/
|
||||
|
||||
PRInt32 numRows = mRows.Length(); // use the cellmap rows to determine the
|
||||
PRInt32 numRows = mRows.Length(); // use the cellmap rows to determine the
|
||||
// current cellmap extent.
|
||||
for (PRInt32 colX = aStartColIndex; colX <= aEndColIndex; colX++) {
|
||||
CellData* cellData;
|
||||
@ -1736,13 +1736,13 @@ void nsCellMap::InsertCells(nsTableCellMap& aMap,
|
||||
aColIndexBefore = numCols - 1;
|
||||
}
|
||||
|
||||
// get the starting col index of the 1st new cells
|
||||
// get the starting col index of the 1st new cells
|
||||
PRInt32 startColIndex;
|
||||
for (startColIndex = aColIndexBefore + 1; startColIndex < numCols; startColIndex++) {
|
||||
CellData* data = GetDataAt(aRowIndex, startColIndex);
|
||||
if (!data || data->IsOrig() || data->IsDead()) {
|
||||
if (!data || data->IsOrig() || data->IsDead()) {
|
||||
// // Not a span. Stop.
|
||||
break;
|
||||
break;
|
||||
}
|
||||
if (data->IsZeroColSpan()) {
|
||||
// Zero colspans collapse. Stop in this case too.
|
||||
@ -1751,8 +1751,8 @@ void nsCellMap::InsertCells(nsTableCellMap& aMap,
|
||||
}
|
||||
}
|
||||
|
||||
// record whether inserted cells are going to cause complications due
|
||||
// to existing row spans, col spans or table sizing.
|
||||
// record whether inserted cells are going to cause complications due
|
||||
// to existing row spans, col spans or table sizing.
|
||||
PRBool spansCauseRebuild = PR_FALSE;
|
||||
|
||||
// check that all cells have the same row span
|
||||
@ -1790,7 +1790,7 @@ void nsCellMap::InsertCells(nsTableCellMap& aMap,
|
||||
ExpandWithCells(aMap, aCellFrames, aRowIndex, startColIndex, rowSpan, zeroRowSpan, aDamageArea);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nsCellMap::ExpandWithRows(nsTableCellMap& aMap,
|
||||
nsTArray<nsTableRowFrame*>& aRowFrames,
|
||||
@ -1804,18 +1804,18 @@ nsCellMap::ExpandWithRows(nsTableCellMap& aMap,
|
||||
mContentRowCount += numNewRows;
|
||||
|
||||
PRInt32 endRowIndex = startRowIndex + numNewRows - 1;
|
||||
|
||||
|
||||
// shift the rows after startRowIndex down and insert empty rows that will
|
||||
// be filled via the AppendCell call below
|
||||
if (!Grow(aMap, numNewRows, startRowIndex)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
PRInt32 newRowIndex = 0;
|
||||
for (PRInt32 rowX = startRowIndex; rowX <= endRowIndex; rowX++) {
|
||||
nsTableRowFrame* rFrame = aRowFrames.ElementAt(newRowIndex);
|
||||
// append cells
|
||||
// append cells
|
||||
nsIFrame* cFrame = rFrame->GetFirstChild(nsnull);
|
||||
PRInt32 colIndex = 0;
|
||||
while (cFrame) {
|
||||
@ -1828,7 +1828,7 @@ nsCellMap::ExpandWithRows(nsTableCellMap& aMap,
|
||||
newRowIndex++;
|
||||
}
|
||||
|
||||
SetDamageArea(0, startRowIndex, aMap.GetColCount(), 1 + endRowIndex - startRowIndex, aDamageArea);
|
||||
SetDamageArea(0, startRowIndex, aMap.GetColCount(), 1 + endRowIndex - startRowIndex, aDamageArea);
|
||||
}
|
||||
|
||||
void nsCellMap::ExpandWithCells(nsTableCellMap& aMap,
|
||||
@ -1867,7 +1867,7 @@ void nsCellMap::ExpandWithCells(nsTableCellMap& aMap,
|
||||
startColIndex = endColIndex + 1;
|
||||
endColIndex = startColIndex + colSpan - 1;
|
||||
}
|
||||
|
||||
|
||||
// add the originating cell data and any cell data corresponding to row/col spans
|
||||
for (PRInt32 rowX = aRowIndex; rowX <= endRowIndex; rowX++) {
|
||||
CellDataArray& row = mRows[rowX];
|
||||
@ -1887,7 +1887,7 @@ void nsCellMap::ExpandWithCells(nsTableCellMap& aMap,
|
||||
DestroyCellData(origData);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
for (PRInt32 colX = startColIndex; colX <= endColIndex; colX++) {
|
||||
CellData* data = origData;
|
||||
if ((rowX != aRowIndex) || (colX != startColIndex)) {
|
||||
@ -1912,7 +1912,7 @@ void nsCellMap::ExpandWithCells(nsTableCellMap& aMap,
|
||||
cellFrame->SetColIndex(startColIndex);
|
||||
}
|
||||
PRInt32 damageHeight = NS_MIN(GetRowGroup()->GetRowCount() - aRowIndex, aRowSpan);
|
||||
SetDamageArea(aColIndex, aRowIndex, 1 + endColIndex - aColIndex, damageHeight, aDamageArea);
|
||||
SetDamageArea(aColIndex, aRowIndex, 1 + endColIndex - aColIndex, damageHeight, aDamageArea);
|
||||
|
||||
PRInt32 rowX;
|
||||
|
||||
@ -1935,14 +1935,14 @@ void nsCellMap::ExpandWithCells(nsTableCellMap& aMap,
|
||||
nsColInfo* colInfo = aMap.GetColInfoAt(colX);
|
||||
colInfo->mNumCellsSpan++;
|
||||
}
|
||||
|
||||
|
||||
// decrease the origin and span counts within the spanned cols
|
||||
PRInt32 colX2 = colX - totalColSpan;
|
||||
nsColInfo* colInfo2 = aMap.GetColInfoAt(colX2);
|
||||
if (data->IsOrig()) {
|
||||
// the old originating col of a moved cell needs adjustment
|
||||
colInfo2->mNumCellsOrig--;
|
||||
}
|
||||
}
|
||||
if (data->IsColSpan()) {
|
||||
colInfo2->mNumCellsSpan--;
|
||||
}
|
||||
@ -1992,10 +1992,10 @@ void nsCellMap::ShrinkWithoutRows(nsTableCellMap& aMap,
|
||||
}
|
||||
aMap.RemoveColsAtEnd();
|
||||
|
||||
SetDamageArea(0, aStartRowIndex, aMap.GetColCount(), 0, aDamageArea);
|
||||
SetDamageArea(0, aStartRowIndex, aMap.GetColCount(), 0, aDamageArea);
|
||||
}
|
||||
|
||||
PRInt32 nsCellMap::GetColSpanForNewCell(nsTableCellFrame& aCellFrameToAdd,
|
||||
PRInt32 nsCellMap::GetColSpanForNewCell(nsTableCellFrame& aCellFrameToAdd,
|
||||
PRBool& aIsZeroColSpan) const
|
||||
{
|
||||
aIsZeroColSpan = PR_FALSE;
|
||||
@ -2018,7 +2018,7 @@ PRInt32 nsCellMap::GetEffectiveColSpan(const nsTableCellMap& aMap,
|
||||
if (PRUint32(aRowIndex) >= mRows.Length()) {
|
||||
return colSpan;
|
||||
}
|
||||
|
||||
|
||||
const CellDataArray& row = mRows[aRowIndex];
|
||||
PRInt32 colX;
|
||||
CellData* data;
|
||||
@ -2028,7 +2028,7 @@ PRInt32 nsCellMap::GetEffectiveColSpan(const nsTableCellMap& aMap,
|
||||
data = row.SafeElementAt(colX);
|
||||
if (data) {
|
||||
// for an overlapping situation get the colspan from the originating cell and
|
||||
// use that as the max number of cols to iterate. Since this is rare, only
|
||||
// use that as the max number of cols to iterate. Since this is rare, only
|
||||
// pay the price of looking up the cell's colspan here.
|
||||
if (!hitOverlap && data->IsOverlap()) {
|
||||
CellData* origData = row.SafeElementAt(aColIndex);
|
||||
@ -2037,7 +2037,7 @@ PRInt32 nsCellMap::GetEffectiveColSpan(const nsTableCellMap& aMap,
|
||||
if (cellFrame) {
|
||||
// possible change the number of colums to iterate
|
||||
maxCols = NS_MIN(aColIndex + cellFrame->GetColSpan(), maxCols);
|
||||
if (colX >= maxCols)
|
||||
if (colX >= maxCols)
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -2057,7 +2057,7 @@ PRInt32 nsCellMap::GetEffectiveColSpan(const nsTableCellMap& aMap,
|
||||
return colSpan;
|
||||
}
|
||||
|
||||
PRInt32
|
||||
PRInt32
|
||||
nsCellMap::GetRowSpanForNewCell(nsTableCellFrame* aCellFrameToAdd,
|
||||
PRInt32 aRowIndex,
|
||||
PRBool& aIsZeroRowSpan) const
|
||||
@ -2067,7 +2067,7 @@ nsCellMap::GetRowSpanForNewCell(nsTableCellFrame* aCellFrameToAdd,
|
||||
if (0 == rowSpan) {
|
||||
// Use a min value of 2 for a zero rowspan to make computations easier
|
||||
// elsewhere. Zero rowspans are only content dependent!
|
||||
rowSpan = NS_MAX(2, mContentRowCount - aRowIndex);
|
||||
rowSpan = NS_MAX(2, mContentRowCount - aRowIndex);
|
||||
aIsZeroRowSpan = PR_TRUE;
|
||||
}
|
||||
return rowSpan;
|
||||
@ -2120,7 +2120,7 @@ PRInt32 nsCellMap::GetRowSpan(PRInt32 aRowIndex,
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else break;
|
||||
}
|
||||
return rowSpan;
|
||||
@ -2143,7 +2143,7 @@ void nsCellMap::ShrinkWithoutCell(nsTableCellMap& aMap,
|
||||
PRUint32 endRowIndex = aRowIndex + rowSpan - 1;
|
||||
PRUint32 endColIndex = aColIndex + colSpan - 1;
|
||||
|
||||
SetDamageArea(aColIndex, aRowIndex, 1 + endColIndex - aColIndex, 1 + endRowIndex - aRowIndex, aDamageArea);
|
||||
SetDamageArea(aColIndex, aRowIndex, 1 + endColIndex - aColIndex, 1 + endRowIndex - aRowIndex, aDamageArea);
|
||||
|
||||
if (aMap.mTableFrame.HasZeroColSpans()) {
|
||||
aMap.mTableFrame.SetNeedColSpanExpansion(PR_TRUE);
|
||||
@ -2187,17 +2187,17 @@ void nsCellMap::ShrinkWithoutCell(nsTableCellMap& aMap,
|
||||
CellData* data = row.SafeElementAt(colX);
|
||||
if (data) {
|
||||
if (data->IsOrig()) {
|
||||
// a cell that gets moved to the left needs adjustment in its new location
|
||||
// a cell that gets moved to the left needs adjustment in its new location
|
||||
data->GetCellFrame()->SetColIndex(colX);
|
||||
nsColInfo* colInfo = aMap.GetColInfoAt(colX);
|
||||
colInfo->mNumCellsOrig++;
|
||||
// a cell that gets moved to the left needs adjustment in its old location
|
||||
// a cell that gets moved to the left needs adjustment in its old location
|
||||
colInfo = aMap.GetColInfoAt(colX + colSpan);
|
||||
if (colInfo) {
|
||||
colInfo->mNumCellsOrig--;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
else if (data->IsColSpan()) {
|
||||
// a cell that gets moved to the left needs adjustment
|
||||
// in its new location
|
||||
@ -2255,7 +2255,7 @@ nsCellMap::RebuildConsideringRows(nsTableCellMap& aMap,
|
||||
// rowX keeps track of where we are in mRows while setting up the
|
||||
// new cellmap.
|
||||
PRUint32 rowX = 0;
|
||||
|
||||
|
||||
// put back the rows before the affected ones just as before. Note that we
|
||||
// can't just copy the old rows in bit-for-bit, because they might be
|
||||
// spanning out into the rows we're adding/removing.
|
||||
@ -2294,7 +2294,7 @@ nsCellMap::RebuildConsideringRows(nsTableCellMap& aMap,
|
||||
else {
|
||||
copyStartRowIndex = aStartRowIndex + aNumRowsToRemove;
|
||||
}
|
||||
|
||||
|
||||
// put back the rows after the affected ones just as before. Again, we can't
|
||||
// just copy the old bits because that would not handle the new rows spanning
|
||||
// out or our earlier old rows spanning through the damaged area.
|
||||
@ -2320,8 +2320,8 @@ nsCellMap::RebuildConsideringRows(nsTableCellMap& aMap,
|
||||
DestroyCellData(row[colX]);
|
||||
}
|
||||
}
|
||||
|
||||
SetDamageArea(0, 0, aMap.GetColCount(), GetRowCount(), aDamageArea);
|
||||
|
||||
SetDamageArea(0, 0, aMap.GetColCount(), GetRowCount(), aDamageArea);
|
||||
}
|
||||
|
||||
void
|
||||
@ -2340,18 +2340,18 @@ nsCellMap::RebuildConsideringCells(nsTableCellMap& aMap,
|
||||
mRows.SwapElements(origRows);
|
||||
|
||||
PRInt32 numNewCells = (aCellFrames) ? aCellFrames->Length() : 0;
|
||||
|
||||
|
||||
// the new cells might extend the previous column number
|
||||
NS_ASSERTION(aNumOrigCols >= aColIndex, "Appending cells far beyond cellmap data?!");
|
||||
PRInt32 numCols = aInsert ? NS_MAX(aNumOrigCols, aColIndex + 1) : aNumOrigCols;
|
||||
|
||||
PRInt32 numCols = aInsert ? NS_MAX(aNumOrigCols, aColIndex + 1) : aNumOrigCols;
|
||||
|
||||
// build the new cell map. Hard to say what, if anything, we can preallocate
|
||||
// here... Should come back to that sometime, perhaps.
|
||||
PRInt32 rowX;
|
||||
for (rowX = 0; rowX < numOrigRows; rowX++) {
|
||||
const CellDataArray& row = origRows[rowX];
|
||||
for (PRInt32 colX = 0; colX < numCols; colX++) {
|
||||
if ((rowX == aRowIndex) && (colX == aColIndex)) {
|
||||
if ((rowX == aRowIndex) && (colX == aColIndex)) {
|
||||
if (aInsert) { // put in the new cells
|
||||
for (PRInt32 cellX = 0; cellX < numNewCells; cellX++) {
|
||||
nsTableCellFrame* cell = aCellFrames->ElementAt(cellX);
|
||||
@ -2379,8 +2379,8 @@ nsCellMap::RebuildConsideringCells(nsTableCellMap& aMap,
|
||||
AppendCell(aMap, cell, aRowIndex, PR_FALSE, aDamageArea);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// delete the old cell map
|
||||
for (rowX = 0; rowX < numOrigRows; rowX++) {
|
||||
CellDataArray& row = origRows[rowX];
|
||||
@ -2420,13 +2420,13 @@ void nsCellMap::RemoveCell(nsTableCellMap& aMap,
|
||||
}
|
||||
|
||||
PRInt32 rowSpan = GetRowSpan(aRowIndex, startColIndex, PR_FALSE);
|
||||
// record whether removing the cells is going to cause complications due
|
||||
// to existing row spans, col spans or table sizing.
|
||||
// record whether removing the cells is going to cause complications due
|
||||
// to existing row spans, col spans or table sizing.
|
||||
PRBool spansCauseRebuild = CellsSpanInOrOut(aRowIndex,
|
||||
aRowIndex + rowSpan - 1,
|
||||
startColIndex, numCols - 1);
|
||||
// XXX if the cell has a col span to the end of the map, and the end has no originating
|
||||
// cells, we need to assume that this the only such cell, and rebuild so that there are
|
||||
// XXX if the cell has a col span to the end of the map, and the end has no originating
|
||||
// cells, we need to assume that this the only such cell, and rebuild so that there are
|
||||
// no extraneous cols at the end. The same is true for removing rows.
|
||||
if (!aCellFrame->GetRowSpan() || !aCellFrame->GetColSpan())
|
||||
spansCauseRebuild = PR_TRUE;
|
||||
@ -2445,7 +2445,7 @@ void nsCellMap::ExpandZeroColSpans(nsTableCellMap& aMap)
|
||||
PRUint32 numRows = mRows.Length();
|
||||
PRUint32 numCols = aMap.GetColCount();
|
||||
PRUint32 rowIndex, colIndex;
|
||||
|
||||
|
||||
for (rowIndex = 0; rowIndex < numRows; rowIndex++) {
|
||||
for (colIndex = 0; colIndex < numCols; colIndex++) {
|
||||
CellData* data = mRows[rowIndex].SafeElementAt(colIndex);
|
||||
@ -2496,10 +2496,10 @@ void nsCellMap::ExpandZeroColSpans(nsTableCellMap& aMap)
|
||||
for (rowX = rowIndex; rowX <= endRowIndex; rowX++) {
|
||||
CellData* newData = AllocCellData(nsnull);
|
||||
if (!newData) return;
|
||||
|
||||
|
||||
newData->SetColSpanOffset(colX - colIndex);
|
||||
newData->SetZeroColSpan(PR_TRUE);
|
||||
|
||||
|
||||
if (rowX > rowIndex) {
|
||||
newData->SetRowSpanOffset(rowX - rowIndex);
|
||||
if (rowZeroSpan)
|
||||
@ -2534,7 +2534,7 @@ void nsCellMap::Dump(PRBool aIsBorderCollapse) const
|
||||
}
|
||||
PRUint32 mapRowCount = mRows.Length();
|
||||
printf("mapRowCount=%u tableRowCount=%d\n", mapRowCount, mContentRowCount);
|
||||
|
||||
|
||||
|
||||
PRUint32 rowIndex, colIndex;
|
||||
for (rowIndex = 0; rowIndex < mapRowCount; rowIndex++) {
|
||||
@ -2558,8 +2558,8 @@ void nsCellMap::Dump(PRBool aIsBorderCollapse) const
|
||||
}
|
||||
if (!(cd->IsRowSpan() && cd->IsColSpan())) {
|
||||
printf(" ");
|
||||
}
|
||||
printf(" ");
|
||||
}
|
||||
printf(" ");
|
||||
}
|
||||
} else {
|
||||
printf("---- ");
|
||||
@ -2570,7 +2570,7 @@ void nsCellMap::Dump(PRBool aIsBorderCollapse) const
|
||||
BCBorderOwner owner;
|
||||
PRUint8 side;
|
||||
PRBool segStart;
|
||||
PRPackedBool bevel;
|
||||
PRPackedBool bevel;
|
||||
for (PRInt32 i = 0; i <= 2; i++) {
|
||||
printf("\n ");
|
||||
for (colIndex = 0; colIndex < colCount; colIndex++) {
|
||||
@ -2621,7 +2621,7 @@ void nsCellMap::Dump(PRBool aIsBorderCollapse) const
|
||||
}
|
||||
#endif
|
||||
|
||||
CellData*
|
||||
CellData*
|
||||
nsCellMap::GetDataAt(PRInt32 aMapRowIndex,
|
||||
PRInt32 aColIndex) const
|
||||
{
|
||||
@ -2632,8 +2632,8 @@ nsCellMap::GetDataAt(PRInt32 aMapRowIndex,
|
||||
// only called if the cell at aMapRowIndex, aColIndex is null or dead
|
||||
// (the latter from ExpandZeroColSpans).
|
||||
void nsCellMap::SetDataAt(nsTableCellMap& aMap,
|
||||
CellData& aNewCell,
|
||||
PRInt32 aMapRowIndex,
|
||||
CellData& aNewCell,
|
||||
PRInt32 aMapRowIndex,
|
||||
PRInt32 aColIndex)
|
||||
{
|
||||
NS_ASSERTION(!!aMap.mBCInfo == mIsBC, "BC state mismatch");
|
||||
@ -2662,7 +2662,7 @@ void nsCellMap::SetDataAt(nsTableCellMap& aMap,
|
||||
// update the originating cell counts if cell originates in this row, col
|
||||
nsColInfo* colInfo = aMap.GetColInfoAt(aColIndex);
|
||||
if (colInfo) {
|
||||
if (aNewCell.IsOrig()) {
|
||||
if (aNewCell.IsOrig()) {
|
||||
colInfo->mNumCellsOrig++;
|
||||
}
|
||||
else if (aNewCell.IsColSpan()) {
|
||||
@ -2672,7 +2672,7 @@ void nsCellMap::SetDataAt(nsTableCellMap& aMap,
|
||||
else NS_ERROR("SetDataAt called with col index > table map num cols");
|
||||
}
|
||||
|
||||
nsTableCellFrame*
|
||||
nsTableCellFrame*
|
||||
nsCellMap::GetCellInfoAt(const nsTableCellMap& aMap,
|
||||
PRInt32 aRowX,
|
||||
PRInt32 aColX,
|
||||
@ -2683,7 +2683,7 @@ nsCellMap::GetCellInfoAt(const nsTableCellMap& aMap,
|
||||
*aOriginates = PR_FALSE;
|
||||
}
|
||||
CellData* data = GetDataAt(aRowX, aColX);
|
||||
nsTableCellFrame* cellFrame = nsnull;
|
||||
nsTableCellFrame* cellFrame = nsnull;
|
||||
if (data) {
|
||||
if (data->IsOrig()) {
|
||||
cellFrame = data->GetCellFrame();
|
||||
@ -2702,7 +2702,7 @@ nsCellMap::GetCellInfoAt(const nsTableCellMap& aMap,
|
||||
}
|
||||
return cellFrame;
|
||||
}
|
||||
|
||||
|
||||
|
||||
PRBool nsCellMap::RowIsSpannedInto(PRInt32 aRowIndex,
|
||||
PRInt32 aNumEffCols) const
|
||||
@ -2733,7 +2733,7 @@ PRBool nsCellMap::RowHasSpanningCells(PRInt32 aRowIndex,
|
||||
// aRowIndex is not the last row, so we check the next row after aRowIndex for spanners
|
||||
for (PRInt32 colIndex = 0; colIndex < aNumEffCols; colIndex++) {
|
||||
CellData* cd = GetDataAt(aRowIndex, colIndex);
|
||||
if (cd && (cd->IsOrig())) { // cell originates
|
||||
if (cd && (cd->IsOrig())) { // cell originates
|
||||
CellData* cd2 = GetDataAt(aRowIndex + 1, colIndex);
|
||||
if (cd2 && cd2->IsRowSpan()) { // cd2 is spanned by a row
|
||||
if (cd->GetCellFrame() == GetCellFrame(aRowIndex + 1, colIndex, *cd2, PR_TRUE)) {
|
||||
@ -2751,7 +2751,7 @@ void nsCellMap::DestroyCellData(CellData* aData)
|
||||
if (!aData) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (mIsBC) {
|
||||
BCCellData* bcData = static_cast<BCCellData*>(aData);
|
||||
bcData->~BCCellData();
|
||||
@ -2785,7 +2785,7 @@ void
|
||||
nsCellMapColumnIterator::AdvanceRowGroup()
|
||||
{
|
||||
do {
|
||||
mCurMapStart += mCurMapContentRowCount;
|
||||
mCurMapStart += mCurMapContentRowCount;
|
||||
mCurMap = mCurMap->GetNextSibling();
|
||||
if (!mCurMap) {
|
||||
// Set mCurMapContentRowCount and mCurMapRelevantRowCount to 0 in case
|
||||
@ -2854,8 +2854,8 @@ nsCellMapColumnIterator::GetNextFrame(PRInt32* aRow, PRInt32* aColSpan)
|
||||
if (cellData->IsColSpan()) {
|
||||
// Look up the originating data for this cell, advance by its relative rowspan.
|
||||
PRInt32 rowspanOffset = cellData->GetRowSpanOffset();
|
||||
nsTableCellFrame* cellFrame = mCurMap->GetCellFrame(mCurMapRow, mCol, *cellData, PR_FALSE);
|
||||
NS_ASSERTION(cellFrame,"Must have usable originating data here");
|
||||
nsTableCellFrame* cellFrame = mCurMap->GetCellFrame(mCurMapRow, mCol, *cellData, PR_FALSE);
|
||||
NS_ASSERTION(cellFrame,"Must have usable originating data here");
|
||||
PRInt32 rowSpan = cellFrame->GetRowSpan();
|
||||
if (rowSpan == 0) {
|
||||
AdvanceRowGroup();
|
||||
@ -2872,7 +2872,7 @@ nsCellMapColumnIterator::GetNextFrame(PRInt32* aRow, PRInt32* aColSpan)
|
||||
|
||||
nsTableCellFrame* cellFrame = cellData->GetCellFrame();
|
||||
NS_ASSERTION(cellFrame, "Orig data without cellframe?");
|
||||
|
||||
|
||||
*aRow = mCurMapStart + mCurMapRow;
|
||||
PRBool ignoredZeroSpan;
|
||||
*aColSpan = mCurMap->GetEffectiveColSpan(*mMap, mCurMapRow, mCol,
|
||||
|
@ -62,7 +62,7 @@ struct nsColInfo
|
||||
PRInt32 mNumCellsOrig; // number of cells originating in the col
|
||||
PRInt32 mNumCellsSpan; // number of cells spanning into the col via colspans (not rowspans)
|
||||
|
||||
nsColInfo();
|
||||
nsColInfo();
|
||||
nsColInfo(PRInt32 aNumCellsOrig,
|
||||
PRInt32 aNumCellsSpan);
|
||||
};
|
||||
@ -89,10 +89,10 @@ public:
|
||||
PRBool aBorderCollapse);
|
||||
|
||||
/** destructor
|
||||
* NOT VIRTUAL BECAUSE THIS CLASS SHOULD **NEVER** BE SUBCLASSED
|
||||
* NOT VIRTUAL BECAUSE THIS CLASS SHOULD **NEVER** BE SUBCLASSED
|
||||
*/
|
||||
~nsTableCellMap();
|
||||
|
||||
|
||||
void RemoveGroupCellMap(nsTableRowGroupFrame* aRowGroup);
|
||||
|
||||
void InsertGroupCellMap(nsTableRowGroupFrame* aNewRowGroup,
|
||||
@ -118,7 +118,7 @@ public:
|
||||
PRBool aUseRowIfOverlap) const;
|
||||
|
||||
/** return the CellData for the cell at (aRowIndex, aColIndex) */
|
||||
CellData* GetDataAt(PRInt32 aRowIndex,
|
||||
CellData* GetDataAt(PRInt32 aRowIndex,
|
||||
PRInt32 aColIndex) const;
|
||||
|
||||
// this function creates a col if needed
|
||||
@ -171,9 +171,9 @@ public:
|
||||
/** return the actual number of rows in the table represented by this CellMap */
|
||||
PRInt32 GetRowCount() const;
|
||||
|
||||
nsTableCellFrame* GetCellInfoAt(PRInt32 aRowX,
|
||||
PRInt32 aColX,
|
||||
PRBool* aOriginates = nsnull,
|
||||
nsTableCellFrame* GetCellInfoAt(PRInt32 aRowX,
|
||||
PRInt32 aColX,
|
||||
PRBool* aOriginates = nsnull,
|
||||
PRInt32* aColSpan = nsnull) const;
|
||||
|
||||
/**
|
||||
@ -217,7 +217,7 @@ protected:
|
||||
* into or out of the rows. This function can only handle insertion
|
||||
* or deletion but NOT both. So either aRowsToInsert must be null
|
||||
* or aNumRowsToRemove must be 0.
|
||||
*
|
||||
*
|
||||
* // XXXbz are both allowed to happen? That'd be a no-op...
|
||||
*/
|
||||
void RebuildConsideringRows(nsCellMap* aCellMap,
|
||||
@ -235,10 +235,10 @@ public:
|
||||
PRUint32 aXPos,
|
||||
PRBool aIsLowerRight = PR_FALSE);
|
||||
|
||||
void SetBCBorderEdge(PRUint8 aEdge,
|
||||
void SetBCBorderEdge(PRUint8 aEdge,
|
||||
nsCellMap& aCellMap,
|
||||
PRUint32 aCellMapStart,
|
||||
PRUint32 aYPos,
|
||||
PRUint32 aYPos,
|
||||
PRUint32 aXPos,
|
||||
PRUint32 aLength,
|
||||
BCBorderOwner aOwner,
|
||||
@ -248,7 +248,7 @@ public:
|
||||
void SetBCBorderCorner(Corner aCorner,
|
||||
nsCellMap& aCellMap,
|
||||
PRUint32 aCellMapStart,
|
||||
PRUint32 aYPos,
|
||||
PRUint32 aYPos,
|
||||
PRUint32 aXPos,
|
||||
PRUint8 aOwner,
|
||||
nscoord aSubSize,
|
||||
@ -268,7 +268,7 @@ protected:
|
||||
friend class BCMapCellIterator;
|
||||
friend class BCPaintBorderIterator;
|
||||
friend class nsCellMapColumnIterator;
|
||||
|
||||
|
||||
/** Insert a row group cellmap after aPrevMap, if aPrefMap is null insert it
|
||||
* at the beginning, the ordering of the cellmap corresponds to the ordering of
|
||||
* rowgroups once OrderRowGroups has been called
|
||||
@ -284,7 +284,7 @@ protected:
|
||||
BCInfo* mBCInfo;
|
||||
};
|
||||
|
||||
/** nsCellMap is a support class for nsTablePart.
|
||||
/** nsCellMap is a support class for nsTablePart.
|
||||
* It maintains an Rows x Columns grid onto which the cells of the table are mapped.
|
||||
* This makes processing of rowspan and colspan attributes much easier.
|
||||
* Each cell is represented by a CellData object.
|
||||
@ -300,14 +300,14 @@ protected:
|
||||
class nsCellMap
|
||||
{
|
||||
public:
|
||||
/** constructor
|
||||
/** constructor
|
||||
* @param aRowGroupFrame the row group frame this is a cellmap for
|
||||
* @param aIsBC whether the table is doing border-collapse
|
||||
*/
|
||||
nsCellMap(nsTableRowGroupFrame* aRowGroupFrame, PRBool aIsBC);
|
||||
|
||||
/** destructor
|
||||
* NOT VIRTUAL BECAUSE THIS CLASS SHOULD **NEVER** BE SUBCLASSED
|
||||
* NOT VIRTUAL BECAUSE THIS CLASS SHOULD **NEVER** BE SUBCLASSED
|
||||
*/
|
||||
~nsCellMap();
|
||||
|
||||
@ -356,26 +356,26 @@ public:
|
||||
void GetRowAndColumnByIndex(PRInt32 aColCount, PRInt32 aIndex,
|
||||
PRInt32 *aRow, PRInt32 *aColumn) const;
|
||||
|
||||
/** append the cellFrame at an empty or dead cell or finally at the end of
|
||||
* the row at aRowIndex and return a pointer to the celldata entry in the
|
||||
/** append the cellFrame at an empty or dead cell or finally at the end of
|
||||
* the row at aRowIndex and return a pointer to the celldata entry in the
|
||||
* cellmap
|
||||
*
|
||||
* @param aMap - reference to the table cell map
|
||||
* @param aCellFrame - a pointer to the cellframe which will be appended
|
||||
* @param aCellFrame - a pointer to the cellframe which will be appended
|
||||
* to the row
|
||||
* @param aRowIndex - to this row the celldata entry will be added
|
||||
* @param aRebuildIfNecessay - if a cell spans into a row below it might be
|
||||
* necesserary to rebuild the cellmap as this rowspan
|
||||
* @param aRebuildIfNecessay - if a cell spans into a row below it might be
|
||||
* necesserary to rebuild the cellmap as this rowspan
|
||||
* might overlap another cell.
|
||||
* @param aDamageArea - area in cellmap coordinates which have been updated.
|
||||
* @param aColToBeginSearch - if not null contains the column number where
|
||||
* the search for a empty or dead cell in the
|
||||
* @param aColToBeginSearch - if not null contains the column number where
|
||||
* the search for a empty or dead cell in the
|
||||
* row should start
|
||||
* @return - a pointer to the celldata entry inserted into
|
||||
* @return - a pointer to the celldata entry inserted into
|
||||
* the cellmap
|
||||
*/
|
||||
CellData* AppendCell(nsTableCellMap& aMap,
|
||||
nsTableCellFrame* aCellFrame,
|
||||
nsTableCellFrame* aCellFrame,
|
||||
PRInt32 aRowIndex,
|
||||
PRBool aRebuildIfNecessary,
|
||||
nsRect& aDamageArea,
|
||||
@ -445,11 +445,11 @@ public:
|
||||
*/
|
||||
PRBool HasMoreThanOneCell(PRInt32 aRowIndex) const;
|
||||
|
||||
/* Get the rowspan for a cell starting at aRowIndex and aColIndex.
|
||||
/* Get the rowspan for a cell starting at aRowIndex and aColIndex.
|
||||
* If aGetEffective is true the size will not exceed the last content based
|
||||
* row. Cells can have a specified rowspan that extends below the last
|
||||
* content based row. This is legitimate considering incr. reflow where the
|
||||
* content rows will arive later.
|
||||
* content rows will arive later.
|
||||
*/
|
||||
PRInt32 GetRowSpan(PRInt32 aRowIndex,
|
||||
PRInt32 aColIndex,
|
||||
@ -480,15 +480,15 @@ protected:
|
||||
*/
|
||||
PRBool Grow(nsTableCellMap& aMap,
|
||||
PRInt32 aNumRows,
|
||||
PRInt32 aRowIndex = -1);
|
||||
PRInt32 aRowIndex = -1);
|
||||
|
||||
void GrowRow(CellDataArray& aRow,
|
||||
PRInt32 aNumCols);
|
||||
|
||||
/** assign aCellData to the cell at (aRow,aColumn) */
|
||||
void SetDataAt(nsTableCellMap& aMap,
|
||||
CellData& aCellData,
|
||||
PRInt32 aMapRowIndex,
|
||||
CellData& aCellData,
|
||||
PRInt32 aMapRowIndex,
|
||||
PRInt32 aColIndex);
|
||||
|
||||
CellData* GetDataAt(PRInt32 aMapRowIndex,
|
||||
@ -543,7 +543,7 @@ protected:
|
||||
nsRect& aDamageArea);
|
||||
|
||||
PRBool CellsSpanOut(nsTArray<nsTableRowFrame*>& aNewRows) const;
|
||||
|
||||
|
||||
/** If a cell spans out of the area defined by aStartRowIndex, aEndRowIndex
|
||||
* and aStartColIndex, aEndColIndex the cellmap changes are more severe so
|
||||
* the corresponding routines needs to be called. This is also necessary if
|
||||
@ -570,9 +570,9 @@ protected:
|
||||
PRInt32 aRowIndex,
|
||||
PRBool& aIsZeroRowSpan) const;
|
||||
|
||||
PRInt32 GetColSpanForNewCell(nsTableCellFrame& aCellFrameToAdd,
|
||||
PRInt32 GetColSpanForNewCell(nsTableCellFrame& aCellFrameToAdd,
|
||||
PRBool& aIsZeroColSpan) const;
|
||||
|
||||
|
||||
// Destroy a CellData struct. This will handle the case of aData
|
||||
// actually being a BCCellData properly.
|
||||
void DestroyCellData(CellData* aData);
|
||||
@ -585,11 +585,11 @@ protected:
|
||||
* in that row. It can be larger than mContentRowCount due to row spans
|
||||
* extending beyond the table */
|
||||
// XXXbz once we have auto TArrays, we should probably use them here.
|
||||
nsTArray<CellDataArray> mRows;
|
||||
nsTArray<CellDataArray> mRows;
|
||||
|
||||
/** the number of rows in the table (content) which is not indentical to the
|
||||
* number of rows in the cell map due to row spans extending beyond the end
|
||||
* of thetable (dead rows) or empty tr tags
|
||||
* of thetable (dead rows) or empty tr tags
|
||||
*/
|
||||
PRInt32 mContentRowCount;
|
||||
|
||||
@ -637,7 +637,7 @@ public:
|
||||
}
|
||||
|
||||
nsTableCellFrame* GetNextFrame(PRInt32* aRow, PRInt32* aColSpan);
|
||||
|
||||
|
||||
private:
|
||||
void AdvanceRowGroup();
|
||||
|
||||
@ -652,7 +652,7 @@ private:
|
||||
// mCurMap starts. This is used to compute row indices to pass to
|
||||
// nsTableCellMap::GetDataAt, so must be a _content_ row index.
|
||||
PRUint32 mCurMapStart;
|
||||
|
||||
|
||||
// In steady-state mCurMapRow is the row in our current nsCellMap
|
||||
// that we'll use the next time GetNextFrame() is called. Due to
|
||||
// the way we skip over rowspans, the entry in mCurMapRow and mCol
|
||||
@ -696,20 +696,20 @@ inline nsTableRowGroupFrame* nsCellMap::GetRowGroup() const
|
||||
}
|
||||
|
||||
inline PRInt32 nsCellMap::GetRowCount(PRBool aConsiderDeadRowSpanRows) const
|
||||
{
|
||||
{
|
||||
PRInt32 rowCount = (aConsiderDeadRowSpanRows) ? mRows.Length() : mContentRowCount;
|
||||
return rowCount;
|
||||
return rowCount;
|
||||
}
|
||||
|
||||
// nsColInfo
|
||||
|
||||
inline nsColInfo::nsColInfo()
|
||||
:mNumCellsOrig(0), mNumCellsSpan(0)
|
||||
:mNumCellsOrig(0), mNumCellsSpan(0)
|
||||
{}
|
||||
|
||||
inline nsColInfo::nsColInfo(PRInt32 aNumCellsOrig,
|
||||
PRInt32 aNumCellsSpan)
|
||||
:mNumCellsOrig(aNumCellsOrig), mNumCellsSpan(aNumCellsSpan)
|
||||
:mNumCellsOrig(aNumCellsOrig), mNumCellsSpan(aNumCellsSpan)
|
||||
{}
|
||||
|
||||
|
||||
|
@ -153,14 +153,14 @@ nsTableCellFrame::NotifyPercentHeight(const nsHTMLReflowState& aReflowState)
|
||||
rs = rs->parentReflowState) {
|
||||
rs->frame->AddStateBits(NS_FRAME_CONTAINS_RELATIVE_HEIGHT);
|
||||
}
|
||||
|
||||
|
||||
nsTableFrame::RequestSpecialHeightReflow(*cellRS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The cell needs to observe its block and things inside its block but nothing below that
|
||||
PRBool
|
||||
PRBool
|
||||
nsTableCellFrame::NeedsToObserve(const nsHTMLReflowState& aReflowState)
|
||||
{
|
||||
const nsHTMLReflowState *rs = aReflowState.parentReflowState;
|
||||
@ -192,7 +192,7 @@ nsTableCellFrame::NeedsToObserve(const nsHTMLReflowState& aReflowState)
|
||||
fType == nsGkAtoms::tableOuterFrame);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsresult
|
||||
nsTableCellFrame::GetRowIndex(PRInt32 &aRowIndex) const
|
||||
{
|
||||
nsresult result;
|
||||
@ -208,9 +208,9 @@ nsTableCellFrame::GetRowIndex(PRInt32 &aRowIndex) const
|
||||
return result;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsresult
|
||||
nsTableCellFrame::GetColIndex(PRInt32 &aColIndex) const
|
||||
{
|
||||
{
|
||||
if (GetPrevInFlow()) {
|
||||
return ((nsTableCellFrame*)GetFirstInFlow())->GetColIndex(aColIndex);
|
||||
}
|
||||
@ -235,7 +235,7 @@ nsTableCellFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
||||
// let the table frame decide what to do
|
||||
nsTableFrame* tableFrame = nsTableFrame::GetTableFrame(this);
|
||||
if (tableFrame) {
|
||||
tableFrame->AttributeChangedFor(this, mContent, aAttribute);
|
||||
tableFrame->AttributeChangedFor(this, mContent, aAttribute);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
@ -245,9 +245,9 @@ nsTableCellFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext)
|
||||
{
|
||||
if (!aOldStyleContext) //avoid this on init
|
||||
return;
|
||||
|
||||
|
||||
nsTableFrame* tableFrame = nsTableFrame::GetTableFrame(this);
|
||||
|
||||
|
||||
if (tableFrame->IsBorderCollapse() &&
|
||||
tableFrame->BCRecalcNeeded(aOldStyleContext, GetStyleContext())) {
|
||||
PRInt32 colIndex, rowIndex;
|
||||
@ -258,7 +258,7 @@ nsTableCellFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsTableCellFrame::AppendFrames(nsIAtom* aListName,
|
||||
nsFrameList& aFrameList)
|
||||
@ -285,7 +285,7 @@ nsTableCellFrame::RemoveFrame(nsIAtom* aListName,
|
||||
}
|
||||
|
||||
void nsTableCellFrame::SetColIndex(PRInt32 aColIndex)
|
||||
{
|
||||
{
|
||||
mColIndex = aColIndex;
|
||||
}
|
||||
|
||||
@ -438,14 +438,14 @@ nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
DO_GLOBAL_REFLOW_COUNT_DSP("nsTableCellFrame");
|
||||
nsTableFrame* tableFrame = nsTableFrame::GetTableFrame(this);
|
||||
|
||||
|
||||
PRInt32 emptyCellStyle = GetContentEmpty() && !tableFrame->IsBorderCollapse() ?
|
||||
GetStyleTableBorder()->mEmptyCells
|
||||
: NS_STYLE_TABLE_EMPTY_CELLS_SHOW;
|
||||
// take account of 'empty-cells'
|
||||
if (GetStyleVisibility()->IsVisible() &&
|
||||
(NS_STYLE_TABLE_EMPTY_CELLS_HIDE != emptyCellStyle)) {
|
||||
|
||||
|
||||
|
||||
PRBool isRoot = aBuilder->IsAtRootOfPseudoStackingContext();
|
||||
if (!isRoot) {
|
||||
@ -482,7 +482,7 @@ nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
nsresult rv = aLists.BorderBackground()->AppendNewToTop(item);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
|
||||
// display borders if we need to
|
||||
if (!tableFrame->IsBorderCollapse() && HasBorder() &&
|
||||
emptyCellStyle == NS_STYLE_TABLE_EMPTY_CELLS_SHOW) {
|
||||
@ -551,7 +551,7 @@ void nsTableCellFrame::VerticallyAlignChild(nscoord aMaxAscent)
|
||||
nscoord topInset = borderPadding.top;
|
||||
nscoord bottomInset = borderPadding.bottom;
|
||||
|
||||
// As per bug 10207, we map 'sub', 'super', 'text-top', 'text-bottom',
|
||||
// As per bug 10207, we map 'sub', 'super', 'text-top', 'text-bottom',
|
||||
// length and percentage values to 'baseline'
|
||||
// XXX It seems that we don't get to see length and percentage values here
|
||||
// because the Style System has already fixed the error and mapped them
|
||||
@ -575,27 +575,27 @@ void nsTableCellFrame::VerticallyAlignChild(nscoord aMaxAscent)
|
||||
|
||||
// Vertically align the child
|
||||
nscoord kidYTop = 0;
|
||||
switch (verticalAlignFlags)
|
||||
switch (verticalAlignFlags)
|
||||
{
|
||||
case NS_STYLE_VERTICAL_ALIGN_BASELINE:
|
||||
// Align the baselines of the child frame with the baselines of
|
||||
// Align the baselines of the child frame with the baselines of
|
||||
// other children in the same row which have 'vertical-align: baseline'
|
||||
kidYTop = topInset + aMaxAscent - GetCellBaseline();
|
||||
break;
|
||||
|
||||
case NS_STYLE_VERTICAL_ALIGN_TOP:
|
||||
// Align the top of the child frame with the top of the content area,
|
||||
// Align the top of the child frame with the top of the content area,
|
||||
kidYTop = topInset;
|
||||
break;
|
||||
|
||||
case NS_STYLE_VERTICAL_ALIGN_BOTTOM:
|
||||
// Align the bottom of the child frame with the bottom of the content area,
|
||||
// Align the bottom of the child frame with the bottom of the content area,
|
||||
kidYTop = height - childHeight - bottomInset;
|
||||
break;
|
||||
|
||||
default:
|
||||
case NS_STYLE_VERTICAL_ALIGN_MIDDLE:
|
||||
// Align the middle of the child frame with the middle of the content area,
|
||||
// Align the middle of the child frame with the middle of the content area,
|
||||
kidYTop = (height - childHeight - bottomInset + topInset) / 2;
|
||||
}
|
||||
// if the content is larger than the cell height align from top
|
||||
@ -605,7 +605,7 @@ void nsTableCellFrame::VerticallyAlignChild(nscoord aMaxAscent)
|
||||
// Invalidate at the old position first
|
||||
firstKid->InvalidateOverflowRect();
|
||||
}
|
||||
|
||||
|
||||
firstKid->SetPosition(nsPoint(kidRect.x, kidYTop));
|
||||
nsHTMLReflowMetrics desiredSize;
|
||||
desiredSize.width = mRect.width;
|
||||
@ -628,7 +628,7 @@ void nsTableCellFrame::VerticallyAlignChild(nscoord aMaxAscent)
|
||||
}
|
||||
}
|
||||
|
||||
// As per bug 10207, we map 'sub', 'super', 'text-top', 'text-bottom',
|
||||
// As per bug 10207, we map 'sub', 'super', 'text-top', 'text-bottom',
|
||||
// length and percentage values to 'baseline'
|
||||
// XXX It seems that we don't get to see length and percentage values here
|
||||
// because the Style System has already fixed the error and mapped them
|
||||
@ -649,7 +649,7 @@ nsTableCellFrame::HasVerticalAlignBaseline()
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
PRBool
|
||||
PRBool
|
||||
nsTableCellFrame::CellHasVisibleContent(nscoord height,
|
||||
nsTableFrame* tableFrame,
|
||||
nsIFrame* kidFrame)
|
||||
@ -676,7 +676,7 @@ nsTableCellFrame::CellHasVisibleContent(nscoord height,
|
||||
return PR_TRUE;
|
||||
}
|
||||
innerFrame = innerFrame->GetNextSibling();
|
||||
}
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
@ -695,7 +695,7 @@ nsTableCellFrame::GetCellBaseline() const
|
||||
}
|
||||
|
||||
PRInt32 nsTableCellFrame::GetRowSpan()
|
||||
{
|
||||
{
|
||||
PRInt32 rowSpan=1;
|
||||
nsGenericHTMLElement *hc = nsGenericHTMLElement::FromContent(mContent);
|
||||
|
||||
@ -704,25 +704,25 @@ PRInt32 nsTableCellFrame::GetRowSpan()
|
||||
const nsAttrValue* attr = hc->GetParsedAttr(nsGkAtoms::rowspan);
|
||||
// Note that we don't need to check the tag name, because only table cells
|
||||
// and table headers parse the "rowspan" attribute into an integer.
|
||||
if (attr && attr->Type() == nsAttrValue::eInteger) {
|
||||
rowSpan = attr->GetIntegerValue();
|
||||
if (attr && attr->Type() == nsAttrValue::eInteger) {
|
||||
rowSpan = attr->GetIntegerValue();
|
||||
}
|
||||
}
|
||||
return rowSpan;
|
||||
}
|
||||
|
||||
PRInt32 nsTableCellFrame::GetColSpan()
|
||||
{
|
||||
{
|
||||
PRInt32 colSpan=1;
|
||||
nsGenericHTMLElement *hc = nsGenericHTMLElement::FromContent(mContent);
|
||||
|
||||
// Don't look at the content's colspan if we're a pseudo cell
|
||||
if (hc && !GetStyleContext()->GetPseudo()) {
|
||||
const nsAttrValue* attr = hc->GetParsedAttr(nsGkAtoms::colspan);
|
||||
const nsAttrValue* attr = hc->GetParsedAttr(nsGkAtoms::colspan);
|
||||
// Note that we don't need to check the tag name, because only table cells
|
||||
// and table headers parse the "colspan" attribute into an integer.
|
||||
if (attr && attr->Type() == nsAttrValue::eInteger) {
|
||||
colSpan = attr->GetIntegerValue();
|
||||
if (attr && attr->Type() == nsAttrValue::eInteger) {
|
||||
colSpan = attr->GetIntegerValue();
|
||||
}
|
||||
}
|
||||
return colSpan;
|
||||
@ -771,8 +771,8 @@ nsTableCellFrame::IntrinsicWidthOffsets(nsIRenderingContext* aRenderingContext)
|
||||
#ifdef DEBUG
|
||||
#define PROBABLY_TOO_LARGE 1000000
|
||||
static
|
||||
void DebugCheckChildSize(nsIFrame* aChild,
|
||||
nsHTMLReflowMetrics& aMet,
|
||||
void DebugCheckChildSize(nsIFrame* aChild,
|
||||
nsHTMLReflowMetrics& aMet,
|
||||
nsSize& aAvailSize)
|
||||
{
|
||||
if ((aMet.width < 0) || (aMet.width > PROBABLY_TOO_LARGE)) {
|
||||
@ -783,11 +783,11 @@ void DebugCheckChildSize(nsIFrame* aChild,
|
||||
#endif
|
||||
|
||||
// the computed height for the cell, which descendants use for percent height calculations
|
||||
// it is the height (minus border, padding) of the cell's first in flow during its final
|
||||
// it is the height (minus border, padding) of the cell's first in flow during its final
|
||||
// reflow without an unconstrained height.
|
||||
static nscoord
|
||||
CalcUnpaginagedHeight(nsPresContext* aPresContext,
|
||||
nsTableCellFrame& aCellFrame,
|
||||
nsTableCellFrame& aCellFrame,
|
||||
nsTableFrame& aTableFrame,
|
||||
nscoord aVerticalBorderPadding)
|
||||
{
|
||||
@ -843,7 +843,7 @@ NS_METHOD nsTableCellFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsMargin border;
|
||||
GetBorderWidth(border);
|
||||
borderPadding += border;
|
||||
|
||||
|
||||
nscoord topInset = borderPadding.top;
|
||||
nscoord rightInset = borderPadding.right;
|
||||
nscoord bottomInset = borderPadding.bottom;
|
||||
@ -877,7 +877,7 @@ NS_METHOD nsTableCellFrame::Reflow(nsPresContext* aPresContext,
|
||||
const_cast<nsHTMLReflowState&>(aReflowState).SetComputedHeight(computedUnpaginatedHeight);
|
||||
DISPLAY_REFLOW_CHANGE();
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
SetHasPctOverHeight(PR_FALSE);
|
||||
}
|
||||
@ -896,7 +896,7 @@ NS_METHOD nsTableCellFrame::Reflow(nsPresContext* aPresContext,
|
||||
}
|
||||
// Don't propagate special height reflow state to our kids
|
||||
kidReflowState.mFlags.mSpecialHeightReflow = PR_FALSE;
|
||||
|
||||
|
||||
if (aReflowState.mFlags.mSpecialHeightReflow ||
|
||||
(GetFirstInFlow()->GetStateBits() & NS_TABLE_CELL_HAD_SPECIAL_REFLOW)) {
|
||||
// We need to force the kid to have mVResize set if we've had a
|
||||
@ -928,7 +928,7 @@ NS_METHOD nsTableCellFrame::Reflow(nsPresContext* aPresContext,
|
||||
DebugCheckChildSize(firstKid, kidSize, availSize);
|
||||
#endif
|
||||
|
||||
// 0 dimensioned cells need to be treated specially in Standard/NavQuirks mode
|
||||
// 0 dimensioned cells need to be treated specially in Standard/NavQuirks mode
|
||||
// see testcase "emptyCells.html"
|
||||
nsIFrame* prevInFlow = GetPrevInFlow();
|
||||
PRBool isEmpty;
|
||||
@ -945,7 +945,7 @@ NS_METHOD nsTableCellFrame::Reflow(nsPresContext* aPresContext,
|
||||
|
||||
nsTableFrame::InvalidateFrame(firstKid, origRect, origOverflowRect,
|
||||
firstReflow);
|
||||
|
||||
|
||||
// first, compute the height which can be set w/o being restricted by aMaxSize.height
|
||||
nscoord cellHeight = kidSize.height;
|
||||
|
||||
@ -958,7 +958,7 @@ NS_METHOD nsTableCellFrame::Reflow(nsPresContext* aPresContext,
|
||||
|
||||
// factor in border and padding
|
||||
if (NS_UNCONSTRAINEDSIZE != cellWidth) {
|
||||
cellWidth += leftInset + rightInset;
|
||||
cellWidth += leftInset + rightInset;
|
||||
}
|
||||
|
||||
// set the cell's desired size and max element size
|
||||
@ -969,7 +969,7 @@ NS_METHOD nsTableCellFrame::Reflow(nsPresContext* aPresContext,
|
||||
|
||||
if (aReflowState.mFlags.mSpecialHeightReflow) {
|
||||
if (aDesiredSize.height > mRect.height) {
|
||||
// set a bit indicating that the pct height contents exceeded
|
||||
// set a bit indicating that the pct height contents exceeded
|
||||
// the height that they could honor in the pass 2 reflow
|
||||
SetHasPctOverHeight(PR_TRUE);
|
||||
}
|
||||
@ -1039,7 +1039,7 @@ NS_NewTableCellFrame(nsIPresShell* aPresShell,
|
||||
|
||||
NS_IMPL_FRAMEARENA_HELPERS(nsBCTableCellFrame)
|
||||
|
||||
nsMargin*
|
||||
nsMargin*
|
||||
nsTableCellFrame::GetBorderWidth(nsMargin& aBorder) const
|
||||
{
|
||||
aBorder = GetStyleBorder()->GetActualBorder();
|
||||
@ -1100,7 +1100,7 @@ nsBCTableCellFrame::GetFrameName(nsAString& aResult) const
|
||||
}
|
||||
#endif
|
||||
|
||||
nsMargin*
|
||||
nsMargin*
|
||||
nsBCTableCellFrame::GetBorderWidth(nsMargin& aBorder) const
|
||||
{
|
||||
PRInt32 aPixelsToTwips = nsPresContext::AppUnitsPerCSSPixel();
|
||||
@ -1126,7 +1126,7 @@ nsBCTableCellFrame::GetBorderWidth(PRUint8 aSide) const
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
nsBCTableCellFrame::SetBorderWidth(PRUint8 aSide,
|
||||
BCPixelSize aValue)
|
||||
{
|
||||
|
@ -67,8 +67,8 @@ class nsTableFrame;
|
||||
*
|
||||
* @author sclark
|
||||
*/
|
||||
class nsTableCellFrame : public nsHTMLContainerFrame,
|
||||
public nsITableCellLayout,
|
||||
class nsTableCellFrame : public nsHTMLContainerFrame,
|
||||
public nsITableCellLayout,
|
||||
public nsIPercentHeightObserver
|
||||
{
|
||||
public:
|
||||
@ -95,7 +95,7 @@ public:
|
||||
|
||||
/** @see nsIFrame::DidSetStyleContext */
|
||||
virtual void DidSetStyleContext(nsStyleContext* aOldStyleContext);
|
||||
|
||||
|
||||
// table cells contain a block frame which does most of the work, and
|
||||
// so these functions should never be called. They assert and return
|
||||
// NS_ERROR_NOT_IMPLEMENTED
|
||||
@ -127,7 +127,7 @@ public:
|
||||
NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
const nsRect& aDirtyRect,
|
||||
const nsDisplayListSet& aLists);
|
||||
|
||||
|
||||
void PaintCellBackground(nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect, nsPoint aPt,
|
||||
PRUint32 aFlags);
|
||||
@ -158,8 +158,8 @@ public:
|
||||
void VerticallyAlignChild(nscoord aMaxAscent);
|
||||
|
||||
PRBool HasVerticalAlignBaseline();
|
||||
|
||||
PRBool CellHasVisibleContent(nscoord height,
|
||||
|
||||
PRBool CellHasVisibleContent(nscoord height,
|
||||
nsTableFrame* tableFrame,
|
||||
nsIFrame* kidFrame);
|
||||
|
||||
@ -198,14 +198,14 @@ public:
|
||||
* @see nsTableFrame::GetEffectiveColSpan()
|
||||
*/
|
||||
virtual PRInt32 GetColSpan();
|
||||
|
||||
|
||||
/** return the cell's column index (starting at 0 for the first column) */
|
||||
virtual nsresult GetColIndex(PRInt32 &aColIndex) const;
|
||||
void SetColIndex(PRInt32 aColIndex);
|
||||
|
||||
/** return the available width given to this frame during its last reflow */
|
||||
inline nscoord GetPriorAvailWidth();
|
||||
|
||||
|
||||
/** set the available width given to this frame during its last reflow */
|
||||
inline void SetPriorAvailWidth(nscoord aPriorAvailWidth);
|
||||
|
||||
@ -232,7 +232,7 @@ public:
|
||||
|
||||
void DecorateForSelection(nsIRenderingContext& aRenderingContext,
|
||||
nsPoint aPt);
|
||||
|
||||
|
||||
protected:
|
||||
/** implement abstract method on nsHTMLContainerFrame */
|
||||
virtual PRIntn GetSkipSides() const;
|
||||
@ -249,7 +249,7 @@ protected:
|
||||
|
||||
friend class nsTableRowFrame;
|
||||
|
||||
PRUint32 mColIndex; // the starting column for this cell
|
||||
PRUint32 mColIndex; // the starting column for this cell
|
||||
|
||||
nscoord mPriorAvailWidth; // the avail width during the last reflow
|
||||
nsSize mDesiredSize; // the last desired width & height
|
||||
@ -265,7 +265,7 @@ inline nsSize nsTableCellFrame::GetDesiredSize()
|
||||
{ return mDesiredSize; }
|
||||
|
||||
inline void nsTableCellFrame::SetDesiredSize(const nsHTMLReflowMetrics & aDesiredSize)
|
||||
{
|
||||
{
|
||||
mDesiredSize.width = aDesiredSize.width;
|
||||
mDesiredSize.height = aDesiredSize.height;
|
||||
}
|
||||
@ -335,7 +335,7 @@ public:
|
||||
PRUint32 aFlags);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
// These are the entire width of the border (the cell edge contains only
|
||||
// the inner half, per the macros in nsTablePainter.h).
|
||||
BCPixelSize mTopBorder;
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user