Make sure that Init() failures for image frames don't mean no alt text. Also
fixes a crasher when reframing fixed-pos frames. This change adds an assertion in ConstructHTMLFrame that InitAndRestoreFrame should succeed (unless it returns NS_ERROR_FRAME_REPLACED). This is an interim change; eventually we want to bail out on errors, but there may be frame impls that return errors in non-error conditions from Init() (eg nsFrameSetFrame did that) and we're a little close to freeze. Bug 202506, r=rbs, sr=roc+moz
This commit is contained in:
@@ -326,15 +326,15 @@ nsHTMLFramesetFrame::Init(nsIPresContext* aPresContext,
|
||||
// find the highest ancestor that is a frameset
|
||||
nsresult rv = NS_OK;
|
||||
nsIFrame* parentFrame = nsnull;
|
||||
GetParent((nsIFrame**)&parentFrame);
|
||||
GetParent(&parentFrame);
|
||||
mTopLevelFrameset = (nsHTMLFramesetFrame*)this;
|
||||
while (parentFrame) {
|
||||
nsHTMLFramesetFrame* frameset;
|
||||
rv = parentFrame->QueryInterface(NS_GET_IID(nsHTMLFramesetFrame),
|
||||
(void**)&frameset);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsHTMLFramesetFrame* frameset = nsnull;
|
||||
CallQueryInterface(parentFrame, &frameset);
|
||||
|
||||
if (frameset) {
|
||||
mTopLevelFrameset = frameset;
|
||||
parentFrame->GetParent((nsIFrame**)&parentFrame);
|
||||
parentFrame->GetParent(&parentFrame);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
@@ -342,8 +342,7 @@ nsHTMLFramesetFrame::Init(nsIPresContext* aPresContext,
|
||||
|
||||
// create the view. a view is needed since it needs to be a mouse grabber
|
||||
nsIView* view;
|
||||
nsresult result = nsComponentManager::CreateInstance(kViewCID, nsnull, NS_GET_IID(nsIView),
|
||||
(void **)&view);
|
||||
nsresult result = CallCreateInstance(kViewCID, &view);
|
||||
nsCOMPtr<nsIPresShell> presShell;
|
||||
aPresContext->GetShell(getter_AddRefs(presShell));
|
||||
nsCOMPtr<nsIViewManager> viewMan;
|
||||
|
||||
Reference in New Issue
Block a user