Make addition or removal of frames in a frameset actually change the

rendering.  Bug 306660, r=jst, sr=roc
This commit is contained in:
bzbarsky%mit.edu 2005-09-06 02:14:36 +00:00
Родитель 8b9158491c
Коммит 0cfd6a71ca
5 изменённых файлов: 34 добавлений и 2 удалений

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

@ -2131,7 +2131,14 @@ nsHTMLDocument::Close()
// handler of the frameset fires before the frames get reflowed
// and loaded. That is the long explanation for why we need this
// one line of code here!
FlushPendingNotifications(Flush_Layout);
// XXXbz as far as I can tell this may not be needed anymore; all
// the testcases in bug 57636 pass without this line... Leaving
// it be for now, though. In any case, there's no reason to do
// this if we have no presshell, since in that case none of the
// above about reusing frames applies.
if (GetNumberOfShells() != 0) {
FlushPendingNotifications(Flush_Layout);
}
// Remove the wyciwyg channel request from the document load group
// that we added in OpenCommon(). If all other requests between

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

@ -1,4 +1,4 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
// vim:cindent:ts=2:et:sw=2:
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
@ -8395,6 +8395,11 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
parentFrame = insertionPoint;
if (parentFrame->GetType() == nsLayoutAtoms::frameSetFrame) {
// Just reframe the parent, since framesets are weird like that.
return RecreateFramesForContent(parentFrame->GetContent());
}
if (parentFrame->IsLeaf()) {
// Nothing to do here; we shouldn't be constructing kids of leaves
return NS_OK;
@ -9040,6 +9045,11 @@ nsCSSFrameConstructor::ContentInserted(nsIContent* aContainer,
aContainer, aIndexInContainer);
}
if (parentFrame->GetType() == nsLayoutAtoms::frameSetFrame) {
// Just reframe the parent, since framesets are weird like that.
return RecreateFramesForContent(parentFrame->GetContent());
}
// Don't construct kids of leaves
if (parentFrame->IsLeaf()) {
return NS_OK;
@ -9602,6 +9612,11 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
parentFrame = insertionPoint;
if (parentFrame->GetType() == nsLayoutAtoms::frameSetFrame) {
// Just reframe the parent, since framesets are weird like that.
return RecreateFramesForContent(parentFrame->GetContent());
}
// Examine the containing-block for the removed content and see if
// :first-letter style applies.
nsIFrame* containingBlock = GetFloatContainingBlock(parentFrame);

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

@ -99,6 +99,7 @@ LAYOUT_ATOM(brFrame, "BRFrame")
LAYOUT_ATOM(bulletFrame, "BulletFrame")
LAYOUT_ATOM(columnSetFrame, "ColumnSetFrame")
LAYOUT_ATOM(fieldSetFrame, "FieldSetFrame")
LAYOUT_ATOM(frameSetFrame, "FrameSetFrame")
LAYOUT_ATOM(gfxButtonControlFrame, "gfxButtonControlFrame")
LAYOUT_ATOM(HTMLCanvasFrame, "HTMLCanvasFrame")
LAYOUT_ATOM(subDocumentFrame, "subDocumentFrame")

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

@ -70,6 +70,7 @@
#include "nsCSSAnonBoxes.h"
#include "nsAutoPtr.h"
#include "nsStyleSet.h"
#include "nsLayoutAtoms.h"
// masks for mEdgeVisibility
#define LEFT_VIS 0x0001
@ -1263,6 +1264,12 @@ nsHTMLFramesetFrame::Reflow(nsPresContext* aPresContext,
return NS_OK;
}
nsIAtom*
nsHTMLFramesetFrame::GetType() const
{
return nsLayoutAtoms::frameSetFrame;
}
PRBool
nsHTMLFramesetFrame::IsLeaf() const
{

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

@ -152,6 +152,8 @@ public:
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
virtual nsIAtom* GetType() const;
virtual PRBool IsLeaf() const;
NS_IMETHOD VerifyTree() const;