mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 13:55:43 +00:00
Don't do unneeded work in nsImageFrame::AttributeChanged. Bug 261723, r+sr=roc
This commit is contained in:
parent
61feb80622
commit
e0dc15e288
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user