Don't do unneeded work in nsImageFrame::AttributeChanged. Bug 261723, r+sr=roc

This commit is contained in:
bzbarsky%mit.edu 2004-09-30 19:23:40 +00:00
parent 61feb80622
commit e0dc15e288
2 changed files with 6 additions and 8 deletions

View File

@ -1780,12 +1780,11 @@ nsImageFrame::AttributeChanged(nsPresContext* aPresContext,
nsresult rv = nsSplittableFrame::AttributeChanged(aPresContext, aChild,
aNameSpaceID, aAttribute,
aModType);
if (NS_OK != rv) {
if (NS_FAILED(rv)) {
return rv;
}
// XXXldb Shouldn't width and height be handled by attribute mapping?
if (nsHTMLAtoms::width == aAttribute || nsHTMLAtoms::height == aAttribute || nsHTMLAtoms::alt == aAttribute)
{ // XXX: could check for new width == old width, and make that a no-op
if (nsHTMLAtoms::alt == aAttribute)
{
mState |= NS_FRAME_IS_DIRTY;
mParent->ReflowDirtyChild(aPresContext->PresShell(), (nsIFrame*) this);
}

View File

@ -1780,12 +1780,11 @@ nsImageFrame::AttributeChanged(nsPresContext* aPresContext,
nsresult rv = nsSplittableFrame::AttributeChanged(aPresContext, aChild,
aNameSpaceID, aAttribute,
aModType);
if (NS_OK != rv) {
if (NS_FAILED(rv)) {
return rv;
}
// XXXldb Shouldn't width and height be handled by attribute mapping?
if (nsHTMLAtoms::width == aAttribute || nsHTMLAtoms::height == aAttribute || nsHTMLAtoms::alt == aAttribute)
{ // XXX: could check for new width == old width, and make that a no-op
if (nsHTMLAtoms::alt == aAttribute)
{
mState |= NS_FRAME_IS_DIRTY;
mParent->ReflowDirtyChild(aPresContext->PresShell(), (nsIFrame*) this);
}