Bug 161184. Shrink nsIPresContexts by moving some default value settings out of it and into StyleStructs where they belong.

r=bzbarsky sr=dbaron
This commit is contained in:
caillon%returnzero.com 2002-08-07 07:39:34 +00:00
Родитель c33e5faff9
Коммит 0fbcecb364
8 изменённых файлов: 8 добавлений и 176 удалений

Просмотреть файл

@ -979,10 +979,9 @@ nsStyleBackground::nsStyleBackground(nsIPresContext* aPresContext)
{
mBackgroundFlags = NS_STYLE_BG_COLOR_TRANSPARENT | NS_STYLE_BG_IMAGE_NONE;
aPresContext->GetDefaultBackgroundColor(&mBackgroundColor);
aPresContext->GetDefaultBackgroundImageAttachment(&mBackgroundAttachment);
aPresContext->GetDefaultBackgroundImageRepeat(&mBackgroundRepeat);
aPresContext->GetDefaultBackgroundImageOffset(&mBackgroundXPosition, &mBackgroundYPosition);
aPresContext->GetDefaultBackgroundImage(mBackgroundImage);
mBackgroundAttachment = NS_STYLE_BG_ATTACHMENT_SCROLL;
mBackgroundRepeat = NS_STYLE_BG_REPEAT_XY;
mBackgroundXPosition = mBackgroundYPosition = 0;
}
nsStyleBackground::nsStyleBackground(const nsStyleBackground& aSource)

Просмотреть файл

@ -187,9 +187,6 @@ nsPresContext::nsPresContext()
mFocusRingWidth = 1;
mFocusRingOnAnything = PR_FALSE;
mDefaultBackgroundImageAttachment = NS_STYLE_BG_ATTACHMENT_SCROLL;
mDefaultBackgroundImageRepeat = NS_STYLE_BG_REPEAT_XY;
mDefaultBackgroundImageOffsetX = mDefaultBackgroundImageOffsetY = 0;
mLanguageSpecificTransformType = eLanguageSpecificTransformType_Unknown;
mIsRenderingOnlySelection = PR_FALSE;
#ifdef IBMBIDI
@ -1164,38 +1161,6 @@ nsPresContext::GetDefaultBackgroundColor(nscolor* aResult)
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::GetDefaultBackgroundImage(nsString& aImage)
{
aImage = mDefaultBackgroundImage;
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::GetDefaultBackgroundImageRepeat(PRUint8* aRepeat)
{
NS_PRECONDITION(aRepeat, "null out param");
*aRepeat = mDefaultBackgroundImageRepeat;
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::GetDefaultBackgroundImageOffset(nscoord* aX, nscoord* aY)
{
NS_PRECONDITION(aX && aY, "null out param");
*aX = mDefaultBackgroundImageOffsetX;
*aY = mDefaultBackgroundImageOffsetY;
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::GetDefaultBackgroundImageAttachment(PRUint8* aAttachment)
{
NS_PRECONDITION(aAttachment, "null out param");
*aAttachment = mDefaultBackgroundImageAttachment;
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::GetDefaultLinkColor(nscolor* aColor)
{
@ -1269,35 +1234,6 @@ nsPresContext::SetDefaultBackgroundColor(nscolor aColor)
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::SetDefaultBackgroundImage(const nsString& aImage)
{
mDefaultBackgroundImage = aImage;
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::SetDefaultBackgroundImageRepeat(PRUint8 aRepeat)
{
mDefaultBackgroundImageRepeat = aRepeat;
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::SetDefaultBackgroundImageOffset(nscoord aX, nscoord aY)
{
mDefaultBackgroundImageOffsetX = aX;
mDefaultBackgroundImageOffsetY = aY;
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::SetDefaultBackgroundImageAttachment(PRUint8 aAttachment)
{
mDefaultBackgroundImageAttachment = aAttachment;
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::SetDefaultLinkColor(nscolor aColor)
{

Просмотреть файл

@ -285,10 +285,6 @@ public:
*/
NS_IMETHOD GetDefaultColor(nscolor* aColor) = 0;
NS_IMETHOD GetDefaultBackgroundColor(nscolor* aColor) = 0;
NS_IMETHOD GetDefaultBackgroundImage(nsString& aImage) = 0;
NS_IMETHOD GetDefaultBackgroundImageRepeat(PRUint8* aRepeat) = 0;
NS_IMETHOD GetDefaultBackgroundImageOffset(nscoord* aX, nscoord* aY) = 0;
NS_IMETHOD GetDefaultBackgroundImageAttachment(PRUint8* aRepeat) = 0;
NS_IMETHOD GetDefaultLinkColor(nscolor* aColor) = 0;
NS_IMETHOD GetDefaultVisitedLinkColor(nscolor* aColor) = 0;
NS_IMETHOD GetFocusBackgroundColor(nscolor* aColor) = 0;
@ -300,10 +296,6 @@ public:
NS_IMETHOD SetDefaultColor(nscolor aColor) = 0;
NS_IMETHOD SetDefaultBackgroundColor(nscolor aColor) = 0;
NS_IMETHOD SetDefaultBackgroundImage(const nsString& aImage) = 0;
NS_IMETHOD SetDefaultBackgroundImageRepeat(PRUint8 aRepeat) = 0;
NS_IMETHOD SetDefaultBackgroundImageOffset(nscoord aX, nscoord aY) = 0;
NS_IMETHOD SetDefaultBackgroundImageAttachment(PRUint8 aRepeat) = 0;
NS_IMETHOD SetDefaultLinkColor(nscolor aColor) = 0;
NS_IMETHOD SetDefaultVisitedLinkColor(nscolor aColor) = 0;

Просмотреть файл

@ -285,10 +285,6 @@ public:
*/
NS_IMETHOD GetDefaultColor(nscolor* aColor) = 0;
NS_IMETHOD GetDefaultBackgroundColor(nscolor* aColor) = 0;
NS_IMETHOD GetDefaultBackgroundImage(nsString& aImage) = 0;
NS_IMETHOD GetDefaultBackgroundImageRepeat(PRUint8* aRepeat) = 0;
NS_IMETHOD GetDefaultBackgroundImageOffset(nscoord* aX, nscoord* aY) = 0;
NS_IMETHOD GetDefaultBackgroundImageAttachment(PRUint8* aRepeat) = 0;
NS_IMETHOD GetDefaultLinkColor(nscolor* aColor) = 0;
NS_IMETHOD GetDefaultVisitedLinkColor(nscolor* aColor) = 0;
NS_IMETHOD GetFocusBackgroundColor(nscolor* aColor) = 0;
@ -300,10 +296,6 @@ public:
NS_IMETHOD SetDefaultColor(nscolor aColor) = 0;
NS_IMETHOD SetDefaultBackgroundColor(nscolor aColor) = 0;
NS_IMETHOD SetDefaultBackgroundImage(const nsString& aImage) = 0;
NS_IMETHOD SetDefaultBackgroundImageRepeat(PRUint8 aRepeat) = 0;
NS_IMETHOD SetDefaultBackgroundImageOffset(nscoord aX, nscoord aY) = 0;
NS_IMETHOD SetDefaultBackgroundImageAttachment(PRUint8 aRepeat) = 0;
NS_IMETHOD SetDefaultLinkColor(nscolor aColor) = 0;
NS_IMETHOD SetDefaultVisitedLinkColor(nscolor aColor) = 0;

Просмотреть файл

@ -285,10 +285,6 @@ public:
*/
NS_IMETHOD GetDefaultColor(nscolor* aColor) = 0;
NS_IMETHOD GetDefaultBackgroundColor(nscolor* aColor) = 0;
NS_IMETHOD GetDefaultBackgroundImage(nsString& aImage) = 0;
NS_IMETHOD GetDefaultBackgroundImageRepeat(PRUint8* aRepeat) = 0;
NS_IMETHOD GetDefaultBackgroundImageOffset(nscoord* aX, nscoord* aY) = 0;
NS_IMETHOD GetDefaultBackgroundImageAttachment(PRUint8* aRepeat) = 0;
NS_IMETHOD GetDefaultLinkColor(nscolor* aColor) = 0;
NS_IMETHOD GetDefaultVisitedLinkColor(nscolor* aColor) = 0;
NS_IMETHOD GetFocusBackgroundColor(nscolor* aColor) = 0;
@ -300,10 +296,6 @@ public:
NS_IMETHOD SetDefaultColor(nscolor aColor) = 0;
NS_IMETHOD SetDefaultBackgroundColor(nscolor aColor) = 0;
NS_IMETHOD SetDefaultBackgroundImage(const nsString& aImage) = 0;
NS_IMETHOD SetDefaultBackgroundImageRepeat(PRUint8 aRepeat) = 0;
NS_IMETHOD SetDefaultBackgroundImageOffset(nscoord aX, nscoord aY) = 0;
NS_IMETHOD SetDefaultBackgroundImageAttachment(PRUint8 aRepeat) = 0;
NS_IMETHOD SetDefaultLinkColor(nscolor aColor) = 0;
NS_IMETHOD SetDefaultVisitedLinkColor(nscolor aColor) = 0;

Просмотреть файл

@ -187,9 +187,6 @@ nsPresContext::nsPresContext()
mFocusRingWidth = 1;
mFocusRingOnAnything = PR_FALSE;
mDefaultBackgroundImageAttachment = NS_STYLE_BG_ATTACHMENT_SCROLL;
mDefaultBackgroundImageRepeat = NS_STYLE_BG_REPEAT_XY;
mDefaultBackgroundImageOffsetX = mDefaultBackgroundImageOffsetY = 0;
mLanguageSpecificTransformType = eLanguageSpecificTransformType_Unknown;
mIsRenderingOnlySelection = PR_FALSE;
#ifdef IBMBIDI
@ -1164,38 +1161,6 @@ nsPresContext::GetDefaultBackgroundColor(nscolor* aResult)
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::GetDefaultBackgroundImage(nsString& aImage)
{
aImage = mDefaultBackgroundImage;
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::GetDefaultBackgroundImageRepeat(PRUint8* aRepeat)
{
NS_PRECONDITION(aRepeat, "null out param");
*aRepeat = mDefaultBackgroundImageRepeat;
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::GetDefaultBackgroundImageOffset(nscoord* aX, nscoord* aY)
{
NS_PRECONDITION(aX && aY, "null out param");
*aX = mDefaultBackgroundImageOffsetX;
*aY = mDefaultBackgroundImageOffsetY;
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::GetDefaultBackgroundImageAttachment(PRUint8* aAttachment)
{
NS_PRECONDITION(aAttachment, "null out param");
*aAttachment = mDefaultBackgroundImageAttachment;
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::GetDefaultLinkColor(nscolor* aColor)
{
@ -1269,35 +1234,6 @@ nsPresContext::SetDefaultBackgroundColor(nscolor aColor)
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::SetDefaultBackgroundImage(const nsString& aImage)
{
mDefaultBackgroundImage = aImage;
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::SetDefaultBackgroundImageRepeat(PRUint8 aRepeat)
{
mDefaultBackgroundImageRepeat = aRepeat;
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::SetDefaultBackgroundImageOffset(nscoord aX, nscoord aY)
{
mDefaultBackgroundImageOffsetX = aX;
mDefaultBackgroundImageOffsetY = aY;
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::SetDefaultBackgroundImageAttachment(PRUint8 aAttachment)
{
mDefaultBackgroundImageAttachment = aAttachment;
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::SetDefaultLinkColor(nscolor aColor)
{

Просмотреть файл

@ -113,10 +113,6 @@ public:
NS_IMETHOD SetFontScaler(PRInt32 aScaler);
NS_IMETHOD GetDefaultColor(nscolor* aColor);
NS_IMETHOD GetDefaultBackgroundColor(nscolor* aColor);
NS_IMETHOD GetDefaultBackgroundImage(nsString& aImage);
NS_IMETHOD GetDefaultBackgroundImageRepeat(PRUint8* aRepeat);
NS_IMETHOD GetDefaultBackgroundImageOffset(nscoord* aX, nscoord* aY);
NS_IMETHOD GetDefaultBackgroundImageAttachment(PRUint8* aRepeat);
NS_IMETHOD GetDefaultLinkColor(nscolor* aColor);
NS_IMETHOD GetDefaultVisitedLinkColor(nscolor* aColor);
@ -127,10 +123,6 @@ public:
NS_IMETHOD GetFocusRingOnAnything(PRBool& focusRingOnAnything);
NS_IMETHOD SetDefaultColor(nscolor aColor);
NS_IMETHOD SetDefaultBackgroundColor(nscolor aColor);
NS_IMETHOD SetDefaultBackgroundImage(const nsString& aImage);
NS_IMETHOD SetDefaultBackgroundImageRepeat(PRUint8 aRepeat);
NS_IMETHOD SetDefaultBackgroundImageOffset(nscoord aX, nscoord aY);
NS_IMETHOD SetDefaultBackgroundImageAttachment(PRUint8 aRepeat);
NS_IMETHOD SetDefaultLinkColor(nscolor aColor);
NS_IMETHOD SetDefaultVisitedLinkColor(nscolor aColor);
@ -248,14 +240,8 @@ protected:
PRUint8 mFocusRingWidth; // set in GetUserPrefs
PRPackedBool mFocusRingOnAnything; // set in GetUserPrefs
PRPackedBool mDrawImageBackground;
PRPackedBool mDrawColorBackground;
PRUint8 mDefaultBackgroundImageAttachment;
PRUint8 mDefaultBackgroundImageRepeat;
nscoord mDefaultBackgroundImageOffsetX;
nscoord mDefaultBackgroundImageOffsetY;
nsString mDefaultBackgroundImage;
PRPackedBool mDrawImageBackground;
PRPackedBool mDrawColorBackground;
nsSupportsHashtable mImageLoaders;

Просмотреть файл

@ -979,10 +979,9 @@ nsStyleBackground::nsStyleBackground(nsIPresContext* aPresContext)
{
mBackgroundFlags = NS_STYLE_BG_COLOR_TRANSPARENT | NS_STYLE_BG_IMAGE_NONE;
aPresContext->GetDefaultBackgroundColor(&mBackgroundColor);
aPresContext->GetDefaultBackgroundImageAttachment(&mBackgroundAttachment);
aPresContext->GetDefaultBackgroundImageRepeat(&mBackgroundRepeat);
aPresContext->GetDefaultBackgroundImageOffset(&mBackgroundXPosition, &mBackgroundYPosition);
aPresContext->GetDefaultBackgroundImage(mBackgroundImage);
mBackgroundAttachment = NS_STYLE_BG_ATTACHMENT_SCROLL;
mBackgroundRepeat = NS_STYLE_BG_REPEAT_XY;
mBackgroundXPosition = mBackgroundYPosition = 0;
}
nsStyleBackground::nsStyleBackground(const nsStyleBackground& aSource)