This commit is contained in:
dbaron%dbaron.org 2004-07-16 21:23:27 +00:00
Родитель 6905e4af37
Коммит 4da6a59fbe
14 изменённых файлов: 21 добавлений и 53 удалений

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

@ -3504,8 +3504,8 @@ nsRuleNode::ComputeListData(nsStyleStruct* aStartStruct,
}
// list-style-image: url, none, inherit
if (eCSSUnit_Image == listData.mImage.GetUnit()) {
list->mListStyleImage = listData.mImage.GetImageValue();
if (eCSSUnit_URL == listData.mImage.GetUnit()) {
list->mListStyleImage = listData.mImage.GetURLValue();
}
else if (eCSSUnit_None == listData.mImage.GetUnit()) {
list->mListStyleImage = nsnull;

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

@ -185,10 +185,9 @@ 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 (iProp == eCSSProperty_background_image &&
val->GetUnit() == eCSSUnit_URL) {
val->StartImageLoad(aRuleData->mPresContext->GetDocument());
val->StartImageLoad(aRuleData->mPresContext->GetDocument());
}
*target = *val;
if (iProp == eCSSProperty_font_family) {

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

@ -1379,11 +1379,7 @@ nsComputedDOMStyle::GetListStyleImage(nsIFrame *aFrame,
if (!list->mListStyleImage) {
val->SetIdent(nsLayoutAtoms::none);
} else {
nsCOMPtr<nsIURI> uri;
if (list->mListStyleImage) {
list->mListStyleImage->GetURI(getter_AddRefs(uri));
}
val->SetURI(uri);
val->SetURI(list->mListStyleImage);
}
}

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

@ -578,7 +578,7 @@ struct nsStyleList : public nsStyleStruct {
PRUint8 mListStyleType; // [inherited] See nsStyleConsts.h
PRUint8 mListStylePosition; // [inherited]
nsCOMPtr<imgIRequest> mListStyleImage; // [inherited]
nsCOMPtr<nsIURI> mListStyleImage; // [inherited]
nsRect mImageRegion; // [inherited] the rect to use within an image
};

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

@ -680,7 +680,7 @@ nsStyleList::nsStyleList(const nsStyleList& aSource)
nsChangeHint nsStyleList::CalcDifference(const nsStyleList& aOther) const
{
if (mListStylePosition == aOther.mListStylePosition &&
EqualImages(mListStyleImage, aOther.mListStyleImage) &&
EqualURIs(mListStyleImage, aOther.mListStyleImage) &&
mListStyleType == aOther.mListStyleType) {
if (mImageRegion == aOther.mImageRegion)
return NS_STYLE_HINT_NONE;

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

@ -124,10 +124,7 @@ nsBulletFrame::Init(nsIPresContext* aPresContext,
nsresult rv = nsFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow);
nsCOMPtr<nsIURI> imgURI;
imgIRequest *imgReq = GetStyleList()->mListStyleImage;
if (imgReq)
imgReq->GetURI(getter_AddRefs(imgURI));
nsIURI *imgURI = GetStyleList()->mListStyleImage;
if (imgURI) {
nsCOMPtr<imgILoader> il(do_GetService("@mozilla.org/image/loader;1", &rv));
if (NS_FAILED(rv))
@ -1590,10 +1587,7 @@ nsBulletFrame::Reflow(nsIPresContext* aPresContext,
}
if (isStyleChange) {
nsCOMPtr<nsIURI> newURI;
imgIRequest *imgReq = GetStyleList()->mListStyleImage;
if (imgReq)
imgReq->GetURI(getter_AddRefs(newURI));
nsIURI *newURI = GetStyleList()->mListStyleImage;
if (newURI) {

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

@ -124,10 +124,7 @@ nsBulletFrame::Init(nsIPresContext* aPresContext,
nsresult rv = nsFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow);
nsCOMPtr<nsIURI> imgURI;
imgIRequest *imgReq = GetStyleList()->mListStyleImage;
if (imgReq)
imgReq->GetURI(getter_AddRefs(imgURI));
nsIURI *imgURI = GetStyleList()->mListStyleImage;
if (imgURI) {
nsCOMPtr<imgILoader> il(do_GetService("@mozilla.org/image/loader;1", &rv));
if (NS_FAILED(rv))
@ -1590,10 +1587,7 @@ nsBulletFrame::Reflow(nsIPresContext* aPresContext,
}
if (isStyleChange) {
nsCOMPtr<nsIURI> newURI;
imgIRequest *imgReq = GetStyleList()->mListStyleImage;
if (imgReq)
imgReq->GetURI(getter_AddRefs(newURI));
nsIURI *newURI = GetStyleList()->mListStyleImage;
if (newURI) {

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

@ -185,10 +185,9 @@ 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 (iProp == eCSSProperty_background_image &&
val->GetUnit() == eCSSUnit_URL) {
val->StartImageLoad(aRuleData->mPresContext->GetDocument());
val->StartImageLoad(aRuleData->mPresContext->GetDocument());
}
*target = *val;
if (iProp == eCSSProperty_font_family) {

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

@ -1379,11 +1379,7 @@ nsComputedDOMStyle::GetListStyleImage(nsIFrame *aFrame,
if (!list->mListStyleImage) {
val->SetIdent(nsLayoutAtoms::none);
} else {
nsCOMPtr<nsIURI> uri;
if (list->mListStyleImage) {
list->mListStyleImage->GetURI(getter_AddRefs(uri));
}
val->SetURI(uri);
val->SetURI(list->mListStyleImage);
}
}

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

@ -3504,8 +3504,8 @@ nsRuleNode::ComputeListData(nsStyleStruct* aStartStruct,
}
// list-style-image: url, none, inherit
if (eCSSUnit_Image == listData.mImage.GetUnit()) {
list->mListStyleImage = listData.mImage.GetImageValue();
if (eCSSUnit_URL == listData.mImage.GetUnit()) {
list->mListStyleImage = listData.mImage.GetURLValue();
}
else if (eCSSUnit_None == listData.mImage.GetUnit()) {
list->mListStyleImage = nsnull;

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

@ -680,7 +680,7 @@ nsStyleList::nsStyleList(const nsStyleList& aSource)
nsChangeHint nsStyleList::CalcDifference(const nsStyleList& aOther) const
{
if (mListStylePosition == aOther.mListStylePosition &&
EqualImages(mListStyleImage, aOther.mListStyleImage) &&
EqualURIs(mListStyleImage, aOther.mListStyleImage) &&
mListStyleType == aOther.mListStyleType) {
if (mImageRegion == aOther.mImageRegion)
return NS_STYLE_HINT_NONE;

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

@ -578,7 +578,7 @@ struct nsStyleList : public nsStyleStruct {
PRUint8 mListStyleType; // [inherited] See nsStyleConsts.h
PRUint8 mListStylePosition; // [inherited]
nsCOMPtr<imgIRequest> mListStyleImage; // [inherited]
nsCOMPtr<nsIURI> mListStyleImage; // [inherited]
nsRect mImageRegion; // [inherited] the rect to use within an image
};

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

@ -359,11 +359,7 @@ nsImageBoxFrame::GetImageSource()
return;
// get the list-style-image
imgIRequest *imgReq = GetStyleList()->mListStyleImage;
if (imgReq)
imgReq->GetURI(getter_AddRefs(mURI));
else
mURI = nsnull;
mURI = GetStyleList()->mListStyleImage;
}
}
@ -551,10 +547,7 @@ nsImageBoxFrame::DidSetStyleContext( nsIPresContext* aPresContext )
return NS_OK;
// If list-style-image changes, we have a new image.
imgIRequest *imgReq = myList->mListStyleImage;
nsCOMPtr<nsIURI> newURI;
if (imgReq)
imgReq->GetURI(getter_AddRefs(newURI));
nsIURI *newURI = myList->mListStyleImage;
PRBool equal;
if (newURI == mURI || // handles null==null
(newURI && mURI && NS_SUCCEEDED(newURI->Equals(mURI, &equal)) && equal))

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

@ -1633,10 +1633,7 @@ nsTreeBodyFrame::GetImage(PRInt32 aRowIndex, nsTreeColumn* aCol, PRBool aUseCont
else {
// Obtain the URL from the style context.
aAllowImageRegions = PR_TRUE;
nsCOMPtr<nsIURI> uri;
imgIRequest *imgReq = aStyleContext->GetStyleList()->mListStyleImage;
if (imgReq)
imgReq->GetURI(getter_AddRefs(uri));
nsIURI* uri = aStyleContext->GetStyleList()->mListStyleImage;
if (!uri)
return NS_OK;
nsCAutoString spec;