Use the list-style-type if our list-style-image does not load. Bug

178371, r=caillon, sr=dbaron
This commit is contained in:
bzbarsky%mit.edu 2002-11-06 01:58:22 +00:00
Родитель f2f0308507
Коммит 2af0dceb8a
2 изменённых файлов: 166 добавлений и 162 удалений

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

@ -195,10 +195,11 @@ nsBulletFrame::Paint(nsIPresContext* aPresContext,
const nsStyleList* myList = (const nsStyleList*)mStyleContext->GetStyleData(eStyleStruct_List);
PRUint8 listStyleType = myList->mListStyleType;
if (myList->mListStyleImage.Length() > 0 && mImageRequest) {
if (!myList->mListStyleImage.IsEmpty() && mImageRequest) {
PRUint32 status;
mImageRequest->GetImageStatus(&status);
if (status & imgIRequest::STATUS_LOAD_COMPLETE) {
if (status & imgIRequest::STATUS_LOAD_COMPLETE &&
!(status & imgIRequest::STATUS_ERROR)) {
nsCOMPtr<imgIContainer> imageCon;
mImageRequest->GetImage(getter_AddRefs(imageCon));
if (imageCon) {
@ -1267,7 +1268,11 @@ nsBulletFrame::GetDesiredSize(nsIPresContext* aCX,
const nsStyleList* myList = (const nsStyleList*)mStyleContext->GetStyleData(eStyleStruct_List);
nscoord ascent;
if (!myList->mListStyleImage.IsEmpty()) {
if (!myList->mListStyleImage.IsEmpty() && mImageRequest) {
PRUint32 status;
mImageRequest->GetImageStatus(&status);
if (status & imgIRequest::STATUS_SIZE_AVAILABLE &&
!(status & imgIRequest::STATUS_ERROR)) {
nscoord widthConstraint = NS_INTRINSICSIZE;
nscoord heightConstraint = NS_INTRINSICSIZE;
PRBool fixedContentWidth = PR_FALSE;
@ -1350,23 +1355,11 @@ nsBulletFrame::GetDesiredSize(nsIPresContext* aCX,
aMetrics.width = mComputedSize.width;
aMetrics.height = mComputedSize.height;
#if 0
mImageLoader.GetDesiredSize(aCX, &aReflowState, aMetrics);
if (!mImageLoader.GetLoadImageFailed()) {
nsHTMLContainerFrame::CreateViewForFrame(aCX, this, mStyleContext, nsnull,
PR_FALSE);
aMetrics.ascent = aMetrics.height;
aMetrics.descent = 0;
return;
}
#endif
aMetrics.ascent = aMetrics.height;
aMetrics.descent = 0;
return;
}
const nsStyleFont* myFont =
@ -1581,6 +1574,13 @@ nsBulletFrame::Reflow(nsIPresContext* aPresContext,
NS_IMETHODIMP nsBulletFrame::OnStartContainer(imgIRequest *aRequest, nsIPresContext *aPresContext, imgIContainer *aImage)
{
if (!aImage) return NS_ERROR_INVALID_ARG;
if (!aRequest) return NS_ERROR_INVALID_ARG;
PRUint32 status;
aRequest->GetImageStatus(&status);
if (status & imgIRequest::STATUS_ERROR) {
return NS_OK;
}
nscoord w, h;
aImage->GetWidth(&w);
@ -1626,6 +1626,8 @@ NS_IMETHODIMP nsBulletFrame::OnDataAvailable(imgIRequest *aRequest, nsIPresConte
{
if (!aRect) return NS_ERROR_NULL_POINTER;
// XXX Should we do anything here if an error occured in the decode?
nsRect r(*aRect);
/* XXX Why do we subtract 1 here? The rect is (for example): (0, 0, 600, 1)..

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

@ -195,10 +195,11 @@ nsBulletFrame::Paint(nsIPresContext* aPresContext,
const nsStyleList* myList = (const nsStyleList*)mStyleContext->GetStyleData(eStyleStruct_List);
PRUint8 listStyleType = myList->mListStyleType;
if (myList->mListStyleImage.Length() > 0 && mImageRequest) {
if (!myList->mListStyleImage.IsEmpty() && mImageRequest) {
PRUint32 status;
mImageRequest->GetImageStatus(&status);
if (status & imgIRequest::STATUS_LOAD_COMPLETE) {
if (status & imgIRequest::STATUS_LOAD_COMPLETE &&
!(status & imgIRequest::STATUS_ERROR)) {
nsCOMPtr<imgIContainer> imageCon;
mImageRequest->GetImage(getter_AddRefs(imageCon));
if (imageCon) {
@ -1267,7 +1268,11 @@ nsBulletFrame::GetDesiredSize(nsIPresContext* aCX,
const nsStyleList* myList = (const nsStyleList*)mStyleContext->GetStyleData(eStyleStruct_List);
nscoord ascent;
if (!myList->mListStyleImage.IsEmpty()) {
if (!myList->mListStyleImage.IsEmpty() && mImageRequest) {
PRUint32 status;
mImageRequest->GetImageStatus(&status);
if (status & imgIRequest::STATUS_SIZE_AVAILABLE &&
!(status & imgIRequest::STATUS_ERROR)) {
nscoord widthConstraint = NS_INTRINSICSIZE;
nscoord heightConstraint = NS_INTRINSICSIZE;
PRBool fixedContentWidth = PR_FALSE;
@ -1350,23 +1355,11 @@ nsBulletFrame::GetDesiredSize(nsIPresContext* aCX,
aMetrics.width = mComputedSize.width;
aMetrics.height = mComputedSize.height;
#if 0
mImageLoader.GetDesiredSize(aCX, &aReflowState, aMetrics);
if (!mImageLoader.GetLoadImageFailed()) {
nsHTMLContainerFrame::CreateViewForFrame(aCX, this, mStyleContext, nsnull,
PR_FALSE);
aMetrics.ascent = aMetrics.height;
aMetrics.descent = 0;
return;
}
#endif
aMetrics.ascent = aMetrics.height;
aMetrics.descent = 0;
return;
}
const nsStyleFont* myFont =
@ -1581,6 +1574,13 @@ nsBulletFrame::Reflow(nsIPresContext* aPresContext,
NS_IMETHODIMP nsBulletFrame::OnStartContainer(imgIRequest *aRequest, nsIPresContext *aPresContext, imgIContainer *aImage)
{
if (!aImage) return NS_ERROR_INVALID_ARG;
if (!aRequest) return NS_ERROR_INVALID_ARG;
PRUint32 status;
aRequest->GetImageStatus(&status);
if (status & imgIRequest::STATUS_ERROR) {
return NS_OK;
}
nscoord w, h;
aImage->GetWidth(&w);
@ -1626,6 +1626,8 @@ NS_IMETHODIMP nsBulletFrame::OnDataAvailable(imgIRequest *aRequest, nsIPresConte
{
if (!aRect) return NS_ERROR_NULL_POINTER;
// XXX Should we do anything here if an error occured in the decode?
nsRect r(*aRect);
/* XXX Why do we subtract 1 here? The rect is (for example): (0, 0, 600, 1)..