Remove |aPresContext| and |aPresShell| parameters from |nsIFrameManager| methods. b=208190 r+sr=bzbarsky
git-svn-id: svn://10.0.0.236/trunk@143961 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
519cf3b3d3
commit
80187c571f
@ -4257,7 +4257,7 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresShell* aPresShell,
|
||||
aState.mFrameState = historyState;
|
||||
if (aState.mFrameState && aState.mFrameManager) {
|
||||
// Restore frame state for the entire subtree of |comboboxFrame|.
|
||||
aState.mFrameManager->RestoreFrameState(aPresContext, comboboxFrame,
|
||||
aState.mFrameManager->RestoreFrameState(comboboxFrame,
|
||||
aState.mFrameState);
|
||||
}
|
||||
} else {
|
||||
@ -4354,7 +4354,7 @@ nsCSSFrameConstructor::InitializeSelectFrame(nsIPresShell* aPresShell,
|
||||
|
||||
if (aState.mFrameState && aState.mFrameManager) {
|
||||
// Restore frame state for the scroll frame
|
||||
aState.mFrameManager->RestoreFrameStateFor(aPresContext, scrollFrame, aState.mFrameState);
|
||||
aState.mFrameManager->RestoreFrameStateFor(scrollFrame, aState.mFrameState);
|
||||
}
|
||||
|
||||
// The area frame is a floater container
|
||||
@ -6710,8 +6710,7 @@ nsCSSFrameConstructor::InitAndRestoreFrame(nsIPresContext* aPresContext
|
||||
|
||||
if (aState.mFrameState && aState.mFrameManager) {
|
||||
// Restore frame state for just the newly created frame.
|
||||
aState.mFrameManager->RestoreFrameStateFor(aPresContext, aNewFrame,
|
||||
aState.mFrameState);
|
||||
aState.mFrameManager->RestoreFrameStateFor(aNewFrame, aState.mFrameState);
|
||||
}
|
||||
|
||||
return rv;
|
||||
@ -7443,8 +7442,7 @@ nsCSSFrameConstructor::ReconstructDocElementHierarchy(nsIPresContext* aPresConte
|
||||
NS_ASSERTION(docParentFrame, "should have a parent frame");
|
||||
if (docParentFrame) {
|
||||
// Remove the old document element hieararchy
|
||||
rv = state.mFrameManager->RemoveFrame(aPresContext, *shell,
|
||||
docParentFrame, nsnull,
|
||||
rv = state.mFrameManager->RemoveFrame(docParentFrame, nsnull,
|
||||
docElementFrame);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// Remove any existing fixed items: they are always on the FixedContainingBlock
|
||||
@ -7459,15 +7457,15 @@ nsCSSFrameConstructor::ReconstructDocElementHierarchy(nsIPresContext* aPresConte
|
||||
newChild);
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = state.mFrameManager->InsertFrames(aPresContext, *shell,
|
||||
docParentFrame, nsnull,
|
||||
rv = state.mFrameManager->InsertFrames(docParentFrame, nsnull,
|
||||
nsnull, newChild);
|
||||
|
||||
// Tell the fixed containing block about its 'fixed' frames
|
||||
if (state.mFixedItems.childList) {
|
||||
state.mFrameManager->InsertFrames(aPresContext, *shell,
|
||||
mFixedContainingBlock, nsLayoutAtoms::fixedList,
|
||||
nsnull, state.mFixedItems.childList);
|
||||
state.mFrameManager->InsertFrames(mFixedContainingBlock,
|
||||
nsLayoutAtoms::fixedList,
|
||||
nsnull,
|
||||
state.mFixedItems.childList);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -7670,7 +7668,7 @@ nsCSSFrameConstructor::AppendFrames(nsIPresContext* aPresContext,
|
||||
nsFrameList frames(firstChild);
|
||||
|
||||
// Insert the frames before the :after pseudo-element.
|
||||
return aFrameManager->InsertFrames(aPresContext, *aPresShell, aParentFrame,
|
||||
return aFrameManager->InsertFrames(aParentFrame,
|
||||
nsnull, frames.GetPrevSiblingFor(afterFrame),
|
||||
aFrameList);
|
||||
}
|
||||
@ -7689,7 +7687,7 @@ nsCSSFrameConstructor::AppendFrames(nsIPresContext* aPresContext,
|
||||
// table column
|
||||
nsIFrame* parentFrame = aParentFrame;
|
||||
aFrameList->GetParent(&parentFrame);
|
||||
rv = aFrameManager->AppendFrames(aPresContext, *aPresShell, parentFrame,
|
||||
rv = aFrameManager->AppendFrames(parentFrame,
|
||||
nsLayoutAtoms::colGroupList, aFrameList);
|
||||
}
|
||||
else if (nsLayoutAtoms::tableColGroupFrame == childType) {
|
||||
@ -7697,22 +7695,21 @@ nsCSSFrameConstructor::AppendFrames(nsIPresContext* aPresContext,
|
||||
nsIFrame* prevSibling;
|
||||
PRBool doAppend = nsTableColGroupFrame::GetLastRealColGroup(tableFrame, &prevSibling);
|
||||
if (doAppend) {
|
||||
rv = aFrameManager->AppendFrames(aPresContext, *aPresShell, aParentFrame,
|
||||
rv = aFrameManager->AppendFrames(aParentFrame,
|
||||
nsLayoutAtoms::colGroupList, aFrameList);
|
||||
}
|
||||
else {
|
||||
rv = aFrameManager->InsertFrames(aPresContext, *aPresShell, aParentFrame,
|
||||
rv = aFrameManager->InsertFrames(aParentFrame,
|
||||
nsLayoutAtoms::colGroupList, prevSibling, aFrameList);
|
||||
}
|
||||
}
|
||||
else if (nsLayoutAtoms::tableCaptionFrame == childType) {
|
||||
// table caption
|
||||
rv = aFrameManager->AppendFrames(aPresContext, *aPresShell, aParentFrame,
|
||||
rv = aFrameManager->AppendFrames(aParentFrame,
|
||||
nsLayoutAtoms::captionList, aFrameList);
|
||||
}
|
||||
else {
|
||||
rv = aFrameManager->AppendFrames(aPresContext, *aPresShell, aParentFrame,
|
||||
nsnull, aFrameList);
|
||||
rv = aFrameManager->AppendFrames(aParentFrame, nsnull, aFrameList);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@ -7720,12 +7717,11 @@ nsCSSFrameConstructor::AppendFrames(nsIPresContext* aPresContext,
|
||||
// check for a table caption which goes on an additional child list with a different parent
|
||||
nsIFrame* outerTableFrame;
|
||||
if (GetCaptionAdjustedParent(aParentFrame, aFrameList, &outerTableFrame)) {
|
||||
rv = aFrameManager->AppendFrames(aPresContext, *aPresShell, outerTableFrame,
|
||||
rv = aFrameManager->AppendFrames(outerTableFrame,
|
||||
nsLayoutAtoms::captionList, aFrameList);
|
||||
}
|
||||
else {
|
||||
rv = aFrameManager->AppendFrames(aPresContext, *aPresShell, aParentFrame,
|
||||
nsnull, aFrameList);
|
||||
rv = aFrameManager->AppendFrames(aParentFrame, nsnull, aFrameList);
|
||||
}
|
||||
}
|
||||
|
||||
@ -8600,8 +8596,7 @@ nsCSSFrameConstructor::AddDummyFrameToSelect(nsIPresContext* aPresContext,
|
||||
nsCOMPtr<nsIFrameManager> frameManager;
|
||||
aPresShell->GetFrameManager(getter_AddRefs(frameManager));
|
||||
if (frameManager) {
|
||||
frameManager->AppendFrames(aPresContext, *aPresShell,
|
||||
aParentFrame, nsnull, generatedFrame);
|
||||
frameManager->AppendFrames(aParentFrame, nsnull, generatedFrame);
|
||||
}
|
||||
}
|
||||
|
||||
@ -8655,8 +8650,7 @@ nsCSSFrameConstructor::RemoveDummyFrameFromSelect(nsIPresContext* aPresContext,
|
||||
aPresShell->GetFrameManager(getter_AddRefs(frameManager));
|
||||
DeletingFrameSubtree(aPresContext, aPresShell, frameManager,
|
||||
dummyFrame);
|
||||
frameManager->RemoveFrame(aPresContext, *aPresShell,
|
||||
parentFrame, nsnull, dummyFrame);
|
||||
frameManager->RemoveFrame(parentFrame, nsnull, dummyFrame);
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
@ -9147,11 +9141,11 @@ nsCSSFrameConstructor::ContentInserted(nsIPresContext* aPresContext,
|
||||
if (GetCaptionAdjustedParent(parentFrame, newFrame, &outerTableFrame)) {
|
||||
// XXXwaterson this seems wrong; i.e., how can we assume
|
||||
// that appending is the right thing to do here?
|
||||
state.mFrameManager->AppendFrames(aPresContext, *shell, outerTableFrame,
|
||||
state.mFrameManager->AppendFrames(outerTableFrame,
|
||||
nsLayoutAtoms::captionList, newFrame);
|
||||
}
|
||||
else {
|
||||
state.mFrameManager->InsertFrames(aPresContext, *shell, parentFrame,
|
||||
state.mFrameManager->InsertFrames(parentFrame,
|
||||
nsnull, prevSibling, newFrame);
|
||||
}
|
||||
}
|
||||
@ -9428,7 +9422,7 @@ DeletingFrameSubtree(nsIPresContext* aPresContext,
|
||||
getter_AddRefs(listName));
|
||||
|
||||
// Ask the parent to delete the out-of-flow frame
|
||||
aFrameManager->RemoveFrame(aPresContext, *aPresShell, parentFrame,
|
||||
aFrameManager->RemoveFrame(parentFrame,
|
||||
listName, outOfFlowFrame);
|
||||
}
|
||||
}
|
||||
@ -9703,8 +9697,7 @@ nsCSSFrameConstructor::ContentRemoved(nsIPresContext* aPresContext,
|
||||
if (placeholderFrame) {
|
||||
placeholderFrame->GetParent(&parentFrame);
|
||||
DeletingFrameSubtree(aPresContext, shell, frameManager, placeholderFrame);
|
||||
rv = frameManager->RemoveFrame(aPresContext, *shell, parentFrame,
|
||||
nsnull, placeholderFrame);
|
||||
rv = frameManager->RemoveFrame(parentFrame, nsnull, placeholderFrame);
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
@ -9728,7 +9721,7 @@ nsCSSFrameConstructor::ContentRemoved(nsIPresContext* aPresContext,
|
||||
// remove the floater first (which gets rid of the lines
|
||||
// reference to the placeholder and floater) and then remove the
|
||||
// placeholder
|
||||
rv = frameManager->RemoveFrame(aPresContext, *shell, parentFrame,
|
||||
rv = frameManager->RemoveFrame(parentFrame,
|
||||
nsLayoutAtoms::floaterList, childFrame);
|
||||
|
||||
// Remove the placeholder frame first (XXX second for now) (so
|
||||
@ -9736,7 +9729,7 @@ nsCSSFrameConstructor::ContentRemoved(nsIPresContext* aPresContext,
|
||||
if (nsnull != placeholderFrame) {
|
||||
placeholderFrame->GetParent(&parentFrame);
|
||||
DeletingFrameSubtree(aPresContext, shell, frameManager, placeholderFrame);
|
||||
rv = frameManager->RemoveFrame(aPresContext, *shell, parentFrame,
|
||||
rv = frameManager->RemoveFrame(parentFrame,
|
||||
nsnull, placeholderFrame);
|
||||
}
|
||||
}
|
||||
@ -9753,15 +9746,14 @@ nsCSSFrameConstructor::ContentRemoved(nsIPresContext* aPresContext,
|
||||
|
||||
// Generate two notifications. First for the absolutely positioned
|
||||
// frame
|
||||
rv = frameManager->RemoveFrame(aPresContext, *shell, parentFrame,
|
||||
rv = frameManager->RemoveFrame(parentFrame,
|
||||
(NS_STYLE_POSITION_FIXED == display->mPosition) ?
|
||||
nsLayoutAtoms::fixedList : nsLayoutAtoms::absoluteList, childFrame);
|
||||
|
||||
// Now the placeholder frame
|
||||
if (nsnull != placeholderFrame) {
|
||||
placeholderFrame->GetParent(&parentFrame);
|
||||
rv = frameManager->RemoveFrame(aPresContext, *shell, parentFrame, nsnull,
|
||||
placeholderFrame);
|
||||
rv = frameManager->RemoveFrame(parentFrame, nsnull, placeholderFrame);
|
||||
}
|
||||
|
||||
} else {
|
||||
@ -9769,12 +9761,11 @@ nsCSSFrameConstructor::ContentRemoved(nsIPresContext* aPresContext,
|
||||
// check for a table caption which goes on an additional child list with a different parent
|
||||
nsIFrame* outerTableFrame;
|
||||
if (GetCaptionAdjustedParent(parentFrame, childFrame, &outerTableFrame)) {
|
||||
rv = frameManager->RemoveFrame(aPresContext, *shell, outerTableFrame,
|
||||
rv = frameManager->RemoveFrame(outerTableFrame,
|
||||
nsLayoutAtoms::captionList, childFrame);
|
||||
}
|
||||
else {
|
||||
rv = frameManager->RemoveFrame(aPresContext, *shell, insertionPoint,
|
||||
nsnull, childFrame);
|
||||
rv = frameManager->RemoveFrame(insertionPoint, nsnull, childFrame);
|
||||
}
|
||||
}
|
||||
|
||||
@ -10296,7 +10287,7 @@ nsCSSFrameConstructor::ContentStatesChanged(nsIPresContext* aPresContext,
|
||||
if (primaryFrame1) {
|
||||
nsStyleChangeList changeList;
|
||||
nsChangeHint frameChange = NS_STYLE_HINT_NONE;
|
||||
frameManager->ComputeStyleChangeFor(aPresContext, primaryFrame1,
|
||||
frameManager->ComputeStyleChangeFor(primaryFrame1,
|
||||
kNameSpaceID_Unknown, nsnull,
|
||||
changeList, NS_STYLE_HINT_NONE,
|
||||
frameChange);
|
||||
@ -10326,7 +10317,7 @@ nsCSSFrameConstructor::ContentStatesChanged(nsIPresContext* aPresContext,
|
||||
if (primaryFrame2) {
|
||||
nsStyleChangeList changeList;
|
||||
nsChangeHint frameChange = NS_STYLE_HINT_NONE;
|
||||
frameManager->ComputeStyleChangeFor(aPresContext, primaryFrame2,
|
||||
frameManager->ComputeStyleChangeFor(primaryFrame2,
|
||||
kNameSpaceID_Unknown, nsnull,
|
||||
changeList, NS_STYLE_HINT_NONE, frameChange);
|
||||
if (app2) {
|
||||
@ -10484,14 +10475,14 @@ nsCSSFrameConstructor::AttributeChanged(nsIPresContext* aPresContext,
|
||||
shell->GetFrameManager(getter_AddRefs(frameManager));
|
||||
|
||||
PRBool affects;
|
||||
frameManager->HasAttributeDependentStyle(aPresContext, aContent,
|
||||
frameManager->HasAttributeDependentStyle(aContent,
|
||||
aAttribute, aModType, &affects);
|
||||
if (affects) {
|
||||
#ifdef DEBUG_shaver
|
||||
fputc('+', stderr);
|
||||
#endif
|
||||
// there is an effect, so compute it
|
||||
frameManager->ComputeStyleChangeFor(aPresContext, primaryFrame,
|
||||
frameManager->ComputeStyleChangeFor(primaryFrame,
|
||||
aNameSpaceID, aAttribute,
|
||||
changeList, aHint, maxHint);
|
||||
} else {
|
||||
@ -10763,8 +10754,7 @@ nsCSSFrameConstructor::CantRenderReplacedElement(nsIPresShell* aPresShell,
|
||||
|
||||
// Replace the old frame with the new frame
|
||||
// XXXbz If this fails, we leak the content node newFrame points to!
|
||||
frameManager->ReplaceFrame(aPresContext, *presShell, parentFrame,
|
||||
listName, aFrame, newFrame);
|
||||
frameManager->ReplaceFrame(parentFrame, listName, aFrame, newFrame);
|
||||
|
||||
// Now that we've replaced the primary frame, if there's a placeholder
|
||||
// frame then complete the transition from image frame to new frame
|
||||
@ -10848,8 +10838,8 @@ nsCSSFrameConstructor::CantRenderReplacedElement(nsIPresShell* aPresShell,
|
||||
NS_ASSERTION(IsPlaceholderFrame(newFrame), "unexpected frame type");
|
||||
|
||||
// Replace the old placeholder frame with the new placeholder frame
|
||||
state.mFrameManager->ReplaceFrame(aPresContext, *presShell, inFlowParent,
|
||||
nsnull, placeholderFrame, newFrame);
|
||||
state.mFrameManager->ReplaceFrame(inFlowParent, nsnull,
|
||||
placeholderFrame, newFrame);
|
||||
}
|
||||
|
||||
// Replace the primary frame
|
||||
@ -10904,8 +10894,8 @@ nsCSSFrameConstructor::CantRenderReplacedElement(nsIPresShell* aPresShell,
|
||||
}
|
||||
DeletingFrameSubtree(aPresContext, presShell,
|
||||
state.mFrameManager, aFrame);
|
||||
state.mFrameManager->ReplaceFrame(aPresContext, *presShell, parentFrame,
|
||||
listName, aFrame, newFrame);
|
||||
state.mFrameManager->ReplaceFrame(parentFrame, listName, aFrame,
|
||||
newFrame);
|
||||
|
||||
// Reset the primary frame mapping. Don't assume that
|
||||
// ConstructFrameByDisplayType() has done this
|
||||
@ -11755,7 +11745,7 @@ nsCSSFrameConstructor::CaptureStateFor(nsIPresContext* aPresContext,
|
||||
nsCOMPtr<nsIFrameManager> frameManager;
|
||||
rv = presShell->GetFrameManager(getter_AddRefs(frameManager));
|
||||
if (NS_SUCCEEDED(rv) && frameManager) {
|
||||
rv = frameManager->CaptureFrameState(aPresContext, aFrame, aHistoryState);
|
||||
rv = frameManager->CaptureFrameState(aFrame, aHistoryState);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -12197,8 +12187,7 @@ nsCSSFrameConstructor::AppendFirstLineFrames(
|
||||
ReparentFrame(aPresContext, lineFrame, firstLineStyle, kid);
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
aState.mFrameManager->AppendFrames(aPresContext, *aState.mPresShell,
|
||||
lineFrame, nsnull, firstInlineFrame);
|
||||
aState.mFrameManager->AppendFrames(lineFrame, nsnull, firstInlineFrame);
|
||||
|
||||
// The remaining frames get appended to the block frame
|
||||
if (remainingFrames) {
|
||||
@ -12246,8 +12235,7 @@ nsCSSFrameConstructor::InsertFirstLineFrames(
|
||||
if (isInline) {
|
||||
// Easy case: the new inline frame will go into the lineFrame.
|
||||
ReparentFrame(aPresContext, lineFrame, firstLineStyle, newFrame);
|
||||
aState.mFrameManager->InsertFrames(aPresContext, *aState.mPresShell,
|
||||
lineFrame, nsnull, nsnull,
|
||||
aState.mFrameManager->InsertFrames(lineFrame, nsnull, nsnull,
|
||||
newFrame);
|
||||
|
||||
// Since the frame is going into the lineFrame, don't let it
|
||||
@ -12797,8 +12785,7 @@ nsCSSFrameConstructor::RemoveFloatingFirstLetterFrames(
|
||||
nsSplittableFrame::BreakFromPrevFlow(nextTextFrame);
|
||||
DeletingFrameSubtree(aPresContext, aPresShell,
|
||||
aFrameManager, nextTextFrame);
|
||||
aFrameManager->RemoveFrame(aPresContext, *aPresShell, nextTextParent,
|
||||
nsnull, nextTextFrame);
|
||||
aFrameManager->RemoveFrame(nextTextParent, nsnull, nextTextFrame);
|
||||
}
|
||||
}
|
||||
|
||||
@ -12825,16 +12812,14 @@ nsCSSFrameConstructor::RemoveFloatingFirstLetterFrames(
|
||||
|
||||
// Remove the floater frame
|
||||
DeletingFrameSubtree(aPresContext, aPresShell, aFrameManager, floater);
|
||||
aFrameManager->RemoveFrame(aPresContext, *aPresShell,
|
||||
aBlockFrame, nsLayoutAtoms::floaterList,
|
||||
aFrameManager->RemoveFrame(aBlockFrame, nsLayoutAtoms::floaterList,
|
||||
floater);
|
||||
|
||||
// Remove placeholder frame
|
||||
aFrameManager->RemoveFrame(aPresContext, *aPresShell,
|
||||
parentFrame, nsnull, placeholderFrame);
|
||||
aFrameManager->RemoveFrame(parentFrame, nsnull, placeholderFrame);
|
||||
|
||||
// Insert text frame in its place
|
||||
aFrameManager->InsertFrames(aPresContext, *aPresShell, parentFrame, nsnull,
|
||||
aFrameManager->InsertFrames(parentFrame, nsnull,
|
||||
prevSibling, newTextFrame);
|
||||
|
||||
return NS_OK;
|
||||
@ -12883,11 +12868,10 @@ nsCSSFrameConstructor::RemoveFirstLetterFrames(nsIPresContext* aPresContext,
|
||||
// Next rip out the kid and replace it with the text frame
|
||||
nsIFrameManager* frameManager = aFrameManager;
|
||||
DeletingFrameSubtree(aPresContext, aPresShell, frameManager, kid);
|
||||
frameManager->RemoveFrame(aPresContext, *aPresShell,
|
||||
aFrame, nsnull, kid);
|
||||
frameManager->RemoveFrame(aFrame, nsnull, kid);
|
||||
|
||||
// Insert text frame in its place
|
||||
frameManager->InsertFrames(aPresContext, *aPresShell, aFrame, nsnull,
|
||||
frameManager->InsertFrames(aFrame, nsnull,
|
||||
prevSibling, textFrame);
|
||||
|
||||
*aStopLooking = PR_TRUE;
|
||||
@ -14025,8 +14009,7 @@ nsresult nsCSSFrameConstructor::RemoveFixedItems(nsIPresContext* aPresContext,
|
||||
if (fixedChild) {
|
||||
DeletingFrameSubtree(aPresContext, aPresShell, aFrameManager,
|
||||
fixedChild);
|
||||
rv = aFrameManager->RemoveFrame(aPresContext, *aPresShell,
|
||||
mFixedContainingBlock,
|
||||
rv = aFrameManager->RemoveFrame(mFixedContainingBlock,
|
||||
nsLayoutAtoms::fixedList,
|
||||
fixedChild);
|
||||
if (NS_FAILED(rv)) {
|
||||
|
||||
@ -286,10 +286,11 @@ public:
|
||||
NS_IMETHOD SetRootFrame(nsIFrame* aRootFrame);
|
||||
|
||||
// Get the canvas frame: searches from the Root frame down, may be null
|
||||
NS_IMETHOD GetCanvasFrame(nsIPresContext* aPresContext, nsIFrame** aCanvasFrame) const;
|
||||
NS_IMETHOD GetCanvasFrame(nsIFrame** aCanvasFrame) const;
|
||||
|
||||
// Primary frame functions
|
||||
NS_IMETHOD GetPrimaryFrameFor(nsIContent* aContent, nsIFrame** aPrimaryFrame);
|
||||
NS_IMETHOD GetPrimaryFrameFor(nsIContent* aContent,
|
||||
nsIFrame** aPrimaryFrame);
|
||||
NS_IMETHOD SetPrimaryFrameFor(nsIContent* aContent,
|
||||
nsIFrame* aPrimaryFrame);
|
||||
NS_IMETHOD ClearPrimaryFrameMap();
|
||||
@ -303,73 +304,60 @@ public:
|
||||
|
||||
// Undisplayed content functions
|
||||
virtual nsStyleContext* GetUndisplayedContent(nsIContent* aContent);
|
||||
virtual void SetUndisplayedContent(nsIContent* aContent, nsStyleContext* aStyleContext);
|
||||
virtual void ChangeUndisplayedContent(nsIContent* aContent, nsStyleContext* aStyleContext);
|
||||
NS_IMETHOD ClearUndisplayedContentIn(nsIContent* aContent, nsIContent* aParentContent);
|
||||
virtual void SetUndisplayedContent(nsIContent* aContent,
|
||||
nsStyleContext* aStyleContext);
|
||||
virtual void ChangeUndisplayedContent(nsIContent* aContent,
|
||||
nsStyleContext* aStyleContext);
|
||||
NS_IMETHOD ClearUndisplayedContentIn(nsIContent* aContent,
|
||||
nsIContent* aParentContent);
|
||||
NS_IMETHOD ClearAllUndisplayedContentIn(nsIContent* aParentContent);
|
||||
NS_IMETHOD ClearUndisplayedContentMap();
|
||||
|
||||
// Functions for manipulating the frame model
|
||||
NS_IMETHOD AppendFrames(nsIPresContext* aPresContext,
|
||||
nsIPresShell& aPresShell,
|
||||
nsIFrame* aParentFrame,
|
||||
NS_IMETHOD AppendFrames(nsIFrame* aParentFrame,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aFrameList);
|
||||
NS_IMETHOD InsertFrames(nsIPresContext* aPresContext,
|
||||
nsIPresShell& aPresShell,
|
||||
nsIFrame* aParentFrame,
|
||||
NS_IMETHOD InsertFrames(nsIFrame* aParentFrame,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aPrevFrame,
|
||||
nsIFrame* aFrameList);
|
||||
NS_IMETHOD RemoveFrame(nsIPresContext* aPresContext,
|
||||
nsIPresShell& aPresShell,
|
||||
nsIFrame* aParentFrame,
|
||||
NS_IMETHOD RemoveFrame(nsIFrame* aParentFrame,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aOldFrame);
|
||||
NS_IMETHOD ReplaceFrame(nsIPresContext* aPresContext,
|
||||
nsIPresShell& aPresShell,
|
||||
nsIFrame* aParentFrame,
|
||||
NS_IMETHOD ReplaceFrame(nsIFrame* aParentFrame,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aOldFrame,
|
||||
nsIFrame* aNewFrame);
|
||||
|
||||
NS_IMETHOD CantRenderReplacedElement(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame);
|
||||
NS_IMETHOD CantRenderReplacedElement(nsIFrame* aFrame);
|
||||
|
||||
NS_IMETHOD NotifyDestroyingFrame(nsIFrame* aFrame);
|
||||
|
||||
NS_IMETHOD ReParentStyleContext(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
NS_IMETHOD ReParentStyleContext(nsIFrame* aFrame,
|
||||
nsStyleContext* aNewParentContext);
|
||||
NS_IMETHOD ComputeStyleChangeFor(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
NS_IMETHOD ComputeStyleChangeFor(nsIFrame* aFrame,
|
||||
PRInt32 aAttrNameSpaceID,
|
||||
nsIAtom* aAttribute,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aMinChange,
|
||||
nsChangeHint& aTopLevelChange);
|
||||
NS_IMETHOD HasAttributeDependentStyle(nsIPresContext *aPresContext,
|
||||
nsIContent *aContent,
|
||||
NS_IMETHOD HasAttributeDependentStyle(nsIContent *aContent,
|
||||
nsIAtom *aAttribute,
|
||||
PRInt32 aModType,
|
||||
PRBool *aResult);
|
||||
|
||||
// Capture state from the entire frame heirarchy and store in aState
|
||||
NS_IMETHOD CaptureFrameState(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
NS_IMETHOD CaptureFrameState(nsIFrame* aFrame,
|
||||
nsILayoutHistoryState* aState);
|
||||
NS_IMETHOD RestoreFrameState(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
NS_IMETHOD RestoreFrameState(nsIFrame* aFrame,
|
||||
nsILayoutHistoryState* aState);
|
||||
// Add/restore state for one frame (special, global type, like scroll position)
|
||||
NS_IMETHOD CaptureFrameStateFor(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
nsILayoutHistoryState* aState,
|
||||
nsIStatefulFrame::SpecialStateID aID = nsIStatefulFrame::eNoID);
|
||||
NS_IMETHOD RestoreFrameStateFor(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
nsILayoutHistoryState* aState,
|
||||
nsIStatefulFrame::SpecialStateID aID = nsIStatefulFrame::eNoID);
|
||||
NS_IMETHOD CaptureFrameStateFor(nsIFrame* aFrame,
|
||||
nsILayoutHistoryState* aState,
|
||||
nsIStatefulFrame::SpecialStateID aID = nsIStatefulFrame::eNoID);
|
||||
NS_IMETHOD RestoreFrameStateFor(nsIFrame* aFrame,
|
||||
nsILayoutHistoryState* aState,
|
||||
nsIStatefulFrame::SpecialStateID aID = nsIStatefulFrame::eNoID);
|
||||
// Gets and sets properties on a given frame
|
||||
NS_IMETHOD GetFrameProperty(nsIFrame* aFrame,
|
||||
nsIAtom* aPropertyName,
|
||||
@ -383,7 +371,7 @@ public:
|
||||
nsIAtom* aPropertyName);
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHOD DebugVerifyStyleTree(nsIPresContext* aPresContext, nsIFrame* aFrame);
|
||||
NS_IMETHOD DebugVerifyStyleTree(nsIFrame* aFrame);
|
||||
#endif
|
||||
|
||||
struct PropertyList {
|
||||
@ -405,6 +393,12 @@ public:
|
||||
};
|
||||
private:
|
||||
|
||||
nsIPresShell* GetPresShell() const { return mPresShell; }
|
||||
nsIPresContext* GetPresContext() const {
|
||||
return mPresShell->GetPresContext();
|
||||
}
|
||||
nsIStyleSet* GetStyleSet() const { return mStyleSet; }
|
||||
|
||||
nsIPresShell* mPresShell; // weak link, because the pres shell owns us
|
||||
nsIStyleSet* mStyleSet; // weak link. pres shell holds a reference
|
||||
nsIFrame* mRootFrame;
|
||||
@ -543,11 +537,11 @@ FrameManager::SetRootFrame(nsIFrame* aRootFrame)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
FrameManager::GetCanvasFrame(nsIPresContext* aPresContext, nsIFrame** aCanvasFrame) const
|
||||
FrameManager::GetCanvasFrame(nsIFrame** aCanvasFrame) const
|
||||
{
|
||||
NS_ENSURE_TRUE(mPresShell, NS_ERROR_NOT_AVAILABLE);
|
||||
NS_PRECONDITION(aCanvasFrame, "aCanvasFrame argument cannot be null");
|
||||
NS_PRECONDITION(aPresContext, "aPresContext argument cannot be null");
|
||||
nsIPresContext *presContext = GetPresContext();
|
||||
|
||||
*aCanvasFrame = nsnull;
|
||||
if (mRootFrame) {
|
||||
@ -569,7 +563,7 @@ FrameManager::GetCanvasFrame(nsIPresContext* aPresContext, nsIFrame** aCanvasFra
|
||||
}
|
||||
}
|
||||
// move on to the child's child
|
||||
childFrame->FirstChild(aPresContext, nsnull, &childFrame);
|
||||
childFrame->FirstChild(presContext, nsnull, &childFrame);
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
@ -955,21 +949,17 @@ FrameManager::ClearUndisplayedContentMap()
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
NS_IMETHODIMP
|
||||
FrameManager::AppendFrames(nsIPresContext* aPresContext,
|
||||
nsIPresShell& aPresShell,
|
||||
nsIFrame* aParentFrame,
|
||||
FrameManager::AppendFrames(nsIFrame* aParentFrame,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aFrameList)
|
||||
{
|
||||
NS_ENSURE_TRUE(mPresShell, NS_ERROR_NOT_AVAILABLE);
|
||||
return aParentFrame->AppendFrames(aPresContext, aPresShell, aListName,
|
||||
aFrameList);
|
||||
return aParentFrame->AppendFrames(GetPresContext(), *GetPresShell(),
|
||||
aListName, aFrameList);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
FrameManager::InsertFrames(nsIPresContext* aPresContext,
|
||||
nsIPresShell& aPresShell,
|
||||
nsIFrame* aParentFrame,
|
||||
FrameManager::InsertFrames(nsIFrame* aParentFrame,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aPrevFrame,
|
||||
nsIFrame* aFrameList)
|
||||
@ -989,14 +979,12 @@ FrameManager::InsertFrames(nsIPresContext* aPresContext,
|
||||
}
|
||||
#endif // IBMBIDI
|
||||
|
||||
return aParentFrame->InsertFrames(aPresContext, aPresShell, aListName,
|
||||
aPrevFrame, aFrameList);
|
||||
return aParentFrame->InsertFrames(GetPresContext(), *GetPresShell(),
|
||||
aListName, aPrevFrame, aFrameList);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
FrameManager::RemoveFrame(nsIPresContext* aPresContext,
|
||||
nsIPresShell& aPresShell,
|
||||
nsIFrame* aParentFrame,
|
||||
FrameManager::RemoveFrame(nsIFrame* aParentFrame,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aOldFrame)
|
||||
{
|
||||
@ -1007,25 +995,23 @@ FrameManager::RemoveFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* nextBidi;
|
||||
GetFrameProperty(aOldFrame, nsLayoutAtoms::nextBidi, 0, (void**) &nextBidi);
|
||||
if (nextBidi) {
|
||||
RemoveFrame(aPresContext, aPresShell, aParentFrame, aListName, nextBidi);
|
||||
RemoveFrame(aParentFrame, aListName, nextBidi);
|
||||
}
|
||||
#endif // IBMBIDI
|
||||
|
||||
return aParentFrame->RemoveFrame(aPresContext, aPresShell, aListName,
|
||||
aOldFrame);
|
||||
return aParentFrame->RemoveFrame(GetPresContext(), *GetPresShell(),
|
||||
aListName, aOldFrame);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
FrameManager::ReplaceFrame(nsIPresContext* aPresContext,
|
||||
nsIPresShell& aPresShell,
|
||||
nsIFrame* aParentFrame,
|
||||
FrameManager::ReplaceFrame(nsIFrame* aParentFrame,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aOldFrame,
|
||||
nsIFrame* aNewFrame)
|
||||
{
|
||||
NS_ENSURE_TRUE(mPresShell, NS_ERROR_NOT_AVAILABLE);
|
||||
return aParentFrame->ReplaceFrame(aPresContext, aPresShell, aListName,
|
||||
aOldFrame, aNewFrame);
|
||||
return aParentFrame->ReplaceFrame(GetPresContext(), *GetPresShell(),
|
||||
aListName, aOldFrame, aNewFrame);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@ -1264,8 +1250,7 @@ nsresult CantRenderReplacedElementEvent::RemoveLoadGroupRequest()
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
FrameManager::CantRenderReplacedElement(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame)
|
||||
FrameManager::CantRenderReplacedElement(nsIFrame* aFrame)
|
||||
{
|
||||
NS_ENSURE_TRUE(mPresShell, NS_ERROR_NOT_AVAILABLE);
|
||||
#ifdef NOISY_EVENTS
|
||||
@ -1488,13 +1473,13 @@ VerifyStyleTree(nsIPresContext* aPresContext, nsIFrame* aFrame, nsStyleContext*
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
FrameManager::DebugVerifyStyleTree(nsIPresContext* aPresContext, nsIFrame* aFrame)
|
||||
FrameManager::DebugVerifyStyleTree(nsIFrame* aFrame)
|
||||
{
|
||||
NS_ENSURE_TRUE(mPresShell, NS_ERROR_NOT_AVAILABLE);
|
||||
if (aFrame) {
|
||||
nsStyleContext* context = aFrame->GetStyleContext();
|
||||
nsStyleContext* parentContext = context->GetParent();
|
||||
VerifyStyleTree(aPresContext, aFrame, parentContext);
|
||||
VerifyStyleTree(GetPresContext(), aFrame, parentContext);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
@ -1502,22 +1487,22 @@ FrameManager::DebugVerifyStyleTree(nsIPresContext* aPresContext, nsIFrame* aFram
|
||||
#endif // DEBUG
|
||||
|
||||
NS_IMETHODIMP
|
||||
FrameManager::ReParentStyleContext(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
FrameManager::ReParentStyleContext(nsIFrame* aFrame,
|
||||
nsStyleContext* aNewParentContext)
|
||||
{
|
||||
NS_ENSURE_TRUE(mPresShell, NS_ERROR_NOT_AVAILABLE);
|
||||
nsresult result = NS_ERROR_NULL_POINTER;
|
||||
if (aFrame) {
|
||||
#ifdef NS_DEBUG
|
||||
DebugVerifyStyleTree(aPresContext, aFrame);
|
||||
DebugVerifyStyleTree(aFrame);
|
||||
#endif
|
||||
|
||||
nsStyleContext* oldContext = aFrame->GetStyleContext();
|
||||
if (oldContext) {
|
||||
nsIPresContext *presContext = GetPresContext();
|
||||
nsRefPtr<nsStyleContext> newContext;
|
||||
result = NS_OK;
|
||||
newContext = mStyleSet->ReParentStyleContext(aPresContext, oldContext,
|
||||
newContext = mStyleSet->ReParentStyleContext(presContext, oldContext,
|
||||
aNewParentContext);
|
||||
if (newContext) {
|
||||
if (newContext != oldContext) {
|
||||
@ -1528,7 +1513,7 @@ FrameManager::ReParentStyleContext(nsIPresContext* aPresContext,
|
||||
|
||||
do {
|
||||
child = nsnull;
|
||||
result = aFrame->FirstChild(aPresContext, childList, &child);
|
||||
result = aFrame->FirstChild(presContext, childList, &child);
|
||||
while ((NS_SUCCEEDED(result)) && child) {
|
||||
nsFrameState state;
|
||||
child->GetFrameState(&state);
|
||||
@ -1540,14 +1525,14 @@ FrameManager::ReParentStyleContext(nsIPresContext* aPresContext,
|
||||
nsIFrame* outOfFlowFrame = ((nsPlaceholderFrame*)child)->GetOutOfFlowFrame();
|
||||
NS_ASSERTION(outOfFlowFrame, "no out-of-flow frame");
|
||||
|
||||
result = ReParentStyleContext(aPresContext, outOfFlowFrame, newContext);
|
||||
result = ReParentStyleContext(outOfFlowFrame, newContext);
|
||||
|
||||
// reparent placeholder's context under out of flow frame
|
||||
nsStyleContext* outOfFlowContext = outOfFlowFrame->GetStyleContext();
|
||||
ReParentStyleContext(aPresContext, child, outOfFlowContext);
|
||||
ReParentStyleContext(child, outOfFlowContext);
|
||||
}
|
||||
else { // regular frame
|
||||
result = ReParentStyleContext(aPresContext, child, newContext);
|
||||
result = ReParentStyleContext(child, newContext);
|
||||
}
|
||||
NS_IF_RELEASE(frameType);
|
||||
}
|
||||
@ -1559,7 +1544,7 @@ FrameManager::ReParentStyleContext(nsIPresContext* aPresContext,
|
||||
aFrame->GetAdditionalChildListName(listIndex++, &childList);
|
||||
} while (childList);
|
||||
|
||||
aFrame->SetStyleContext(aPresContext, newContext);
|
||||
aFrame->SetStyleContext(presContext, newContext);
|
||||
|
||||
// do additional contexts
|
||||
PRInt32 contextIndex = -1;
|
||||
@ -1567,7 +1552,7 @@ FrameManager::ReParentStyleContext(nsIPresContext* aPresContext,
|
||||
nsStyleContext* oldExtraContext = aFrame->GetAdditionalStyleContext(++contextIndex);
|
||||
if (oldExtraContext) {
|
||||
nsRefPtr<nsStyleContext> newExtraContext;
|
||||
newExtraContext = mStyleSet->ReParentStyleContext(aPresContext,
|
||||
newExtraContext = mStyleSet->ReParentStyleContext(presContext,
|
||||
oldExtraContext,
|
||||
newContext);
|
||||
if (newExtraContext) {
|
||||
@ -1580,7 +1565,7 @@ FrameManager::ReParentStyleContext(nsIPresContext* aPresContext,
|
||||
}
|
||||
}
|
||||
#ifdef NS_DEBUG
|
||||
VerifyStyleTree(aPresContext, aFrame, aNewParentContext);
|
||||
VerifyStyleTree(aFrame, aNewParentContext);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@ -2003,8 +1988,7 @@ FrameManager::ReResolveStyleContext(nsIPresContext* aPresContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
FrameManager::ComputeStyleChangeFor(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
FrameManager::ComputeStyleChangeFor(nsIFrame* aFrame,
|
||||
PRInt32 aAttrNameSpaceID,
|
||||
nsIAtom* aAttribute,
|
||||
nsStyleChangeList& aChangeList,
|
||||
@ -2033,7 +2017,7 @@ FrameManager::ComputeStyleChangeFor(nsIPresContext* aPresContext,
|
||||
do {
|
||||
// Inner loop over next-in-flows of the current frame
|
||||
nsChangeHint frameChange;
|
||||
ReResolveStyleContext(aPresContext, frame, nsnull,
|
||||
ReResolveStyleContext(GetPresContext(), frame, nsnull,
|
||||
aAttrNameSpaceID, aAttribute,
|
||||
aChangeList, aTopLevelChange, frameChange);
|
||||
NS_UpdateHint(aTopLevelChange, frameChange);
|
||||
@ -2069,8 +2053,7 @@ FrameManager::ComputeStyleChangeFor(nsIPresContext* aPresContext,
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
FrameManager::HasAttributeDependentStyle(nsIPresContext *aPresContext,
|
||||
nsIContent *aContent,
|
||||
FrameManager::HasAttributeDependentStyle(nsIContent *aContent,
|
||||
nsIAtom *aAttribute,
|
||||
PRInt32 aModType,
|
||||
PRBool *aResult)
|
||||
@ -2085,7 +2068,7 @@ FrameManager::HasAttributeDependentStyle(nsIPresContext *aPresContext,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return mStyleSet->HasAttributeDependentStyle(aPresContext, aContent,
|
||||
return mStyleSet->HasAttributeDependentStyle(GetPresContext(), aContent,
|
||||
aAttribute, aModType,
|
||||
aResult);
|
||||
}
|
||||
@ -2093,8 +2076,7 @@ FrameManager::HasAttributeDependentStyle(nsIPresContext *aPresContext,
|
||||
// Capture state for a given frame.
|
||||
// Accept a content id here, in some cases we may not have content (scroll position)
|
||||
NS_IMETHODIMP
|
||||
FrameManager::CaptureFrameStateFor(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
FrameManager::CaptureFrameStateFor(nsIFrame* aFrame,
|
||||
nsILayoutHistoryState* aState,
|
||||
nsIStatefulFrame::SpecialStateID aID)
|
||||
{
|
||||
@ -2110,7 +2092,7 @@ FrameManager::CaptureFrameStateFor(nsIPresContext* aPresContext,
|
||||
// Capture the state, exit early if we get null (nothing to save)
|
||||
nsCOMPtr<nsIPresState> frameState;
|
||||
nsresult rv = NS_OK;
|
||||
rv = statefulFrame->SaveState(aPresContext, getter_AddRefs(frameState));
|
||||
rv = statefulFrame->SaveState(GetPresContext(), getter_AddRefs(frameState));
|
||||
if (!frameState) {
|
||||
return NS_OK;
|
||||
}
|
||||
@ -2131,24 +2113,23 @@ FrameManager::CaptureFrameStateFor(nsIPresContext* aPresContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
FrameManager::CaptureFrameState(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
FrameManager::CaptureFrameState(nsIFrame* aFrame,
|
||||
nsILayoutHistoryState* aState)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
NS_ENSURE_TRUE(mPresShell, NS_ERROR_NOT_AVAILABLE);
|
||||
NS_PRECONDITION(nsnull != aFrame && nsnull != aState, "null parameters passed in");
|
||||
|
||||
rv = CaptureFrameStateFor(aPresContext, aFrame, aState);
|
||||
rv = CaptureFrameStateFor(aFrame, aState);
|
||||
|
||||
// Now capture state recursively for the frame hierarchy rooted at aFrame
|
||||
nsIAtom* childListName = nsnull;
|
||||
PRInt32 childListIndex = 0;
|
||||
do {
|
||||
nsIFrame* childFrame;
|
||||
aFrame->FirstChild(aPresContext, childListName, &childFrame);
|
||||
aFrame->FirstChild(GetPresContext(), childListName, &childFrame);
|
||||
while (childFrame) {
|
||||
rv = CaptureFrameState(aPresContext, childFrame, aState);
|
||||
rv = CaptureFrameState(childFrame, aState);
|
||||
// Get the next sibling child frame
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
}
|
||||
@ -2162,7 +2143,9 @@ FrameManager::CaptureFrameState(nsIPresContext* aPresContext,
|
||||
// Restore state for a given frame.
|
||||
// Accept a content id here, in some cases we may not have content (scroll position)
|
||||
NS_IMETHODIMP
|
||||
FrameManager::RestoreFrameStateFor(nsIPresContext* aPresContext, nsIFrame* aFrame, nsILayoutHistoryState* aState, nsIStatefulFrame::SpecialStateID aID)
|
||||
FrameManager::RestoreFrameStateFor(nsIFrame* aFrame,
|
||||
nsILayoutHistoryState* aState,
|
||||
nsIStatefulFrame::SpecialStateID aID)
|
||||
{
|
||||
NS_ENSURE_TRUE(mPresShell && aFrame && aState, NS_ERROR_FAILURE);
|
||||
|
||||
@ -2198,7 +2181,7 @@ FrameManager::RestoreFrameStateFor(nsIPresContext* aPresContext, nsIFrame* aFram
|
||||
}
|
||||
|
||||
// Restore it
|
||||
rv = statefulFrame->RestoreState(aPresContext, frameState);
|
||||
rv = statefulFrame->RestoreState(GetPresContext(), frameState);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// If we restore ok, remove the state from the state table
|
||||
@ -2206,22 +2189,22 @@ FrameManager::RestoreFrameStateFor(nsIPresContext* aPresContext, nsIFrame* aFram
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
FrameManager::RestoreFrameState(nsIPresContext* aPresContext, nsIFrame* aFrame, nsILayoutHistoryState* aState)
|
||||
FrameManager::RestoreFrameState(nsIFrame* aFrame, nsILayoutHistoryState* aState)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
NS_ENSURE_TRUE(mPresShell, NS_ERROR_NOT_AVAILABLE);
|
||||
NS_PRECONDITION(nsnull != aFrame && nsnull != aState, "null parameters passed in");
|
||||
|
||||
rv = RestoreFrameStateFor(aPresContext, aFrame, aState);
|
||||
rv = RestoreFrameStateFor(aFrame, aState);
|
||||
|
||||
// Now restore state recursively for the frame hierarchy rooted at aFrame
|
||||
nsIAtom* childListName = nsnull;
|
||||
PRInt32 childListIndex = 0;
|
||||
do {
|
||||
nsIFrame* childFrame;
|
||||
aFrame->FirstChild(aPresContext, childListName, &childFrame);
|
||||
aFrame->FirstChild(GetPresContext(), childListName, &childFrame);
|
||||
while (childFrame) {
|
||||
rv = RestoreFrameState(aPresContext, childFrame, aState);
|
||||
rv = RestoreFrameState(childFrame, aState);
|
||||
// Get the next sibling child frame
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
}
|
||||
|
||||
@ -344,8 +344,7 @@ public:
|
||||
* The content object associated with aFrame should either be a IMG
|
||||
* element, an OBJECT element, or an APPLET element
|
||||
*/
|
||||
NS_IMETHOD CantRenderReplacedElement(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame) = 0;
|
||||
NS_IMETHOD CantRenderReplacedElement(nsIFrame* aFrame) = 0;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -1008,7 +1008,7 @@ nsPresContext::ReParentStyleContext(nsIFrame* aFrame,
|
||||
nsCOMPtr<nsIFrameManager> manager;
|
||||
nsresult rv = mShell->GetFrameManager(getter_AddRefs(manager));
|
||||
if (NS_SUCCEEDED(rv) && manager) {
|
||||
rv = manager->ReParentStyleContext(this, aFrame, aNewParentContext);
|
||||
rv = manager->ReParentStyleContext(aFrame, aNewParentContext);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -1124,8 +1124,7 @@ public:
|
||||
NS_IMETHOD ClearFrameRefs(nsIFrame* aFrame);
|
||||
NS_IMETHOD CreateRenderingContext(nsIFrame *aFrame,
|
||||
nsIRenderingContext** aContext);
|
||||
NS_IMETHOD CantRenderReplacedElement(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame);
|
||||
NS_IMETHOD CantRenderReplacedElement(nsIFrame* aFrame);
|
||||
NS_IMETHOD GoToAnchor(const nsAString& aAnchorName, PRBool aScroll);
|
||||
|
||||
NS_IMETHOD ScrollFrameIntoView(nsIFrame *aFrame,
|
||||
@ -3672,7 +3671,7 @@ PresShell::EndLoad(nsIDocument *aDocument)
|
||||
nsIFrame* scrollFrame = nsnull;
|
||||
GetRootScrollFrame(mPresContext, rootFrame, &scrollFrame);
|
||||
if (scrollFrame) {
|
||||
mFrameManager->RestoreFrameStateFor(mPresContext, scrollFrame, historyState, nsIStatefulFrame::eDocumentScrollState);
|
||||
mFrameManager->RestoreFrameStateFor(scrollFrame, historyState, nsIStatefulFrame::eDocumentScrollState);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3985,11 +3984,10 @@ PresShell::CreateRenderingContext(nsIFrame *aFrame,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PresShell::CantRenderReplacedElement(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame)
|
||||
PresShell::CantRenderReplacedElement(nsIFrame* aFrame)
|
||||
{
|
||||
if (mFrameManager) {
|
||||
return mFrameManager->CantRenderReplacedElement(aPresContext, aFrame);
|
||||
return mFrameManager->CantRenderReplacedElement(aFrame);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
@ -4737,12 +4735,12 @@ PresShell::CaptureHistoryState(nsILayoutHistoryState** aState, PRBool aLeavingPa
|
||||
nsIFrame* scrollFrame = nsnull;
|
||||
rv = GetRootScrollFrame(mPresContext, rootFrame, &scrollFrame);
|
||||
if (scrollFrame) {
|
||||
rv = mFrameManager->CaptureFrameStateFor(mPresContext, scrollFrame, historyState, nsIStatefulFrame::eDocumentScrollState);
|
||||
rv = mFrameManager->CaptureFrameStateFor(scrollFrame, historyState, nsIStatefulFrame::eDocumentScrollState);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
rv = mFrameManager->CaptureFrameState(mPresContext, rootFrame, historyState);
|
||||
rv = mFrameManager->CaptureFrameState(rootFrame, historyState);
|
||||
|
||||
return rv;
|
||||
}
|
||||
@ -5561,9 +5559,9 @@ PresShell::ReconstructStyleData(PRBool aRebuildRuleTree)
|
||||
}
|
||||
|
||||
nsChangeHint frameChange = NS_STYLE_HINT_NONE;
|
||||
frameManager->ComputeStyleChangeFor(mPresContext, rootFrame,
|
||||
kNameSpaceID_Unknown, nsnull,
|
||||
changeList, NS_STYLE_HINT_NONE, frameChange);
|
||||
frameManager->ComputeStyleChangeFor(rootFrame, kNameSpaceID_Unknown, nsnull,
|
||||
changeList, NS_STYLE_HINT_NONE,
|
||||
frameChange);
|
||||
|
||||
if (frameChange & nsChangeHint_ReconstructDoc)
|
||||
set->ReconstructDocElementHierarchy(mPresContext);
|
||||
|
||||
@ -91,7 +91,7 @@ public:
|
||||
|
||||
// Get the canvas frame. The canvas frame may or may not exist, so the
|
||||
// argument aCanvasFrame may be nsnull.
|
||||
NS_IMETHOD GetCanvasFrame(nsIPresContext* aPresContext, nsIFrame** aCanvasFrame) const = 0;
|
||||
NS_IMETHOD GetCanvasFrame(nsIFrame** aCanvasFrame) const = 0;
|
||||
|
||||
// Primary frame functions
|
||||
NS_IMETHOD GetPrimaryFrameFor(nsIContent* aContent, nsIFrame** aPrimaryFrame) = 0;
|
||||
@ -117,32 +117,23 @@ public:
|
||||
NS_IMETHOD ClearUndisplayedContentMap() = 0;
|
||||
|
||||
// Functions for manipulating the frame model
|
||||
NS_IMETHOD AppendFrames(nsIPresContext* aPresContext,
|
||||
nsIPresShell& aPresShell,
|
||||
nsIFrame* aParentFrame,
|
||||
NS_IMETHOD AppendFrames(nsIFrame* aParentFrame,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aFrameList) = 0;
|
||||
NS_IMETHOD InsertFrames(nsIPresContext* aPresContext,
|
||||
nsIPresShell& aPresShell,
|
||||
nsIFrame* aParentFrame,
|
||||
NS_IMETHOD InsertFrames(nsIFrame* aParentFrame,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aPrevFrame,
|
||||
nsIFrame* aFrameList) = 0;
|
||||
NS_IMETHOD RemoveFrame(nsIPresContext* aPresContext,
|
||||
nsIPresShell& aPresShell,
|
||||
nsIFrame* aParentFrame,
|
||||
NS_IMETHOD RemoveFrame(nsIFrame* aParentFrame,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aOldFrame) = 0;
|
||||
NS_IMETHOD ReplaceFrame(nsIPresContext* aPresContext,
|
||||
nsIPresShell& aPresShell,
|
||||
nsIFrame* aParentFrame,
|
||||
NS_IMETHOD ReplaceFrame(nsIFrame* aParentFrame,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aOldFrame,
|
||||
nsIFrame* aNewFrame) = 0;
|
||||
|
||||
// Notification that we were unable to render a replaced element
|
||||
NS_IMETHOD CantRenderReplacedElement(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame) = 0;
|
||||
NS_IMETHOD CantRenderReplacedElement(nsIFrame* aFrame) = 0;
|
||||
|
||||
// Notification that a frame is about to be destroyed. This allows any outstanding
|
||||
// references to the frame to be cleaned up
|
||||
@ -150,13 +141,11 @@ public:
|
||||
|
||||
// reparent the style contexts of this frame sub tree to live under the
|
||||
// new given parent style context
|
||||
NS_IMETHOD ReParentStyleContext(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
NS_IMETHOD ReParentStyleContext(nsIFrame* aFrame,
|
||||
nsStyleContext* aNewParentContext) = 0;
|
||||
|
||||
// Re-resolve style contexts for frame tree
|
||||
NS_IMETHOD ComputeStyleChangeFor(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
NS_IMETHOD ComputeStyleChangeFor(nsIFrame* aFrame,
|
||||
PRInt32 aAttrNameSpaceID,
|
||||
nsIAtom* aAttribute,
|
||||
nsStyleChangeList& aChangeList,
|
||||
@ -164,8 +153,7 @@ public:
|
||||
nsChangeHint& aTopLevelChange) = 0;
|
||||
|
||||
// Determine whether an attribute affects style
|
||||
NS_IMETHOD HasAttributeDependentStyle(nsIPresContext* aPresContext,
|
||||
nsIContent *aContent,
|
||||
NS_IMETHOD HasAttributeDependentStyle(nsIContent *aContent,
|
||||
nsIAtom *aAttribute,
|
||||
PRInt32 aModType,
|
||||
PRBool *aResult) = 0;
|
||||
@ -175,21 +163,17 @@ public:
|
||||
* aState is the document state storage object onto which each frame
|
||||
* stores its state.
|
||||
*/
|
||||
NS_IMETHOD CaptureFrameState(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
NS_IMETHOD CaptureFrameState(nsIFrame* aFrame,
|
||||
nsILayoutHistoryState* aState) = 0;
|
||||
NS_IMETHOD RestoreFrameState(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
NS_IMETHOD RestoreFrameState(nsIFrame* aFrame,
|
||||
nsILayoutHistoryState* aState) = 0;
|
||||
// Add/restore state for one frame (special, global type, like scroll position)
|
||||
NS_IMETHOD CaptureFrameStateFor(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
nsILayoutHistoryState* aState,
|
||||
nsIStatefulFrame::SpecialStateID aID = nsIStatefulFrame::eNoID) = 0;
|
||||
NS_IMETHOD RestoreFrameStateFor(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
nsILayoutHistoryState* aState,
|
||||
nsIStatefulFrame::SpecialStateID aID = nsIStatefulFrame::eNoID) = 0;
|
||||
NS_IMETHOD CaptureFrameStateFor(nsIFrame* aFrame,
|
||||
nsILayoutHistoryState* aState,
|
||||
nsIStatefulFrame::SpecialStateID aID = nsIStatefulFrame::eNoID) = 0;
|
||||
NS_IMETHOD RestoreFrameStateFor(nsIFrame* aFrame,
|
||||
nsILayoutHistoryState* aState,
|
||||
nsIStatefulFrame::SpecialStateID aID = nsIStatefulFrame::eNoID) = 0;
|
||||
|
||||
/**
|
||||
* Gets a property value for a given frame.
|
||||
@ -250,7 +234,7 @@ public:
|
||||
/**
|
||||
* DEBUG ONLY method to verify integrity of style tree versus frame tree
|
||||
*/
|
||||
NS_IMETHOD DebugVerifyStyleTree(nsIPresContext* aPresContext, nsIFrame* aFrame) = 0;
|
||||
NS_IMETHOD DebugVerifyStyleTree(nsIFrame* aFrame) = 0;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@ -344,8 +344,7 @@ public:
|
||||
* The content object associated with aFrame should either be a IMG
|
||||
* element, an OBJECT element, or an APPLET element
|
||||
*/
|
||||
NS_IMETHOD CantRenderReplacedElement(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame) = 0;
|
||||
NS_IMETHOD CantRenderReplacedElement(nsIFrame* aFrame) = 0;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -1008,7 +1008,7 @@ nsPresContext::ReParentStyleContext(nsIFrame* aFrame,
|
||||
nsCOMPtr<nsIFrameManager> manager;
|
||||
nsresult rv = mShell->GetFrameManager(getter_AddRefs(manager));
|
||||
if (NS_SUCCEEDED(rv) && manager) {
|
||||
rv = manager->ReParentStyleContext(this, aFrame, aNewParentContext);
|
||||
rv = manager->ReParentStyleContext(aFrame, aNewParentContext);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -340,7 +340,7 @@ nsHTMLButtonControlFrame::SetInitialChildList(nsIPresContext* aPresContext,
|
||||
frame->SetParent(mFrames.FirstChild());
|
||||
// now reparent the contexts for the reparented frame too
|
||||
if (frameManager) {
|
||||
frameManager->ReParentStyleContext(aPresContext,frame,newParentContext);
|
||||
frameManager->ReParentStyleContext(frame, newParentContext);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -519,8 +519,7 @@ nsImageFrame::HandleLoadError(nsresult aStatus, nsIPresShell* aPresShell)
|
||||
// ObjectFrame, not us (we're an anonymous frame then)....
|
||||
nsIFrame* primaryFrame = nsnull;
|
||||
aPresShell->GetPrimaryFrameFor(mContent, &primaryFrame);
|
||||
aPresShell->CantRenderReplacedElement(mPresContext,
|
||||
primaryFrame ? primaryFrame : this);
|
||||
aPresShell->CantRenderReplacedElement(primaryFrame ? primaryFrame : this);
|
||||
return NS_ERROR_FRAME_REPLACED;
|
||||
}
|
||||
|
||||
|
||||
@ -1194,7 +1194,7 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext,
|
||||
//check for alternative content with CantRenderReplacedElement()
|
||||
nsIPresShell* presShell;
|
||||
aPresContext->GetShell(&presShell);
|
||||
rv = presShell->CantRenderReplacedElement(aPresContext, this);
|
||||
rv = presShell->CantRenderReplacedElement(this);
|
||||
NS_RELEASE(presShell);
|
||||
} else {
|
||||
NotifyContentObjectWrapper();
|
||||
|
||||
@ -286,10 +286,11 @@ public:
|
||||
NS_IMETHOD SetRootFrame(nsIFrame* aRootFrame);
|
||||
|
||||
// Get the canvas frame: searches from the Root frame down, may be null
|
||||
NS_IMETHOD GetCanvasFrame(nsIPresContext* aPresContext, nsIFrame** aCanvasFrame) const;
|
||||
NS_IMETHOD GetCanvasFrame(nsIFrame** aCanvasFrame) const;
|
||||
|
||||
// Primary frame functions
|
||||
NS_IMETHOD GetPrimaryFrameFor(nsIContent* aContent, nsIFrame** aPrimaryFrame);
|
||||
NS_IMETHOD GetPrimaryFrameFor(nsIContent* aContent,
|
||||
nsIFrame** aPrimaryFrame);
|
||||
NS_IMETHOD SetPrimaryFrameFor(nsIContent* aContent,
|
||||
nsIFrame* aPrimaryFrame);
|
||||
NS_IMETHOD ClearPrimaryFrameMap();
|
||||
@ -303,73 +304,60 @@ public:
|
||||
|
||||
// Undisplayed content functions
|
||||
virtual nsStyleContext* GetUndisplayedContent(nsIContent* aContent);
|
||||
virtual void SetUndisplayedContent(nsIContent* aContent, nsStyleContext* aStyleContext);
|
||||
virtual void ChangeUndisplayedContent(nsIContent* aContent, nsStyleContext* aStyleContext);
|
||||
NS_IMETHOD ClearUndisplayedContentIn(nsIContent* aContent, nsIContent* aParentContent);
|
||||
virtual void SetUndisplayedContent(nsIContent* aContent,
|
||||
nsStyleContext* aStyleContext);
|
||||
virtual void ChangeUndisplayedContent(nsIContent* aContent,
|
||||
nsStyleContext* aStyleContext);
|
||||
NS_IMETHOD ClearUndisplayedContentIn(nsIContent* aContent,
|
||||
nsIContent* aParentContent);
|
||||
NS_IMETHOD ClearAllUndisplayedContentIn(nsIContent* aParentContent);
|
||||
NS_IMETHOD ClearUndisplayedContentMap();
|
||||
|
||||
// Functions for manipulating the frame model
|
||||
NS_IMETHOD AppendFrames(nsIPresContext* aPresContext,
|
||||
nsIPresShell& aPresShell,
|
||||
nsIFrame* aParentFrame,
|
||||
NS_IMETHOD AppendFrames(nsIFrame* aParentFrame,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aFrameList);
|
||||
NS_IMETHOD InsertFrames(nsIPresContext* aPresContext,
|
||||
nsIPresShell& aPresShell,
|
||||
nsIFrame* aParentFrame,
|
||||
NS_IMETHOD InsertFrames(nsIFrame* aParentFrame,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aPrevFrame,
|
||||
nsIFrame* aFrameList);
|
||||
NS_IMETHOD RemoveFrame(nsIPresContext* aPresContext,
|
||||
nsIPresShell& aPresShell,
|
||||
nsIFrame* aParentFrame,
|
||||
NS_IMETHOD RemoveFrame(nsIFrame* aParentFrame,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aOldFrame);
|
||||
NS_IMETHOD ReplaceFrame(nsIPresContext* aPresContext,
|
||||
nsIPresShell& aPresShell,
|
||||
nsIFrame* aParentFrame,
|
||||
NS_IMETHOD ReplaceFrame(nsIFrame* aParentFrame,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aOldFrame,
|
||||
nsIFrame* aNewFrame);
|
||||
|
||||
NS_IMETHOD CantRenderReplacedElement(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame);
|
||||
NS_IMETHOD CantRenderReplacedElement(nsIFrame* aFrame);
|
||||
|
||||
NS_IMETHOD NotifyDestroyingFrame(nsIFrame* aFrame);
|
||||
|
||||
NS_IMETHOD ReParentStyleContext(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
NS_IMETHOD ReParentStyleContext(nsIFrame* aFrame,
|
||||
nsStyleContext* aNewParentContext);
|
||||
NS_IMETHOD ComputeStyleChangeFor(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
NS_IMETHOD ComputeStyleChangeFor(nsIFrame* aFrame,
|
||||
PRInt32 aAttrNameSpaceID,
|
||||
nsIAtom* aAttribute,
|
||||
nsStyleChangeList& aChangeList,
|
||||
nsChangeHint aMinChange,
|
||||
nsChangeHint& aTopLevelChange);
|
||||
NS_IMETHOD HasAttributeDependentStyle(nsIPresContext *aPresContext,
|
||||
nsIContent *aContent,
|
||||
NS_IMETHOD HasAttributeDependentStyle(nsIContent *aContent,
|
||||
nsIAtom *aAttribute,
|
||||
PRInt32 aModType,
|
||||
PRBool *aResult);
|
||||
|
||||
// Capture state from the entire frame heirarchy and store in aState
|
||||
NS_IMETHOD CaptureFrameState(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
NS_IMETHOD CaptureFrameState(nsIFrame* aFrame,
|
||||
nsILayoutHistoryState* aState);
|
||||
NS_IMETHOD RestoreFrameState(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
NS_IMETHOD RestoreFrameState(nsIFrame* aFrame,
|
||||
nsILayoutHistoryState* aState);
|
||||
// Add/restore state for one frame (special, global type, like scroll position)
|
||||
NS_IMETHOD CaptureFrameStateFor(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
nsILayoutHistoryState* aState,
|
||||
nsIStatefulFrame::SpecialStateID aID = nsIStatefulFrame::eNoID);
|
||||
NS_IMETHOD RestoreFrameStateFor(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
nsILayoutHistoryState* aState,
|
||||
nsIStatefulFrame::SpecialStateID aID = nsIStatefulFrame::eNoID);
|
||||
NS_IMETHOD CaptureFrameStateFor(nsIFrame* aFrame,
|
||||
nsILayoutHistoryState* aState,
|
||||
nsIStatefulFrame::SpecialStateID aID = nsIStatefulFrame::eNoID);
|
||||
NS_IMETHOD RestoreFrameStateFor(nsIFrame* aFrame,
|
||||
nsILayoutHistoryState* aState,
|
||||
nsIStatefulFrame::SpecialStateID aID = nsIStatefulFrame::eNoID);
|
||||
// Gets and sets properties on a given frame
|
||||
NS_IMETHOD GetFrameProperty(nsIFrame* aFrame,
|
||||
nsIAtom* aPropertyName,
|
||||
@ -383,7 +371,7 @@ public:
|
||||
nsIAtom* aPropertyName);
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
NS_IMETHOD DebugVerifyStyleTree(nsIPresContext* aPresContext, nsIFrame* aFrame);
|
||||
NS_IMETHOD DebugVerifyStyleTree(nsIFrame* aFrame);
|
||||
#endif
|
||||
|
||||
struct PropertyList {
|
||||
@ -405,6 +393,12 @@ public:
|
||||
};
|
||||
private:
|
||||
|
||||
nsIPresShell* GetPresShell() const { return mPresShell; }
|
||||
nsIPresContext* GetPresContext() const {
|
||||
return mPresShell->GetPresContext();
|
||||
}
|
||||
nsIStyleSet* GetStyleSet() const { return mStyleSet; }
|
||||
|
||||
nsIPresShell* mPresShell; // weak link, because the pres shell owns us
|
||||
nsIStyleSet* mStyleSet; // weak link. pres shell holds a reference
|
||||
nsIFrame* mRootFrame;
|
||||
@ -543,11 +537,11 @@ FrameManager::SetRootFrame(nsIFrame* aRootFrame)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
FrameManager::GetCanvasFrame(nsIPresContext* aPresContext, nsIFrame** aCanvasFrame) const
|
||||
FrameManager::GetCanvasFrame(nsIFrame** aCanvasFrame) const
|
||||
{
|
||||
NS_ENSURE_TRUE(mPresShell, NS_ERROR_NOT_AVAILABLE);
|
||||
NS_PRECONDITION(aCanvasFrame, "aCanvasFrame argument cannot be null");
|
||||
NS_PRECONDITION(aPresContext, "aPresContext argument cannot be null");
|
||||
nsIPresContext *presContext = GetPresContext();
|
||||
|
||||
*aCanvasFrame = nsnull;
|
||||
if (mRootFrame) {
|
||||
@ -569,7 +563,7 @@ FrameManager::GetCanvasFrame(nsIPresContext* aPresContext, nsIFrame** aCanvasFra
|
||||
}
|
||||
}
|
||||
// move on to the child's child
|
||||
childFrame->FirstChild(aPresContext, nsnull, &childFrame);
|
||||
childFrame->FirstChild(presContext, nsnull, &childFrame);
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
@ -955,21 +949,17 @@ FrameManager::ClearUndisplayedContentMap()
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
NS_IMETHODIMP
|
||||
FrameManager::AppendFrames(nsIPresContext* aPresContext,
|
||||
nsIPresShell& aPresShell,
|
||||
nsIFrame* aParentFrame,
|
||||
FrameManager::AppendFrames(nsIFrame* aParentFrame,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aFrameList)
|
||||
{
|
||||
NS_ENSURE_TRUE(mPresShell, NS_ERROR_NOT_AVAILABLE);
|
||||
return aParentFrame->AppendFrames(aPresContext, aPresShell, aListName,
|
||||
aFrameList);
|
||||
return aParentFrame->AppendFrames(GetPresContext(), *GetPresShell(),
|
||||
aListName, aFrameList);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
FrameManager::InsertFrames(nsIPresContext* aPresContext,
|
||||
nsIPresShell& aPresShell,
|
||||
nsIFrame* aParentFrame,
|
||||
FrameManager::InsertFrames(nsIFrame* aParentFrame,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aPrevFrame,
|
||||
nsIFrame* aFrameList)
|
||||
@ -989,14 +979,12 @@ FrameManager::InsertFrames(nsIPresContext* aPresContext,
|
||||
}
|
||||
#endif // IBMBIDI
|
||||
|
||||
return aParentFrame->InsertFrames(aPresContext, aPresShell, aListName,
|
||||
aPrevFrame, aFrameList);
|
||||
return aParentFrame->InsertFrames(GetPresContext(), *GetPresShell(),
|
||||
aListName, aPrevFrame, aFrameList);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
FrameManager::RemoveFrame(nsIPresContext* aPresContext,
|
||||
nsIPresShell& aPresShell,
|
||||
nsIFrame* aParentFrame,
|
||||
FrameManager::RemoveFrame(nsIFrame* aParentFrame,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aOldFrame)
|
||||
{
|
||||
@ -1007,25 +995,23 @@ FrameManager::RemoveFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* nextBidi;
|
||||
GetFrameProperty(aOldFrame, nsLayoutAtoms::nextBidi, 0, (void**) &nextBidi);
|
||||
if (nextBidi) {
|
||||
RemoveFrame(aPresContext, aPresShell, aParentFrame, aListName, nextBidi);
|
||||
RemoveFrame(aParentFrame, aListName, nextBidi);
|
||||
}
|
||||
#endif // IBMBIDI
|
||||
|
||||
return aParentFrame->RemoveFrame(aPresContext, aPresShell, aListName,
|
||||
aOldFrame);
|
||||
return aParentFrame->RemoveFrame(GetPresContext(), *GetPresShell(),
|
||||
aListName, aOldFrame);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
FrameManager::ReplaceFrame(nsIPresContext* aPresContext,
|
||||
nsIPresShell& aPresShell,
|
||||
nsIFrame* aParentFrame,
|
||||
FrameManager::ReplaceFrame(nsIFrame* aParentFrame,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aOldFrame,
|
||||
nsIFrame* aNewFrame)
|
||||
{
|
||||
NS_ENSURE_TRUE(mPresShell, NS_ERROR_NOT_AVAILABLE);
|
||||
return aParentFrame->ReplaceFrame(aPresContext, aPresShell, aListName,
|
||||
aOldFrame, aNewFrame);
|
||||
return aParentFrame->ReplaceFrame(GetPresContext(), *GetPresShell(),
|
||||
aListName, aOldFrame, aNewFrame);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@ -1264,8 +1250,7 @@ nsresult CantRenderReplacedElementEvent::RemoveLoadGroupRequest()
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
FrameManager::CantRenderReplacedElement(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame)
|
||||
FrameManager::CantRenderReplacedElement(nsIFrame* aFrame)
|
||||
{
|
||||
NS_ENSURE_TRUE(mPresShell, NS_ERROR_NOT_AVAILABLE);
|
||||
#ifdef NOISY_EVENTS
|
||||
@ -1488,13 +1473,13 @@ VerifyStyleTree(nsIPresContext* aPresContext, nsIFrame* aFrame, nsStyleContext*
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
FrameManager::DebugVerifyStyleTree(nsIPresContext* aPresContext, nsIFrame* aFrame)
|
||||
FrameManager::DebugVerifyStyleTree(nsIFrame* aFrame)
|
||||
{
|
||||
NS_ENSURE_TRUE(mPresShell, NS_ERROR_NOT_AVAILABLE);
|
||||
if (aFrame) {
|
||||
nsStyleContext* context = aFrame->GetStyleContext();
|
||||
nsStyleContext* parentContext = context->GetParent();
|
||||
VerifyStyleTree(aPresContext, aFrame, parentContext);
|
||||
VerifyStyleTree(GetPresContext(), aFrame, parentContext);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
@ -1502,22 +1487,22 @@ FrameManager::DebugVerifyStyleTree(nsIPresContext* aPresContext, nsIFrame* aFram
|
||||
#endif // DEBUG
|
||||
|
||||
NS_IMETHODIMP
|
||||
FrameManager::ReParentStyleContext(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
FrameManager::ReParentStyleContext(nsIFrame* aFrame,
|
||||
nsStyleContext* aNewParentContext)
|
||||
{
|
||||
NS_ENSURE_TRUE(mPresShell, NS_ERROR_NOT_AVAILABLE);
|
||||
nsresult result = NS_ERROR_NULL_POINTER;
|
||||
if (aFrame) {
|
||||
#ifdef NS_DEBUG
|
||||
DebugVerifyStyleTree(aPresContext, aFrame);
|
||||
DebugVerifyStyleTree(aFrame);
|
||||
#endif
|
||||
|
||||
nsStyleContext* oldContext = aFrame->GetStyleContext();
|
||||
if (oldContext) {
|
||||
nsIPresContext *presContext = GetPresContext();
|
||||
nsRefPtr<nsStyleContext> newContext;
|
||||
result = NS_OK;
|
||||
newContext = mStyleSet->ReParentStyleContext(aPresContext, oldContext,
|
||||
newContext = mStyleSet->ReParentStyleContext(presContext, oldContext,
|
||||
aNewParentContext);
|
||||
if (newContext) {
|
||||
if (newContext != oldContext) {
|
||||
@ -1528,7 +1513,7 @@ FrameManager::ReParentStyleContext(nsIPresContext* aPresContext,
|
||||
|
||||
do {
|
||||
child = nsnull;
|
||||
result = aFrame->FirstChild(aPresContext, childList, &child);
|
||||
result = aFrame->FirstChild(presContext, childList, &child);
|
||||
while ((NS_SUCCEEDED(result)) && child) {
|
||||
nsFrameState state;
|
||||
child->GetFrameState(&state);
|
||||
@ -1540,14 +1525,14 @@ FrameManager::ReParentStyleContext(nsIPresContext* aPresContext,
|
||||
nsIFrame* outOfFlowFrame = ((nsPlaceholderFrame*)child)->GetOutOfFlowFrame();
|
||||
NS_ASSERTION(outOfFlowFrame, "no out-of-flow frame");
|
||||
|
||||
result = ReParentStyleContext(aPresContext, outOfFlowFrame, newContext);
|
||||
result = ReParentStyleContext(outOfFlowFrame, newContext);
|
||||
|
||||
// reparent placeholder's context under out of flow frame
|
||||
nsStyleContext* outOfFlowContext = outOfFlowFrame->GetStyleContext();
|
||||
ReParentStyleContext(aPresContext, child, outOfFlowContext);
|
||||
ReParentStyleContext(child, outOfFlowContext);
|
||||
}
|
||||
else { // regular frame
|
||||
result = ReParentStyleContext(aPresContext, child, newContext);
|
||||
result = ReParentStyleContext(child, newContext);
|
||||
}
|
||||
NS_IF_RELEASE(frameType);
|
||||
}
|
||||
@ -1559,7 +1544,7 @@ FrameManager::ReParentStyleContext(nsIPresContext* aPresContext,
|
||||
aFrame->GetAdditionalChildListName(listIndex++, &childList);
|
||||
} while (childList);
|
||||
|
||||
aFrame->SetStyleContext(aPresContext, newContext);
|
||||
aFrame->SetStyleContext(presContext, newContext);
|
||||
|
||||
// do additional contexts
|
||||
PRInt32 contextIndex = -1;
|
||||
@ -1567,7 +1552,7 @@ FrameManager::ReParentStyleContext(nsIPresContext* aPresContext,
|
||||
nsStyleContext* oldExtraContext = aFrame->GetAdditionalStyleContext(++contextIndex);
|
||||
if (oldExtraContext) {
|
||||
nsRefPtr<nsStyleContext> newExtraContext;
|
||||
newExtraContext = mStyleSet->ReParentStyleContext(aPresContext,
|
||||
newExtraContext = mStyleSet->ReParentStyleContext(presContext,
|
||||
oldExtraContext,
|
||||
newContext);
|
||||
if (newExtraContext) {
|
||||
@ -1580,7 +1565,7 @@ FrameManager::ReParentStyleContext(nsIPresContext* aPresContext,
|
||||
}
|
||||
}
|
||||
#ifdef NS_DEBUG
|
||||
VerifyStyleTree(aPresContext, aFrame, aNewParentContext);
|
||||
VerifyStyleTree(aFrame, aNewParentContext);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@ -2003,8 +1988,7 @@ FrameManager::ReResolveStyleContext(nsIPresContext* aPresContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
FrameManager::ComputeStyleChangeFor(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
FrameManager::ComputeStyleChangeFor(nsIFrame* aFrame,
|
||||
PRInt32 aAttrNameSpaceID,
|
||||
nsIAtom* aAttribute,
|
||||
nsStyleChangeList& aChangeList,
|
||||
@ -2033,7 +2017,7 @@ FrameManager::ComputeStyleChangeFor(nsIPresContext* aPresContext,
|
||||
do {
|
||||
// Inner loop over next-in-flows of the current frame
|
||||
nsChangeHint frameChange;
|
||||
ReResolveStyleContext(aPresContext, frame, nsnull,
|
||||
ReResolveStyleContext(GetPresContext(), frame, nsnull,
|
||||
aAttrNameSpaceID, aAttribute,
|
||||
aChangeList, aTopLevelChange, frameChange);
|
||||
NS_UpdateHint(aTopLevelChange, frameChange);
|
||||
@ -2069,8 +2053,7 @@ FrameManager::ComputeStyleChangeFor(nsIPresContext* aPresContext,
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
FrameManager::HasAttributeDependentStyle(nsIPresContext *aPresContext,
|
||||
nsIContent *aContent,
|
||||
FrameManager::HasAttributeDependentStyle(nsIContent *aContent,
|
||||
nsIAtom *aAttribute,
|
||||
PRInt32 aModType,
|
||||
PRBool *aResult)
|
||||
@ -2085,7 +2068,7 @@ FrameManager::HasAttributeDependentStyle(nsIPresContext *aPresContext,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return mStyleSet->HasAttributeDependentStyle(aPresContext, aContent,
|
||||
return mStyleSet->HasAttributeDependentStyle(GetPresContext(), aContent,
|
||||
aAttribute, aModType,
|
||||
aResult);
|
||||
}
|
||||
@ -2093,8 +2076,7 @@ FrameManager::HasAttributeDependentStyle(nsIPresContext *aPresContext,
|
||||
// Capture state for a given frame.
|
||||
// Accept a content id here, in some cases we may not have content (scroll position)
|
||||
NS_IMETHODIMP
|
||||
FrameManager::CaptureFrameStateFor(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
FrameManager::CaptureFrameStateFor(nsIFrame* aFrame,
|
||||
nsILayoutHistoryState* aState,
|
||||
nsIStatefulFrame::SpecialStateID aID)
|
||||
{
|
||||
@ -2110,7 +2092,7 @@ FrameManager::CaptureFrameStateFor(nsIPresContext* aPresContext,
|
||||
// Capture the state, exit early if we get null (nothing to save)
|
||||
nsCOMPtr<nsIPresState> frameState;
|
||||
nsresult rv = NS_OK;
|
||||
rv = statefulFrame->SaveState(aPresContext, getter_AddRefs(frameState));
|
||||
rv = statefulFrame->SaveState(GetPresContext(), getter_AddRefs(frameState));
|
||||
if (!frameState) {
|
||||
return NS_OK;
|
||||
}
|
||||
@ -2131,24 +2113,23 @@ FrameManager::CaptureFrameStateFor(nsIPresContext* aPresContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
FrameManager::CaptureFrameState(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
FrameManager::CaptureFrameState(nsIFrame* aFrame,
|
||||
nsILayoutHistoryState* aState)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
NS_ENSURE_TRUE(mPresShell, NS_ERROR_NOT_AVAILABLE);
|
||||
NS_PRECONDITION(nsnull != aFrame && nsnull != aState, "null parameters passed in");
|
||||
|
||||
rv = CaptureFrameStateFor(aPresContext, aFrame, aState);
|
||||
rv = CaptureFrameStateFor(aFrame, aState);
|
||||
|
||||
// Now capture state recursively for the frame hierarchy rooted at aFrame
|
||||
nsIAtom* childListName = nsnull;
|
||||
PRInt32 childListIndex = 0;
|
||||
do {
|
||||
nsIFrame* childFrame;
|
||||
aFrame->FirstChild(aPresContext, childListName, &childFrame);
|
||||
aFrame->FirstChild(GetPresContext(), childListName, &childFrame);
|
||||
while (childFrame) {
|
||||
rv = CaptureFrameState(aPresContext, childFrame, aState);
|
||||
rv = CaptureFrameState(childFrame, aState);
|
||||
// Get the next sibling child frame
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
}
|
||||
@ -2162,7 +2143,9 @@ FrameManager::CaptureFrameState(nsIPresContext* aPresContext,
|
||||
// Restore state for a given frame.
|
||||
// Accept a content id here, in some cases we may not have content (scroll position)
|
||||
NS_IMETHODIMP
|
||||
FrameManager::RestoreFrameStateFor(nsIPresContext* aPresContext, nsIFrame* aFrame, nsILayoutHistoryState* aState, nsIStatefulFrame::SpecialStateID aID)
|
||||
FrameManager::RestoreFrameStateFor(nsIFrame* aFrame,
|
||||
nsILayoutHistoryState* aState,
|
||||
nsIStatefulFrame::SpecialStateID aID)
|
||||
{
|
||||
NS_ENSURE_TRUE(mPresShell && aFrame && aState, NS_ERROR_FAILURE);
|
||||
|
||||
@ -2198,7 +2181,7 @@ FrameManager::RestoreFrameStateFor(nsIPresContext* aPresContext, nsIFrame* aFram
|
||||
}
|
||||
|
||||
// Restore it
|
||||
rv = statefulFrame->RestoreState(aPresContext, frameState);
|
||||
rv = statefulFrame->RestoreState(GetPresContext(), frameState);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// If we restore ok, remove the state from the state table
|
||||
@ -2206,22 +2189,22 @@ FrameManager::RestoreFrameStateFor(nsIPresContext* aPresContext, nsIFrame* aFram
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
FrameManager::RestoreFrameState(nsIPresContext* aPresContext, nsIFrame* aFrame, nsILayoutHistoryState* aState)
|
||||
FrameManager::RestoreFrameState(nsIFrame* aFrame, nsILayoutHistoryState* aState)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
NS_ENSURE_TRUE(mPresShell, NS_ERROR_NOT_AVAILABLE);
|
||||
NS_PRECONDITION(nsnull != aFrame && nsnull != aState, "null parameters passed in");
|
||||
|
||||
rv = RestoreFrameStateFor(aPresContext, aFrame, aState);
|
||||
rv = RestoreFrameStateFor(aFrame, aState);
|
||||
|
||||
// Now restore state recursively for the frame hierarchy rooted at aFrame
|
||||
nsIAtom* childListName = nsnull;
|
||||
PRInt32 childListIndex = 0;
|
||||
do {
|
||||
nsIFrame* childFrame;
|
||||
aFrame->FirstChild(aPresContext, childListName, &childFrame);
|
||||
aFrame->FirstChild(GetPresContext(), childListName, &childFrame);
|
||||
while (childFrame) {
|
||||
rv = RestoreFrameState(aPresContext, childFrame, aState);
|
||||
rv = RestoreFrameState(childFrame, aState);
|
||||
// Get the next sibling child frame
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
}
|
||||
|
||||
@ -519,8 +519,7 @@ nsImageFrame::HandleLoadError(nsresult aStatus, nsIPresShell* aPresShell)
|
||||
// ObjectFrame, not us (we're an anonymous frame then)....
|
||||
nsIFrame* primaryFrame = nsnull;
|
||||
aPresShell->GetPrimaryFrameFor(mContent, &primaryFrame);
|
||||
aPresShell->CantRenderReplacedElement(mPresContext,
|
||||
primaryFrame ? primaryFrame : this);
|
||||
aPresShell->CantRenderReplacedElement(primaryFrame ? primaryFrame : this);
|
||||
return NS_ERROR_FRAME_REPLACED;
|
||||
}
|
||||
|
||||
|
||||
@ -1194,7 +1194,7 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext,
|
||||
//check for alternative content with CantRenderReplacedElement()
|
||||
nsIPresShell* presShell;
|
||||
aPresContext->GetShell(&presShell);
|
||||
rv = presShell->CantRenderReplacedElement(aPresContext, this);
|
||||
rv = presShell->CantRenderReplacedElement(this);
|
||||
NS_RELEASE(presShell);
|
||||
} else {
|
||||
NotifyContentObjectWrapper();
|
||||
|
||||
@ -1124,8 +1124,7 @@ public:
|
||||
NS_IMETHOD ClearFrameRefs(nsIFrame* aFrame);
|
||||
NS_IMETHOD CreateRenderingContext(nsIFrame *aFrame,
|
||||
nsIRenderingContext** aContext);
|
||||
NS_IMETHOD CantRenderReplacedElement(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame);
|
||||
NS_IMETHOD CantRenderReplacedElement(nsIFrame* aFrame);
|
||||
NS_IMETHOD GoToAnchor(const nsAString& aAnchorName, PRBool aScroll);
|
||||
|
||||
NS_IMETHOD ScrollFrameIntoView(nsIFrame *aFrame,
|
||||
@ -3672,7 +3671,7 @@ PresShell::EndLoad(nsIDocument *aDocument)
|
||||
nsIFrame* scrollFrame = nsnull;
|
||||
GetRootScrollFrame(mPresContext, rootFrame, &scrollFrame);
|
||||
if (scrollFrame) {
|
||||
mFrameManager->RestoreFrameStateFor(mPresContext, scrollFrame, historyState, nsIStatefulFrame::eDocumentScrollState);
|
||||
mFrameManager->RestoreFrameStateFor(scrollFrame, historyState, nsIStatefulFrame::eDocumentScrollState);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3985,11 +3984,10 @@ PresShell::CreateRenderingContext(nsIFrame *aFrame,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PresShell::CantRenderReplacedElement(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame)
|
||||
PresShell::CantRenderReplacedElement(nsIFrame* aFrame)
|
||||
{
|
||||
if (mFrameManager) {
|
||||
return mFrameManager->CantRenderReplacedElement(aPresContext, aFrame);
|
||||
return mFrameManager->CantRenderReplacedElement(aFrame);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
@ -4737,12 +4735,12 @@ PresShell::CaptureHistoryState(nsILayoutHistoryState** aState, PRBool aLeavingPa
|
||||
nsIFrame* scrollFrame = nsnull;
|
||||
rv = GetRootScrollFrame(mPresContext, rootFrame, &scrollFrame);
|
||||
if (scrollFrame) {
|
||||
rv = mFrameManager->CaptureFrameStateFor(mPresContext, scrollFrame, historyState, nsIStatefulFrame::eDocumentScrollState);
|
||||
rv = mFrameManager->CaptureFrameStateFor(scrollFrame, historyState, nsIStatefulFrame::eDocumentScrollState);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
rv = mFrameManager->CaptureFrameState(mPresContext, rootFrame, historyState);
|
||||
rv = mFrameManager->CaptureFrameState(rootFrame, historyState);
|
||||
|
||||
return rv;
|
||||
}
|
||||
@ -5561,9 +5559,9 @@ PresShell::ReconstructStyleData(PRBool aRebuildRuleTree)
|
||||
}
|
||||
|
||||
nsChangeHint frameChange = NS_STYLE_HINT_NONE;
|
||||
frameManager->ComputeStyleChangeFor(mPresContext, rootFrame,
|
||||
kNameSpaceID_Unknown, nsnull,
|
||||
changeList, NS_STYLE_HINT_NONE, frameChange);
|
||||
frameManager->ComputeStyleChangeFor(rootFrame, kNameSpaceID_Unknown, nsnull,
|
||||
changeList, NS_STYLE_HINT_NONE,
|
||||
frameChange);
|
||||
|
||||
if (frameChange & nsChangeHint_ReconstructDoc)
|
||||
set->ReconstructDocElementHierarchy(mPresContext);
|
||||
|
||||
@ -340,7 +340,7 @@ nsHTMLButtonControlFrame::SetInitialChildList(nsIPresContext* aPresContext,
|
||||
frame->SetParent(mFrames.FirstChild());
|
||||
// now reparent the contexts for the reparented frame too
|
||||
if (frameManager) {
|
||||
frameManager->ReParentStyleContext(aPresContext,frame,newParentContext);
|
||||
frameManager->ReParentStyleContext(frame, newParentContext);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -4257,7 +4257,7 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresShell* aPresShell,
|
||||
aState.mFrameState = historyState;
|
||||
if (aState.mFrameState && aState.mFrameManager) {
|
||||
// Restore frame state for the entire subtree of |comboboxFrame|.
|
||||
aState.mFrameManager->RestoreFrameState(aPresContext, comboboxFrame,
|
||||
aState.mFrameManager->RestoreFrameState(comboboxFrame,
|
||||
aState.mFrameState);
|
||||
}
|
||||
} else {
|
||||
@ -4354,7 +4354,7 @@ nsCSSFrameConstructor::InitializeSelectFrame(nsIPresShell* aPresShell,
|
||||
|
||||
if (aState.mFrameState && aState.mFrameManager) {
|
||||
// Restore frame state for the scroll frame
|
||||
aState.mFrameManager->RestoreFrameStateFor(aPresContext, scrollFrame, aState.mFrameState);
|
||||
aState.mFrameManager->RestoreFrameStateFor(scrollFrame, aState.mFrameState);
|
||||
}
|
||||
|
||||
// The area frame is a floater container
|
||||
@ -6710,8 +6710,7 @@ nsCSSFrameConstructor::InitAndRestoreFrame(nsIPresContext* aPresContext
|
||||
|
||||
if (aState.mFrameState && aState.mFrameManager) {
|
||||
// Restore frame state for just the newly created frame.
|
||||
aState.mFrameManager->RestoreFrameStateFor(aPresContext, aNewFrame,
|
||||
aState.mFrameState);
|
||||
aState.mFrameManager->RestoreFrameStateFor(aNewFrame, aState.mFrameState);
|
||||
}
|
||||
|
||||
return rv;
|
||||
@ -7443,8 +7442,7 @@ nsCSSFrameConstructor::ReconstructDocElementHierarchy(nsIPresContext* aPresConte
|
||||
NS_ASSERTION(docParentFrame, "should have a parent frame");
|
||||
if (docParentFrame) {
|
||||
// Remove the old document element hieararchy
|
||||
rv = state.mFrameManager->RemoveFrame(aPresContext, *shell,
|
||||
docParentFrame, nsnull,
|
||||
rv = state.mFrameManager->RemoveFrame(docParentFrame, nsnull,
|
||||
docElementFrame);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// Remove any existing fixed items: they are always on the FixedContainingBlock
|
||||
@ -7459,15 +7457,15 @@ nsCSSFrameConstructor::ReconstructDocElementHierarchy(nsIPresContext* aPresConte
|
||||
newChild);
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = state.mFrameManager->InsertFrames(aPresContext, *shell,
|
||||
docParentFrame, nsnull,
|
||||
rv = state.mFrameManager->InsertFrames(docParentFrame, nsnull,
|
||||
nsnull, newChild);
|
||||
|
||||
// Tell the fixed containing block about its 'fixed' frames
|
||||
if (state.mFixedItems.childList) {
|
||||
state.mFrameManager->InsertFrames(aPresContext, *shell,
|
||||
mFixedContainingBlock, nsLayoutAtoms::fixedList,
|
||||
nsnull, state.mFixedItems.childList);
|
||||
state.mFrameManager->InsertFrames(mFixedContainingBlock,
|
||||
nsLayoutAtoms::fixedList,
|
||||
nsnull,
|
||||
state.mFixedItems.childList);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -7670,7 +7668,7 @@ nsCSSFrameConstructor::AppendFrames(nsIPresContext* aPresContext,
|
||||
nsFrameList frames(firstChild);
|
||||
|
||||
// Insert the frames before the :after pseudo-element.
|
||||
return aFrameManager->InsertFrames(aPresContext, *aPresShell, aParentFrame,
|
||||
return aFrameManager->InsertFrames(aParentFrame,
|
||||
nsnull, frames.GetPrevSiblingFor(afterFrame),
|
||||
aFrameList);
|
||||
}
|
||||
@ -7689,7 +7687,7 @@ nsCSSFrameConstructor::AppendFrames(nsIPresContext* aPresContext,
|
||||
// table column
|
||||
nsIFrame* parentFrame = aParentFrame;
|
||||
aFrameList->GetParent(&parentFrame);
|
||||
rv = aFrameManager->AppendFrames(aPresContext, *aPresShell, parentFrame,
|
||||
rv = aFrameManager->AppendFrames(parentFrame,
|
||||
nsLayoutAtoms::colGroupList, aFrameList);
|
||||
}
|
||||
else if (nsLayoutAtoms::tableColGroupFrame == childType) {
|
||||
@ -7697,22 +7695,21 @@ nsCSSFrameConstructor::AppendFrames(nsIPresContext* aPresContext,
|
||||
nsIFrame* prevSibling;
|
||||
PRBool doAppend = nsTableColGroupFrame::GetLastRealColGroup(tableFrame, &prevSibling);
|
||||
if (doAppend) {
|
||||
rv = aFrameManager->AppendFrames(aPresContext, *aPresShell, aParentFrame,
|
||||
rv = aFrameManager->AppendFrames(aParentFrame,
|
||||
nsLayoutAtoms::colGroupList, aFrameList);
|
||||
}
|
||||
else {
|
||||
rv = aFrameManager->InsertFrames(aPresContext, *aPresShell, aParentFrame,
|
||||
rv = aFrameManager->InsertFrames(aParentFrame,
|
||||
nsLayoutAtoms::colGroupList, prevSibling, aFrameList);
|
||||
}
|
||||
}
|
||||
else if (nsLayoutAtoms::tableCaptionFrame == childType) {
|
||||
// table caption
|
||||
rv = aFrameManager->AppendFrames(aPresContext, *aPresShell, aParentFrame,
|
||||
rv = aFrameManager->AppendFrames(aParentFrame,
|
||||
nsLayoutAtoms::captionList, aFrameList);
|
||||
}
|
||||
else {
|
||||
rv = aFrameManager->AppendFrames(aPresContext, *aPresShell, aParentFrame,
|
||||
nsnull, aFrameList);
|
||||
rv = aFrameManager->AppendFrames(aParentFrame, nsnull, aFrameList);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@ -7720,12 +7717,11 @@ nsCSSFrameConstructor::AppendFrames(nsIPresContext* aPresContext,
|
||||
// check for a table caption which goes on an additional child list with a different parent
|
||||
nsIFrame* outerTableFrame;
|
||||
if (GetCaptionAdjustedParent(aParentFrame, aFrameList, &outerTableFrame)) {
|
||||
rv = aFrameManager->AppendFrames(aPresContext, *aPresShell, outerTableFrame,
|
||||
rv = aFrameManager->AppendFrames(outerTableFrame,
|
||||
nsLayoutAtoms::captionList, aFrameList);
|
||||
}
|
||||
else {
|
||||
rv = aFrameManager->AppendFrames(aPresContext, *aPresShell, aParentFrame,
|
||||
nsnull, aFrameList);
|
||||
rv = aFrameManager->AppendFrames(aParentFrame, nsnull, aFrameList);
|
||||
}
|
||||
}
|
||||
|
||||
@ -8600,8 +8596,7 @@ nsCSSFrameConstructor::AddDummyFrameToSelect(nsIPresContext* aPresContext,
|
||||
nsCOMPtr<nsIFrameManager> frameManager;
|
||||
aPresShell->GetFrameManager(getter_AddRefs(frameManager));
|
||||
if (frameManager) {
|
||||
frameManager->AppendFrames(aPresContext, *aPresShell,
|
||||
aParentFrame, nsnull, generatedFrame);
|
||||
frameManager->AppendFrames(aParentFrame, nsnull, generatedFrame);
|
||||
}
|
||||
}
|
||||
|
||||
@ -8655,8 +8650,7 @@ nsCSSFrameConstructor::RemoveDummyFrameFromSelect(nsIPresContext* aPresContext,
|
||||
aPresShell->GetFrameManager(getter_AddRefs(frameManager));
|
||||
DeletingFrameSubtree(aPresContext, aPresShell, frameManager,
|
||||
dummyFrame);
|
||||
frameManager->RemoveFrame(aPresContext, *aPresShell,
|
||||
parentFrame, nsnull, dummyFrame);
|
||||
frameManager->RemoveFrame(parentFrame, nsnull, dummyFrame);
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
@ -9147,11 +9141,11 @@ nsCSSFrameConstructor::ContentInserted(nsIPresContext* aPresContext,
|
||||
if (GetCaptionAdjustedParent(parentFrame, newFrame, &outerTableFrame)) {
|
||||
// XXXwaterson this seems wrong; i.e., how can we assume
|
||||
// that appending is the right thing to do here?
|
||||
state.mFrameManager->AppendFrames(aPresContext, *shell, outerTableFrame,
|
||||
state.mFrameManager->AppendFrames(outerTableFrame,
|
||||
nsLayoutAtoms::captionList, newFrame);
|
||||
}
|
||||
else {
|
||||
state.mFrameManager->InsertFrames(aPresContext, *shell, parentFrame,
|
||||
state.mFrameManager->InsertFrames(parentFrame,
|
||||
nsnull, prevSibling, newFrame);
|
||||
}
|
||||
}
|
||||
@ -9428,7 +9422,7 @@ DeletingFrameSubtree(nsIPresContext* aPresContext,
|
||||
getter_AddRefs(listName));
|
||||
|
||||
// Ask the parent to delete the out-of-flow frame
|
||||
aFrameManager->RemoveFrame(aPresContext, *aPresShell, parentFrame,
|
||||
aFrameManager->RemoveFrame(parentFrame,
|
||||
listName, outOfFlowFrame);
|
||||
}
|
||||
}
|
||||
@ -9703,8 +9697,7 @@ nsCSSFrameConstructor::ContentRemoved(nsIPresContext* aPresContext,
|
||||
if (placeholderFrame) {
|
||||
placeholderFrame->GetParent(&parentFrame);
|
||||
DeletingFrameSubtree(aPresContext, shell, frameManager, placeholderFrame);
|
||||
rv = frameManager->RemoveFrame(aPresContext, *shell, parentFrame,
|
||||
nsnull, placeholderFrame);
|
||||
rv = frameManager->RemoveFrame(parentFrame, nsnull, placeholderFrame);
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
@ -9728,7 +9721,7 @@ nsCSSFrameConstructor::ContentRemoved(nsIPresContext* aPresContext,
|
||||
// remove the floater first (which gets rid of the lines
|
||||
// reference to the placeholder and floater) and then remove the
|
||||
// placeholder
|
||||
rv = frameManager->RemoveFrame(aPresContext, *shell, parentFrame,
|
||||
rv = frameManager->RemoveFrame(parentFrame,
|
||||
nsLayoutAtoms::floaterList, childFrame);
|
||||
|
||||
// Remove the placeholder frame first (XXX second for now) (so
|
||||
@ -9736,7 +9729,7 @@ nsCSSFrameConstructor::ContentRemoved(nsIPresContext* aPresContext,
|
||||
if (nsnull != placeholderFrame) {
|
||||
placeholderFrame->GetParent(&parentFrame);
|
||||
DeletingFrameSubtree(aPresContext, shell, frameManager, placeholderFrame);
|
||||
rv = frameManager->RemoveFrame(aPresContext, *shell, parentFrame,
|
||||
rv = frameManager->RemoveFrame(parentFrame,
|
||||
nsnull, placeholderFrame);
|
||||
}
|
||||
}
|
||||
@ -9753,15 +9746,14 @@ nsCSSFrameConstructor::ContentRemoved(nsIPresContext* aPresContext,
|
||||
|
||||
// Generate two notifications. First for the absolutely positioned
|
||||
// frame
|
||||
rv = frameManager->RemoveFrame(aPresContext, *shell, parentFrame,
|
||||
rv = frameManager->RemoveFrame(parentFrame,
|
||||
(NS_STYLE_POSITION_FIXED == display->mPosition) ?
|
||||
nsLayoutAtoms::fixedList : nsLayoutAtoms::absoluteList, childFrame);
|
||||
|
||||
// Now the placeholder frame
|
||||
if (nsnull != placeholderFrame) {
|
||||
placeholderFrame->GetParent(&parentFrame);
|
||||
rv = frameManager->RemoveFrame(aPresContext, *shell, parentFrame, nsnull,
|
||||
placeholderFrame);
|
||||
rv = frameManager->RemoveFrame(parentFrame, nsnull, placeholderFrame);
|
||||
}
|
||||
|
||||
} else {
|
||||
@ -9769,12 +9761,11 @@ nsCSSFrameConstructor::ContentRemoved(nsIPresContext* aPresContext,
|
||||
// check for a table caption which goes on an additional child list with a different parent
|
||||
nsIFrame* outerTableFrame;
|
||||
if (GetCaptionAdjustedParent(parentFrame, childFrame, &outerTableFrame)) {
|
||||
rv = frameManager->RemoveFrame(aPresContext, *shell, outerTableFrame,
|
||||
rv = frameManager->RemoveFrame(outerTableFrame,
|
||||
nsLayoutAtoms::captionList, childFrame);
|
||||
}
|
||||
else {
|
||||
rv = frameManager->RemoveFrame(aPresContext, *shell, insertionPoint,
|
||||
nsnull, childFrame);
|
||||
rv = frameManager->RemoveFrame(insertionPoint, nsnull, childFrame);
|
||||
}
|
||||
}
|
||||
|
||||
@ -10296,7 +10287,7 @@ nsCSSFrameConstructor::ContentStatesChanged(nsIPresContext* aPresContext,
|
||||
if (primaryFrame1) {
|
||||
nsStyleChangeList changeList;
|
||||
nsChangeHint frameChange = NS_STYLE_HINT_NONE;
|
||||
frameManager->ComputeStyleChangeFor(aPresContext, primaryFrame1,
|
||||
frameManager->ComputeStyleChangeFor(primaryFrame1,
|
||||
kNameSpaceID_Unknown, nsnull,
|
||||
changeList, NS_STYLE_HINT_NONE,
|
||||
frameChange);
|
||||
@ -10326,7 +10317,7 @@ nsCSSFrameConstructor::ContentStatesChanged(nsIPresContext* aPresContext,
|
||||
if (primaryFrame2) {
|
||||
nsStyleChangeList changeList;
|
||||
nsChangeHint frameChange = NS_STYLE_HINT_NONE;
|
||||
frameManager->ComputeStyleChangeFor(aPresContext, primaryFrame2,
|
||||
frameManager->ComputeStyleChangeFor(primaryFrame2,
|
||||
kNameSpaceID_Unknown, nsnull,
|
||||
changeList, NS_STYLE_HINT_NONE, frameChange);
|
||||
if (app2) {
|
||||
@ -10484,14 +10475,14 @@ nsCSSFrameConstructor::AttributeChanged(nsIPresContext* aPresContext,
|
||||
shell->GetFrameManager(getter_AddRefs(frameManager));
|
||||
|
||||
PRBool affects;
|
||||
frameManager->HasAttributeDependentStyle(aPresContext, aContent,
|
||||
frameManager->HasAttributeDependentStyle(aContent,
|
||||
aAttribute, aModType, &affects);
|
||||
if (affects) {
|
||||
#ifdef DEBUG_shaver
|
||||
fputc('+', stderr);
|
||||
#endif
|
||||
// there is an effect, so compute it
|
||||
frameManager->ComputeStyleChangeFor(aPresContext, primaryFrame,
|
||||
frameManager->ComputeStyleChangeFor(primaryFrame,
|
||||
aNameSpaceID, aAttribute,
|
||||
changeList, aHint, maxHint);
|
||||
} else {
|
||||
@ -10763,8 +10754,7 @@ nsCSSFrameConstructor::CantRenderReplacedElement(nsIPresShell* aPresShell,
|
||||
|
||||
// Replace the old frame with the new frame
|
||||
// XXXbz If this fails, we leak the content node newFrame points to!
|
||||
frameManager->ReplaceFrame(aPresContext, *presShell, parentFrame,
|
||||
listName, aFrame, newFrame);
|
||||
frameManager->ReplaceFrame(parentFrame, listName, aFrame, newFrame);
|
||||
|
||||
// Now that we've replaced the primary frame, if there's a placeholder
|
||||
// frame then complete the transition from image frame to new frame
|
||||
@ -10848,8 +10838,8 @@ nsCSSFrameConstructor::CantRenderReplacedElement(nsIPresShell* aPresShell,
|
||||
NS_ASSERTION(IsPlaceholderFrame(newFrame), "unexpected frame type");
|
||||
|
||||
// Replace the old placeholder frame with the new placeholder frame
|
||||
state.mFrameManager->ReplaceFrame(aPresContext, *presShell, inFlowParent,
|
||||
nsnull, placeholderFrame, newFrame);
|
||||
state.mFrameManager->ReplaceFrame(inFlowParent, nsnull,
|
||||
placeholderFrame, newFrame);
|
||||
}
|
||||
|
||||
// Replace the primary frame
|
||||
@ -10904,8 +10894,8 @@ nsCSSFrameConstructor::CantRenderReplacedElement(nsIPresShell* aPresShell,
|
||||
}
|
||||
DeletingFrameSubtree(aPresContext, presShell,
|
||||
state.mFrameManager, aFrame);
|
||||
state.mFrameManager->ReplaceFrame(aPresContext, *presShell, parentFrame,
|
||||
listName, aFrame, newFrame);
|
||||
state.mFrameManager->ReplaceFrame(parentFrame, listName, aFrame,
|
||||
newFrame);
|
||||
|
||||
// Reset the primary frame mapping. Don't assume that
|
||||
// ConstructFrameByDisplayType() has done this
|
||||
@ -11755,7 +11745,7 @@ nsCSSFrameConstructor::CaptureStateFor(nsIPresContext* aPresContext,
|
||||
nsCOMPtr<nsIFrameManager> frameManager;
|
||||
rv = presShell->GetFrameManager(getter_AddRefs(frameManager));
|
||||
if (NS_SUCCEEDED(rv) && frameManager) {
|
||||
rv = frameManager->CaptureFrameState(aPresContext, aFrame, aHistoryState);
|
||||
rv = frameManager->CaptureFrameState(aFrame, aHistoryState);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -12197,8 +12187,7 @@ nsCSSFrameConstructor::AppendFirstLineFrames(
|
||||
ReparentFrame(aPresContext, lineFrame, firstLineStyle, kid);
|
||||
kid->GetNextSibling(&kid);
|
||||
}
|
||||
aState.mFrameManager->AppendFrames(aPresContext, *aState.mPresShell,
|
||||
lineFrame, nsnull, firstInlineFrame);
|
||||
aState.mFrameManager->AppendFrames(lineFrame, nsnull, firstInlineFrame);
|
||||
|
||||
// The remaining frames get appended to the block frame
|
||||
if (remainingFrames) {
|
||||
@ -12246,8 +12235,7 @@ nsCSSFrameConstructor::InsertFirstLineFrames(
|
||||
if (isInline) {
|
||||
// Easy case: the new inline frame will go into the lineFrame.
|
||||
ReparentFrame(aPresContext, lineFrame, firstLineStyle, newFrame);
|
||||
aState.mFrameManager->InsertFrames(aPresContext, *aState.mPresShell,
|
||||
lineFrame, nsnull, nsnull,
|
||||
aState.mFrameManager->InsertFrames(lineFrame, nsnull, nsnull,
|
||||
newFrame);
|
||||
|
||||
// Since the frame is going into the lineFrame, don't let it
|
||||
@ -12797,8 +12785,7 @@ nsCSSFrameConstructor::RemoveFloatingFirstLetterFrames(
|
||||
nsSplittableFrame::BreakFromPrevFlow(nextTextFrame);
|
||||
DeletingFrameSubtree(aPresContext, aPresShell,
|
||||
aFrameManager, nextTextFrame);
|
||||
aFrameManager->RemoveFrame(aPresContext, *aPresShell, nextTextParent,
|
||||
nsnull, nextTextFrame);
|
||||
aFrameManager->RemoveFrame(nextTextParent, nsnull, nextTextFrame);
|
||||
}
|
||||
}
|
||||
|
||||
@ -12825,16 +12812,14 @@ nsCSSFrameConstructor::RemoveFloatingFirstLetterFrames(
|
||||
|
||||
// Remove the floater frame
|
||||
DeletingFrameSubtree(aPresContext, aPresShell, aFrameManager, floater);
|
||||
aFrameManager->RemoveFrame(aPresContext, *aPresShell,
|
||||
aBlockFrame, nsLayoutAtoms::floaterList,
|
||||
aFrameManager->RemoveFrame(aBlockFrame, nsLayoutAtoms::floaterList,
|
||||
floater);
|
||||
|
||||
// Remove placeholder frame
|
||||
aFrameManager->RemoveFrame(aPresContext, *aPresShell,
|
||||
parentFrame, nsnull, placeholderFrame);
|
||||
aFrameManager->RemoveFrame(parentFrame, nsnull, placeholderFrame);
|
||||
|
||||
// Insert text frame in its place
|
||||
aFrameManager->InsertFrames(aPresContext, *aPresShell, parentFrame, nsnull,
|
||||
aFrameManager->InsertFrames(parentFrame, nsnull,
|
||||
prevSibling, newTextFrame);
|
||||
|
||||
return NS_OK;
|
||||
@ -12883,11 +12868,10 @@ nsCSSFrameConstructor::RemoveFirstLetterFrames(nsIPresContext* aPresContext,
|
||||
// Next rip out the kid and replace it with the text frame
|
||||
nsIFrameManager* frameManager = aFrameManager;
|
||||
DeletingFrameSubtree(aPresContext, aPresShell, frameManager, kid);
|
||||
frameManager->RemoveFrame(aPresContext, *aPresShell,
|
||||
aFrame, nsnull, kid);
|
||||
frameManager->RemoveFrame(aFrame, nsnull, kid);
|
||||
|
||||
// Insert text frame in its place
|
||||
frameManager->InsertFrames(aPresContext, *aPresShell, aFrame, nsnull,
|
||||
frameManager->InsertFrames(aFrame, nsnull,
|
||||
prevSibling, textFrame);
|
||||
|
||||
*aStopLooking = PR_TRUE;
|
||||
@ -14025,8 +14009,7 @@ nsresult nsCSSFrameConstructor::RemoveFixedItems(nsIPresContext* aPresContext,
|
||||
if (fixedChild) {
|
||||
DeletingFrameSubtree(aPresContext, aPresShell, aFrameManager,
|
||||
fixedChild);
|
||||
rv = aFrameManager->RemoveFrame(aPresContext, *aPresShell,
|
||||
mFixedContainingBlock,
|
||||
rv = aFrameManager->RemoveFrame(mFixedContainingBlock,
|
||||
nsLayoutAtoms::fixedList,
|
||||
fixedChild);
|
||||
if (NS_FAILED(rv)) {
|
||||
|
||||
@ -666,15 +666,14 @@ nsMathMLContainerFrame::PropagateScriptStyleFor(nsIPresContext* aPresContext,
|
||||
if (fm) {
|
||||
nsChangeHint maxChange = NS_STYLE_HINT_NONE, minChange = NS_STYLE_HINT_NONE;
|
||||
nsStyleChangeList changeList;
|
||||
fm->ComputeStyleChangeFor(aPresContext, aFrame,
|
||||
kNameSpaceID_None, nsMathMLAtoms::fontsize,
|
||||
changeList, minChange, maxChange);
|
||||
fm->ComputeStyleChangeFor(aFrame, kNameSpaceID_None,
|
||||
nsMathMLAtoms::fontsize, changeList,
|
||||
minChange, maxChange);
|
||||
#ifdef DEBUG
|
||||
// Use the parent frame to make sure we catch in-flows and such
|
||||
nsIFrame* parentFrame;
|
||||
aFrame->GetParent(&parentFrame);
|
||||
fm->DebugVerifyStyleTree(aPresContext,
|
||||
parentFrame ? parentFrame : aFrame);
|
||||
fm->DebugVerifyStyleTree(parentFrame ? parentFrame : aFrame);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -714,15 +714,13 @@ nsMathMLFrame::MapAttributesIntoCSS(nsIPresContext* aPresContext,
|
||||
if (fm) {
|
||||
nsChangeHint maxChange = NS_STYLE_HINT_NONE, minChange = NS_STYLE_HINT_NONE;
|
||||
nsStyleChangeList changeList;
|
||||
fm->ComputeStyleChangeFor(aPresContext, aFrame,
|
||||
kNameSpaceID_None, nsnull,
|
||||
fm->ComputeStyleChangeFor(aFrame, kNameSpaceID_None, nsnull,
|
||||
changeList, minChange, maxChange);
|
||||
#ifdef DEBUG
|
||||
// Use the parent frame to make sure we catch in-flows and such
|
||||
nsIFrame* parentFrame;
|
||||
aFrame->GetParent(&parentFrame);
|
||||
fm->DebugVerifyStyleTree(aPresContext,
|
||||
parentFrame ? parentFrame : aFrame);
|
||||
fm->DebugVerifyStyleTree(parentFrame ? parentFrame : aFrame);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -354,15 +354,14 @@ nsMathMLTokenFrame::SetTextStyle(nsIPresContext* aPresContext)
|
||||
if (fm) {
|
||||
nsChangeHint maxChange, minChange = NS_STYLE_HINT_NONE;
|
||||
nsStyleChangeList changeList;
|
||||
fm->ComputeStyleChangeFor(aPresContext, this,
|
||||
fm->ComputeStyleChangeFor(this,
|
||||
kNameSpaceID_None, nsMathMLAtoms::fontstyle,
|
||||
changeList, minChange, maxChange);
|
||||
#ifdef DEBUG
|
||||
// Use the parent frame to make sure we catch in-flows and such
|
||||
nsIFrame* parentFrame;
|
||||
GetParent(&parentFrame);
|
||||
fm->DebugVerifyStyleTree(aPresContext,
|
||||
parentFrame ? parentFrame : this);
|
||||
fm->DebugVerifyStyleTree(parentFrame ? parentFrame : this);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -293,14 +293,13 @@ MapAttributesInto(nsIPresContext* aPresContext,
|
||||
if (fm) {
|
||||
nsChangeHint maxChange = NS_STYLE_HINT_NONE, minChange = NS_STYLE_HINT_NONE;
|
||||
nsStyleChangeList changeList;
|
||||
fm->ComputeStyleChangeFor(aPresContext, aCellFrame, kNameSpaceID_None, nsnull,
|
||||
fm->ComputeStyleChangeFor(aCellFrame, kNameSpaceID_None, nsnull,
|
||||
changeList, minChange, maxChange);
|
||||
#ifdef DEBUG
|
||||
// Use the parent frame to make sure we catch in-flows and such
|
||||
nsIFrame* parentFrame;
|
||||
aCellFrame->GetParent(&parentFrame);
|
||||
fm->DebugVerifyStyleTree(aPresContext,
|
||||
parentFrame ? parentFrame : aCellFrame);
|
||||
fm->DebugVerifyStyleTree(parentFrame ? parentFrame : aCellFrame);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user