зеркало из https://github.com/mozilla/pjs.git
Don't look for the primary frame unless we have to on broken images. Bug
239262, r+sr=dbaron, a=chofmann
This commit is contained in:
Родитель
5f7de0089d
Коммит
46389cab0e
|
@ -490,12 +490,21 @@ nsImageFrame::HandleLoadError(nsresult aStatus, nsIPresShell* aPresShell)
|
|||
if (!useSizedBox) {
|
||||
// let the presShell handle converting this into the inline alt
|
||||
// text frame
|
||||
// We have to try to get the primary frame for mContent, since for
|
||||
// <object> the frame CantRenderReplacedElement wants is the
|
||||
// ObjectFrame, not us (we're an anonymous frame then)....
|
||||
nsIFrame* primaryFrame = nsnull;
|
||||
aPresShell->GetPrimaryFrameFor(mContent, &primaryFrame);
|
||||
aPresShell->CantRenderReplacedElement(primaryFrame ? primaryFrame : this);
|
||||
if (mContent->IsContentOfType(nsIContent::eHTML) &&
|
||||
(mContent->Tag() == nsHTMLAtoms::object ||
|
||||
mContent->Tag() == nsHTMLAtoms::embed)) {
|
||||
// We have to try to get the primary frame for mContent, since for
|
||||
// <object> the frame CantRenderReplacedElement wants is the
|
||||
// ObjectFrame, not us (we're an anonymous frame then)....
|
||||
aPresShell->GetPrimaryFrameFor(mContent, &primaryFrame);
|
||||
}
|
||||
|
||||
if (!primaryFrame) {
|
||||
primaryFrame = this;
|
||||
}
|
||||
|
||||
aPresShell->CantRenderReplacedElement(primaryFrame);
|
||||
return NS_ERROR_FRAME_REPLACED;
|
||||
}
|
||||
|
||||
|
|
|
@ -490,12 +490,21 @@ nsImageFrame::HandleLoadError(nsresult aStatus, nsIPresShell* aPresShell)
|
|||
if (!useSizedBox) {
|
||||
// let the presShell handle converting this into the inline alt
|
||||
// text frame
|
||||
// We have to try to get the primary frame for mContent, since for
|
||||
// <object> the frame CantRenderReplacedElement wants is the
|
||||
// ObjectFrame, not us (we're an anonymous frame then)....
|
||||
nsIFrame* primaryFrame = nsnull;
|
||||
aPresShell->GetPrimaryFrameFor(mContent, &primaryFrame);
|
||||
aPresShell->CantRenderReplacedElement(primaryFrame ? primaryFrame : this);
|
||||
if (mContent->IsContentOfType(nsIContent::eHTML) &&
|
||||
(mContent->Tag() == nsHTMLAtoms::object ||
|
||||
mContent->Tag() == nsHTMLAtoms::embed)) {
|
||||
// We have to try to get the primary frame for mContent, since for
|
||||
// <object> the frame CantRenderReplacedElement wants is the
|
||||
// ObjectFrame, not us (we're an anonymous frame then)....
|
||||
aPresShell->GetPrimaryFrameFor(mContent, &primaryFrame);
|
||||
}
|
||||
|
||||
if (!primaryFrame) {
|
||||
primaryFrame = this;
|
||||
}
|
||||
|
||||
aPresShell->CantRenderReplacedElement(primaryFrame);
|
||||
return NS_ERROR_FRAME_REPLACED;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче