Backed out changeset 9b0b2391485c due to linker errors related to nsStyleStructInlines.h not being included enough.

This commit is contained in:
L. David Baron 2008-07-16 22:59:14 -07:00
parent bb4be48531
commit 9e4ceade8e
73 changed files with 125 additions and 1993 deletions

View File

@ -583,8 +583,8 @@ nsGenericHTMLElement::GetOffsetRect(nsRect& aRect, nsIContent** aOffsetParent)
if (parent &&
parent->GetStylePosition()->mBoxSizing != NS_STYLE_BOX_SIZING_BORDER) {
const nsStyleBorder* border = parent->GetStyleBorder();
origin.x -= border->GetActualBorderWidth(NS_SIDE_LEFT);
origin.y -= border->GetActualBorderWidth(NS_SIDE_TOP);
origin.x -= border->GetBorderWidth(NS_SIDE_LEFT);
origin.y -= border->GetBorderWidth(NS_SIDE_TOP);
}
// XXX We should really consider subtracting out padding for

View File

@ -666,7 +666,7 @@ nsImageDocument::CheckOverflowing(PRBool changeState)
nsMargin m;
if (styleContext->GetStyleMargin()->GetMargin(m))
visibleArea.Deflate(m);
m = styleContext->GetStyleBorder()->GetActualBorder();
m = styleContext->GetStyleBorder()->GetBorder();
visibleArea.Deflate(m);
if (styleContext->GetStylePadding()->GetPadding(m))
visibleArea.Deflate(m);

View File

@ -406,7 +406,7 @@ interface nsIDOMCSS2Properties : nsISupports
// raises(DOMException) on setting
};
[scriptable, uuid(f1781ae4-00e6-4751-8698-2925f925fd76)]
[scriptable, uuid(816581b0-3d89-11dd-ae16-0800200c9a66)]
interface nsIDOMNSCSS2Properties : nsIDOMCSS2Properties
{
/* Non-DOM 2 extensions */
@ -596,8 +596,4 @@ interface nsIDOMNSCSS2Properties : nsIDOMCSS2Properties
attribute DOMString MozBoxShadow;
// raises(DOMException) on setting
attribute DOMString MozBorderImage;
// raises(DOMException) on setting
};

View File

@ -337,8 +337,7 @@ public:
* Uses a surface for drawing. This is a shorthand for creating a
* pattern and setting it.
*
* @param offset from the source surface, to use only part of it.
* May need to make it negative.
* @param offset ?
*/
void SetSource(gfxASurface *surface, const gfxPoint& offset = gfxPoint(0.0, 0.0));

View File

@ -26,7 +26,6 @@
* Masayuki Nakano <masayuki@d-toybox.com>
* L. David Baron <dbaron@dbaron.org>, Mozilla Corporation
* Michael Ventnor <m.ventnor@gmail.com>
* Rob Arnold <robarnold@mozilla.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
@ -73,11 +72,8 @@
#include "nsLayoutUtils.h"
#include "nsINameSpaceManager.h"
#include "nsBlockFrame.h"
#include "gfxContext.h"
#include "nsIInterfaceRequestorUtils.h"
#include "gfxPlatform.h"
#include "gfxImageSurface.h"
#include "nsStyleStructInlines.h"
#define BORDER_FULL 0 //entire side
#define BORDER_INSIDE 1 //inside half
@ -2699,12 +2695,6 @@ nsCSSRendering::PaintBorder(nsPresContext* aPresContext,
return; // Let the theme handle it.
}
if (aBorderStyle.IsBorderImageLoaded()) {
DrawBorderImage(aPresContext, aRenderingContext, aForFrame,
aBorderArea, aBorderStyle, aHardBorderSize);
return;
}
// Get our style context's color struct.
const nsStyleColor* ourColor = aStyleContext->GetStyleColor();
@ -2716,7 +2706,7 @@ nsCSSRendering::PaintBorder(nsPresContext* aPresContext,
if (aHardBorderSize > 0) {
border.SizeTo(aHardBorderSize, aHardBorderSize, aHardBorderSize, aHardBorderSize);
} else {
border = aBorderStyle.GetComputedBorder();
border = aBorderStyle.GetBorder();
}
if ((0 == border.left) && (0 == border.right) &&
@ -3349,7 +3339,7 @@ nsCSSRendering::PaintBoxShadow(nsPresContext* aPresContext,
nsRect frameRect;
const nsStyleBorder* styleBorder = aForFrame->GetStyleBorder();
borderValues = styleBorder->GetActualBorder();
borderValues = styleBorder->GetBorder();
sidesToSkip = aForFrame->GetSkipSides();
frameRect = nsRect(aForFramePt, aForFrame->GetSize());
@ -3736,13 +3726,20 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
PRBool needBackgroundColor = !(aColor.mBackgroundFlags &
NS_STYLE_BG_COLOR_TRANSPARENT);
PRIntn repeat = aColor.mBackgroundRepeat;
nscoord xDistance, yDistance;
switch (repeat) {
case NS_STYLE_BG_REPEAT_X:
xDistance = dirtyRect.width;
yDistance = tileHeight;
break;
case NS_STYLE_BG_REPEAT_Y:
xDistance = tileWidth;
yDistance = dirtyRect.height;
break;
case NS_STYLE_BG_REPEAT_XY:
xDistance = dirtyRect.width;
yDistance = dirtyRect.height;
if (needBackgroundColor) {
// If the image is completely opaque, we do not need to paint the
// background color
@ -3767,6 +3764,8 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
case NS_STYLE_BG_REPEAT_OFF:
default:
NS_ASSERTION(repeat == NS_STYLE_BG_REPEAT_OFF, "unknown background-repeat value");
xDistance = tileWidth;
yDistance = tileHeight;
break;
}
@ -3847,7 +3846,7 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
// Take the border out of the frame's rect
const nsStyleBorder* borderStyle = firstRootElementFrame->GetStyleBorder();
firstRootElementFrameArea.Deflate(borderStyle->GetActualBorder());
firstRootElementFrameArea.Deflate(borderStyle->GetBorder());
// Get the anchor point
ComputeBackgroundAnchorPoint(aColor, firstRootElementFrameArea +
@ -3887,7 +3886,7 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
if (haveRadius) {
gfxFloat radii[4];
ComputePixelRadii(borderRadii, bgClipArea, aBorder.GetActualBorder(),
ComputePixelRadii(borderRadii, bgClipArea, aBorder.GetBorder(),
aForFrame ? aForFrame->GetSkipSides() : 0,
appUnitsPerPixel, radii);
@ -4062,401 +4061,6 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext,
}
void
nsCSSRendering::DrawBorderImage(nsPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
nsIFrame* aForFrame,
const nsRect& aBorderArea,
const nsStyleBorder& aBorderStyle,
nscoord aHardBorderSize)
{
float percent;
nsStyleCoord borderImageSplit[4];
PRInt32 borderImageSplitInt[4];
nsMargin border;
gfxFloat borderTop, borderRight, borderBottom, borderLeft;
gfxFloat borderImageSplitGfx[4];
if (aHardBorderSize > 0) {
border.SizeTo(aHardBorderSize, aHardBorderSize, aHardBorderSize, aHardBorderSize);
} else {
border = aBorderStyle.GetActualBorder();
}
if ((0 == border.left) && (0 == border.right) &&
(0 == border.top) && (0 == border.bottom)) {
// Empty border area
return;
}
borderImageSplit[NS_SIDE_TOP] = aBorderStyle.mBorderImageSplit.GetTop();
borderImageSplit[NS_SIDE_RIGHT] = aBorderStyle.mBorderImageSplit.GetRight();
borderImageSplit[NS_SIDE_BOTTOM] = aBorderStyle.mBorderImageSplit.GetBottom();
borderImageSplit[NS_SIDE_LEFT] = aBorderStyle.mBorderImageSplit.GetLeft();
imgIRequest *req = aPresContext->LoadBorderImage(aBorderStyle.GetBorderImage(), aForFrame);
nsCOMPtr<imgIContainer> image;
req->GetImage(getter_AddRefs(image));
nsSize imageSize;
image->GetWidth(&imageSize.width);
image->GetHeight(&imageSize.height);
imageSize.width = nsPresContext::CSSPixelsToAppUnits(imageSize.width);
imageSize.height = nsPresContext::CSSPixelsToAppUnits(imageSize.height);
// convert percentage values
NS_FOR_CSS_SIDES(side) {
borderImageSplitInt[side] = 0;
switch (borderImageSplit[side].GetUnit()) {
case eStyleUnit_Percent:
percent = borderImageSplit[side].GetPercentValue();
if (side == NS_SIDE_TOP || side == NS_SIDE_BOTTOM)
borderImageSplitInt[side] = (nscoord)(percent * imageSize.height);
else
borderImageSplitInt[side] = (nscoord)(percent * imageSize.width);
break;
case eStyleUnit_Integer:
borderImageSplitInt[side] = nsPresContext::CSSPixelsToAppUnits(borderImageSplit[side].
GetIntValue());
break;
case eStyleUnit_Factor:
borderImageSplitInt[side] = nsPresContext::CSSPixelsToAppUnits(borderImageSplit[side].GetFactorValue());
break;
default:
break;
}
}
gfxContext *thebesCtx = aRenderingContext.ThebesContext();
nsCOMPtr<nsIDeviceContext> dc;
aRenderingContext.GetDeviceContext(*getter_AddRefs(dc));
NS_FOR_CSS_SIDES(side) {
borderImageSplitGfx[side] = nsPresContext::AppUnitsToFloatCSSPixels(borderImageSplitInt[side]);
}
borderTop = dc->AppUnitsToGfxUnits(border.top);
borderRight = dc->AppUnitsToGfxUnits(border.right);
borderBottom = dc->AppUnitsToGfxUnits(border.bottom);
borderLeft = dc->AppUnitsToGfxUnits(border.left);
gfxSize gfxImageSize;
gfxImageSize.width = nsPresContext::AppUnitsToFloatCSSPixels(imageSize.width);
gfxImageSize.height = nsPresContext::AppUnitsToFloatCSSPixels(imageSize.height);
nsRect outerRect(aBorderArea);
gfxRect rectToDraw,
rectToDrawSource;
gfxRect clipRect;
clipRect.pos.x = dc->AppUnitsToGfxUnits(outerRect.x);
clipRect.pos.y = dc->AppUnitsToGfxUnits(outerRect.y);
clipRect.size.width = dc->AppUnitsToGfxUnits(outerRect.width);
clipRect.size.height = dc->AppUnitsToGfxUnits(outerRect.height);
thebesCtx->UserToDevicePixelSnapped(clipRect);
thebesCtx->Save();
thebesCtx->PushGroup(gfxASurface::CONTENT_COLOR_ALPHA);
gfxSize middleSize(clipRect.size.width - (borderLeft + borderRight),
clipRect.size.height - (borderTop + borderBottom));
// middle size in source space
gfxIntSize middleSizeSource(gfxImageSize.width - (borderImageSplitGfx[NS_SIDE_RIGHT] + borderImageSplitGfx[NS_SIDE_LEFT]),
gfxImageSize.height - (borderImageSplitGfx[NS_SIDE_TOP] + borderImageSplitGfx[NS_SIDE_BOTTOM]));
gfxSize interSizeTop, interSizeBottom, interSizeLeft, interSizeRight,
interSizeMiddle;
gfxFloat topScale = borderTop/borderImageSplitGfx[NS_SIDE_TOP];
gfxFloat bottomScale = borderBottom/borderImageSplitGfx[NS_SIDE_BOTTOM];
gfxFloat leftScale = borderLeft/borderImageSplitGfx[NS_SIDE_LEFT];
gfxFloat rightScale = borderRight/borderImageSplitGfx[NS_SIDE_RIGHT];
gfxFloat middleScaleH,
middleScaleV;
// TODO: check for nan and properly check for inf
if (topScale != 0.0 && borderImageSplitGfx[NS_SIDE_TOP] != 0.0) {
middleScaleH = topScale;
} else if (bottomScale != 0.0 && borderImageSplitGfx[NS_SIDE_BOTTOM] != 0.0) {
middleScaleH = bottomScale;
} else {
middleScaleH = 1.0;
}
if (leftScale != 0.0 && borderImageSplitGfx[NS_SIDE_LEFT] != 0.0) {
middleScaleV = leftScale;
} else if (rightScale != 0.0 && borderImageSplitGfx[NS_SIDE_RIGHT] != 0.0) {
middleScaleV = rightScale;
} else {
middleScaleV = 1.0;
}
interSizeTop.height = borderTop;
interSizeTop.width = middleSizeSource.width*topScale;
interSizeBottom.height = borderBottom;
interSizeBottom.width = middleSizeSource.width*bottomScale;
interSizeLeft.width = borderLeft;
interSizeLeft.height = middleSizeSource.height*leftScale;
interSizeRight.width = borderRight;
interSizeRight.height = middleSizeSource.height*rightScale;
interSizeMiddle.width = middleSizeSource.width*middleScaleH;
interSizeMiddle.height = middleSizeSource.height*middleScaleV;
// draw top left corner
rectToDraw = clipRect;
rectToDraw.size.width = borderLeft;
rectToDraw.size.height = borderTop;
rectToDrawSource.pos.x = 0;
rectToDrawSource.pos.y = 0;
rectToDrawSource.size.width = borderImageSplitGfx[NS_SIDE_LEFT];
rectToDrawSource.size.height = borderImageSplitGfx[NS_SIDE_TOP];
DrawBorderImageSide(thebesCtx, dc, image,
rectToDraw, rectToDraw.size, rectToDrawSource,
NS_STYLE_BORDER_IMAGE_STRETCH, NS_STYLE_BORDER_IMAGE_STRETCH);
// draw top
rectToDraw = clipRect;
rectToDraw.pos.x += borderLeft;
rectToDraw.size.width = middleSize.width;
rectToDraw.size.height = borderTop;
rectToDrawSource.pos.x = borderImageSplitGfx[NS_SIDE_LEFT];
rectToDrawSource.pos.y = 0;
rectToDrawSource.size.width = middleSizeSource.width;
rectToDrawSource.size.height = borderImageSplitGfx[NS_SIDE_TOP];
DrawBorderImageSide(thebesCtx, dc, image,
rectToDraw, interSizeTop, rectToDrawSource,
aBorderStyle.mBorderImageHFill, NS_STYLE_BORDER_IMAGE_STRETCH);
// draw top right corner
rectToDraw = clipRect;
rectToDraw.pos.x += clipRect.size.width - borderRight;
rectToDraw.size.width = borderRight;
rectToDraw.size.height = borderTop;
rectToDrawSource.pos.x = gfxImageSize.width - borderImageSplitGfx[NS_SIDE_RIGHT];
rectToDrawSource.pos.y = 0;
rectToDrawSource.size.width = borderImageSplitGfx[NS_SIDE_RIGHT];
rectToDrawSource.size.height = borderImageSplitGfx[NS_SIDE_TOP];
DrawBorderImageSide(thebesCtx, dc, image,
rectToDraw, rectToDraw.size, rectToDrawSource,
NS_STYLE_BORDER_IMAGE_STRETCH, NS_STYLE_BORDER_IMAGE_STRETCH);
// draw right
rectToDraw = clipRect;
rectToDraw.pos.x += clipRect.size.width - borderRight;
rectToDraw.pos.y += borderTop;
rectToDraw.size.width = borderRight;
rectToDraw.size.height = middleSize.height;
rectToDrawSource.pos.x = gfxImageSize.width - borderImageSplitGfx[NS_SIDE_RIGHT];
rectToDrawSource.pos.y = borderImageSplitGfx[NS_SIDE_TOP];
rectToDrawSource.size.width = borderImageSplitGfx[NS_SIDE_RIGHT];
rectToDrawSource.size.height = middleSizeSource.height;
DrawBorderImageSide(thebesCtx, dc, image,
rectToDraw, interSizeRight, rectToDrawSource,
NS_STYLE_BORDER_IMAGE_STRETCH, aBorderStyle.mBorderImageVFill);
// draw bottom right corner
rectToDraw = clipRect;
rectToDraw.pos.x += clipRect.size.width - borderRight;
rectToDraw.pos.y += clipRect.size.height - borderBottom;
rectToDraw.size.width = borderRight;
rectToDraw.size.height = borderBottom;
rectToDrawSource.pos.x = gfxImageSize.width - borderImageSplitGfx[NS_SIDE_RIGHT];
rectToDrawSource.pos.y = gfxImageSize.height - borderImageSplitGfx[NS_SIDE_BOTTOM];
rectToDrawSource.size.width = borderImageSplitGfx[NS_SIDE_RIGHT];
rectToDrawSource.size.height = borderImageSplitGfx[NS_SIDE_BOTTOM];
DrawBorderImageSide(thebesCtx, dc, image,
rectToDraw, rectToDraw.size, rectToDrawSource,
NS_STYLE_BORDER_IMAGE_STRETCH, NS_STYLE_BORDER_IMAGE_STRETCH);
// draw bottom
rectToDraw = clipRect;
rectToDraw.pos.x += borderLeft;
rectToDraw.pos.y += clipRect.size.height - borderBottom;
rectToDraw.size.width = middleSize.width;
rectToDraw.size.height = borderBottom;
rectToDrawSource.pos.x = borderImageSplitGfx[NS_SIDE_LEFT];
rectToDrawSource.pos.y = gfxImageSize.height - borderImageSplitGfx[NS_SIDE_BOTTOM];
rectToDrawSource.size.width = middleSizeSource.width;
rectToDrawSource.size.height = borderImageSplitGfx[NS_SIDE_BOTTOM];
DrawBorderImageSide(thebesCtx, dc, image,
rectToDraw, interSizeBottom, rectToDrawSource,
aBorderStyle.mBorderImageHFill, NS_STYLE_BORDER_IMAGE_STRETCH);
// draw bottom left corner
rectToDraw = clipRect;
rectToDraw.pos.y += clipRect.size.height - borderBottom;
rectToDraw.size.width = borderLeft;
rectToDraw.size.height = borderBottom;
rectToDrawSource.pos.x = 0;
rectToDrawSource.pos.y = gfxImageSize.height - borderImageSplitGfx[NS_SIDE_BOTTOM];
rectToDrawSource.size.width = borderImageSplitGfx[NS_SIDE_LEFT];
rectToDrawSource.size.height = borderImageSplitGfx[NS_SIDE_BOTTOM];
DrawBorderImageSide(thebesCtx, dc, image,
rectToDraw, rectToDraw.size, rectToDrawSource,
NS_STYLE_BORDER_IMAGE_STRETCH, NS_STYLE_BORDER_IMAGE_STRETCH);
// draw left
rectToDraw = clipRect;
rectToDraw.pos.y += borderTop;
rectToDraw.size.width = borderLeft;
rectToDraw.size.height = middleSize.height;
rectToDrawSource.pos.x = 0;
rectToDrawSource.pos.y = borderImageSplitGfx[NS_SIDE_TOP];
rectToDrawSource.size.width = borderImageSplitGfx[NS_SIDE_LEFT];
rectToDrawSource.size.height = middleSizeSource.height;
DrawBorderImageSide(thebesCtx, dc, image,
rectToDraw, interSizeLeft, rectToDrawSource,
NS_STYLE_BORDER_IMAGE_STRETCH, aBorderStyle.mBorderImageVFill);
// Draw middle
rectToDraw = clipRect;
rectToDraw.pos.x += borderLeft;
rectToDraw.pos.y += borderTop;
rectToDraw.size.width = middleSize.width;
rectToDraw.size.height = middleSize.height;
rectToDrawSource.pos.x = borderImageSplitGfx[NS_SIDE_LEFT];
rectToDrawSource.pos.y = borderImageSplitGfx[NS_SIDE_TOP];
rectToDrawSource.size = middleSizeSource;
DrawBorderImageSide(thebesCtx, dc, image,
rectToDraw, interSizeMiddle, rectToDrawSource,
aBorderStyle.mBorderImageHFill, aBorderStyle.mBorderImageVFill);
thebesCtx->PopGroupToSource();
thebesCtx->SetOperator(gfxContext::OPERATOR_OVER);
thebesCtx->Paint();
thebesCtx->Restore();
}
void
nsCSSRendering::DrawBorderImageSide(gfxContext *aThebesContext,
nsIDeviceContext* aDeviceContext,
imgIContainer* aImage,
gfxRect& aDestRect,
gfxSize& aInterSize,
gfxRect& aSourceRect,
PRUint8 aHFillType,
PRUint8 aVFillType)
{
if (aDestRect.size.width < 1.0 || aDestRect.size.height < 1.0 ||
aSourceRect.size.width < 1.0 || aSourceRect.size.height < 1.0) {
return;
}
gfxIntSize gfxSourceSize((PRInt32)aSourceRect.size.width,
(PRInt32)aSourceRect.size.height);
// where the actual border ends up being rendered
aThebesContext->UserToDevicePixelSnapped(aDestRect);
aThebesContext->UserToDevicePixelSnapped(aSourceRect);
if (aDestRect.size.height < 1.0 ||
aDestRect.size.width < 1.0)
return;
if (aInterSize.width < 1.0 ||
aInterSize.height < 1.0)
return;
// Surface will hold just the part of the source image specified by the aSourceRect
// but at a different size
nsRefPtr<gfxASurface> interSurface =
gfxPlatform::GetPlatform()->CreateOffscreenSurface(
gfxSourceSize, gfxASurface::ImageFormatARGB32);
gfxMatrix srcMatrix;
// Adjust the matrix scale for Step 1 of the spec
srcMatrix.Scale(aSourceRect.size.width/aInterSize.width,
aSourceRect.size.height/aInterSize.height);
{
nsCOMPtr<gfxIImageFrame> frame;
nsresult rv = aImage->GetCurrentFrame(getter_AddRefs(frame));
if(NS_FAILED(rv))
return;
nsCOMPtr<nsIImage> image;
image = do_GetInterface(frame);
if(!image)
return;
// surface for the whole image
nsRefPtr<gfxPattern> imagePattern;
rv = image->GetPattern(getter_AddRefs(imagePattern));
if(NS_FAILED(rv) || !imagePattern)
return;
gfxMatrix mat;
mat.Translate(aSourceRect.pos);
imagePattern->SetMatrix(mat);
// Straightforward blit - no resizing
nsRefPtr<gfxContext> srcCtx = new gfxContext(interSurface);
srcCtx->SetPattern(imagePattern);
srcCtx->SetOperator(gfxContext::OPERATOR_SOURCE);
srcCtx->Paint();
srcCtx = nsnull;
}
// offset to make the middle tile centered in the middle of the border
gfxPoint renderOffset(0, 0);
gfxSize rectSize(aDestRect.size);
aThebesContext->Save();
aThebesContext->Clip(aDestRect);
gfxFloat hScale(1.0), vScale(1.0);
nsRefPtr<gfxPattern> pattern = new gfxPattern(interSurface);
pattern->SetExtend(gfxPattern::EXTEND_PAD);
switch (aHFillType) {
case NS_STYLE_BORDER_IMAGE_REPEAT:
renderOffset.x = (rectSize.width - aInterSize.width*NS_ceil(rectSize.width/aInterSize.width))*-0.5;
aDestRect.pos.x -= renderOffset.x;
pattern->SetExtend(gfxPattern::EXTEND_REPEAT);
break;
case NS_STYLE_BORDER_IMAGE_ROUND:
hScale = aInterSize.width*(NS_ceil(aDestRect.size.width/aInterSize.width)/aDestRect.size.width);
pattern->SetExtend(gfxPattern::EXTEND_REPEAT);
break;
case NS_STYLE_BORDER_IMAGE_STRETCH:
default:
hScale = aInterSize.width/aDestRect.size.width;
break;
}
switch (aVFillType) {
case NS_STYLE_BORDER_IMAGE_REPEAT:
renderOffset.y = (rectSize.height - aInterSize.height*NS_ceil(rectSize.height/aInterSize.height))*-0.5;
aDestRect.pos.y -= renderOffset.y;
pattern->SetExtend(gfxPattern::EXTEND_REPEAT);
break;
case NS_STYLE_BORDER_IMAGE_ROUND:
vScale = aInterSize.height*(NS_ceil(aDestRect.size.height/aInterSize.height)/aDestRect.size.height);
pattern->SetExtend(gfxPattern::EXTEND_REPEAT);
break;
case NS_STYLE_BORDER_IMAGE_STRETCH:
default:
vScale = aInterSize.height/aDestRect.size.height;
break;
}
// Adjust the matrix scale for Step 2 of the spec
srcMatrix.Scale(hScale,vScale);
pattern->SetMatrix(srcMatrix);
// render
aThebesContext->Translate(aDestRect.pos);
aThebesContext->SetPattern(pattern);
aThebesContext->NewPath();
aThebesContext->Rectangle(gfxRect(renderOffset, rectSize));
aThebesContext->SetOperator(gfxContext::OPERATOR_ADD);
aThebesContext->Fill();
aThebesContext->Restore();
}
void
nsCSSRendering::PaintBackgroundColor(nsPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
@ -4536,7 +4140,7 @@ nsCSSRendering::PaintRoundedBackground(nsPresContext* aPresContext,
// Get the radius to the outer edge of the padding.
// -moz-border-radius is the radius to the outer edge of the border.
NS_FOR_CSS_SIDES(side) {
aTheRadius[side] -= aBorder.GetActualBorderWidth(side);
aTheRadius[side] -= aBorder.GetBorderWidth(side);
aTheRadius[side] = PR_MAX(aTheRadius[side], 0);
}
}
@ -4550,7 +4154,7 @@ nsCSSRendering::PaintRoundedBackground(nsPresContext* aPresContext,
// convert the radii
gfxFloat radii[4];
nsMargin border = aBorder.GetActualBorder();
nsMargin border = aBorder.GetBorder();
ComputePixelRadii(aTheRadius, aBgClipArea, border,
aForFrame ? aForFrame->GetSkipSides() : 0,

View File

@ -273,22 +273,6 @@ public:
protected:
static void DrawBorderImage(nsPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
nsIFrame* aForFrame,
const nsRect& aBorderArea,
const nsStyleBorder& aBorderStyle,
nscoord aHardBorderSize);
static void DrawBorderImageSide(gfxContext *aThebesContext,
nsIDeviceContext* aDeviceContext,
imgIContainer* aImage,
gfxRect& aDestRect,
gfxSize& aInterSize,
gfxRect& aSourceRect,
PRUint8 aHFillType,
PRUint8 aVFillType);
static void PaintBackgroundColor(nsPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
nsIFrame* aForFrame,

View File

@ -50,7 +50,6 @@
#include "nsRegion.h"
#include "nsFrameManager.h"
#include "gfxContext.h"
#include "nsStyleStructInlines.h"
nsDisplayListBuilder::nsDisplayListBuilder(nsIFrame* aReferenceFrame,
PRBool aIsForEvents, PRBool aBuildCaret)
@ -609,16 +608,11 @@ nsDisplayBorder::OptimizeVisibility(nsDisplayListBuilder* aBuilder,
nsRect paddingRect = mFrame->GetPaddingRect() - mFrame->GetPosition() +
aBuilder->ToReferenceFrame(mFrame);
const nsStyleBorder *styleBorder;
if (paddingRect.Contains(aVisibleRegion->GetBounds()) &&
!(styleBorder = mFrame->GetStyleBorder())->IsBorderImageLoaded() &&
!nsLayoutUtils::HasNonZeroSide(styleBorder->mBorderRadius)) {
!nsLayoutUtils::HasNonZeroSide(mFrame->GetStyleBorder()->mBorderRadius)) {
// the visible region is entirely inside the content rect, and no part
// of the border is rendered inside the content rect, so we are not
// visible
// Skip this if there's a border-image (which draws a background
// too) or if there is a border-radius (which makes the border draw
// further in).
return PR_FALSE;
}

View File

@ -80,12 +80,10 @@ nsImageLoader::~nsImageLoader()
void
nsImageLoader::Init(nsIFrame *aFrame, nsPresContext *aPresContext,
PRBool aReflowOnLoad)
nsImageLoader::Init(nsIFrame *aFrame, nsPresContext *aPresContext)
{
mFrame = aFrame;
mPresContext = aPresContext;
mReflowOnLoad = aReflowOnLoad;
}
void
@ -210,16 +208,6 @@ NS_IMETHODIMP nsImageLoader::FrameChanged(imgIContainer *aContainer,
void
nsImageLoader::RedrawDirtyFrame(const nsRect* aDamageRect)
{
if (mReflowOnLoad) {
nsIPresShell *shell = mPresContext->GetPresShell();
nsresult rv = shell->FrameNeedsReflow(mFrame, nsIPresShell::eStyleChange, NS_FRAME_IS_DIRTY);
NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Could not reflow after loading border-image");
// Note that we're assuming that the resulting reflow will
// invalidate the entire frame. Given that we only set
// mReflowOnLoad if the actual border width will change when we do
// this reflow, this invalidate should happen.
return;
}
// NOTE: It is not sufficient to invalidate only the size of the image:
// the image may be tiled!
// The best option is to call into the frame, however lacking this

View File

@ -69,8 +69,7 @@ public:
NS_IMETHOD FrameChanged(imgIContainer *aContainer, gfxIImageFrame *newframe,
nsRect * dirtyRect);
void Init(nsIFrame *aFrame, nsPresContext *aPresContext,
PRBool aReflowOnLoad);
void Init(nsIFrame *aFrame, nsPresContext *aPresContext);
nsresult Load(imgIRequest *aImage);
void Destroy();
@ -85,5 +84,4 @@ private:
nsIFrame *mFrame;
nsPresContext *mPresContext;
nsCOMPtr<imgIRequest> mRequest;
PRBool mReflowOnLoad;
};

View File

@ -801,9 +801,6 @@ nsPresContext::Init(nsIDeviceContext* aDeviceContext)
if (!mImageLoaders.Init())
return NS_ERROR_OUT_OF_MEMORY;
if (!mBorderImageLoaders.Init())
return NS_ERROR_OUT_OF_MEMORY;
// Get the look and feel service here; default colors will be initialized
// from calling GetUserPreferences() when we get a presshell.
nsresult rv = CallGetService(kLookAndFeelCID, &mLookAndFeel);
@ -1171,21 +1168,18 @@ nsPresContext::SetFullZoom(float aZoom)
}
imgIRequest*
nsPresContext::DoLoadImage(nsPresContext::ImageLoaderTable& aTable,
imgIRequest* aImage,
nsIFrame* aTargetFrame,
PRBool aReflowOnLoad)
nsPresContext::LoadImage(imgIRequest* aImage, nsIFrame* aTargetFrame)
{
// look and see if we have a loader for the target frame.
nsCOMPtr<nsImageLoader> loader;
aTable.Get(aTargetFrame, getter_AddRefs(loader));
mImageLoaders.Get(aTargetFrame, getter_AddRefs(loader));
if (!loader) {
loader = new nsImageLoader();
if (!loader)
return nsnull;
loader->Init(aTargetFrame, this, aReflowOnLoad);
loader->Init(aTargetFrame, this);
mImageLoaders.Put(aTargetFrame, loader);
}
@ -1196,18 +1190,6 @@ nsPresContext::DoLoadImage(nsPresContext::ImageLoaderTable& aTable,
return request;
}
imgIRequest*
nsPresContext::LoadImage(imgIRequest* aImage, nsIFrame* aTargetFrame)
{
return DoLoadImage(mImageLoaders, aImage, aTargetFrame, PR_FALSE);
}
imgIRequest*
nsPresContext::LoadBorderImage(imgIRequest* aImage, nsIFrame* aTargetFrame)
{
return DoLoadImage(mBorderImageLoaders, aImage, aTargetFrame,
aTargetFrame->GetStyleBorder()->ImageBorderDiffers());
}
void
nsPresContext::StopImagesFor(nsIFrame* aTargetFrame)
@ -1220,14 +1202,6 @@ nsPresContext::StopImagesFor(nsIFrame* aTargetFrame)
mImageLoaders.Remove(aTargetFrame);
}
mBorderImageLoaders.Get(aTargetFrame, getter_AddRefs(loader));
if (loader) {
loader->Destroy();
mBorderImageLoaders.Remove(aTargetFrame);
}
}

View File

@ -364,28 +364,14 @@ public:
/**
* Set up observers so that aTargetFrame will be invalidated when
* aImage loads, where aImage is its background image. Only a single
* image will be tracked per frame.
* Load an image for the target frame. This call can be made
* repeated with only a single image ever being loaded. When the
* image's data is ready for rendering the target frame's Paint()
* method will be invoked (via the ViewManager) so that the
* appropriate damage repair is done.
*/
NS_HIDDEN_(imgIRequest*) LoadImage(imgIRequest* aImage,
nsIFrame* aTargetFrame);
/**
* Set up observers so that aTargetFrame will be invalidated or
* reflowed (as appropriate) when aImage loads, where aImage is its
* *border* image. Only a single image will be tracked per frame.
*/
NS_HIDDEN_(imgIRequest*) LoadBorderImage(imgIRequest* aImage,
nsIFrame* aTargetFrame);
private:
typedef nsInterfaceHashtable<nsVoidPtrHashKey, nsImageLoader> ImageLoaderTable;
NS_HIDDEN_(imgIRequest*) DoLoadImage(ImageLoaderTable& aTable,
imgIRequest* aImage,
nsIFrame* aTargetFrame,
PRBool aReflowOnLoad);
public:
/**
* This method is called when a frame is being destroyed to
@ -814,8 +800,7 @@ protected:
nsILinkHandler* mLinkHandler; // [WEAK]
nsIAtom* mLangGroup; // [STRONG]
ImageLoaderTable mImageLoaders;
ImageLoaderTable mBorderImageLoaders;
nsInterfaceHashtable<nsVoidPtrHashKey, nsImageLoader> mImageLoaders;
nsWeakPtr mContainer;
float mTextZoom; // Text zoom, defaults to 1.0

View File

@ -271,11 +271,6 @@
// derived from a table with its rules attribute set
#define NS_STYLE_BORDER_STYLE_RULES_MARKER 0x10
// See nsStyleBorder mBorderImage
#define NS_STYLE_BORDER_IMAGE_STRETCH 0
#define NS_STYLE_BORDER_IMAGE_REPEAT 1
#define NS_STYLE_BORDER_IMAGE_ROUND 2
// See nsStyleDisplay
#define NS_STYLE_CLEAR_NONE 0
#define NS_STYLE_CLEAR_LEFT 1

View File

@ -263,7 +263,7 @@ nsButtonFrameRenderer::GetButtonOuterFocusBorderAndPadding()
if (!mOuterFocusStyle->GetStylePadding()->GetPadding(result)) {
NS_NOTYETIMPLEMENTED("percentage padding");
}
result += mOuterFocusStyle->GetStyleBorder()->GetActualBorder();
result += mOuterFocusStyle->GetStyleBorder()->GetBorder();
}
return result;
@ -302,7 +302,7 @@ nsButtonFrameRenderer::GetButtonInnerFocusBorderAndPadding()
if (!mInnerFocusStyle->GetStylePadding()->GetPadding(result)) {
NS_NOTYETIMPLEMENTED("percentage padding");
}
result += mInnerFocusStyle->GetStyleBorder()->GetActualBorder();
result += mInnerFocusStyle->GetStyleBorder()->GetBorder();
}
return result;

View File

@ -262,7 +262,7 @@ nsFieldSetFrame::PaintBorderBackground(nsIRenderingContext& aRenderingContext,
const nsStyleBorder* borderStyle = GetStyleBorder();
const nsStylePadding* paddingStyle = GetStylePadding();
nscoord topBorder = borderStyle->GetActualBorderWidth(NS_SIDE_TOP);
nscoord topBorder = borderStyle->GetBorderWidth(NS_SIDE_TOP);
nscoord yoff = 0;
nsPresContext* presContext = PresContext();

View File

@ -226,7 +226,7 @@ nsHTMLButtonControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// but the real problem is the FirstChild (the AreaFrame)
// isn't being constrained properly
// Bug #17474
nsMargin border = GetStyleBorder()->GetActualBorder();
nsMargin border = GetStyleBorder()->GetBorder();
nsRect rect(aBuilder->ToReferenceFrame(this), GetSize());
rect.Deflate(border);

View File

@ -395,7 +395,7 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat
nsresult rv;
// Get the border values
const nsMargin& border = aReflowState.mStyleBorder->GetActualBorder();
const nsMargin& border = aReflowState.mStyleBorder->GetBorder();
nscoord availWidth = aContainingBlockWidth;
if (availWidth == -1) {

View File

@ -796,7 +796,7 @@ CalculateContainingBlockSizeForAbsolutes(const nsHTMLReflowState& aReflowState,
nsSize cbSize(aFrameSize);
// Containing block is relative to the padding edge
const nsMargin& border = aReflowState.mStyleBorder->GetActualBorder();
const nsMargin& border = aReflowState.mStyleBorder->GetBorder();
cbSize.width -= border.left + border.right;
cbSize.height -= border.top + border.bottom;
@ -2650,8 +2650,8 @@ nsBlockFrame::IsSelfEmpty()
const nsStyleBorder* border = GetStyleBorder();
const nsStylePadding* padding = GetStylePadding();
if (border->GetActualBorderWidth(NS_SIDE_TOP) != 0 ||
border->GetActualBorderWidth(NS_SIDE_BOTTOM) != 0 ||
if (border->GetBorderWidth(NS_SIDE_TOP) != 0 ||
border->GetBorderWidth(NS_SIDE_BOTTOM) != 0 ||
!IsPaddingZero(padding->mPadding.GetTopUnit(),
padding->mPadding.GetTop()) ||
!IsPaddingZero(padding->mPadding.GetBottomUnit(),

View File

@ -666,7 +666,7 @@ nsContainerFrame::DoInlineIntrinsicWidth(nsIRenderingContext *aRenderingContext,
if (!GetPrevContinuation()) {
aData->currentLine +=
GetCoord(stylePadding->mPadding.Get(startSide), 0) +
styleBorder->GetActualBorderWidth(startSide) +
styleBorder->GetBorderWidth(startSide) +
GetCoord(styleMargin->mMargin.Get(startSide), 0);
}
@ -703,7 +703,7 @@ nsContainerFrame::DoInlineIntrinsicWidth(nsIRenderingContext *aRenderingContext,
if (!lastInFlow->GetNextContinuation()) {
aData->currentLine +=
GetCoord(stylePadding->mPadding.Get(endSide), 0) +
styleBorder->GetActualBorderWidth(endSide) +
styleBorder->GetBorderWidth(endSide) +
GetCoord(styleMargin->mMargin.Get(endSide), 0);
}
}

View File

@ -586,7 +586,7 @@ nsIFrame::GetUsedBorder() const
return result;
}
return GetStyleBorder()->GetActualBorder();
return GetStyleBorder()->GetBorder();
}
/* virtual */ nsMargin
@ -2989,8 +2989,8 @@ nsFrame::IntrinsicWidthOffsets(nsIRenderingContext* aRenderingContext)
&result.hPadding, &result.hPctPadding);
const nsStyleBorder *styleBorder = GetStyleBorder();
result.hBorder += styleBorder->GetActualBorderWidth(NS_SIDE_LEFT);
result.hBorder += styleBorder->GetActualBorderWidth(NS_SIDE_RIGHT);
result.hBorder += styleBorder->GetBorderWidth(NS_SIDE_LEFT);
result.hBorder += styleBorder->GetBorderWidth(NS_SIDE_RIGHT);
const nsStyleDisplay *disp = GetStyleDisplay();
if (IsThemed(disp)) {
@ -3781,7 +3781,7 @@ nsFrame::CheckInvalidateSizeChange(nsPresContext* aPresContext,
// may be moving.
const nsStyleBorder* border = GetStyleBorder();
NS_FOR_CSS_SIDES(side) {
if (border->GetActualBorderWidth(side) != 0) {
if (border->GetBorderWidth(side) != 0) {
Invalidate(nsRect(0, 0, mRect.width, mRect.height));
return;
}

View File

@ -308,17 +308,6 @@ nsHTMLReflowState::Init(nsPresContext* aPresContext,
InitResizeFlags(aPresContext);
// We have to start loading the border image now, because the
// border-image's width overrides only apply once the image is loaded.
// Starting the load of the image means we'll get a reflow when the
// image loads. (If we didn't do it now, and the image loaded between
// reflow and paint, we'd never get the notification, and our size
// would be wrong.)
imgIRequest *borderImage = mStyleBorder->GetBorderImage();
if (borderImage) {
aPresContext->LoadBorderImage(borderImage, frame);
}
NS_ASSERTION((mFrameType == NS_CSS_FRAME_TYPE_INLINE &&
!frame->IsFrameOfType(nsIFrame::eReplaced)) ||
frame->GetType() == nsGkAtoms::textFrame ||
@ -810,7 +799,7 @@ nsHTMLReflowState::CalculateHorizBorderPaddingMargin(
nscoord* aInsideBoxSizing,
nscoord* aOutsideBoxSizing)
{
const nsMargin& border = mStyleBorder->GetActualBorder();
const nsMargin& border = mStyleBorder->GetBorder();
nsMargin padding, margin;
// See if the style system can provide us the padding directly
@ -1902,7 +1891,7 @@ nsCSSOffsetState::InitOffsets(nscoord aContainingBlockWidth,
mComputedBorderPadding = *aBorder;
}
else {
mComputedBorderPadding = frame->GetStyleBorder()->GetActualBorder();
mComputedBorderPadding = frame->GetStyleBorder()->GetBorder();
}
mComputedBorderPadding += mComputedPadding;

View File

@ -133,8 +133,8 @@ nsInlineFrame::IsSelfEmpty()
// XXX Top and bottom removed, since they shouldn't affect things, but this
// doesn't really match with nsLineLayout.cpp's setting of
// ZeroEffectiveSpanBox, anymore, so what should this really be?
if (border->GetActualBorderWidth(NS_SIDE_RIGHT) != 0 ||
border->GetActualBorderWidth(NS_SIDE_LEFT) != 0 ||
if (border->GetBorderWidth(NS_SIDE_RIGHT) != 0 ||
border->GetBorderWidth(NS_SIDE_LEFT) != 0 ||
!IsPaddingZero(padding->mPadding.GetRightUnit(),
padding->mPadding.GetRight()) ||
!IsPaddingZero(padding->mPadding.GetLeftUnit(),

View File

@ -206,7 +206,7 @@ nsPageContentFrame::Reflow(nsPresContext* aPresContext,
if (aDesiredSize.mOverflowArea.XMost() > aDesiredSize.width) {
mPD->mPageContentXMost =
aDesiredSize.mOverflowArea.XMost() +
kidReflowState.mStyleBorder->GetActualBorderWidth(NS_SIDE_RIGHT) +
kidReflowState.mStyleBorder->GetBorderWidth(NS_SIDE_RIGHT) +
padding.right;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 B

View File

@ -1,37 +0,0 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>test of -moz-border-image</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
table { margin: 0; padding: 0; border-spacing: 0; empty-cells: show; }
td { padding: 0; }
</style>
</head>
<body>
<table>
<col style="width: 7px">
<col style="width: 100px">
<col style="width: 7px">
<tr style="height: 7px">
<td style="background: #87f0b4"></td>
<td style="background: #4a298e"></td>
<td style="background: #c98bb7"></td>
</tr>
<tr style="height: 5px">
<td style="background: #90a213"></td>
<td style="background: #c9aa7d"></td>
<td style="background: #90c157"></td>
</tr>
<tr style="height: 7px">
<td style="background: #9d57c1"></td>
<td style="background: #3a8e20"></td>
<td style="background: #0e6f6c"></td>
</tr>
</table>
</body>
</html>

View File

@ -1,22 +0,0 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>test of -moz-border-image</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
div {
background: red; /* fail if this shows through */
background-image: url('3x3multicolor.png'); /* fail if this shows through */
-moz-border-image: url('3x3multicolor.png') 1 1 1 1 / 7px;
-khtml-border-image: url('3x3multicolor.png') 1 1 1 1 / 7px;
border-image: url('3x3multicolor.png') 1 1 1 1 / 7px;
}
</style>
</head>
<body>
<div style="width: 100px; height: 5px"></div>
</body>
</html>

View File

@ -1,165 +0,0 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>test of -moz-border-image</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
table { margin: 0; padding: 0; border-spacing: 0; empty-cells: show; }
td { padding: 0; }
table { margin-bottom: 2px; }
</style>
</head>
<body>
<table>
<col style="width: 11px">
<col style="width: 9px">
<col style="width: 6px">
<tr style="height: 4px">
<td style="background: #93bd5d"></td>
<td style="background: #b55dbd"></td>
<td style="background: #8d4921"></td>
</tr>
<tr style="height: 1px">
<td style="background: #21a02c"></td>
<td style="background: #4a298e"></td>
<td style="background: #ef9b23"></td>
</tr>
<tr style="height: 8px">
<td style="background: #9b733a"></td>
<td style="background: #f155ad"></td>
<td style="background: #adf3eb"></td>
</tr>
</table>
<table>
<col style="width: 4px">
<col style="width: 2px">
<col style="width: 1px">
<tr style="height: 3px">
<td style="background: #93bd5d"></td>
<td style="background: #b55dbd"></td>
<td style="background: #8d4921"></td>
</tr>
<tr style="height: 17px">
<td style="background: #21a02c"></td>
<td style="background: #4a298e"></td>
<td style="background: #ef9b23"></td>
</tr>
<tr style="height: 0px">
<td style="background: #9b733a"></td>
<td style="background: #f155ad"></td>
<td style="background: #adf3eb"></td>
</tr>
</table>
<table>
<col style="width: 3px">
<col style="width: 17px">
<col style="width: 2px">
<tr style="height: 10px">
<td style="background: #93bd5d"></td>
<td style="background: #b55dbd"></td>
<td style="background: #8d4921"></td>
</tr>
<tr style="height: 8px">
<td style="background: #21a02c"></td>
<td style="background: #4a298e"></td>
<td style="background: #ef9b23"></td>
</tr>
<tr style="height: 5px">
<td style="background: #9b733a"></td>
<td style="background: #f155ad"></td>
<td style="background: #adf3eb"></td>
</tr>
</table>
<table>
<col style="width: 0px">
<col style="width: 8px">
<col style="width: 7px">
<tr style="height: 5px">
<td style="background: #93bd5d"></td>
<td style="background: #b55dbd"></td>
<td style="background: #8d4921"></td>
</tr>
<tr style="height: 5px">
<td style="background: #21a02c"></td>
<td style="background: #4a298e"></td>
<td style="background: #ef9b23"></td>
</tr>
<tr style="height: 1px">
<td style="background: #9b733a"></td>
<td style="background: #f155ad"></td>
<td style="background: #adf3eb"></td>
</tr>
</table>
<table>
<col style="width: 2px">
<col style="width: 0px">
<col style="width: 8px">
<tr style="height: 4px">
<td style="background: #93bd5d"></td>
<td style="background: #b55dbd"></td>
<td style="background: #8d4921"></td>
</tr>
<tr style="height: 8px">
<td style="background: #21a02c"></td>
<td style="background: #4a298e"></td>
<td style="background: #ef9b23"></td>
</tr>
<tr style="height: 10px">
<td style="background: #9b733a"></td>
<td style="background: #f155ad"></td>
<td style="background: #adf3eb"></td>
</tr>
</table>
<table>
<col style="width: 2px">
<col style="width: 17px">
<col style="width: 0px">
<tr style="height: 4px">
<td style="background: #93bd5d"></td>
<td style="background: #b55dbd"></td>
<td style="background: #8d4921"></td>
</tr>
<tr style="height: 0px">
<td style="background: #21a02c"></td>
<td style="background: #4a298e"></td>
<td style="background: #ef9b23"></td>
</tr>
<tr style="height: 10px">
<td style="background: #9b733a"></td>
<td style="background: #f155ad"></td>
<td style="background: #adf3eb"></td>
</tr>
</table>
<table>
<col style="width: 0px">
<col style="width: 17px">
<col style="width: 3px">
<tr style="height: 1px">
<td style="background: #93bd5d"></td>
<td style="background: #b55dbd"></td>
<td style="background: #8d4921"></td>
</tr>
<tr style="height: 0px">
<td style="background: #21a02c"></td>
<td style="background: #4a298e"></td>
<td style="background: #ef9b23"></td>
</tr>
<tr style="height: 0px">
<td style="background: #9b733a"></td>
<td style="background: #f155ad"></td>
<td style="background: #adf3eb"></td>
</tr>
</table>
</body>
</html>

View File

@ -1,96 +0,0 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>test of -moz-border-image</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
div {
background: red; /* fail if this shows through */
background-image: url('3x3multicolor.png'); /* fail if this shows through */
margin-bottom: 2px;
}
div.one {
-moz-border-image: url(10x5multicolor.png) 2 2 1 3;
-khtml-border-image: url(10x5multicolor.png) 2 2 1 3;
border-image: url(10x5multicolor.png) 2 2 1 3;
border-width: 4px 6px 8px 11px;
width: 9px;
height: 1px;
}
div.two {
-moz-border-image: url(10x5multicolor.png) 40% 20% 20% 30%;
-khtml-border-image: url(10x5multicolor.png) 40% 20% 20% 30%;
border-image: url(10x5multicolor.png) 40% 20% 20% 30%;
border-width: 3px 1px 0px 4px;
width: 2px;
height: 17px;
}
div.three {
-moz-border-image: url(10x5multicolor.png) 40% 2 1 30%;
-khtml-border-image: url(10x5multicolor.png) 40% 2 1 30%;
border-image: url(10x5multicolor.png) 40% 2 1 30%;
border-width: 10px 2px 5px 3px;
width: 17px;
height: 8px;
}
div.four {
-moz-border-image: url(10x5multicolor.png) 2 2 20% 30%;
-khtml-border-image: url(10x5multicolor.png) 2 2 20% 30%;
border-image: url(10x5multicolor.png) 2 2 20% 30%;
border-width: 5px 7px 1px 0;
width: 8px;
height: 5px;
}
div.five {
border-width: 5px 6px 7px 8px; /* ignored */
border-width: 5px 6px 7px 8px ! important; /* ignored */
-moz-border-image: url(10x5multicolor.png) 40% 2 1 30% / 4px 8px 10px 2px;
-khtml-border-image: url(10x5multicolor.png) 40% 2 1 30% / 4px 8px 10px 2px;
border-image: url(10x5multicolor.png) 40% 2 1 30% / 4px 8px 10px 2px;
border-width: 5px 6px 7px 8px; /* ignored */
border-width: 5px 6px 7px 8px ! important; /* ignored */
width: 0;
height: 8px;
}
div.five {
border-width: 5px 6px 7px 8px; /* ignored */
border-width: 5px 6px 7px 8px ! important; /* ignored */
}
div.six {
border-width: 5px 6px 7px 8px; /* ignored */
-moz-border-image: url(10x5multicolor.png) 40% 2 1 30% / 4px 0 10px 2px;
-khtml-border-image: url(10x5multicolor.png) 40% 2 1 30% / 4px 0 10px 2px;
border-image: url(10x5multicolor.png) 40% 2 1 30% / 4px 0 10px 2px;
width: 17px;
height: 0;
}
div.seven {
-moz-border-image: url(10x5multicolor.png) 40% 2 1 30%;
-khtml-border-image: url(10x5multicolor.png) 40% 2 1 30%;
border-image: url(10x5multicolor.png) 40% 2 1 30%;
border-width: 1px 3px 0 0;
width: 17px;
height: 0;
}
</style>
</head>
<body>
<div class="one"></div>
<div class="two"></div>
<div class="three"></div>
<div class="four"></div>
<div class="five"></div>
<div class="six"></div>
<div class="seven"></div>
</body>
</html>

View File

@ -1,55 +0,0 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>test of -moz-border-image: number repetition</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
div {
background: red; /* fail if this shows through */
background-image: url('3x3multicolor.png'); /* fail if this shows through */
margin-bottom: 2px;
}
div.one {
-moz-border-image: url(10x5multicolor.png) 2 2 2 2 / 4px 6px 8px 6px;
-khtml-border-image: url(10x5multicolor.png) 2 2 2 2 / 4px 6px 8px 6px;
border-image: url(10x5multicolor.png) 2 2 2 2 / 4px 6px 8px 6px;
width: 5px;
height: 2px;
}
div.two {
-moz-border-image: url(10x5multicolor.png) 2 1 2 1/ 4px 4px 4px 4px;
-khtml-border-image: url(10x5multicolor.png) 2 1 2 1/ 4px 4px 4px 4px;
border-image: url(10x5multicolor.png) 2 1 2 1/ 4px 4px 4px 4px;
width: 5px;
height: 2px;
}
div.three {
-moz-border-image: url(10x5multicolor.png) 2 3 1 3 / 4px 2px 4px 2px;
-khtml-border-image: url(10x5multicolor.png) 2 3 1 3 / 4px 2px 4px 2px;
border-image: url(10x5multicolor.png) 2 3 1 3 / 4px 2px 4px 2px;
width: 5px;
height: 2px;
}
div.four {
-moz-border-image: url(10x5multicolor.png) 2 3 1 1 / 4px 3px 4px 3px;
-khtml-border-image: url(10x5multicolor.png) 2 3 1 1 / 4px 3px 4px 3px;
border-image: url(10x5multicolor.png) 2 3 1 1 / 4px 3px 4px 3px;
width: 5px;
height: 2px;
}
</style>
</head>
<body>
<div class="one"></div>
<div class="two"></div>
<div class="three"></div>
<div class="four"></div>
</body>
</html>

View File

@ -1,56 +0,0 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>test of -moz-border-image: number repetition</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
div {
background: red; /* fail if this shows through */
background-image: url('3x3multicolor.png'); /* fail if this shows through */
margin-bottom: 2px;
}
div.one {
-moz-border-image: url(10x5multicolor.png) 2 / 4px 6px 8px;
-khtml-border-image: url(10x5multicolor.png) 2 / 4px 6px 8px;
border-image: url(10x5multicolor.png) 2 / 4px 6px 8px;
width: 5px;
height: 2px;
}
div.two {
-moz-border-image: url(10x5multicolor.png) 2 1 / 4px;
-khtml-border-image: url(10x5multicolor.png) 2 1 / 4px;
border-image: url(10x5multicolor.png) 2 1 / 4px;
width: 5px;
height: 2px;
}
div.three {
-moz-border-image: url(10x5multicolor.png) 2 3 1;
-khtml-border-image: url(10x5multicolor.png) 2 3 1;
border-image: url(10x5multicolor.png) 2 3 1;
border-width: 4px 2px;
width: 5px;
height: 2px;
}
div.four {
-moz-border-image: url(10x5multicolor.png) 2 3 1 1 / 4px 3px;
-khtml-border-image: url(10x5multicolor.png) 2 3 1 1 / 4px 3px;
border-image: url(10x5multicolor.png) 2 3 1 1 / 4px 3px;
width: 5px;
height: 2px;
}
</style>
</head>
<body>
<div class="one"></div>
<div class="two"></div>
<div class="three"></div>
<div class="four"></div>
</body>
</html>

View File

@ -1,7 +0,0 @@
== solid-image-1.html solid-image-1-ref.html
== transparent-image-1.html transparent-image-1-ref.html
== solid-image-2.html solid-image-2-ref.html
== multicolor-image-1.html multicolor-image-1-ref.html
== multicolor-image-2.html multicolor-image-2-ref.html
== multicolor-image-3.html multicolor-image-3-ref.html
!= repeat-image-1.html repeat-image-1-ref.html

View File

@ -1,57 +0,0 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>test of -moz-border-image</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
table { margin: 0; padding: 0; border-spacing: 0; empty-cells: show; }
td { padding: 0; }
</style>
</head>
<body>
<table>
<col style="width: 3px">
<col style="width: 1px">
<col style="width: 1px">
<col style="width: 1px">
<col style="width: 1px">
<col style="width: 3px">
<tr style="height: 1px">
<td style="background: #ff0000"></td>
<td style="background: #00ff00"></td>
<td style="background: #0000ff"></td>
<td style="background: #00ff00"></td>
<td style="background: #0000ff"></td>
<td style="background: #ff0000"></td>
</tr>
<tr style="height: 1px">
<td style="background: #00ff00"></td>
<td style="background: #ff0000"></td>
<td style="background: #ff0000"></td>
<td style="background: #ff0000"></td>
<td style="background: #ff0000"></td>
<td style="background: #0000ff"></td>
</tr>
<tr style="height: 1px">
<td style="background: #0000ff"></td>
<td style="background: #ff0000"></td>
<td style="background: #ff0000"></td>
<td style="background: #ff0000"></td>
<td style="background: #ff0000"></td>
<td style="background: #00ff00"></td>
</tr>
<tr style="height: 1px">
<td style="background: #ff0000"></td>
<td style="background: #00ff00"></td>
<td style="background: #0000ff"></td>
<td style="background: #00ff00"></td>
<td style="background: #0000ff"></td>
<td style="background: #ff0000"></td>
</tr>
</table>
</body>
</html>

View File

@ -1,31 +0,0 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>test of -moz-border-image</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
div.p1 {
background: red; /* fail if this shows through */
background-image: url('3x3multicolor.png'); /* fail if this shows through */
-moz-border-image: url('4x4multicolor.png') 1 1 1 1 / 1px 3px repeat;
-khtml-border-image: url('4x4multicolor.png') 1 1 1 1 / 1px 3px repeat;
border-image: url('4x4multicolor.png') 1 1 1 1 / 1px 3px repeat;
}
div.p2 {
background: red; /* fail if this shows through */
background-image: url('3x3multicolor.png'); /* fail if this shows through */
-moz-border-image: url('4x4multicolor.png') 1 1 1 1 / 1px 3px;
-khtml-border-image: url('4x4multicolor.png') 1 1 1 1 / 1px 3px;
border-image: url('4x4multicolor.png') 1 1 1 1 / 1px 3px;
}
</style>
</head>
<body>
<div class="p1" style="width: 4px; height: 2px"></div>
<!--<div class="p2" style="width: 4px; height: 2px"></div> -->
</body>
</html>

View File

@ -1,11 +0,0 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>test of -moz-border-image</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
</head>
<body>
<div style="border: solid #1DD813 1em;">border.png<br />second longer longer longer longer longer longer line<br />third longer longer longer longer longer longer line</div>
</body>
</html>

View File

@ -1,18 +0,0 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>test of -moz-border-image</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
div {
-moz-border-image: url('3x3green-1DD813.png') 1 1 1 1 / 1em;
-khtml-border-image: url('3x3green-1DD813.png') 1 1 1 1 / 1em;
border-image: url('3x3green-1DD813.png') 1 1 1 1 / 1em;
}
</style>
</head>
<body>
<div>border.png<br />second longer longer longer longer longer longer line<br />third longer longer longer longer longer longer line</div>
</body>
</html>

View File

@ -1,38 +0,0 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>test of -moz-border-image</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
div {
border: 10px solid #1DD813;
margin: 1px;
}
</style>
</head>
<body>
<div style="width: 50px; height: 5px"></div>
<div style="width: 51px; height: 5px"></div>
<div style="width: 52px; height: 5px"></div>
<div style="width: 53px; height: 5px"></div>
<div style="width: 54px; height: 5px"></div>
<div style="width: 55px; height: 5px"></div>
<div style="width: 56px; height: 5px"></div>
<div style="width: 57px; height: 5px"></div>
<div style="width: 58px; height: 5px"></div>
<div style="width: 59px; height: 5px"></div>
<div style="width: 550px; height: 5px"></div>
<div style="width: 551px; height: 5px"></div>
<div style="width: 552px; height: 5px"></div>
<div style="width: 553px; height: 5px"></div>
<div style="width: 554px; height: 5px"></div>
<div style="width: 555px; height: 5px"></div>
<div style="width: 556px; height: 5px"></div>
<div style="width: 557px; height: 5px"></div>
<div style="width: 558px; height: 5px"></div>
<div style="width: 559px; height: 5px"></div>
</body>
</html>

View File

@ -1,40 +0,0 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>test of -moz-border-image</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
div {
-moz-border-image: url('3x3green-1DD813.png') 1 1 1 1 / 10px;
-khtml-border-image: url('3x3green-1DD813.png') 1 1 1 1 / 10px;
border-image: url('3x3green-1DD813.png') 1 1 1 1 / 10px;
margin: 1px;
}
</style>
</head>
<body>
<div style="width: 50px; height: 5px"></div>
<div style="width: 51px; height: 5px"></div>
<div style="width: 52px; height: 5px"></div>
<div style="width: 53px; height: 5px"></div>
<div style="width: 54px; height: 5px"></div>
<div style="width: 55px; height: 5px"></div>
<div style="width: 56px; height: 5px"></div>
<div style="width: 57px; height: 5px"></div>
<div style="width: 58px; height: 5px"></div>
<div style="width: 59px; height: 5px"></div>
<div style="width: 550px; height: 5px"></div>
<div style="width: 551px; height: 5px"></div>
<div style="width: 552px; height: 5px"></div>
<div style="width: 553px; height: 5px"></div>
<div style="width: 554px; height: 5px"></div>
<div style="width: 555px; height: 5px"></div>
<div style="width: 556px; height: 5px"></div>
<div style="width: 557px; height: 5px"></div>
<div style="width: 558px; height: 5px"></div>
<div style="width: 559px; height: 5px"></div>
</body>
</html>

View File

@ -1,11 +0,0 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>test of -moz-border-image</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
</head>
<body>
<div style="padding: 1em;">border.png<br />second longer longer longer longer longer longer line<br />third longer longer longer longer longer longer line</div>
</body>
</html>

View File

@ -1,18 +0,0 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>test of -moz-border-image</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
div {
-moz-border-image: url('3x3transparent.png') 1 1 1 1; border: double orange 1em;
-khtml-border-image: url('3x3transparent.png') 1 1 1 1; border: double orange 1em;
border-image: url('3x3transparent.png') 1 1 1 1; border: double orange 1em;
}
</style>
</head>
<body>
<div>border.png<br />second longer longer longer longer longer longer line<br />third longer longer longer longer longer longer line</div>
</body>
</html>

View File

@ -1,59 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Pixel rounding testcase</title>
<style type="text/css">
html, body { margin: 0; border: none; padding: 0; }
div { position: absolute; height: 10px; width: 10px; }
</style>
</head>
<body>
<div style="top: 10px; left: 10px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 2px;"></div>
<div style="top: 10px; left: 30px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 2px;"></div>
<div style="top: 10px; left: 50px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 2px;"></div>
<div style="top: 10px; left: 70px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 2px;"></div>
<div style="top: 10px; left: 90px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 2px;"></div>
<div style="top: 10px; left: 110px; -moz-border-image: url(random-10x10.png) 3 2 2 3; border-width: 2px 2px 2px 2px;"></div>
<div style="top: 10px; left: 130px; -moz-border-image: url(random-10x10.png) 3 2 2 3 stretch; border-width: 2px 2px 2px 2px;"></div>
<div style="top: 10px; left: 150px; -moz-border-image: url(random-10x10.png) 3 2 2 3 stretch stretch; border-width: 2px 2px 2px 2px;"></div>
<div style="top: 10px; left: 170px; -moz-border-image: url(random-10x10.png) 3 2 2 3; border-width: 2px 2px 2px 2px;"></div>
<div style="top: 10px; left: 190px; -moz-border-image: url(random-10x10.png) 3 2 2 3; border-width: 2px 2px 2px 2px;"></div>
<div style="top: 30px; left: 10px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 2px round;"></div>
<div style="top: 30px; left: 30px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 2px round round;"></div>
<div style="top: 30px; left: 50px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 2px round round;"></div>
<div style="top: 30px; left: 70px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 2px round;"></div>
<div style="top: 30px; left: 90px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 2px round;"></div>
<div style="top: 30px; left: 110px; -moz-border-image: url(random-10x10.png) 3 2 2 3 round round; border-width: 2px 2px 2px 2px;"></div>
<div style="top: 30px; left: 130px; -moz-border-image: url(random-10x10.png) 3 2 2 3 round; border-width: 2px 2px 2px 2px;"></div>
<div style="top: 30px; left: 150px; -moz-border-image: url(random-10x10.png) 3 2 2 3 round; border-width: 2px 2px 2px 2px;"></div>
<div style="top: 30px; left: 170px; -moz-border-image: url(random-10x10.png) 3 2 2 3 round; border-width: 2px 2px 2px 2px;"></div>
<div style="top: 30px; left: 190px; -moz-border-image: url(random-10x10.png) 3 2 2 3 round round; border-width: 2px 2px 2px 2px;"></div>
<div style="top: 50px; left: 10px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 2px repeat;"></div>
<div style="top: 50px; left: 30px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 2px repeat repeat;"></div>
<div style="top: 50px; left: 50px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 2px repeat repeat;"></div>
<div style="top: 50px; left: 70px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 2px repeat;"></div>
<div style="top: 50px; left: 90px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 2px repeat;"></div>
<div style="top: 50px; left: 110px; -moz-border-image: url(random-10x10.png) 3 2 2 3 repeat repeat; border-width: 2px 2px 2px 2px;"></div>
<div style="top: 50px; left: 130px; -moz-border-image: url(random-10x10.png) 3 2 2 3 repeat; border-width: 2px 2px 2px 2px;"></div>
<div style="top: 50px; left: 150px; -moz-border-image: url(random-10x10.png) 3 2 2 3 repeat; border-width: 2px 2px 2px 2px;"></div>
<div style="top: 50px; left: 170px; -moz-border-image: url(random-10x10.png) 3 2 2 3 repeat; border-width: 2px 2px 2px 2px;"></div>
<div style="top: 50px; left: 190px; -moz-border-image: url(random-10x10.png) 3 2 2 3 repeat repeat; border-width: 2px 2px 2px 2px;"></div>
<div style="top: 70px; left: 10px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 2px repeat round;"></div>
<div style="top: 70px; left: 30px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 2px stretch repeat;"></div>
<div style="top: 70px; left: 50px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 2px round repeat;"></div>
<div style="top: 70px; left: 70px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 2px repeat stretch;"></div>
<div style="top: 70px; left: 90px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 2px round stretch;"></div>
<div style="top: 70px; left: 110px; -moz-border-image: url(random-10x10.png) 3 2 2 3 stretch round; border-width: 2px 2px 2px 2px;"></div>
<div style="top: 70px; left: 130px; -moz-border-image: url(random-10x10.png) 3 2 2 3 round repeat; border-width: 2px 2px 2px 2px;"></div>
<div style="top: 70px; left: 150px; -moz-border-image: url(random-10x10.png) 3 2 2 3 stretch repeat; border-width: 2px 2px 2px 2px;"></div>
<div style="top: 70px; left: 170px; -moz-border-image: url(random-10x10.png) 3 2 2 3 repeat round; border-width: 2px 2px 2px 2px;"></div>
<div style="top: 70px; left: 190px; -moz-border-image: url(random-10x10.png) 3 2 2 3 repeat round; border-width: 2px 2px 2px 2px;"></div>
</body>
</html>

View File

@ -1,59 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Pixel rounding testcase</title>
<style type="text/css">
html, body { margin: 0; border: none; padding: 0; }
div { position: absolute; height: 10px; width: 10px; }
</style>
</head>
<body>
<div style="top: 10px; left: 10px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 3px 2px 2px 2px;"></div>
<div style="top: 10px; left: 30px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 3px 2px 2px;"></div>
<div style="top: 10px; left: 50px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 3px 2px;"></div>
<div style="top: 10px; left: 70px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 3px;"></div>
<div style="top: 10px; left: 90px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 3px 3px 3px 3px;"></div>
<div style="top: 10px; left: 110px; -moz-border-image: url(random-10x10.png) 3 2 2 3; border-width: 3px 2px 2px 2px;"></div>
<div style="top: 10px; left: 130px; -moz-border-image: url(random-10x10.png) 3 2 2 3 stretch; border-width: 2px 3px 2px 2px;"></div>
<div style="top: 10px; left: 150px; -moz-border-image: url(random-10x10.png) 3 2 2 3 stretch stretch; border-width: 2px 2px 3px 2px;"></div>
<div style="top: 10px; left: 170px; -moz-border-image: url(random-10x10.png) 3 2 2 3; border-width: 2px 2px 2px 3px;"></div>
<div style="top: 10px; left: 190px; -moz-border-image: url(random-10x10.png) 3 2 2 3; border-width: 3px 3px 3px 3px;"></div>
<div style="top: 30px; left: 10px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 3px 2px 2px 2px round;"></div>
<div style="top: 30px; left: 30px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 3px 2px 2px round round;"></div>
<div style="top: 30px; left: 50px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 3px 2px round round;"></div>
<div style="top: 30px; left: 70px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 3px round;"></div>
<div style="top: 30px; left: 90px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 3px 3px 3px 3px round;"></div>
<div style="top: 30px; left: 110px; -moz-border-image: url(random-10x10.png) 3 2 2 3 round round; border-width: 3px 2px 2px 2px;"></div>
<div style="top: 30px; left: 130px; -moz-border-image: url(random-10x10.png) 3 2 2 3 round; border-width: 2px 3px 2px 2px;"></div>
<div style="top: 30px; left: 150px; -moz-border-image: url(random-10x10.png) 3 2 2 3 round; border-width: 2px 2px 3px 2px;"></div>
<div style="top: 30px; left: 170px; -moz-border-image: url(random-10x10.png) 3 2 2 3 round; border-width: 2px 2px 2px 3px;"></div>
<div style="top: 30px; left: 190px; -moz-border-image: url(random-10x10.png) 3 2 2 3 round round; border-width: 3px 3px 3px 3px;"></div>
<div style="top: 50px; left: 10px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 3px 2px 2px 2px repeat;"></div>
<div style="top: 50px; left: 30px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 3px 2px 2px repeat repeat;"></div>
<div style="top: 50px; left: 50px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 3px 2px repeat repeat;"></div>
<div style="top: 50px; left: 70px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 3px repeat;"></div>
<div style="top: 50px; left: 90px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 3px 3px 3px 3px repeat;"></div>
<div style="top: 50px; left: 110px; -moz-border-image: url(random-10x10.png) 3 2 2 3 repeat repeat; border-width: 3px 2px 2px 2px;"></div>
<div style="top: 50px; left: 130px; -moz-border-image: url(random-10x10.png) 3 2 2 3 repeat; border-width: 2px 3px 2px 2px;"></div>
<div style="top: 50px; left: 150px; -moz-border-image: url(random-10x10.png) 3 2 2 3 repeat; border-width: 2px 2px 3px 2px;"></div>
<div style="top: 50px; left: 170px; -moz-border-image: url(random-10x10.png) 3 2 2 3 repeat; border-width: 2px 2px 2px 3px;"></div>
<div style="top: 50px; left: 190px; -moz-border-image: url(random-10x10.png) 3 2 2 3 repeat repeat; border-width: 3px 3px 3px 3px;"></div>
<div style="top: 70px; left: 10px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 3px 2px 2px 2px repeat round;"></div>
<div style="top: 70px; left: 30px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 3px 2px 2px stretch repeat;"></div>
<div style="top: 70px; left: 50px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 3px 2px round repeat;"></div>
<div style="top: 70px; left: 70px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 3px repeat stretch;"></div>
<div style="top: 70px; left: 90px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 3px 3px 3px 3px round stretch;"></div>
<div style="top: 70px; left: 110px; -moz-border-image: url(random-10x10.png) 3 2 2 3 stretch round; border-width: 3px 2px 2px 2px;"></div>
<div style="top: 70px; left: 130px; -moz-border-image: url(random-10x10.png) 3 2 2 3 round repeat; border-width: 2px 3px 2px 2px;"></div>
<div style="top: 70px; left: 150px; -moz-border-image: url(random-10x10.png) 3 2 2 3 stretch repeat; border-width: 2px 2px 3px 2px;"></div>
<div style="top: 70px; left: 170px; -moz-border-image: url(random-10x10.png) 3 2 2 3 repeat round; border-width: 2px 2px 2px 3px;"></div>
<div style="top: 70px; left: 190px; -moz-border-image: url(random-10x10.png) 3 2 2 3 repeat round; border-width: 3px 3px 3px 3px;"></div>
</body>
</html>

View File

@ -1,59 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Pixel rounding testcase</title>
<style type="text/css">
html, body { margin: 0; border: none; padding: 0; }
div { position: absolute; height: 10px; width: 10px; }
</style>
</head>
<body>
<div style="top: 10px; left: 10px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2.4px 2px 2px 2px;"></div>
<div style="top: 10px; left: 30px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2.4px 2px 2px;"></div>
<div style="top: 10px; left: 50px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2.4px 2px;"></div>
<div style="top: 10px; left: 70px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 2.4px;"></div>
<div style="top: 10px; left: 90px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2.4px 2.4px 2.4px 2.4px;"></div>
<div style="top: 10px; left: 110px; -moz-border-image: url(random-10x10.png) 3 2 2 3; border-width: 2.4px 2px 2px 2px;"></div>
<div style="top: 10px; left: 130px; -moz-border-image: url(random-10x10.png) 3 2 2 3 stretch; border-width: 2px 2.4px 2px 2px;"></div>
<div style="top: 10px; left: 150px; -moz-border-image: url(random-10x10.png) 3 2 2 3 stretch stretch; border-width: 2px 2px 2.4px 2px;"></div>
<div style="top: 10px; left: 170px; -moz-border-image: url(random-10x10.png) 3 2 2 3; border-width: 2px 2px 2px 2.4px;"></div>
<div style="top: 10px; left: 190px; -moz-border-image: url(random-10x10.png) 3 2 2 3; border-width: 2.4px 2.4px 2.4px 2.4px;"></div>
<div style="top: 30px; left: 10px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2.4px 2px 2px 2px round;"></div>
<div style="top: 30px; left: 30px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2.4px 2px 2px round round;"></div>
<div style="top: 30px; left: 50px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2.4px 2px round round;"></div>
<div style="top: 30px; left: 70px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 2.4px round;"></div>
<div style="top: 30px; left: 90px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2.4px 2.4px 2.4px 2.4px round;"></div>
<div style="top: 30px; left: 110px; -moz-border-image: url(random-10x10.png) 3 2 2 3 round round; border-width: 2.4px 2px 2px 2px;"></div>
<div style="top: 30px; left: 130px; -moz-border-image: url(random-10x10.png) 3 2 2 3 round; border-width: 2px 2.4px 2px 2px;"></div>
<div style="top: 30px; left: 150px; -moz-border-image: url(random-10x10.png) 3 2 2 3 round; border-width: 2px 2px 2.4px 2px;"></div>
<div style="top: 30px; left: 170px; -moz-border-image: url(random-10x10.png) 3 2 2 3 round; border-width: 2px 2px 2px 2.4px;"></div>
<div style="top: 30px; left: 190px; -moz-border-image: url(random-10x10.png) 3 2 2 3 round round; border-width: 2.4px 2.4px 2.4px 2.4px;"></div>
<div style="top: 50px; left: 10px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2.4px 2px 2px 2px repeat;"></div>
<div style="top: 50px; left: 30px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2.4px 2px 2px repeat repeat;"></div>
<div style="top: 50px; left: 50px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2.4px 2px repeat repeat;"></div>
<div style="top: 50px; left: 70px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 2.4px repeat;"></div>
<div style="top: 50px; left: 90px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2.4px 2.4px 2.4px 2.4px repeat;"></div>
<div style="top: 50px; left: 110px; -moz-border-image: url(random-10x10.png) 3 2 2 3 repeat repeat; border-width: 2.4px 2px 2px 2px;"></div>
<div style="top: 50px; left: 130px; -moz-border-image: url(random-10x10.png) 3 2 2 3 repeat; border-width: 2px 2.4px 2px 2px;"></div>
<div style="top: 50px; left: 150px; -moz-border-image: url(random-10x10.png) 3 2 2 3 repeat; border-width: 2px 2px 2.4px 2px;"></div>
<div style="top: 50px; left: 170px; -moz-border-image: url(random-10x10.png) 3 2 2 3 repeat; border-width: 2px 2px 2px 2.4px;"></div>
<div style="top: 50px; left: 190px; -moz-border-image: url(random-10x10.png) 3 2 2 3 repeat repeat; border-width: 2.4px 2.4px 2.4px 2.4px;"></div>
<div style="top: 70px; left: 10px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2.4px 2px 2px 2px repeat round;"></div>
<div style="top: 70px; left: 30px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2.4px 2px 2px stretch repeat;"></div>
<div style="top: 70px; left: 50px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2.4px 2px round repeat;"></div>
<div style="top: 70px; left: 70px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 2.4px repeat stretch;"></div>
<div style="top: 70px; left: 90px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2.4px 2.4px 2.4px 2.4px round stretch;"></div>
<div style="top: 70px; left: 110px; -moz-border-image: url(random-10x10.png) 3 2 2 3 stretch round; border-width: 2.4px 2px 2px 2px;"></div>
<div style="top: 70px; left: 130px; -moz-border-image: url(random-10x10.png) 3 2 2 3 round repeat; border-width: 2px 2.4px 2px 2px;"></div>
<div style="top: 70px; left: 150px; -moz-border-image: url(random-10x10.png) 3 2 2 3 stretch repeat; border-width: 2px 2px 2.4px 2px;"></div>
<div style="top: 70px; left: 170px; -moz-border-image: url(random-10x10.png) 3 2 2 3 repeat round; border-width: 2px 2px 2px 2.4px;"></div>
<div style="top: 70px; left: 190px; -moz-border-image: url(random-10x10.png) 3 2 2 3 repeat round; border-width: 2.4px 2.4px 2.4px 2.4px;"></div>
</body>
</html>

View File

@ -1,59 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Pixel rounding testcase</title>
<style type="text/css">
html, body { margin: 0; border: none; padding: 0; }
div { position: absolute; height: 10px; width: 10px; }
</style>
</head>
<body>
<div style="top: 10px; left: 10px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2.9px 2px 2px 2px;"></div>
<div style="top: 10px; left: 30px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2.9px 2px 2px;"></div>
<div style="top: 10px; left: 50px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2.9px 2px;"></div>
<div style="top: 10px; left: 70px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 2.9px;"></div>
<div style="top: 10px; left: 90px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2.9px 2.9px 2.9px 2.9px;"></div>
<div style="top: 10px; left: 110px; -moz-border-image: url(random-10x10.png) 3 2 2 3; border-width: 2.9px 2px 2px 2px;"></div>
<div style="top: 10px; left: 130px; -moz-border-image: url(random-10x10.png) 3 2 2 3 stretch; border-width: 2px 2.9px 2px 2px;"></div>
<div style="top: 10px; left: 150px; -moz-border-image: url(random-10x10.png) 3 2 2 3 stretch stretch; border-width: 2px 2px 2.9px 2px;"></div>
<div style="top: 10px; left: 170px; -moz-border-image: url(random-10x10.png) 3 2 2 3; border-width: 2px 2px 2px 2.9px;"></div>
<div style="top: 10px; left: 190px; -moz-border-image: url(random-10x10.png) 3 2 2 3; border-width: 2.9px 2.9px 2.9px 2.9px;"></div>
<div style="top: 30px; left: 10px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2.9px 2px 2px 2px round;"></div>
<div style="top: 30px; left: 30px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2.9px 2px 2px round round;"></div>
<div style="top: 30px; left: 50px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2.9px 2px round round;"></div>
<div style="top: 30px; left: 70px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 2.9px round;"></div>
<div style="top: 30px; left: 90px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2.9px 2.9px 2.9px 2.9px round;"></div>
<div style="top: 30px; left: 110px; -moz-border-image: url(random-10x10.png) 3 2 2 3 round round; border-width: 2.9px 2px 2px 2px;"></div>
<div style="top: 30px; left: 130px; -moz-border-image: url(random-10x10.png) 3 2 2 3 round; border-width: 2px 2.9px 2px 2px;"></div>
<div style="top: 30px; left: 150px; -moz-border-image: url(random-10x10.png) 3 2 2 3 round; border-width: 2px 2px 2.9px 2px;"></div>
<div style="top: 30px; left: 170px; -moz-border-image: url(random-10x10.png) 3 2 2 3 round; border-width: 2px 2px 2px 2.9px;"></div>
<div style="top: 30px; left: 190px; -moz-border-image: url(random-10x10.png) 3 2 2 3 round round; border-width: 2.9px 2.9px 2.9px 2.9px;"></div>
<div style="top: 50px; left: 10px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2.9px 2px 2px 2px repeat;"></div>
<div style="top: 50px; left: 30px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2.9px 2px 2px repeat repeat;"></div>
<div style="top: 50px; left: 50px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2.9px 2px repeat repeat;"></div>
<div style="top: 50px; left: 70px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 2.9px repeat;"></div>
<div style="top: 50px; left: 90px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2.9px 2.9px 2.9px 2.9px repeat;"></div>
<div style="top: 50px; left: 110px; -moz-border-image: url(random-10x10.png) 3 2 2 3 repeat repeat; border-width: 2.9px 2px 2px 2px;"></div>
<div style="top: 50px; left: 130px; -moz-border-image: url(random-10x10.png) 3 2 2 3 repeat; border-width: 2px 2.9px 2px 2px;"></div>
<div style="top: 50px; left: 150px; -moz-border-image: url(random-10x10.png) 3 2 2 3 repeat; border-width: 2px 2px 2.9px 2px;"></div>
<div style="top: 50px; left: 170px; -moz-border-image: url(random-10x10.png) 3 2 2 3 repeat; border-width: 2px 2px 2px 2.9px;"></div>
<div style="top: 50px; left: 190px; -moz-border-image: url(random-10x10.png) 3 2 2 3 repeat repeat; border-width: 2.9px 2.9px 2.9px 2.9px;"></div>
<div style="top: 70px; left: 10px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2.9px 2px 2px 2px repeat round;"></div>
<div style="top: 70px; left: 30px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2.9px 2px 2px stretch repeat;"></div>
<div style="top: 70px; left: 50px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2.9px 2px round repeat;"></div>
<div style="top: 70px; left: 70px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2px 2px 2px 2.9px repeat stretch;"></div>
<div style="top: 70px; left: 90px; -moz-border-image: url(random-10x10.png) 3 2 2 3 / 2.9px 2.9px 2.9px 2.9px round stretch;"></div>
<div style="top: 70px; left: 110px; -moz-border-image: url(random-10x10.png) 3 2 2 3 stretch round; border-width: 2.9px 2px 2px 2px;"></div>
<div style="top: 70px; left: 130px; -moz-border-image: url(random-10x10.png) 3 2 2 3 round repeat; border-width: 2px 2.9px 2px 2px;"></div>
<div style="top: 70px; left: 150px; -moz-border-image: url(random-10x10.png) 3 2 2 3 stretch repeat; border-width: 2px 2px 2.9px 2px;"></div>
<div style="top: 70px; left: 170px; -moz-border-image: url(random-10x10.png) 3 2 2 3 repeat round; border-width: 2px 2px 2px 2.9px;"></div>
<div style="top: 70px; left: 190px; -moz-border-image: url(random-10x10.png) 3 2 2 3 repeat round; border-width: 2.9px 2.9px 2.9px 2.9px;"></div>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 391 B

View File

@ -173,7 +173,3 @@ random-if(MOZ_WIDGET_TOOLKIT=="cocoa") == image-left-6.html image-left-10-ref.ht
== rounded-background-color-width-left-6.html rounded-background-color-width-6.html
fails-if(MOZ_WIDGET_TOOLKIT=="cocoa") == background-image-tiling.html background-image-tiling-ref.html # probably bug 379317
!= border-image-width-0.html border-image-width-10.html
== border-image-width-4.html border-image-width-0.html
== border-image-width-9.html border-image-width-0.html

View File

@ -14,9 +14,6 @@ include ../../modules/libpr0n/test/reftest/reftest.list
# bidi/
include bidi/reftest.list
# border-image
include border-image/reftest.list
# box-properties/
include box-properties/reftest.list

View File

@ -117,7 +117,6 @@ EXPORTS = \
nsStyleSet.h \
nsStyleStruct.h \
nsStyleStructFwd.h \
nsStyleStructInlines.h \
nsStyleStructList.h \
nsStyleUtil.h \
$(NULL)

View File

@ -206,20 +206,10 @@ nsCSSCompressedDataBlock::MapRuleInfoInto(nsRuleData *aRuleData) const
if (target->GetUnit() == eCSSUnit_Null) {
const nsCSSValue *val = ValueAtCursor(cursor);
NS_ASSERTION(val->GetUnit() != eCSSUnit_Null, "oops");
if (iProp == eCSSProperty_background_image ||
iProp == eCSSProperty_list_style_image) {
if (val->GetUnit() == eCSSUnit_URL) {
val->StartImageLoad(
aRuleData->mPresContext->Document());
}
} else if (iProp == eCSSProperty_border_image) {
if (val->GetUnit() == eCSSUnit_Array) {
nsCSSValue::Array *array = val->GetArrayValue();
if (array->Item(0).GetUnit() == eCSSUnit_URL) {
array->Item(0).StartImageLoad(
aRuleData->mPresContext->Document());
}
}
if ((iProp == eCSSProperty_background_image ||
iProp == eCSSProperty_list_style_image) &&
val->GetUnit() == eCSSUnit_URL) {
val->StartImageLoad(aRuleData->mPresContext->Document());
}
*target = *val;
if (iProp == eCSSProperty_font_family) {

View File

@ -329,14 +329,6 @@ nsCSSDeclaration::AppendCSSValueToString(nsCSSProperty aProperty,
nsCSSValue::Array *array = aValue.GetArrayValue();
PRBool mark = PR_FALSE;
for (PRUint16 i = 0, i_end = array->Count(); i < i_end; ++i) {
if (aProperty == eCSSProperty_border_image && i >= 5) {
if (array->Item(i).GetUnit() == eCSSUnit_Null) {
continue;
}
if (i == 5) {
aResult.AppendLiteral(" /");
}
}
if (mark && array->Item(i).GetUnit() != eCSSUnit_Null) {
if (unit == eCSSUnit_Array)
aResult.AppendLiteral(" ");

View File

@ -324,7 +324,6 @@ protected:
PRBool ParseBorderColors(nsresult& aErrorCode,
nsCSSValueList** aResult,
nsCSSProperty aProperty);
PRBool ParseBorderImage(nsresult& aErrorCode);
PRBool ParseBorderSpacing(nsresult& aErrorCode);
PRBool ParseBorderSide(nsresult& aErrorCode,
const nsCSSProperty aPropIDs[],
@ -4440,8 +4439,6 @@ PRBool CSSParserImpl::ParseProperty(nsresult& aErrorCode,
return ParseBorderColors(aErrorCode,
&mTempData.mMargin.mBorderColors.mTop,
aPropID);
case eCSSProperty_border_image:
return ParseBorderImage(aErrorCode);
case eCSSProperty_border_width:
return ParseBorderWidth(aErrorCode);
case eCSSProperty_border_end_color:
@ -4655,7 +4652,6 @@ PRBool CSSParserImpl::ParseSingleValueProperty(nsresult& aErrorCode,
case eCSSProperty_border:
case eCSSProperty_border_color:
case eCSSProperty_border_bottom_colors:
case eCSSProperty_border_image:
case eCSSProperty_border_left_colors:
case eCSSProperty_border_right_colors:
case eCSSProperty_border_end_color:
@ -5493,93 +5489,6 @@ PRBool CSSParserImpl::ParseBorderColor(nsresult& aErrorCode)
kBorderColorIDs);
}
PRBool CSSParserImpl::ParseBorderImage(nsresult& aErrorCode)
{
if (ParseVariant(aErrorCode, mTempData.mMargin.mBorderImage,
VARIANT_INHERIT | VARIANT_NONE, nsnull)) {
mTempData.SetPropertyBit(eCSSProperty_border_image);
return PR_TRUE;
}
// <uri> [<number> | <percentage>]{1,4} [ / <border-width>{1,4} ]? [stretch | repeat | round]{0,2}
nsRefPtr<nsCSSValue::Array> arr = nsCSSValue::Array::Create(11);
if (!arr) {
aErrorCode = NS_ERROR_OUT_OF_MEMORY;
return PR_FALSE;
}
nsCSSValue& url = arr->Item(0);
nsCSSValue& splitTop = arr->Item(1);
nsCSSValue& splitRight = arr->Item(2);
nsCSSValue& splitBottom = arr->Item(3);
nsCSSValue& splitLeft = arr->Item(4);
nsCSSValue& borderWidthTop = arr->Item(5);
nsCSSValue& borderWidthRight = arr->Item(6);
nsCSSValue& borderWidthBottom = arr->Item(7);
nsCSSValue& borderWidthLeft = arr->Item(8);
nsCSSValue& horizontalKeyword = arr->Item(9);
nsCSSValue& verticalKeyword = arr->Item(10);
// <uri>
if (!ParseVariant(aErrorCode, url, VARIANT_URL, nsnull)) {
return PR_FALSE;
}
// [<number> | <percentage>]{1,4}
if (!ParsePositiveVariant(aErrorCode, splitTop,
VARIANT_NUMBER | VARIANT_PERCENT, nsnull)) {
return PR_FALSE;
}
if (!ParsePositiveVariant(aErrorCode, splitRight,
VARIANT_NUMBER | VARIANT_PERCENT, nsnull)) {
splitRight = splitTop;
}
if (!ParsePositiveVariant(aErrorCode, splitBottom,
VARIANT_NUMBER | VARIANT_PERCENT, nsnull)) {
splitBottom = splitTop;
}
if (!ParsePositiveVariant(aErrorCode, splitLeft,
VARIANT_NUMBER | VARIANT_PERCENT, nsnull)) {
splitLeft = splitRight;
}
// [ / <border-width>{1,4} ]?
if (ExpectSymbol(aErrorCode, '/', PR_TRUE)) {
// if have '/', at least one value is required
if (!ParsePositiveVariant(aErrorCode, borderWidthTop,
VARIANT_LENGTH, nsnull)) {
return PR_FALSE;
}
if (!ParsePositiveVariant(aErrorCode, borderWidthRight,
VARIANT_LENGTH, nsnull)) {
borderWidthRight = borderWidthTop;
}
if (!ParsePositiveVariant(aErrorCode, borderWidthBottom,
VARIANT_LENGTH, nsnull)) {
borderWidthBottom = borderWidthTop;
}
if (!ParsePositiveVariant(aErrorCode, borderWidthLeft,
VARIANT_LENGTH, nsnull)) {
borderWidthLeft = borderWidthRight;
}
}
// [stretch | repeat | round]{0,2}
// missing keywords are handled in nsRuleNode::ComputeBorderData()
if (ParseEnum(aErrorCode, horizontalKeyword, nsCSSProps::kBorderImageKTable)) {
ParseEnum(aErrorCode, verticalKeyword, nsCSSProps::kBorderImageKTable);
}
if (!ExpectEndProperty(aErrorCode)) {
return PR_FALSE;
}
mTempData.mMargin.mBorderImage.SetArrayValue(arr, eCSSUnit_Array);
mTempData.SetPropertyBit(eCSSProperty_border_image);
return PR_TRUE;
}
PRBool CSSParserImpl::ParseBorderSpacing(nsresult& aErrorCode)
{
nsCSSValue xValue;

View File

@ -304,7 +304,6 @@ CSS_PROP_SHORTHAND(-moz-border-end-width, border_end_width, MozBorderEndWidth)
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
CSS_PROP_BORDER(border-end-width-value, border_end_width_value, X, Margin, mBorderEndWidth, eCSSType_Value, kBorderWidthKTable)
#endif
CSS_PROP_BORDER(-moz-border-image, border_image, MozBorderImage, Margin, mBorderImage, eCSSType_Value, kBorderImageKTable)
CSS_PROP_SHORTHAND(border-left, border_left, BorderLeft)
CSS_PROP_SHORTHAND(border-left-color, border_left_color, BorderLeftColor)
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL

View File

@ -352,13 +352,6 @@ const PRInt32 nsCSSProps::kBorderColorKTable[] = {
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBorderImageKTable[] = {
eCSSKeyword_stretch, NS_STYLE_BORDER_IMAGE_STRETCH,
eCSSKeyword_repeat, NS_STYLE_BORDER_IMAGE_REPEAT,
eCSSKeyword_round, NS_STYLE_BORDER_IMAGE_ROUND,
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBorderStyleKTable[] = {
eCSSKeyword_hidden, NS_STYLE_BORDER_STYLE_HIDDEN,
eCSSKeyword_dotted, NS_STYLE_BORDER_STYLE_DOTTED,

View File

@ -122,7 +122,6 @@ public:
static const PRInt32 kBackgroundRepeatKTable[];
static const PRInt32 kBorderCollapseKTable[];
static const PRInt32 kBorderColorKTable[];
static const PRInt32 kBorderImageKTable[];
static const PRInt32 kBorderStyleKTable[];
static const PRInt32 kBorderWidthKTable[];
static const PRInt32 kBoxAlignKTable[];

View File

@ -354,7 +354,6 @@ struct nsCSSMargin : public nsCSSStruct {
nsCSSValue mOutlineOffset;
nsCSSRect mOutlineRadius; // (extension)
nsCSSValue mFloatEdge; // NEW
nsCSSValue mBorderImage;
nsCSSValueList* mBoxShadow;
private:
nsCSSMargin(const nsCSSMargin& aOther); // NOT IMPLEMENTED

View File

@ -61,7 +61,6 @@
#include "nsHTMLReflowState.h"
#include "nsThemeConstants.h"
#include "nsStyleUtil.h"
#include "nsStyleStructInlines.h"
#include "nsPresContext.h"
#include "nsIDocument.h"
@ -2174,93 +2173,6 @@ nsComputedDOMStyle::GetBoxSizing(nsIDOMCSSValue** aValue)
return CallQueryInterface(val, aValue);
}
nsresult
nsComputedDOMStyle::GetBorderImage(nsIDOMCSSValue** aValue)
{
const nsStyleBorder* border = GetStyleBorder();
// none
if (!border->GetBorderImage()) {
nsROCSSPrimitiveValue *valNone = GetROCSSPrimitiveValue();
NS_ENSURE_TRUE(valNone, NS_ERROR_OUT_OF_MEMORY);
valNone->SetIdent(nsGkAtoms::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)) {
delete valURI;
delete valueList;
return NS_ERROR_OUT_OF_MEMORY;
}
nsCOMPtr<nsIURI> uri;
border->GetBorderImage()->GetURI(getter_AddRefs(uri));
valURI->SetURI(uri);
// four split numbers
NS_FOR_CSS_SIDES(side) {
nsROCSSPrimitiveValue *valSplit = GetROCSSPrimitiveValue();
if (!valSplit || !valueList->AppendCSSValue(valSplit)) {
delete valSplit;
delete valueList;
return NS_ERROR_OUT_OF_MEMORY;
}
SetValueToCoord(valSplit, border->mBorderImageSplit.Get(side), nsnull,
nsnull);
}
// copy of border-width
if (border->mHaveBorderImageWidth) {
nsROCSSPrimitiveValue *slash = GetROCSSPrimitiveValue();
if (!slash || !valueList->AppendCSSValue(slash)) {
delete slash;
delete valueList;
return NS_ERROR_OUT_OF_MEMORY;
}
slash->SetString(NS_LITERAL_STRING("/"));
NS_FOR_CSS_SIDES(side) {
nsROCSSPrimitiveValue *borderWidth = GetROCSSPrimitiveValue();
if (!borderWidth || !valueList->AppendCSSValue(borderWidth)) {
delete borderWidth;
delete valueList;
return NS_ERROR_OUT_OF_MEMORY;
}
nscoord width = GetStyleBorder()->mBorderImageWidth.side(side);
borderWidth->SetAppUnits(width);
}
}
// first keyword
nsROCSSPrimitiveValue *keyword = GetROCSSPrimitiveValue();
if (!keyword || !valueList->AppendCSSValue(keyword)) {
delete keyword;
delete valueList;
return NS_ERROR_OUT_OF_MEMORY;
}
const nsAFlatCString& borderImageIdent =
nsCSSProps::ValueToKeyword(GetStyleBorder()->mBorderImageHFill,
nsCSSProps::kBorderImageKTable);
keyword->SetIdent(borderImageIdent);
// second keyword
nsROCSSPrimitiveValue *keyword2 = GetROCSSPrimitiveValue();
if (!keyword2 || !valueList->AppendCSSValue(keyword2)) {
delete keyword2;
delete valueList;
return NS_ERROR_OUT_OF_MEMORY;
}
const nsAFlatCString& borderImageIdent2 =
nsCSSProps::ValueToKeyword(GetStyleBorder()->mBorderImageVFill,
nsCSSProps::kBorderImageKTable);
keyword2->SetIdent(borderImageIdent2);
return CallQueryInterface(valueList, aValue);
}
nsresult
nsComputedDOMStyle::GetFloatEdge(nsIDOMCSSValue** aValue)
{
@ -3054,7 +2966,7 @@ nsComputedDOMStyle::GetBorderWidthFor(PRUint8 aSide, nsIDOMCSSValue** aValue)
FlushPendingReflows();
width = mInnerFrame->GetUsedBorder().side(aSide);
} else {
width = GetStyleBorder()->GetActualBorderWidth(aSide);
width = GetStyleBorder()->GetBorderWidth(aSide);
}
val->SetAppUnits(width);
@ -3942,7 +3854,6 @@ nsComputedDOMStyle::GetQueryablePropertyMap(PRUint32* aLength)
COMPUTED_STYLE_MAP_ENTRY(_moz_background_origin, BackgroundOrigin),
COMPUTED_STYLE_MAP_ENTRY(binding, Binding),
COMPUTED_STYLE_MAP_ENTRY(border_bottom_colors, BorderBottomColors),
COMPUTED_STYLE_MAP_ENTRY(border_image, BorderImage),
COMPUTED_STYLE_MAP_ENTRY(border_left_colors, BorderLeftColors),
COMPUTED_STYLE_MAP_ENTRY(border_right_colors, BorderRightColors),
COMPUTED_STYLE_MAP_ENTRY(border_top_colors, BorderTopColors),

View File

@ -198,7 +198,6 @@ private:
nsresult GetBorderRadiusTopLeft(nsIDOMCSSValue** aValue);
nsresult GetBorderRadiusTopRight(nsIDOMCSSValue** aValue);
nsresult GetFloatEdge(nsIDOMCSSValue** aValue);
nsresult GetBorderImage(nsIDOMCSSValue** aValue);
/* Box Shadow */
nsresult GetBoxShadow(nsIDOMCSSValue** aValue);

View File

@ -68,7 +68,6 @@
#include "nsILanguageAtomService.h"
#include "nsIStyleRule.h"
#include "nsBidiUtils.h"
#include "nsStyleStructInlines.h"
/*
* For storage of an |nsRuleNode|'s children in a PLDHashTable.
@ -3772,17 +3771,12 @@ nsRuleNode::ComputeBorderData(void* aStartStruct,
}
else if (eCSSUnit_Inherit == value.GetUnit()) {
inherited = PR_TRUE;
border->SetBorderWidth(side,
parentBorder->GetComputedBorder().side(side));
border->SetBorderWidth(side, parentBorder->GetBorderWidth(side));
}
else if (eCSSUnit_Initial == value.GetUnit()) {
border->SetBorderWidth(side,
(mPresContext->GetBorderWidthTable())[NS_STYLE_BORDER_WIDTH_MEDIUM]);
}
else {
NS_ASSERTION(eCSSUnit_Null == value.GetUnit(),
"missing case handling border width");
}
}
}
@ -3919,78 +3913,6 @@ nsRuleNode::ComputeBorderData(void* aStartStruct,
else if (eCSSUnit_Initial == marginData.mFloatEdge.GetUnit()) {
border->mFloatEdge = NS_STYLE_FLOAT_EDGE_CONTENT;
}
// border-image
if (eCSSUnit_Array == marginData.mBorderImage.GetUnit()) {
nsCSSValue::Array *arr = marginData.mBorderImage.GetArrayValue();
// the image
if (eCSSUnit_Image == arr->Item(0).GetUnit()) {
border->SetBorderImage(arr->Item(0).GetImageValue());
}
// the numbers saying where to split the image
NS_FOR_CSS_SIDES(side) {
// an uninitialized parentCoord is ok because I'm not passing SETCOORD_INHERIT
if (SetCoord(arr->Item(1 + side), coord, nsStyleCoord(),
SETCOORD_FACTOR | SETCOORD_PERCENT, aContext,
mPresContext, inherited)) {
border->mBorderImageSplit.Set(side, coord);
}
}
// possible replacement for border-width
// if have one - have all four (see CSSParserImpl::ParseBorderImage())
if (eCSSUnit_Null != arr->Item(5).GetUnit()) {
NS_FOR_CSS_SIDES(side) {
// an uninitialized parentCoord is ok because I'm not passing SETCOORD_INHERIT
if (!SetCoord(arr->Item(5 + side), coord, nsStyleCoord(),
SETCOORD_LENGTH, aContext, mPresContext, inherited)) {
NS_NOTREACHED("SetCoord for border-width replacement from border-image failed");
}
if (coord.GetUnit() == eStyleUnit_Coord) {
border->SetBorderImageWidthOverride(side, coord.GetCoordValue());
} else {
NS_WARNING("a border-width replacement from border-image "
"has a unit that's not eStyleUnit_Coord");
border->SetBorderImageWidthOverride(side, 0);
}
}
border->mHaveBorderImageWidth = PR_TRUE;
} else {
border->mHaveBorderImageWidth = PR_FALSE;
}
// stretch/round/repeat keywords
if (eCSSUnit_Null == arr->Item(9).GetUnit()) {
// default, both horizontal and vertical are stretch
border->mBorderImageHFill = NS_STYLE_BORDER_IMAGE_STRETCH;
border->mBorderImageVFill = NS_STYLE_BORDER_IMAGE_STRETCH;
} else {
// have horizontal value
border->mBorderImageHFill = arr->Item(9).GetIntValue();
if (eCSSUnit_Null == arr->Item(10).GetUnit()) {
// vertical same as horizontal
border->mBorderImageVFill = border->mBorderImageHFill;
} else {
// have vertical value
border->mBorderImageVFill = arr->Item(10).GetIntValue();
}
}
} else if (eCSSUnit_None == marginData.mBorderImage.GetUnit() ||
eCSSUnit_Initial == marginData.mBorderImage.GetUnit()) {
border->mHaveBorderImageWidth = PR_FALSE;
border->SetBorderImage(nsnull);
} else if (eCSSUnit_Inherit == marginData.mBorderImage.GetUnit()) {
NS_FOR_CSS_SIDES(side) {
border->SetBorderImageWidthOverride(side, parentBorder->mBorderImageWidth.side(side));
}
border->mBorderImageSplit = parentBorder->mBorderImageSplit;
border->mBorderImageHFill = parentBorder->mBorderImageHFill;
border->mBorderImageVFill = parentBorder->mBorderImageVFill;
border->mHaveBorderImageWidth = parentBorder->mHaveBorderImageWidth;
border->SetBorderImage(parentBorder->GetBorderImage());
}
COMPUTE_END_RESET(Border, border)
}

View File

@ -644,10 +644,10 @@ void nsStyleContext::DumpRegressionData(nsPresContext* aPresContext, FILE* out,
const char format [] = "top: %dtw right: %dtw bottom: %dtw left: %dtw";
#endif
nsPrintfCString output(format,
border->GetActualBorderWidth(NS_SIDE_TOP),
border->GetActualBorderWidth(NS_SIDE_RIGHT),
border->GetActualBorderWidth(NS_SIDE_BOTTOM),
border->GetActualBorderWidth(NS_SIDE_LEFT));
border->GetBorderWidth(NS_SIDE_TOP),
border->GetBorderWidth(NS_SIDE_RIGHT),
border->GetBorderWidth(NS_SIDE_BOTTOM),
border->GetBorderWidth(NS_SIDE_LEFT));
fprintf(out, "%s ", output.get());
border->mBorderRadius.ToString(str);
fprintf(out, "%s ", NS_ConvertUTF16toUTF8(str).get());

View File

@ -44,7 +44,6 @@
*/
#include "nsStyleStruct.h"
#include "nsStyleStructInlines.h"
#include "nsStyleConsts.h"
#include "nsThemeConstants.h"
#include "nsString.h"
@ -354,9 +353,7 @@ nsChangeHint nsStylePadding::MaxDifference()
#endif
nsStyleBorder::nsStyleBorder(nsPresContext* aPresContext)
: mHaveBorderImageWidth(PR_FALSE),
mComputedBorder(0, 0, 0, 0),
mBorderImage(nsnull)
: mActualBorder(0, 0, 0, 0)
{
nscoord medium =
(aPresContext->GetBorderWidthTable())[NS_STYLE_BORDER_WIDTH_MEDIUM];
@ -376,18 +373,12 @@ nsStyleBorder::nsStyleBorder(nsPresContext* aPresContext)
}
nsStyleBorder::nsStyleBorder(const nsStyleBorder& aSrc)
: mBorderRadius(aSrc.mBorderRadius),
mBorderImageSplit(aSrc.mBorderImageSplit),
mFloatEdge(aSrc.mFloatEdge),
mBorderImageHFill(aSrc.mBorderImageHFill),
mBorderImageVFill(aSrc.mBorderImageVFill),
mBoxShadow(aSrc.mBoxShadow),
mHaveBorderImageWidth(aSrc.mHaveBorderImageWidth),
mBorderImageWidth(aSrc.mBorderImageWidth),
mComputedBorder(aSrc.mComputedBorder),
: mActualBorder(aSrc.mActualBorder),
mTwipsPerPixel(aSrc.mTwipsPerPixel),
mBorder(aSrc.mBorder),
mBorderImage(aSrc.mBorderImage),
mTwipsPerPixel(aSrc.mTwipsPerPixel)
mBorderRadius(aSrc.mBorderRadius),
mFloatEdge(aSrc.mFloatEdge),
mBoxShadow(aSrc.mBoxShadow)
{
mBorderColors = nsnull;
if (aSrc.mBorderColors) {
@ -405,15 +396,6 @@ nsStyleBorder::nsStyleBorder(const nsStyleBorder& aSrc)
}
}
nsStyleBorder::~nsStyleBorder()
{
if (mBorderColors) {
for (PRInt32 i = 0; i < 4; i++)
delete mBorderColors[i];
delete [] mBorderColors;
}
}
void*
nsStyleBorder::operator new(size_t sz, nsPresContext* aContext) CPP_THROW_NEW {
void* result = aContext->AllocateFromShell(sz);
@ -434,7 +416,7 @@ nsChangeHint nsStyleBorder::CalcDifference(const nsStyleBorder& aOther) const
// Note that differences in mBorder don't affect rendering (which should only
// use mComputedBorder), so don't need to be tested for here.
if (mTwipsPerPixel == aOther.mTwipsPerPixel &&
mComputedBorder == aOther.mComputedBorder &&
mActualBorder == aOther.mActualBorder &&
mFloatEdge == aOther.mFloatEdge) {
// Note that mBorderStyle stores not only the border style but also
// color-related flags. Given that we've already done an mComputedBorder
@ -480,25 +462,6 @@ nsChangeHint nsStyleBorder::MaxDifference()
}
#endif
PRBool
nsStyleBorder::ImageBorderDiffers() const
{
return mComputedBorder !=
(mHaveBorderImageWidth ? mBorderImageWidth : mBorder);
}
const nsMargin&
nsStyleBorder::GetActualBorder() const
{
if (IsBorderImageLoaded())
if (mHaveBorderImageWidth)
return mBorderImageWidth;
else
return mBorder;
else
return mComputedBorder;
}
nsStyleOutline::nsStyleOutline(nsPresContext* aPresContext)
{
// spacing values not inherited

View File

@ -22,7 +22,6 @@
* Contributor(s):
* Mats Palmgren <mats.palmgren@bredband.net>
* Masayuki Nakano <masayuki@d-toybox.com>
* Rob Arnold <robarnold@mozilla.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
@ -193,7 +192,6 @@ struct nsStyleBackground {
// We have to take slower codepaths for fixed background attachment,
// but we don't want to do that when there's no image.
// Not inline because it uses an nsCOMPtr<imgIRequest>
// FIXME: Should be in nsStyleStructInlines.h.
PRBool HasFixedBackground() const;
};
@ -401,7 +399,13 @@ class nsCSSShadowArray {
struct nsStyleBorder {
nsStyleBorder(nsPresContext* aContext);
nsStyleBorder(const nsStyleBorder& aBorder);
~nsStyleBorder();
~nsStyleBorder(void) {
if (mBorderColors) {
for (PRInt32 i = 0; i < 4; i++)
delete mBorderColors[i];
delete []mBorderColors;
}
}
void* operator new(size_t sz, nsPresContext* aContext) CPP_THROW_NEW;
void Destroy(nsPresContext* aContext);
@ -410,18 +414,12 @@ struct nsStyleBorder {
#ifdef DEBUG
static nsChangeHint MaxDifference();
#endif
PRBool ImageBorderDiffers() const;
nsStyleSides mBorderRadius; // [reset] length, percent
nsStyleSides mBorderImageSplit; // [reset] integer, percent
PRUint8 mFloatEdge; // [reset] see nsStyleConsts.h
PRUint8 mBorderImageHFill; // [reset]
PRUint8 mBorderImageVFill; // [reset]
nsBorderColors** mBorderColors; // [reset] multiple levels of color for a border.
nsRefPtr<nsCSSShadowArray> mBoxShadow; // [reset] NULL for 'none'
PRBool mHaveBorderImageWidth; // [reset]
nsMargin mBorderImageWidth; // [reset]
void EnsureBorderColors() {
if (!mBorderColors) {
mBorderColors = new nsBorderColors*[4];
@ -440,39 +438,34 @@ struct nsStyleBorder {
// Return whether aStyle is a visible style. Invisible styles cause
// the relevant computed border width to be 0.
// Note that this does *not* consider the effects of 'border-image':
// if border-style is none, but there is a loaded border image,
// HasVisibleStyle will be false even though there *is* a border.
// Defined in nsStyleStructInlines.h.
inline PRBool HasVisibleStyle(PRUint8 aSide);
static PRBool IsVisibleStyle(PRUint8 aStyle) {
return aStyle != NS_STYLE_BORDER_STYLE_NONE &&
aStyle != NS_STYLE_BORDER_STYLE_HIDDEN;
}
// aBorderWidth is in twips
// Defined in nsStyleStructInlines.h.
inline void SetBorderWidth(PRUint8 aSide, nscoord aBorderWidth);
inline void SetBorderImageWidthOverride(PRUint8 aSide, nscoord aBorderWidth);
// Get the actual border, in twips. (If there is no border-image
// loaded, this is the same as GetComputedBorder. If there is a
// border-image loaded, it uses the border-image width overrides if
// 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'.
const nsMargin& GetComputedBorder() const
void SetBorderWidth(PRUint8 aSide, nscoord aBorderWidth)
{
return mComputedBorder;
mBorder.side(aSide) = aBorderWidth;
if (IsVisibleStyle(GetBorderStyle(aSide))) {
mActualBorder.side(aSide) =
NS_ROUND_BORDER_TO_PIXELS(aBorderWidth, mTwipsPerPixel);
}
}
// Get the actual border, in twips.
const nsMargin& GetBorder() const
{
return mActualBorder;
}
// Get the actual border width for a particular side, in twips. Note that
// this is zero if and only if there is no border to be painted for this
// side. That is, this value takes into account the border style and the
// value is rounded to the nearest device pixel by NS_ROUND_BORDER_TO_PIXELS.
nscoord GetActualBorderWidth(PRUint8 aSide) const
nscoord GetBorderWidth(PRUint8 aSide) const
{
return GetActualBorder().side(aSide);
return mActualBorder.side(aSide);
}
PRUint8 GetBorderStyle(PRUint8 aSide) const
@ -481,11 +474,18 @@ struct nsStyleBorder {
return (mBorderStyle[aSide] & BORDER_STYLE_MASK);
}
// Defined in nsStyleStructInlines.h.
inline void RebuildActualBorderSide(PRUint8 aSide);
inline void SetBorderStyle(PRUint8 aSide, PRUint8 aStyle);
inline void RebuildActualBorder();
inline PRBool IsBorderImageLoaded() const;
void SetBorderStyle(PRUint8 aSide, PRUint8 aStyle)
{
NS_ASSERTION(aSide <= NS_SIDE_LEFT, "bad side");
mBorderStyle[aSide] &= ~BORDER_STYLE_MASK;
mBorderStyle[aSide] |= (aStyle & BORDER_STYLE_MASK);
if (IsVisibleStyle(aStyle)) {
mActualBorder.side(aSide) =
NS_ROUND_BORDER_TO_PIXELS(mBorder.side(aSide), mTwipsPerPixel);
} else {
mActualBorder.side(aSide) = 0;
}
}
void GetBorderColor(PRUint8 aSide, nscolor& aColor,
PRBool& aTransparent, PRBool& aForeground) const
@ -507,10 +507,6 @@ struct nsStyleBorder {
mBorderStyle[aSide] &= ~BORDER_COLOR_SPECIAL;
}
// These are defined in nsStyleStructInlines.h
inline void SetBorderImage(imgIRequest* aImage);
inline imgIRequest* GetBorderImage() const;
void GetCompositeColors(PRInt32 aIndex, nsBorderColors** aColors) const
{
if (!mBorderColors)
@ -549,34 +545,26 @@ struct nsStyleBorder {
}
protected:
// mComputedBorder holds the CSS2.1 computed border-width values. In
// mActualBorder holds the CSS2.1 actual border-width values. In
// particular, these widths take into account the border-style for the
// relevant side and the values are rounded to the nearest device
// pixel. They are also rounded (which is not part of the definition
// of computed values). However, they do *not* take into account the
// presence of border-image. See GetActualBorder above for how to
// really get the actual border.
nsMargin mComputedBorder;
// relevant side and the values are rounded to the nearest device pixel.
nsMargin mActualBorder;
// mBorder holds the nscoord values for the border widths as they would be if
// all the border-style values were visible (not hidden or none). This
// member exists so that when we create structs using the copy
// member exists solely so that when we create structs using the copy
// constructor during style resolution the new structs will know what the
// specified values of the border were in case they have more specific rules
// setting the border style. Note that this isn't quite the CSS specified
// value, since this has had the enumerated border widths converted to
// lengths, and all lengths converted to twips. But it's not quite the
// computed value either. The values are rounded to the nearest device pixel
// We also use these values when we have a loaded border-image that
// does not have width overrides.
// computed value either.
nsMargin mBorder;
PRUint8 mBorderStyle[4]; // [reset] See nsStyleConsts.h
nscolor mBorderColor[4]; // [reset] the colors to use for a simple border. not used
// if -moz-border-colors is specified
nsCOMPtr<imgIRequest> mBorderImage; // [reset]
nscoord mTwipsPerPixel;
};

View File

@ -1,115 +0,0 @@
/* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is nsStyleStructInlines.h.
*
* The Initial Developer of the Original Code is the Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* L. David Baron <dbaron@dbaron.org>, Mozilla Corporation (original author)
* Rob Arnold <robarnold@mozilla.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*
* Inline methods that belong in nsStyleStruct.h, except that they
* require more headers.
*/
#ifndef nsStyleStructInlines_h_
#define nsStyleStructInlines_h_
#include "nsStyleStruct.h"
#include "imgIRequest.h"
inline void
nsStyleBorder::SetBorderImage(imgIRequest* aImage)
{
mBorderImage = aImage;
RebuildActualBorder();
}
inline imgIRequest*
nsStyleBorder::GetBorderImage() const
{
return mBorderImage;
}
inline PRBool nsStyleBorder::HasVisibleStyle(PRUint8 aSide)
{
PRUint8 style = GetBorderStyle(aSide);
return (style != NS_STYLE_BORDER_STYLE_NONE &&
style != NS_STYLE_BORDER_STYLE_HIDDEN);
}
inline void nsStyleBorder::SetBorderWidth(PRUint8 aSide, nscoord aBorderWidth)
{
nscoord roundedWidth =
NS_ROUND_BORDER_TO_PIXELS(aBorderWidth, mTwipsPerPixel);
mBorder.side(aSide) = roundedWidth;
if (HasVisibleStyle(aSide))
mComputedBorder.side(aSide) = roundedWidth;
}
inline void nsStyleBorder::SetBorderImageWidthOverride(PRUint8 aSide,
nscoord aBorderWidth)
{
mBorderImageWidth.side(aSide) =
NS_ROUND_BORDER_TO_PIXELS(aBorderWidth, mTwipsPerPixel);
}
inline void nsStyleBorder::RebuildActualBorderSide(PRUint8 aSide)
{
mComputedBorder.side(aSide) =
(HasVisibleStyle(aSide) ? mBorder.side(aSide) : 0);
}
inline void nsStyleBorder::SetBorderStyle(PRUint8 aSide, PRUint8 aStyle)
{
NS_ASSERTION(aSide <= NS_SIDE_LEFT, "bad side");
mBorderStyle[aSide] &= ~BORDER_STYLE_MASK;
mBorderStyle[aSide] |= (aStyle & BORDER_STYLE_MASK);
RebuildActualBorderSide(aSide);
}
inline void nsStyleBorder::RebuildActualBorder()
{
NS_FOR_CSS_SIDES(side) {
RebuildActualBorderSide(side);
}
}
inline PRBool nsStyleBorder::IsBorderImageLoaded() const
{
PRUint32 status;
return mBorderImage &&
NS_SUCCEEDED(mBorderImage->GetImageStatus(&status)) &&
(status & imgIRequest::STATUS_FRAME_COMPLETE);
}
#endif /* !defined(nsStyleStructInlines_h_) */

View File

@ -149,23 +149,6 @@ var gCSSProperties = {
other_values: [ "thin", "thick", "1px", "2em" ],
invalid_values: [ "5%" ]
},
"-moz-border-image": {
domProp: "MozBorderImage",
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "none" ],
other_values: [ "url('border.png') 27 27 27 27",
"url('border.png') 27",
"url('border.png') 27 27 27 27 repeat",
"url('border.png') 27 27 27 27 / 1em",
"url('border.png') 27 27 27 27 / 1em 1em 1em 1em repeat",
"url('border.png') 27 27 27 27 / 1em 1em 1em 1em stretch round" ],
invalid_values: [ "url('border.png')",
"url('border.png') 27 27 27 27 27",
"url('border.png') 27 27 27 27 / 1em 1em 1em 1em 1em",
"url('border.png') / repeat",
"url('border.png') 27 27 27 27 /" ]
},
"-moz-border-left-colors": {
domProp: "MozBorderLeftColors",
inherited: false,

View File

@ -199,14 +199,14 @@ function test_property(property)
step1comps.push(gComputedStyle.getPropertyValue(info.subproperties[idx]));
func = xfail_accepted(property, value) ? todo_isnot : isnot;
func(step1val, "", "setting '" + value + "' on '" + property + "'");
func(step1val, "", "setting '" + value + "' on '" + property);
if ("subproperties" in info)
for (idx in info.subproperties) {
var subprop = info.subproperties[idx];
func = xfail_accepted_split(property, subprop, value)
? todo_isnot : isnot;
func(gDeclaration.getPropertyValue(subprop), "",
"setting '" + value + "' on '" + property + "'");
"setting '" + value + "' on '" + property);
}
// We don't care particularly about the whitespace or the placement of

View File

@ -1040,7 +1040,7 @@ NS_NewTableCellFrame(nsIPresShell* aPresShell,
nsMargin*
nsTableCellFrame::GetBorderWidth(nsMargin& aBorder) const
{
aBorder = GetStyleBorder()->GetActualBorder();
aBorder = GetStyleBorder()->GetBorder();
return &aBorder;
}

View File

@ -2546,7 +2546,7 @@ void GetSeparateModelBorderPadding(const nsHTMLReflowState* aReflowState,
// mComputedBorderPadding or we don't and then we get the padding
// wrong!
const nsStyleBorder* border = aStyleContext.GetStyleBorder();
aBorderPadding = border->GetActualBorder();
aBorderPadding = border->GetBorder();
if (aReflowState) {
aBorderPadding += aReflowState->mComputedPadding;
}
@ -4648,7 +4648,7 @@ GetColorAndStyle(const nsIFrame* aFrame,
aSide = NS_SIDE_RIGHT;
}
}
width = styleData->GetActualBorderWidth(aSide);
width = styleData->GetBorderWidth(aSide);
aWidth = nsPresContext::AppUnitsToIntCSSPixels(width);
}

View File

@ -355,7 +355,7 @@ nsBox::GetBorder(nsMargin& aMargin)
}
}
aMargin = GetStyleBorder()->GetActualBorder();
aMargin = GetStyleBorder()->GetBorder();
return NS_OK;
}

View File

@ -197,13 +197,13 @@ nsBoxObject::GetOffsetRect(nsRect& aRect)
// For the origin, add in the border for the frame
const nsStyleBorder* border = frame->GetStyleBorder();
origin.x += border->GetActualBorderWidth(NS_SIDE_LEFT);
origin.y += border->GetActualBorderWidth(NS_SIDE_TOP);
origin.x += border->GetBorderWidth(NS_SIDE_LEFT);
origin.y += border->GetBorderWidth(NS_SIDE_TOP);
// And subtract out the border for the parent
const nsStyleBorder* parentBorder = parent->GetStyleBorder();
origin.x -= parentBorder->GetActualBorderWidth(NS_SIDE_LEFT);
origin.y -= parentBorder->GetActualBorderWidth(NS_SIDE_TOP);
origin.x -= parentBorder->GetBorderWidth(NS_SIDE_LEFT);
origin.y -= parentBorder->GetBorderWidth(NS_SIDE_TOP);
aRect.x = nsPresContext::AppUnitsToIntCSSPixels(origin.x);
aRect.y = nsPresContext::AppUnitsToIntCSSPixels(origin.y);

View File

@ -151,7 +151,7 @@ nsGroupBoxFrame::PaintBorderBackground(nsIRenderingContext& aRenderingContext,
PRIntn skipSides = 0;
const nsStyleBorder* borderStyleData = GetStyleBorder();
const nsStylePadding* paddingStyleData = GetStylePadding();
const nsMargin& border = borderStyleData->GetActualBorder();
const nsMargin& border = borderStyleData->GetBorder();
nscoord yoff = 0;
nsPresContext* presContext = PresContext();

View File

@ -776,7 +776,7 @@ nsListBoxBodyFrame::ComputeIntrinsicWidth(nsBoxLayoutState& aBoxLayoutState)
if (styleContext->GetStylePadding()->GetPadding(margin))
width += margin.LeftRight();
width += styleContext->GetStyleBorder()->GetActualBorder().LeftRight();
width += styleContext->GetStyleBorder()->GetBorder().LeftRight();
if (styleContext->GetStyleMargin()->GetMargin(margin))
width += margin.LeftRight();

View File

@ -195,7 +195,7 @@ GetBorderPadding(nsStyleContext* aContext, nsMargin& aMargin)
if (!aContext->GetStylePadding()->GetPadding(aMargin)) {
NS_NOTYETIMPLEMENTED("percentage padding");
}
aMargin += aContext->GetStyleBorder()->GetActualBorder();
aMargin += aContext->GetStyleBorder()->GetBorder();
}
static void