diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h index 2453417abb27..f1eca31f1094 100644 --- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -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 diff --git a/layout/generic/nsTextFrame.h b/layout/generic/nsTextFrame.h index 48eb8c2c5c4e..bc74251ceda8 100644 --- a/layout/generic/nsTextFrame.h +++ b/layout/generic/nsTextFrame.h @@ -453,8 +453,6 @@ protected: ContentOffsets GetCharacterOffsetAtFramePointInternal(const nsPoint &aPoint, PRBool aForInsertionPoint); - - void ClearFrameOffsetCache(); }; #endif diff --git a/layout/generic/nsTextFrameThebes.cpp b/layout/generic/nsTextFrameThebes.cpp index d76b0e4b7ef1..012913e45a49 100644 --- a/layout/generic/nsTextFrameThebes.cpp +++ b/layout/generic/nsTextFrameThebes.cpp @@ -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 - (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(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; }