diff --git a/mozilla/layout/generic/nsBlockFrame.cpp b/mozilla/layout/generic/nsBlockFrame.cpp index 8dd711c92bf..8a18b6f8116 100644 --- a/mozilla/layout/generic/nsBlockFrame.cpp +++ b/mozilla/layout/generic/nsBlockFrame.cpp @@ -3705,11 +3705,11 @@ nsBlockFrame::DoReflowInlineFrames(nsBlockReflowState& aState, } if (LINE_REFLOW_OK != lineReflowStatus) { // It is possible that one or more of next lines are empty - // (because of DeleteChildsNextInFlow). If so, delete them now + // (because of DeleteNextInFlowChild). If so, delete them now // in case we are finished. ++aLine; while ((aLine != end_lines()) && (0 == aLine->GetChildCount())) { - // XXX Is this still necessary now that DeleteChildsNextInFlow + // XXX Is this still necessary now that DeleteNextInFlowChild // uses DoRemoveFrame? nsLineBox *toremove = aLine; aLine = mLines.erase(aLine); @@ -5271,36 +5271,21 @@ nsBlockFrame::DoRemoveFrame(nsIPresContext* aPresContext, } void -nsBlockFrame::DeleteChildsNextInFlow(nsIPresContext* aPresContext, - nsIFrame* aChild) +nsBlockFrame::DeleteNextInFlowChild(nsIPresContext* aPresContext, + nsIFrame* aNextInFlow) { -#ifdef DEBUG - // out-of-flow and placeholders frames don't satisfy the IsChild condition because - // DeleteChildsNextInFlow needs to be called on the parent of the next-in-flow - nsFrameState childState; - aChild->GetFrameState(&childState); - nsCOMPtr frameType; - aChild->GetFrameType(getter_AddRefs(frameType)); - if ((nsLayoutAtoms::placeholderFrame != frameType) && !(childState & NS_FRAME_OUT_OF_FLOW)) { - NS_PRECONDITION(IsChild(aPresContext, aChild), "bad geometric parent"); - } -#endif + nsIFrame* prevInFlow; + aNextInFlow->GetPrevInFlow(&prevInFlow); + NS_PRECONDITION(prevInFlow, "bad next-in-flow"); + NS_PRECONDITION(IsChild(aPresContext, aNextInFlow), "bad geometric parent"); - nsIFrame* nextInFlow; - aChild->GetNextInFlow(&nextInFlow); - NS_PRECONDITION(nsnull != nextInFlow, "null next-in-flow"); #ifdef IBMBIDI nsIFrame* nextBidi; - aChild->GetBidiProperty(aPresContext, nsLayoutAtoms::nextBidi, - (void**) &nextBidi,sizeof(nextBidi)); - if (nextBidi != nextInFlow) { + prevInFlow->GetBidiProperty(aPresContext, nsLayoutAtoms::nextBidi, + (void**) &nextBidi,sizeof(nextBidi)); + if (nextBidi != aNextInFlow) { #endif // IBMBIDI - nsBlockFrame* parent; - nextInFlow->GetParent((nsIFrame**)&parent); - NS_PRECONDITION(nsnull != parent, "next-in-flow with no parent"); - NS_PRECONDITION(! parent->mLines.empty(), "next-in-flow with weird parent"); -// NS_PRECONDITION(nsnull == parent->mOverflowLines, "parent with overflow"); - parent->DoRemoveFrame(aPresContext, nextInFlow); + DoRemoveFrame(aPresContext, aNextInFlow); #ifdef IBMBIDI } #endif // IBMBIDI @@ -5321,11 +5306,10 @@ nsBlockFrame::ReflowFloater(nsBlockReflowState& aState, nsIFrame* nextInFlow; aPlaceholder->GetNextInFlow(&nextInFlow); if (nextInFlow) { - // Use nextInFlow's parent since it always will be able to find nextInFlow. // If aPlaceholder's parent is an inline, nextInFlow's will be a block. nsHTMLContainerFrame* parent; nextInFlow->GetParent((nsIFrame**)&parent); - parent->DeleteChildsNextInFlow(aState.mPresContext, aPlaceholder); + parent->DeleteNextInFlowChild(aState.mPresContext, nextInFlow); } // Reflow the floater. nsIFrame* floater = aPlaceholder->GetOutOfFlowFrame(); @@ -6239,7 +6223,7 @@ nsBlockFrame::ReflowDirtyChild(nsIPresShell* aPresShell, nsIFrame* aChild) } ////////////////////////////////////////////////////////////////////// -// Debugging +// Start Debugging #ifdef NS_DEBUG static PRBool @@ -6278,16 +6262,34 @@ InSiblingList(nsLineList& aLines, nsIFrame* aFrame) PRBool nsBlockFrame::IsChild(nsIPresContext* aPresContext, nsIFrame* aFrame) { + // Continued out-of-flows don't satisfy InLineList(), continued out-of-flows + // and placeholders don't satisfy InSiblingList(). + PRBool skipLineList = PR_FALSE; + PRBool skipSiblingList = PR_FALSE; + nsIFrame* prevInFlow; + aFrame->GetPrevInFlow(&prevInFlow); + if (prevInFlow) { + nsFrameState state; + aFrame->GetFrameState(&state); + nsCOMPtr frameType; + aFrame->GetFrameType(getter_AddRefs(frameType)); + skipLineList = (state & NS_FRAME_OUT_OF_FLOW); + skipSiblingList = (nsLayoutAtoms::placeholderFrame == frameType) || + (state & NS_FRAME_OUT_OF_FLOW); + } + nsIFrame* parent; aFrame->GetParent(&parent); if (parent != (nsIFrame*)this) { return PR_FALSE; } - if (InLineList(mLines, aFrame) && InSiblingList(mLines, aFrame)) { + if ((skipLineList || InLineList(mLines, aFrame)) && + (skipSiblingList || InSiblingList(mLines, aFrame))) { return PR_TRUE; } nsLineList* overflowLines = GetOverflowLines(aPresContext, PR_FALSE); - if (overflowLines && InLineList(*overflowLines, aFrame) && InSiblingList(*overflowLines, aFrame)) { + if (overflowLines && (skipLineList || InLineList(*overflowLines, aFrame)) && + (skipSiblingList || InSiblingList(*overflowLines, aFrame))) { return PR_TRUE; } return PR_FALSE; @@ -6323,7 +6325,8 @@ nsBlockFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const } #endif -//---------------------------------------------------------------------- +// End Debugging +////////////////////////////////////////////////////////////////////// NS_IMETHODIMP nsBlockFrame::Init(nsIPresContext* aPresContext, diff --git a/mozilla/layout/generic/nsBlockFrame.h b/mozilla/layout/generic/nsBlockFrame.h index 0bac95e6963..176badcd3d5 100644 --- a/mozilla/layout/generic/nsBlockFrame.h +++ b/mozilla/layout/generic/nsBlockFrame.h @@ -180,8 +180,8 @@ public: #endif - virtual void DeleteChildsNextInFlow(nsIPresContext* aPresContext, - nsIFrame* aNextInFlow); + virtual void DeleteNextInFlowChild(nsIPresContext* aPresContext, + nsIFrame* aNextInFlow); /** return the topmost block child based on y-index. * almost always the first or second line, if there is one. diff --git a/mozilla/layout/generic/nsBlockReflowContext.cpp b/mozilla/layout/generic/nsBlockReflowContext.cpp index 201abfac560..ec9d11667d0 100644 --- a/mozilla/layout/generic/nsBlockReflowContext.cpp +++ b/mozilla/layout/generic/nsBlockReflowContext.cpp @@ -626,8 +626,8 @@ nsBlockReflowContext::ReflowBlock(const nsRect& aSpace, // parent is not this because we are executing pullup code) /* XXX promote DeleteChildsNextInFlow to nsIFrame to elminate this cast */ nsHTMLContainerFrame* parent; - mFrame->GetParent((nsIFrame**)&parent); - parent->DeleteChildsNextInFlow(mPresContext, mFrame); + kidNextInFlow->GetParent((nsIFrame**)&parent); + parent->DeleteNextInFlowChild(mPresContext, kidNextInFlow); } } } diff --git a/mozilla/layout/generic/nsContainerFrame.cpp b/mozilla/layout/generic/nsContainerFrame.cpp index 608f3c8a3fb..82942d741ae 100644 --- a/mozilla/layout/generic/nsContainerFrame.cpp +++ b/mozilla/layout/generic/nsContainerFrame.cpp @@ -883,7 +883,7 @@ nsContainerFrame::FrameNeedsView(nsIPresContext* aPresContext, /** * Invokes the WillReflow() function, positions the frame and its view (if * requested), and then calls Reflow(). If the reflow succeeds and the child - * frame is complete, deletes any next-in-flows using DeleteChildsNextInFlow() + * frame is complete, deletes any next-in-flows using DeleteNextInFlowChild() */ nsresult nsContainerFrame::ReflowChild(nsIFrame* aKidFrame, @@ -953,10 +953,9 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame, // Remove all of the childs next-in-flows. Make sure that we ask // the right parent to do the removal (it's possible that the // parent is not this because we are executing pullup code) - nsIFrame* parent; - aKidFrame->GetParent(&parent); - ((nsContainerFrame*)parent)->DeleteChildsNextInFlow(aPresContext, - aKidFrame); + nsContainerFrame* parent; + kidNextInFlow->GetParent((nsIFrame**)&parent); + parent->DeleteNextInFlowChild(aPresContext, kidNextInFlow); } } return result; @@ -1051,69 +1050,64 @@ nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame, } /** - * Remove and delete aChild's next-in-flow(s). Updates the sibling and flow + * Remove and delete aNextInFlow and its next-in-flows. Updates the sibling and flow * pointers - * - * @param aChild child this child's next-in-flow - * @return PR_TRUE if successful and PR_FALSE otherwise */ void -nsContainerFrame::DeleteChildsNextInFlow(nsIPresContext* aPresContext, - nsIFrame* aChild) +nsContainerFrame::DeleteNextInFlowChild(nsIPresContext* aPresContext, + nsIFrame* aNextInFlow) { - NS_PRECONDITION(mFrames.ContainsFrame(aChild), "bad geometric parent"); - - nsIFrame* nextInFlow; - nsContainerFrame* parent; - - aChild->GetNextInFlow(&nextInFlow); - NS_PRECONDITION(nsnull != nextInFlow, "null next-in-flow"); - nextInFlow->GetParent((nsIFrame**)&parent); + nsIFrame* prevInFlow; + aNextInFlow->GetPrevInFlow(&prevInFlow); + NS_PRECONDITION(prevInFlow, "bad prev-in-flow"); + NS_PRECONDITION(mFrames.ContainsFrame(aNextInFlow), "bad geometric parent"); // If the next-in-flow has a next-in-flow then delete it, too (and // delete it first). nsIFrame* nextNextInFlow; - - nextInFlow->GetNextInFlow(&nextNextInFlow); - if (nsnull != nextNextInFlow) { - parent->DeleteChildsNextInFlow(aPresContext, nextInFlow); + aNextInFlow->GetNextInFlow(&nextNextInFlow); + if (nextNextInFlow) { + nsContainerFrame* parent; + nextNextInFlow->GetParent((nsIFrame**)&parent); + parent->DeleteNextInFlowChild(aPresContext, nextNextInFlow); } #ifdef IBMBIDI nsIFrame* nextBidi; - aChild->GetBidiProperty(aPresContext, nsLayoutAtoms::nextBidi, - (void**) &nextBidi,sizeof(nextBidi)); - if (nextBidi == nextInFlow) { + prevInFlow->GetBidiProperty(aPresContext, nsLayoutAtoms::nextBidi, + (void**) &nextBidi,sizeof(nextBidi)); + if (nextBidi == aNextInFlow) { return; } #endif // IBMBIDI // Disconnect the next-in-flow from the flow list - nsSplittableFrame::BreakFromPrevFlow(nextInFlow); + nsSplittableFrame::BreakFromPrevFlow(aNextInFlow); // Take the next-in-flow out of the parent's child list - PRBool result = parent->mFrames.RemoveFrame(nextInFlow); + PRBool result = mFrames.RemoveFrame(aNextInFlow); if (!result) { // We didn't find the child in the parent's principal child list. // Maybe it's on the overflow list? - nsFrameList overflowFrames(parent->GetOverflowFrames(aPresContext, PR_TRUE)); + nsFrameList overflowFrames(GetOverflowFrames(aPresContext, PR_TRUE)); - if (overflowFrames.IsEmpty() || !overflowFrames.RemoveFrame(nextInFlow)) { + if (overflowFrames.IsEmpty() || !overflowFrames.RemoveFrame(aNextInFlow)) { NS_ASSERTION(result, "failed to remove frame"); } // Set the overflow property again if (overflowFrames.NotEmpty()) { - parent->SetOverflowFrames(aPresContext, overflowFrames.FirstChild()); + SetOverflowFrames(aPresContext, overflowFrames.FirstChild()); } } // Delete the next-in-flow frame - nextInFlow->Destroy(aPresContext); + aNextInFlow->Destroy(aPresContext); #ifdef NS_DEBUG - aChild->GetNextInFlow(&nextInFlow); - NS_POSTCONDITION(nsnull == nextInFlow, "non null next-in-flow"); + nsIFrame* nextInFlow; + prevInFlow->GetNextInFlow(&nextInFlow); + NS_POSTCONDITION(!nextInFlow, "non null next-in-flow"); #endif } diff --git a/mozilla/layout/generic/nsContainerFrame.h b/mozilla/layout/generic/nsContainerFrame.h index fc05068ac63..444d9efcd2d 100644 --- a/mozilla/layout/generic/nsContainerFrame.h +++ b/mozilla/layout/generic/nsContainerFrame.h @@ -88,8 +88,8 @@ public: #endif // nsContainerFrame methods - virtual void DeleteChildsNextInFlow(nsIPresContext* aPresContext, - nsIFrame* aChild); + virtual void DeleteNextInFlowChild(nsIPresContext* aPresContext, + nsIFrame* aNextInFlow); static PRInt32 LengthOf(nsIFrame* aFrameList) { nsFrameList tmp(aFrameList); @@ -143,7 +143,7 @@ public: /** * Invokes the WillReflow() function, positions the frame and its view (if * requested), and then calls Reflow(). If the reflow succeeds and the child - * frame is complete, deletes any next-in-flows using DeleteChildsNextInFlow() + * frame is complete, deletes any next-in-flows using DeleteNextInFlowChild() * * Flags: * NS_FRAME_NO_MOVE_VIEW - don't position the frame's view. Set this if you diff --git a/mozilla/layout/generic/nsFirstLetterFrame.cpp b/mozilla/layout/generic/nsFirstLetterFrame.cpp index bc72bcc3e93..bb5d38d9b18 100644 --- a/mozilla/layout/generic/nsFirstLetterFrame.cpp +++ b/mozilla/layout/generic/nsFirstLetterFrame.cpp @@ -275,7 +275,7 @@ nsFirstLetterFrame::Reflow(nsIPresContext* aPresContext, kid->GetNextInFlow(&kidNextInFlow); if (nsnull != kidNextInFlow) { // Remove all of the childs next-in-flows - DeleteChildsNextInFlow(aPresContext, kid); + DeleteNextInFlowChild(aPresContext, kidNextInFlow); } } else { diff --git a/mozilla/layout/generic/nsLineLayout.cpp b/mozilla/layout/generic/nsLineLayout.cpp index b82baf6cdcb..58c69ad97f7 100644 --- a/mozilla/layout/generic/nsLineLayout.cpp +++ b/mozilla/layout/generic/nsLineLayout.cpp @@ -1288,8 +1288,8 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame, // the right parent to do the removal (it's possible that the // parent is not this because we are executing pullup code) nsHTMLContainerFrame* parent; - aFrame->GetParent((nsIFrame**) &parent); - parent->DeleteChildsNextInFlow(mPresContext, aFrame); + kidNextInFlow->GetParent((nsIFrame**) &parent); + parent->DeleteNextInFlowChild(mPresContext, kidNextInFlow); } } diff --git a/mozilla/layout/html/base/src/nsBlockFrame.cpp b/mozilla/layout/html/base/src/nsBlockFrame.cpp index 8dd711c92bf..8a18b6f8116 100644 --- a/mozilla/layout/html/base/src/nsBlockFrame.cpp +++ b/mozilla/layout/html/base/src/nsBlockFrame.cpp @@ -3705,11 +3705,11 @@ nsBlockFrame::DoReflowInlineFrames(nsBlockReflowState& aState, } if (LINE_REFLOW_OK != lineReflowStatus) { // It is possible that one or more of next lines are empty - // (because of DeleteChildsNextInFlow). If so, delete them now + // (because of DeleteNextInFlowChild). If so, delete them now // in case we are finished. ++aLine; while ((aLine != end_lines()) && (0 == aLine->GetChildCount())) { - // XXX Is this still necessary now that DeleteChildsNextInFlow + // XXX Is this still necessary now that DeleteNextInFlowChild // uses DoRemoveFrame? nsLineBox *toremove = aLine; aLine = mLines.erase(aLine); @@ -5271,36 +5271,21 @@ nsBlockFrame::DoRemoveFrame(nsIPresContext* aPresContext, } void -nsBlockFrame::DeleteChildsNextInFlow(nsIPresContext* aPresContext, - nsIFrame* aChild) +nsBlockFrame::DeleteNextInFlowChild(nsIPresContext* aPresContext, + nsIFrame* aNextInFlow) { -#ifdef DEBUG - // out-of-flow and placeholders frames don't satisfy the IsChild condition because - // DeleteChildsNextInFlow needs to be called on the parent of the next-in-flow - nsFrameState childState; - aChild->GetFrameState(&childState); - nsCOMPtr frameType; - aChild->GetFrameType(getter_AddRefs(frameType)); - if ((nsLayoutAtoms::placeholderFrame != frameType) && !(childState & NS_FRAME_OUT_OF_FLOW)) { - NS_PRECONDITION(IsChild(aPresContext, aChild), "bad geometric parent"); - } -#endif + nsIFrame* prevInFlow; + aNextInFlow->GetPrevInFlow(&prevInFlow); + NS_PRECONDITION(prevInFlow, "bad next-in-flow"); + NS_PRECONDITION(IsChild(aPresContext, aNextInFlow), "bad geometric parent"); - nsIFrame* nextInFlow; - aChild->GetNextInFlow(&nextInFlow); - NS_PRECONDITION(nsnull != nextInFlow, "null next-in-flow"); #ifdef IBMBIDI nsIFrame* nextBidi; - aChild->GetBidiProperty(aPresContext, nsLayoutAtoms::nextBidi, - (void**) &nextBidi,sizeof(nextBidi)); - if (nextBidi != nextInFlow) { + prevInFlow->GetBidiProperty(aPresContext, nsLayoutAtoms::nextBidi, + (void**) &nextBidi,sizeof(nextBidi)); + if (nextBidi != aNextInFlow) { #endif // IBMBIDI - nsBlockFrame* parent; - nextInFlow->GetParent((nsIFrame**)&parent); - NS_PRECONDITION(nsnull != parent, "next-in-flow with no parent"); - NS_PRECONDITION(! parent->mLines.empty(), "next-in-flow with weird parent"); -// NS_PRECONDITION(nsnull == parent->mOverflowLines, "parent with overflow"); - parent->DoRemoveFrame(aPresContext, nextInFlow); + DoRemoveFrame(aPresContext, aNextInFlow); #ifdef IBMBIDI } #endif // IBMBIDI @@ -5321,11 +5306,10 @@ nsBlockFrame::ReflowFloater(nsBlockReflowState& aState, nsIFrame* nextInFlow; aPlaceholder->GetNextInFlow(&nextInFlow); if (nextInFlow) { - // Use nextInFlow's parent since it always will be able to find nextInFlow. // If aPlaceholder's parent is an inline, nextInFlow's will be a block. nsHTMLContainerFrame* parent; nextInFlow->GetParent((nsIFrame**)&parent); - parent->DeleteChildsNextInFlow(aState.mPresContext, aPlaceholder); + parent->DeleteNextInFlowChild(aState.mPresContext, nextInFlow); } // Reflow the floater. nsIFrame* floater = aPlaceholder->GetOutOfFlowFrame(); @@ -6239,7 +6223,7 @@ nsBlockFrame::ReflowDirtyChild(nsIPresShell* aPresShell, nsIFrame* aChild) } ////////////////////////////////////////////////////////////////////// -// Debugging +// Start Debugging #ifdef NS_DEBUG static PRBool @@ -6278,16 +6262,34 @@ InSiblingList(nsLineList& aLines, nsIFrame* aFrame) PRBool nsBlockFrame::IsChild(nsIPresContext* aPresContext, nsIFrame* aFrame) { + // Continued out-of-flows don't satisfy InLineList(), continued out-of-flows + // and placeholders don't satisfy InSiblingList(). + PRBool skipLineList = PR_FALSE; + PRBool skipSiblingList = PR_FALSE; + nsIFrame* prevInFlow; + aFrame->GetPrevInFlow(&prevInFlow); + if (prevInFlow) { + nsFrameState state; + aFrame->GetFrameState(&state); + nsCOMPtr frameType; + aFrame->GetFrameType(getter_AddRefs(frameType)); + skipLineList = (state & NS_FRAME_OUT_OF_FLOW); + skipSiblingList = (nsLayoutAtoms::placeholderFrame == frameType) || + (state & NS_FRAME_OUT_OF_FLOW); + } + nsIFrame* parent; aFrame->GetParent(&parent); if (parent != (nsIFrame*)this) { return PR_FALSE; } - if (InLineList(mLines, aFrame) && InSiblingList(mLines, aFrame)) { + if ((skipLineList || InLineList(mLines, aFrame)) && + (skipSiblingList || InSiblingList(mLines, aFrame))) { return PR_TRUE; } nsLineList* overflowLines = GetOverflowLines(aPresContext, PR_FALSE); - if (overflowLines && InLineList(*overflowLines, aFrame) && InSiblingList(*overflowLines, aFrame)) { + if (overflowLines && (skipLineList || InLineList(*overflowLines, aFrame)) && + (skipSiblingList || InSiblingList(*overflowLines, aFrame))) { return PR_TRUE; } return PR_FALSE; @@ -6323,7 +6325,8 @@ nsBlockFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const } #endif -//---------------------------------------------------------------------- +// End Debugging +////////////////////////////////////////////////////////////////////// NS_IMETHODIMP nsBlockFrame::Init(nsIPresContext* aPresContext, diff --git a/mozilla/layout/html/base/src/nsBlockFrame.h b/mozilla/layout/html/base/src/nsBlockFrame.h index 0bac95e6963..176badcd3d5 100644 --- a/mozilla/layout/html/base/src/nsBlockFrame.h +++ b/mozilla/layout/html/base/src/nsBlockFrame.h @@ -180,8 +180,8 @@ public: #endif - virtual void DeleteChildsNextInFlow(nsIPresContext* aPresContext, - nsIFrame* aNextInFlow); + virtual void DeleteNextInFlowChild(nsIPresContext* aPresContext, + nsIFrame* aNextInFlow); /** return the topmost block child based on y-index. * almost always the first or second line, if there is one. diff --git a/mozilla/layout/html/base/src/nsBlockReflowContext.cpp b/mozilla/layout/html/base/src/nsBlockReflowContext.cpp index 201abfac560..ec9d11667d0 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowContext.cpp +++ b/mozilla/layout/html/base/src/nsBlockReflowContext.cpp @@ -626,8 +626,8 @@ nsBlockReflowContext::ReflowBlock(const nsRect& aSpace, // parent is not this because we are executing pullup code) /* XXX promote DeleteChildsNextInFlow to nsIFrame to elminate this cast */ nsHTMLContainerFrame* parent; - mFrame->GetParent((nsIFrame**)&parent); - parent->DeleteChildsNextInFlow(mPresContext, mFrame); + kidNextInFlow->GetParent((nsIFrame**)&parent); + parent->DeleteNextInFlowChild(mPresContext, kidNextInFlow); } } } diff --git a/mozilla/layout/html/base/src/nsContainerFrame.cpp b/mozilla/layout/html/base/src/nsContainerFrame.cpp index 608f3c8a3fb..82942d741ae 100644 --- a/mozilla/layout/html/base/src/nsContainerFrame.cpp +++ b/mozilla/layout/html/base/src/nsContainerFrame.cpp @@ -883,7 +883,7 @@ nsContainerFrame::FrameNeedsView(nsIPresContext* aPresContext, /** * Invokes the WillReflow() function, positions the frame and its view (if * requested), and then calls Reflow(). If the reflow succeeds and the child - * frame is complete, deletes any next-in-flows using DeleteChildsNextInFlow() + * frame is complete, deletes any next-in-flows using DeleteNextInFlowChild() */ nsresult nsContainerFrame::ReflowChild(nsIFrame* aKidFrame, @@ -953,10 +953,9 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame, // Remove all of the childs next-in-flows. Make sure that we ask // the right parent to do the removal (it's possible that the // parent is not this because we are executing pullup code) - nsIFrame* parent; - aKidFrame->GetParent(&parent); - ((nsContainerFrame*)parent)->DeleteChildsNextInFlow(aPresContext, - aKidFrame); + nsContainerFrame* parent; + kidNextInFlow->GetParent((nsIFrame**)&parent); + parent->DeleteNextInFlowChild(aPresContext, kidNextInFlow); } } return result; @@ -1051,69 +1050,64 @@ nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame, } /** - * Remove and delete aChild's next-in-flow(s). Updates the sibling and flow + * Remove and delete aNextInFlow and its next-in-flows. Updates the sibling and flow * pointers - * - * @param aChild child this child's next-in-flow - * @return PR_TRUE if successful and PR_FALSE otherwise */ void -nsContainerFrame::DeleteChildsNextInFlow(nsIPresContext* aPresContext, - nsIFrame* aChild) +nsContainerFrame::DeleteNextInFlowChild(nsIPresContext* aPresContext, + nsIFrame* aNextInFlow) { - NS_PRECONDITION(mFrames.ContainsFrame(aChild), "bad geometric parent"); - - nsIFrame* nextInFlow; - nsContainerFrame* parent; - - aChild->GetNextInFlow(&nextInFlow); - NS_PRECONDITION(nsnull != nextInFlow, "null next-in-flow"); - nextInFlow->GetParent((nsIFrame**)&parent); + nsIFrame* prevInFlow; + aNextInFlow->GetPrevInFlow(&prevInFlow); + NS_PRECONDITION(prevInFlow, "bad prev-in-flow"); + NS_PRECONDITION(mFrames.ContainsFrame(aNextInFlow), "bad geometric parent"); // If the next-in-flow has a next-in-flow then delete it, too (and // delete it first). nsIFrame* nextNextInFlow; - - nextInFlow->GetNextInFlow(&nextNextInFlow); - if (nsnull != nextNextInFlow) { - parent->DeleteChildsNextInFlow(aPresContext, nextInFlow); + aNextInFlow->GetNextInFlow(&nextNextInFlow); + if (nextNextInFlow) { + nsContainerFrame* parent; + nextNextInFlow->GetParent((nsIFrame**)&parent); + parent->DeleteNextInFlowChild(aPresContext, nextNextInFlow); } #ifdef IBMBIDI nsIFrame* nextBidi; - aChild->GetBidiProperty(aPresContext, nsLayoutAtoms::nextBidi, - (void**) &nextBidi,sizeof(nextBidi)); - if (nextBidi == nextInFlow) { + prevInFlow->GetBidiProperty(aPresContext, nsLayoutAtoms::nextBidi, + (void**) &nextBidi,sizeof(nextBidi)); + if (nextBidi == aNextInFlow) { return; } #endif // IBMBIDI // Disconnect the next-in-flow from the flow list - nsSplittableFrame::BreakFromPrevFlow(nextInFlow); + nsSplittableFrame::BreakFromPrevFlow(aNextInFlow); // Take the next-in-flow out of the parent's child list - PRBool result = parent->mFrames.RemoveFrame(nextInFlow); + PRBool result = mFrames.RemoveFrame(aNextInFlow); if (!result) { // We didn't find the child in the parent's principal child list. // Maybe it's on the overflow list? - nsFrameList overflowFrames(parent->GetOverflowFrames(aPresContext, PR_TRUE)); + nsFrameList overflowFrames(GetOverflowFrames(aPresContext, PR_TRUE)); - if (overflowFrames.IsEmpty() || !overflowFrames.RemoveFrame(nextInFlow)) { + if (overflowFrames.IsEmpty() || !overflowFrames.RemoveFrame(aNextInFlow)) { NS_ASSERTION(result, "failed to remove frame"); } // Set the overflow property again if (overflowFrames.NotEmpty()) { - parent->SetOverflowFrames(aPresContext, overflowFrames.FirstChild()); + SetOverflowFrames(aPresContext, overflowFrames.FirstChild()); } } // Delete the next-in-flow frame - nextInFlow->Destroy(aPresContext); + aNextInFlow->Destroy(aPresContext); #ifdef NS_DEBUG - aChild->GetNextInFlow(&nextInFlow); - NS_POSTCONDITION(nsnull == nextInFlow, "non null next-in-flow"); + nsIFrame* nextInFlow; + prevInFlow->GetNextInFlow(&nextInFlow); + NS_POSTCONDITION(!nextInFlow, "non null next-in-flow"); #endif } diff --git a/mozilla/layout/html/base/src/nsContainerFrame.h b/mozilla/layout/html/base/src/nsContainerFrame.h index fc05068ac63..444d9efcd2d 100644 --- a/mozilla/layout/html/base/src/nsContainerFrame.h +++ b/mozilla/layout/html/base/src/nsContainerFrame.h @@ -88,8 +88,8 @@ public: #endif // nsContainerFrame methods - virtual void DeleteChildsNextInFlow(nsIPresContext* aPresContext, - nsIFrame* aChild); + virtual void DeleteNextInFlowChild(nsIPresContext* aPresContext, + nsIFrame* aNextInFlow); static PRInt32 LengthOf(nsIFrame* aFrameList) { nsFrameList tmp(aFrameList); @@ -143,7 +143,7 @@ public: /** * Invokes the WillReflow() function, positions the frame and its view (if * requested), and then calls Reflow(). If the reflow succeeds and the child - * frame is complete, deletes any next-in-flows using DeleteChildsNextInFlow() + * frame is complete, deletes any next-in-flows using DeleteNextInFlowChild() * * Flags: * NS_FRAME_NO_MOVE_VIEW - don't position the frame's view. Set this if you diff --git a/mozilla/layout/html/base/src/nsFirstLetterFrame.cpp b/mozilla/layout/html/base/src/nsFirstLetterFrame.cpp index bc72bcc3e93..bb5d38d9b18 100644 --- a/mozilla/layout/html/base/src/nsFirstLetterFrame.cpp +++ b/mozilla/layout/html/base/src/nsFirstLetterFrame.cpp @@ -275,7 +275,7 @@ nsFirstLetterFrame::Reflow(nsIPresContext* aPresContext, kid->GetNextInFlow(&kidNextInFlow); if (nsnull != kidNextInFlow) { // Remove all of the childs next-in-flows - DeleteChildsNextInFlow(aPresContext, kid); + DeleteNextInFlowChild(aPresContext, kidNextInFlow); } } else { diff --git a/mozilla/layout/html/base/src/nsLineLayout.cpp b/mozilla/layout/html/base/src/nsLineLayout.cpp index b82baf6cdcb..58c69ad97f7 100644 --- a/mozilla/layout/html/base/src/nsLineLayout.cpp +++ b/mozilla/layout/html/base/src/nsLineLayout.cpp @@ -1288,8 +1288,8 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame, // the right parent to do the removal (it's possible that the // parent is not this because we are executing pullup code) nsHTMLContainerFrame* parent; - aFrame->GetParent((nsIFrame**) &parent); - parent->DeleteChildsNextInFlow(mPresContext, aFrame); + kidNextInFlow->GetParent((nsIFrame**) &parent); + parent->DeleteNextInFlowChild(mPresContext, kidNextInFlow); } } diff --git a/mozilla/layout/html/tests/block/images/black_1pix.html b/mozilla/layout/html/tests/block/images/black_1pix.html new file mode 100644 index 00000000000..71e5bb1939a --- /dev/null +++ b/mozilla/layout/html/tests/block/images/black_1pix.html @@ -0,0 +1,2 @@ +Not Found +

Not Found

The requested object does not exist on this server. The link you followed is either outdated, inaccurate, or the server has been instructed not to let you have it. \ No newline at end of file diff --git a/mozilla/layout/html/tests/block/images/continue.jpg b/mozilla/layout/html/tests/block/images/continue.jpg new file mode 100644 index 00000000000..ddae3d500f6 Binary files /dev/null and b/mozilla/layout/html/tests/block/images/continue.jpg differ diff --git a/mozilla/layout/html/tests/block/images/fig1s.jpg b/mozilla/layout/html/tests/block/images/fig1s.jpg new file mode 100644 index 00000000000..0fdf1e24566 Binary files /dev/null and b/mozilla/layout/html/tests/block/images/fig1s.jpg differ diff --git a/mozilla/layout/html/tests/block/images/fig2s.jpg b/mozilla/layout/html/tests/block/images/fig2s.jpg new file mode 100644 index 00000000000..d676dc38dc1 Binary files /dev/null and b/mozilla/layout/html/tests/block/images/fig2s.jpg differ diff --git a/mozilla/layout/html/tests/block/images/fig3s.jpg b/mozilla/layout/html/tests/block/images/fig3s.jpg new file mode 100644 index 00000000000..395a6648bcf Binary files /dev/null and b/mozilla/layout/html/tests/block/images/fig3s.jpg differ diff --git a/mozilla/layout/html/tests/block/images/tech-banner1.gif b/mozilla/layout/html/tests/block/images/tech-banner1.gif new file mode 100644 index 00000000000..f3316caafe3 Binary files /dev/null and b/mozilla/layout/html/tests/block/images/tech-banner1.gif differ diff --git a/mozilla/layout/html/tests/block/images/tech-banner2.gif b/mozilla/layout/html/tests/block/images/tech-banner2.gif new file mode 100644 index 00000000000..33a6c038f12 Binary files /dev/null and b/mozilla/layout/html/tests/block/images/tech-banner2.gif differ diff --git a/mozilla/layout/html/tests/block/printing/163614.html b/mozilla/layout/html/tests/block/printing/163614.html new file mode 100644 index 00000000000..4d660ac1f03 --- /dev/null +++ b/mozilla/layout/html/tests/block/printing/163614.html @@ -0,0 +1,192 @@ + + + + II. The Hall Effect + + + + + + + + + +
Technical ActivitiesTechnical ActivitiesResearch Projects / FacilitiesAbout SEDHomeNational Institute of Standards and TechnologySearchOutputsTechnical ActivitiesNIST home page
+ + + + + + + + + +
+ + + + + + +
+
+

II. The Hall Effect

+
+ +

Evolution of Resistance Concepts
+ The Hall Effect and the Lorentz Force
+ The van der Pauw Technique

+
+

Evolution of Resistance Concepts

+

Electrical characterization of materials evolved in three levels of understanding. In the early 1800s, the resistance R and conductance G were treated as measurable physical quantities obtainable from two-terminal I-V measurements (i.e., current I, voltage V). +Later, it became obvious that the resistance alone was not comprehensive +enough since different sample shapes gave different resistance values. This +led to the understanding (second level) that an intrinsic material property +like resistivity (or conductivity) is required that is not influenced by +the particular geometry of the sample. For the first time, this allowed scientists +to quantify the current-carrying capability of the material and carry out +meaningful comparisons between different samples.

+

By the +early 1900s, it was realized that resistivity was not a fundamental material +parameter, since different materials can have the same resistivity. Also, +a given material might exhibit different values of resistivity, depending +upon how it was synthesized. This is especially true for semiconductors, +where resistivity alone could not explain all observations. Theories of electrical +conduction were constructed with varying degrees of success, but until the +advent of quantum mechanics, no generally acceptable solution to the problem +of electrical transport was developed. This led to the definitions of carrier +density n and mobility ΅  (third level of understanding) which are capable of dealing with even the most complex electrical measurements today.Schematic of the Hall effect in a long, thin bar of semiconductor with four ohmic contacts. The direction of the magnetic field B is along the z-axis and the sample has a finite thickness d

+

The Hall Effect and the Lorentz Force

+

The +basic physical principle underlying the Hall effect is the Lorentz force. +When an electron moves along a direction perpendicular to an applied magnetic +field, it experiences a force acting normal to both directions and moves +in response to this force and the force effected by the internal electric +field. For an n-type, bar-shaped semiconductor shown in Fig.1, the carriers are predominately electrons of bulk density n. We assume that a constant current I +flows along the x-axis from left to right in the presence of a z-directed +magnetic field. Electrons subject to the Lorentz force initially drift away +from the current line toward the negative y-axis, resulting in an excess +surface electrical charge on the side of the sample. This charge results +in the Hall voltage, a potential drop across the two sides of the sample. +(Note that the force on holes is toward the same side because of their opposite +velocity and positive charge.) This transverse voltage is the Hall voltage +VH and its magnitude is equal to IB/qnd, where I is the current, B is the magnetic field, d is the sample thickness, and q (1.602 x 10-19 C) is the elementary charge. In some cases, it is convenient to use layer or sheet density (ns = nd) instead of bulk density. One then obtains the equation

+

+ + + + + + + +
ns = IB/q|VH|.(1)
+

+

Thus, by measuring the Hall voltage VH and from the known values of I, B, and q, one can determine the sheet density ns +of charge carriers in semiconductors. If the measurement apparatus is set +up as described later in Section III, the Hall voltage is negative for n-type semiconductors and positive for p-type semiconductors. The sheet resistance RS +of the semiconductor can be conveniently determined by use of the van der +Pauw resistivity measurement technique. Since sheet resistance involves both +sheet density and mobility, one can determine the Hall mobility from the +equation

+

+ + + + + + + +
 ΅  = |VH|/RSIB = 1/(qnSRS).(2)
+
+
+

+

If the conducting layer thickness d is known, one can determine the bulk resistivity (r = RSd) and the bulk density (n = nS/d). Schematic of a van der Pauw configuration used in the determination of the two characteristic resistances RA and RB

+

The van der Pauw Technique

+

In order to determine both the mobility ΅   and the sheet density ns, a combination of a resistivity measurement and a Hall measurement +is needed. We discuss here the van der Pauw technique which, due to its convenience, +is widely used in the semiconductor industry to determine the resistivity +of uniform samples (References 3 and 4). As originally devised by van der +Pauw, one uses an arbitrarily shaped (but simply connected, i.e., no holes +or nonconducting islands or inclusions), thin-plate sample containing four +very small ohmic contacts placed on the periphery (preferably in the corners) +of the plate. A schematic of a rectangular van der Pauw configuration is +shown in Fig. 2.

+

The objective of the resistivity measurement is to determine the sheet resistance RS. Van der Pauw demonstrated that there are actually two characteristic resistances RA and RB, associated with the corresponding terminals shown in Fig. 2. RA and RB are related to the sheet resistance RS through the van der Pauw equation

+

+ + + + + + + +
exp(-pRA/RS) + exp(-pRB/RS) = 1(3)
+

+

which can be solved numerically for RS.

+

The bulk electrical resistivity r can be calculated using

+

+ + + + + + + +
r = RSd.(4)
+

+

To obtain the two characteristic resistances, one applies a dc current I into contact 1 and out of contact 2 and measures the voltage V43 from contact 4 to contact 3 as shown in Fig. 2. Next, one applies the current I into contact 2 and out of contact 3 while measuring the voltage V14 from contact 1 to contact 4. RA and RB are calculated by means of the following expressions:

+

+ + + + + + + +
RA = V43/I12 and RB = V14/I23.(5)
+

+

Schematic of a van der Pauw configuration used in the determination of the Hall voltage VHThe objective of the Hall measurement in the van der Pauw technique is to determine the sheet carrier density ns by measuring the Hall voltage VH. The Hall voltage measurement consists of a series of voltage measurements with a constant current I and a constant magnetic field B applied perpendicular to the plane of the sample. Conveniently, the same sample, shown again in Fig. 3, can also be used for the Hall measurement. To measure the Hall voltage VH, a current I is forced through the opposing pair of contacts 1 and 3 and the Hall voltage VH (= V24) is measured across the remaining pair of contacts 2 and 4. Once the Hall voltage VH is acquired, the sheet carrier density ns can be calculated via ns = IB/q|VH| from the known values of I, B, and q.

+

There +are practical aspects which must be considered when carrying out Hall and +resistivity measurements. Primary concerns are (1) ohmic contact quality +and size, (2) sample uniformity and accurate thickness determination, (3) +thermomagnetic effects due to nonuniform temperature, and (4) photoconductive +and photovoltaic effects which can be minimized by measuring in a dark environment. +Also, the sample lateral dimensions must be large compared to the size of +the contacts and the sample thickness. Finally, one must accurately measure +sample temperature, magnetic field intensity, electrical current, and voltage.

+

Click for Next Page

+
+

+


+

+

| Main Page | I. Introduction | II. The Hall Effect | evolution of resistance concepts |
+ | the Hall effect and the Lorentz force | the van der Pauw technique |
+ | III. Resistivity and Hall Measurements | sample geometry | definitions for resistivity measurements |
+ | resistivity measurements | resistivity calculations | definitions for Hall measurements |
+ | Hall measurements | Hall calculations | Sample Hall Worksheet | Worksheet with Typical Data | IV. Algorithm |
+ | V. References | VI. Leave or View Comments | figure 1 | figure 2 | | figure 3 | figure 4 |
+

+

+


+

+
+

NIST is an agency of the U.S. Commerce Department's Technology Administration.

+

Date created: 12/4/2000
+ Last updated: 6/28/2001

+
+ + + + + + +
  +

Conferences/Workshops

+

Nanotechnology

+

Electronic Interconnects/Packaging

+

Compound Semiconductors

+

Hall Effect Measurements

+

Compound Semiconductor Roadmap

+
+ \ No newline at end of file diff --git a/mozilla/layout/html/tests/block/printing/file_list.txt b/mozilla/layout/html/tests/block/printing/file_list.txt index 1486ebf0499..2265e857415 100644 --- a/mozilla/layout/html/tests/block/printing/file_list.txt +++ b/mozilla/layout/html/tests/block/printing/file_list.txt @@ -20,3 +20,5 @@ file:///s:/mozilla/layout/html/tests/block/printing/145305-19.html file:///s:/mozilla/layout/html/tests/block/printing/145305-20.html file:///s:/mozilla/layout/html/tests/block/printing/145305-21.html file:///s:/mozilla/layout/html/tests/block/printing/150652.html +file:///s:/mozilla/layout/html/tests/block/printing/163614.html +