Bug 1048752. Part 23: Remove aIgnoreDrawnState from MustDrawCaret. r=tn

--HG--
extra : rebase_source : 20e724ce09deec3987437838ac9f05e84ddbe2fd
This commit is contained in:
Robert O'Callahan 2014-08-06 17:19:28 +12:00
Родитель 39217b370a
Коммит 7de632d807
2 изменённых файлов: 9 добавлений и 14 удалений

Просмотреть файл

@ -277,7 +277,7 @@ void nsCaret::SetCaretVisible(bool inMakeVisible)
nsresult nsCaret::GetCaretVisible(bool *outMakeVisible)
{
NS_ENSURE_ARG_POINTER(outMakeVisible);
*outMakeVisible = (mVisible && MustDrawCaret(true));
*outMakeVisible = (mVisible && MustDrawCaret());
return NS_OK;
}
@ -893,13 +893,13 @@ nsCaret::CheckCaretDrawingState()
{
if (mDrawn) {
// The caret is drawn; if it shouldn't be, erase it.
if (!mVisible || !MustDrawCaret(true))
if (!mVisible || !MustDrawCaret())
EraseCaret();
}
else
{
// The caret is not drawn; if it should be, draw it.
if (mPendingDraw && (mVisible && MustDrawCaret(true)))
if (mPendingDraw && (mVisible && MustDrawCaret()))
DrawCaret(true);
}
}
@ -935,11 +935,8 @@ size_t nsCaret::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
(see IsMenuPopupHidingCaret()).
----------------------------------------------------------------------------- */
bool nsCaret::MustDrawCaret(bool aIgnoreDrawnState)
bool nsCaret::MustDrawCaret()
{
if (!aIgnoreDrawnState && mDrawn)
return true;
nsCOMPtr<nsISelection> domSelection = do_QueryReferent(mDomSelectionWeak);
if (!domSelection)
return false;
@ -1009,7 +1006,7 @@ bool nsCaret::IsMenuPopupHidingCaret()
void nsCaret::DrawCaret(bool aInvalidate)
{
// Do we need to draw the caret at all?
if (!MustDrawCaret(false))
if (!mDrawn && !MustDrawCaret())
return;
// Can we draw the caret now?

Просмотреть файл

@ -188,12 +188,10 @@ protected:
nsRect* aRect,
nscoord* aBidiIndicatorSize);
// Returns true if the caret should be drawn. When |mDrawn| is true,
// this returns true, so that we erase the drawn caret. If |aIgnoreDrawnState|
// is true, we don't take into account whether the caret is currently
// drawn or not. This can be used to determine if the caret is drawn when
// it shouldn't be.
bool MustDrawCaret(bool aIgnoreDrawnState);
// Returns true if the caret should be drawn. We don't take into account
// whether the caret is currently drawn or not. This can be used to
// determine if the caret is drawn when it shouldn't be.
bool MustDrawCaret();
void DrawCaret(bool aInvalidate);
void DrawCaretAfterBriefDelay();