Correcting our background painting code per the latest CSS specs. By default, backgrounds should be painted to the border

area, and not the padding area as per the CSS 2 Errata, CSS2.1 and CSS3.  Also, implementing the CSS3 'background-clip'
and 'background-origin' properties (currently with -moz- prefixes) to control this behavior.
Bug 162252, r=dbaron sr=roc+moz


git-svn-id: svn://10.0.0.236/trunk@131419 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
caillon%returnzero.com
2002-10-08 10:24:53 +00:00
parent eeef82662c
commit 0f7366d6d0
71 changed files with 1432 additions and 792 deletions

View File

@@ -977,6 +977,8 @@ nsStyleBackground::nsStyleBackground(nsIPresContext* aPresContext)
mBackgroundFlags = NS_STYLE_BG_COLOR_TRANSPARENT | NS_STYLE_BG_IMAGE_NONE;
aPresContext->GetDefaultBackgroundColor(&mBackgroundColor);
mBackgroundAttachment = NS_STYLE_BG_ATTACHMENT_SCROLL;
mBackgroundClip = NS_STYLE_BG_CLIP_BORDER;
mBackgroundOrigin = NS_STYLE_BG_ORIGIN_PADDING;
mBackgroundRepeat = NS_STYLE_BG_REPEAT_XY;
mBackgroundXPosition = mBackgroundYPosition = 0;
}
@@ -986,7 +988,8 @@ nsStyleBackground::nsStyleBackground(const nsStyleBackground& aSource)
mBackgroundAttachment = aSource.mBackgroundAttachment;
mBackgroundFlags = aSource.mBackgroundFlags;
mBackgroundRepeat = aSource.mBackgroundRepeat;
mBackgroundClip = aSource.mBackgroundClip;
mBackgroundOrigin = aSource.mBackgroundOrigin;
mBackgroundColor = aSource.mBackgroundColor;
mBackgroundXPosition = aSource.mBackgroundXPosition;
mBackgroundYPosition = aSource.mBackgroundYPosition;
@@ -1007,6 +1010,8 @@ nsChangeHint nsStyleBackground::CalcDifference(const nsStyleBackground& aOther)
(mBackgroundColor == aOther.mBackgroundColor) &&
(mBackgroundXPosition == aOther.mBackgroundXPosition) &&
(mBackgroundYPosition == aOther.mBackgroundYPosition) &&
(mBackgroundClip == aOther.mBackgroundClip) &&
(mBackgroundOrigin == aOther.mBackgroundOrigin) &&
(mBackgroundImage == aOther.mBackgroundImage))
return NS_STYLE_HINT_NONE;
return NS_STYLE_HINT_VISUAL;