Bug 64945: XML prettyprinting final stage. Implements document.removeBinding and drops the prettyprint binding when the document is modified. Also turn on prettyprinting by default.

r=jkeiser,hyatt,bz sr=rpotts a=asa
This commit is contained in:
sicking%bigfoot.com 2002-10-22 06:07:52 +00:00
parent 496eb2fa30
commit 886cde781d
4 changed files with 60 additions and 0 deletions

View File

@ -288,6 +288,10 @@ public:
NS_IMETHOD CancelReflowCommand(nsIFrame* aTargetFrame, nsReflowType* aCmdType) = 0;
NS_IMETHOD CancelAllReflowCommands() = 0;
/**
* Recreates the frames for a node
*/
NS_IMETHOD RecreateFramesFor(nsIContent* aContent) = 0;
/**
* Determine if it is safe to flush all pending notifications

View File

@ -1068,6 +1068,11 @@ public:
NS_IMETHOD IsSafeToFlush(PRBool& aIsSafeToFlush);
NS_IMETHOD FlushPendingNotifications(PRBool aUpdateViews);
/**
* Recreates the frames for a node
*/
NS_IMETHOD RecreateFramesFor(nsIContent* aContent);
/**
* Post a request to handle a DOM event after Reflow has finished.
*/
@ -3873,6 +3878,27 @@ PresShell::CancelAllReflowCommands()
return NS_OK;
}
NS_IMETHODIMP
PresShell::RecreateFramesFor(nsIContent* aContent)
{
NS_ENSURE_TRUE(mPresContext, NS_ERROR_FAILURE);
nsCOMPtr<nsIStyleSet> styleSet;
nsresult rv = GetStyleSet(getter_AddRefs(styleSet));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIStyleFrameConstruction> frameConstruction;
rv = styleSet->GetStyleFrameConstruction(getter_AddRefs(frameConstruction));
NS_ENSURE_SUCCESS(rv, rv);
// Don't call RecreateFramesForContent since that is not exported and we want
// to keep the number of entrypoints down.
nsStyleChangeList changeList;
changeList.AppendChange(nsnull, aContent, nsChangeHint_ReconstructFrame);
return frameConstruction->ProcessRestyledFrames(changeList, mPresContext);
}
NS_IMETHODIMP
PresShell::ClearFrameRefs(nsIFrame* aFrame)
{

View File

@ -288,6 +288,10 @@ public:
NS_IMETHOD CancelReflowCommand(nsIFrame* aTargetFrame, nsReflowType* aCmdType) = 0;
NS_IMETHOD CancelAllReflowCommands() = 0;
/**
* Recreates the frames for a node
*/
NS_IMETHOD RecreateFramesFor(nsIContent* aContent) = 0;
/**
* Determine if it is safe to flush all pending notifications

View File

@ -1068,6 +1068,11 @@ public:
NS_IMETHOD IsSafeToFlush(PRBool& aIsSafeToFlush);
NS_IMETHOD FlushPendingNotifications(PRBool aUpdateViews);
/**
* Recreates the frames for a node
*/
NS_IMETHOD RecreateFramesFor(nsIContent* aContent);
/**
* Post a request to handle a DOM event after Reflow has finished.
*/
@ -3873,6 +3878,27 @@ PresShell::CancelAllReflowCommands()
return NS_OK;
}
NS_IMETHODIMP
PresShell::RecreateFramesFor(nsIContent* aContent)
{
NS_ENSURE_TRUE(mPresContext, NS_ERROR_FAILURE);
nsCOMPtr<nsIStyleSet> styleSet;
nsresult rv = GetStyleSet(getter_AddRefs(styleSet));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIStyleFrameConstruction> frameConstruction;
rv = styleSet->GetStyleFrameConstruction(getter_AddRefs(frameConstruction));
NS_ENSURE_SUCCESS(rv, rv);
// Don't call RecreateFramesForContent since that is not exported and we want
// to keep the number of entrypoints down.
nsStyleChangeList changeList;
changeList.AppendChange(nsnull, aContent, nsChangeHint_ReconstructFrame);
return frameConstruction->ProcessRestyledFrames(changeList, mPresContext);
}
NS_IMETHODIMP
PresShell::ClearFrameRefs(nsIFrame* aFrame)
{