Backed out changeset 8f8ee0543d0f from bug 580869 in the CLOSED TREE

--HG--
extra : rebase_source : 0bfba926d30e0d6fc80bccd4a5614b1532d9234b
This commit is contained in:
Dave Townsend 2010-08-06 15:01:59 -07:00
parent c3b7bf8b39
commit 4590036b45
3 changed files with 3 additions and 47 deletions

View File

@ -253,8 +253,8 @@ typedef PRUint64 nsFrameState;
// frame instead of the root frame.
#define NS_FRAME_REFLOW_ROOT NS_FRAME_STATE_BIT(19)
// Bits 20-31 and 60-63 of the frame state are reserved for implementations.
#define NS_FRAME_IMPL_RESERVED nsFrameState(0xF0000000FFF00000)
// Bits 20-31 of the frame state are reserved for implementations.
#define NS_FRAME_IMPL_RESERVED nsFrameState(0xFFF00000)
// This bit is set on floats whose parent does not contain their
// placeholder. This can happen for two reasons: (1) the float was

View File

@ -453,8 +453,6 @@ protected:
ContentOffsets GetCharacterOffsetAtFramePointInternal(const nsPoint &aPoint,
PRBool aForInsertionPoint);
void ClearFrameOffsetCache();
};
#endif

View File

@ -138,8 +138,6 @@ static void DestroyTabWidth(void* aPropertyValue)
NS_DECLARE_FRAME_PROPERTY(TabWidthProperty, DestroyTabWidth)
NS_DECLARE_FRAME_PROPERTY(OffsetToFrameProperty, nsnull)
// The following flags are set during reflow
// This bit is set on the first frame in a continuation indicating
@ -185,9 +183,6 @@ NS_DECLARE_FRAME_PROPERTY(OffsetToFrameProperty, nsnull)
// nsTextFrame.h has
// #define TEXT_HAS_NONCOLLAPSED_CHARACTERS NS_FRAME_STATE_BIT(31)
// Whether this frame is cached in the Offset Frame Cache (OffsetToFrameProperty)
#define TEXT_IN_OFFSET_CACHE NS_FRAME_STATE_BIT(63)
/*
* Some general notes
*
@ -3469,23 +3464,9 @@ nsTextFrame::Init(nsIContent* aContent,
return nsFrame::Init(aContent, aParent, aPrevInFlow);
}
void
nsTextFrame::ClearFrameOffsetCache()
{
// See if we need to remove ourselves from the offset cache
if (GetStateBits() & TEXT_IN_OFFSET_CACHE) {
nsIFrame* primaryFrame = mContent->GetPrimaryFrame();
NS_ASSERTION(primaryFrame, "We should have a primary frame");
primaryFrame->Properties().Delete(OffsetToFrameProperty());
RemoveStateBits(TEXT_IN_OFFSET_CACHE);
}
}
void
nsTextFrame::DestroyFrom(nsIFrame* aDestructRoot)
{
ClearFrameOffsetCache();
// We might want to clear NS_CREATE_FRAME_IF_NON_WHITESPACE or
// NS_REFRAME_IF_WHITESPACE on mContent here, since our parent frame
// type might be changing. Not clear whether it's worth it.
@ -3615,8 +3596,6 @@ nsContinuingTextFrame::Init(nsIContent* aContent,
void
nsContinuingTextFrame::DestroyFrom(nsIFrame* aDestructRoot)
{
ClearFrameOffsetCache();
// The text associated with this frame will become associated with our
// prev-continuation. If that means the text has changed style, then
// we need to wipe out the text run for the text.
@ -5303,25 +5282,9 @@ nsTextFrame::GetChildFrameContainingOffset(PRInt32 aContentOffset,
NS_ASSERTION(aOutOffset && aOutFrame, "Bad out parameters");
NS_ASSERTION(aContentOffset >= 0, "Negative content offset, existing code was very broken!");
NS_ASSERTION(this == mContent->GetPrimaryFrame(),
"GetChildFrameContainingOffset should only be called on the primary frame");
nsTextFrame* f = this;
PRInt32 offset = mContentOffset;
// Try to look up the offset to frame property
nsTextFrame* cachedFrame = static_cast<nsTextFrame*>
(Properties().Get(OffsetToFrameProperty()));
if (cachedFrame) {
f = cachedFrame;
offset = f->GetContentOffset();
f->RemoveStateBits(TEXT_IN_OFFSET_CACHE);
}
if ((aContentOffset >= offset) &&
(aHint || aContentOffset != offset)) {
if (aContentOffset >= mContentOffset) {
while (PR_TRUE) {
nsTextFrame* next = static_cast<nsTextFrame*>(f->GetNextContinuation());
if (!next || aContentOffset < next->GetContentOffset())
@ -5351,11 +5314,6 @@ nsTextFrame::GetChildFrameContainingOffset(PRInt32 aContentOffset,
*aOutOffset = aContentOffset - f->GetContentOffset();
*aOutFrame = f;
// cache the frame we found
Properties().Set(OffsetToFrameProperty(), f);
f->AddStateBits(TEXT_IN_OFFSET_CACHE);
return NS_OK;
}