mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 593211 - Part 2: Back out bug 581585 r,a=roc
--HG-- extra : rebase_source : f368d3214a458bd642055c46ded2955bdec2a28b
This commit is contained in:
parent
db9e8d389b
commit
3b1ecb5fe3
@ -178,7 +178,6 @@ nsCaret::nsCaret()
|
||||
#endif
|
||||
, mLastContentOffset(0)
|
||||
, mLastHint(nsFrameSelection::HINTLEFT)
|
||||
, mLastFrameOffset(0)
|
||||
{
|
||||
}
|
||||
|
||||
@ -301,7 +300,6 @@ void nsCaret::Terminate()
|
||||
mPresShell = nsnull;
|
||||
|
||||
mLastContent = nsnull;
|
||||
mLastFrame = nsnull;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -505,8 +503,8 @@ nsIFrame * nsCaret::GetCaretFrame(PRInt32 *aOffset)
|
||||
if (!mDrawn)
|
||||
return nsnull;
|
||||
|
||||
// Recompute the frame that we're supposed to draw in if the cached frame
|
||||
// is stale (dead).
|
||||
// Recompute the frame that we're supposed to draw in to guarantee that
|
||||
// we're not going to try to draw into a stale (dead) frame.
|
||||
PRInt32 offset;
|
||||
nsIFrame *frame = nsnull;
|
||||
nsresult rv = GetCaretFrameForNodeOffset(mLastContent, mLastContentOffset,
|
||||
@ -742,16 +740,6 @@ nsCaret::GetCaretFrameForNodeOffset(nsIContent* aContentNode,
|
||||
nsIFrame** aReturnFrame,
|
||||
PRInt32* aReturnOffset)
|
||||
{
|
||||
// Try to see if we can use our cached frame
|
||||
if (mLastFrame.IsAlive() &&
|
||||
mLastContent == aContentNode &&
|
||||
mLastContentOffset == aOffset &&
|
||||
mLastHint == aFrameHint &&
|
||||
mLastBidiLevel == aBidiLevel) {
|
||||
*aReturnFrame = mLastFrame;
|
||||
*aReturnOffset = mLastFrameOffset;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//get frame selection and find out what frame to use...
|
||||
nsCOMPtr<nsIPresShell> presShell = do_QueryReferent(mPresShell);
|
||||
@ -912,8 +900,6 @@ nsCaret::GetCaretFrameForNodeOffset(nsIContent* aContentNode,
|
||||
}
|
||||
*aReturnFrame = theFrame;
|
||||
*aReturnOffset = theFrameOffset;
|
||||
mLastFrame = theFrame;
|
||||
mLastFrameOffset = theFrameOffset;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -293,11 +293,8 @@ protected:
|
||||
// actually drawn (anon <BR> in text control)
|
||||
PRInt32 mLastContentOffset; // the offset for the last request
|
||||
|
||||
nsFrameSelection::HINT mLastHint; // the hint associated with the last request, see also
|
||||
// mLastBidiLevel above
|
||||
|
||||
nsWeakFrame mLastFrame; // the last frame on which the caret has been drawn.
|
||||
PRInt32 mLastFrameOffset; // the frame offset for the last caret position
|
||||
nsFrameSelection::HINT mLastHint; // the hint associated with the last request, see also
|
||||
// mLastBidiLevel below
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user